This commit is contained in:
gnembon committed 2023-01-18 22:11:19 +01:00
1 parent 2b95a878ad
commit c7d506675e
19 files changed
+107 -43

No files matched your search

@@ -4,20 +4,24 @@ import carpet.CarpetSettings;
import net.minecraft.core.BlockPos;
import net.minecraft.server.commands.FillCommand;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.level.GameRules;
import net.minecraft.world.level.block.Block;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(FillCommand.class)
public abstract class FillCommandMixin
{
@ModifyConstant(method = "fillBlocks", constant = @Constant(intValue = CarpetSettings.VANILLA_FILL_LIMIT))
private static int fillLimit(int original)
@Redirect(method = "fillBlocks", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/world/level/GameRules;getInt(Lnet/minecraft/world/level/GameRules$Key;)I"
))
private static int redirectCloneGameRuleInt(GameRules instance, GameRules.Key<GameRules.IntegerValue> key)
{
return CarpetSettings.fillLimit;
int vanilla = instance.getInt(key);
return Math.max(vanilla, CarpetSettings.fillLimit);
}
@Redirect(method = "fillBlocks", at = @At(