23w03a
This commit is contained in:
1 parent
2b95a878ad
commit
c7d506675e
19 files changed
+107
-43
No files matched your search
@@ -2,16 +2,21 @@ package carpet.mixins;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
import net.minecraft.server.commands.FillBiomeCommand;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(FillBiomeCommand.class)
|
||||
public class FillBiomeCommandMixin
|
||||
{
|
||||
@ModifyConstant(method = "fill", constant = @Constant(intValue = CarpetSettings.VANILLA_FILL_LIMIT))
|
||||
private static int fillLimit(int original)
|
||||
@Redirect(method = "fill", 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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user