Fix magma cubes made of literal magma

This commit is contained in:
patience 2026-06-21 01:28:29 +01:00
parent 466ba87d1a
commit 30b44ed43e
No known key found for this signature in database
2 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,31 @@
package xyz.nearmisses.patience.mc_rebalance.mixin.mob;
import net.minecraft.util.Mth;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.entity.monster.MagmaCube;
import net.minecraft.world.entity.monster.Slime;
import net.minecraft.world.level.Level;
import org.spongepowered.asm.mixin.Mixin;
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(MagmaCube.class)
public class MagmaCubeTweak extends Slime {
public MagmaCubeTweak(EntityType<? extends Slime> entityType, Level level) {
super(entityType, level);
}
@Inject(method = "getAttackDamage", at=@At("HEAD"), cancellable = true)
private void removeSecretSauce(CallbackInfoReturnable<Float> cir){
cir.setReturnValue(super.getAttackDamage());
}
@Inject(method="setSize", at=@At("TAIL"))
private void addOrdinarySauce(int i, boolean bl, CallbackInfo ci){
int j = Mth.clamp(i, 1, 127);
this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue((double)j + 2.0F);
}
}

View file

@ -13,6 +13,7 @@
"mob.CreakingRework", "mob.CreakingRework",
"mob.EnderDragonHitRateCap", "mob.EnderDragonHitRateCap",
"mob.HappyGhastTweak", "mob.HappyGhastTweak",
"mob.MagmaCubeTweak",
"mob.WardenRework", "mob.WardenRework",
"mob.WitherSkeletonRework" "mob.WitherSkeletonRework"
], ],