fill stuff

This commit is contained in:
gnembon committed 2019-05-18 14:24:51 -03:00
1 parent 38d01bdffb
commit d35b6bde36
11 files changed
+193 -13

No files matched your search

@@ -1,6 +1,7 @@
package carpet.mixins;
import carpet.CarpetServer;
import carpet.CarpetSettings;
import com.mojang.brigadier.CommandDispatcher;
import net.minecraft.server.command.CommandManager;
import net.minecraft.server.command.ServerCommandSource;
@@ -10,6 +11,7 @@ import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(CommandManager.class)
@@ -24,4 +26,17 @@ public abstract class CommandManagerMixin
private void onRegister(boolean boolean_1, CallbackInfo ci) {
CarpetServer.registerCarpetCommands(this.dispatcher);
}
@Inject(method = "execute", at = @At("HEAD"))
private void onExecuteBegin(ServerCommandSource serverCommandSource_1, String string_1, CallbackInfoReturnable<Integer> cir)
{
if (!CarpetSettings.b_fillUpdates)
CarpetSettings.impendingFillSkipUpdates = true;
}
@Inject(method = "execute", at = @At("RETURN"))
private void onExecuteEnd(ServerCommandSource serverCommandSource_1, String string_1, CallbackInfoReturnable<Integer> cir)
{
CarpetSettings.impendingFillSkipUpdates = false;
}
}