Migrate Carpet Mixin names to mojang mappings

This commit is contained in:
FX - PR0CESS committed 2022-01-28 16:47:18 -05:00
1 parent 2c3871b90e
commit a547677597
154 files changed
+422 -501

No files matched your search

@@ -0,0 +1,48 @@
package carpet.mixins;
import carpet.CarpetSettings;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LightningBolt;
import net.minecraft.world.entity.MobSpawnType;
import net.minecraft.world.entity.SpawnGroupData;
import net.minecraft.world.entity.monster.ElderGuardian;
import net.minecraft.world.entity.monster.Guardian;
import net.minecraft.world.entity.monster.Monster;
import net.minecraft.world.level.Level;
import org.spongepowered.asm.mixin.Mixin;
@Mixin(Guardian.class)
public abstract class Guardian_renewableSpongesMixin extends Monster
{
protected Guardian_renewableSpongesMixin(EntityType<? extends Monster> entityType_1, Level world_1)
{
super(entityType_1, world_1);
}
@Override
public void thunderHit(ServerLevel serverWorld, LightningBolt lightningEntity)
{ // isRemoved()
if (!this.level.isClientSide && !this.isRemoved() && CarpetSettings.renewableSponges && !((Object)this instanceof ElderGuardian))
{
ElderGuardian elderGuardian = new ElderGuardian(EntityType.ELDER_GUARDIAN ,this.level);
elderGuardian.moveTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot());
elderGuardian.finalizeSpawn(serverWorld ,this.level.getCurrentDifficultyAt(elderGuardian.blockPosition()), MobSpawnType.CONVERSION, (SpawnGroupData)null, (CompoundTag)null);
elderGuardian.setNoAi(this.isNoAi());
if (this.hasCustomName())
{
elderGuardian.setCustomName(this.getCustomName());
elderGuardian.setCustomNameVisible(this.isCustomNameVisible());
}
this.level.addFreshEntity(elderGuardian);
this.discard(); // discard remove();
}
else
{
super.thunderHit(serverWorld, lightningEntity);
}
}
}