Files
fabric-carpet/src/main/java/carpet/mixins/FillBiomeCommandMixin.java
T
2023-01-18 22:11:19 +01:00

23 lines
741 B
Java

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.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(FillBiomeCommand.class)
public class FillBiomeCommandMixin
{
@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)
{
int vanilla = instance.getInt(key);
return Math.max(vanilla, CarpetSettings.fillLimit);
}
}