diff options
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Skeleton.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Skeleton.java.patch | 148 |
1 files changed, 148 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Skeleton.java.patch b/patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Skeleton.java.patch new file mode 100644 index 0000000000..a2c1a0f8d3 --- /dev/null +++ b/patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Skeleton.java.patch @@ -0,0 +1,148 @@ +--- a/net/minecraft/world/entity/monster/Skeleton.java ++++ b/net/minecraft/world/entity/monster/Skeleton.java +@@ -11,23 +11,22 @@ + import net.minecraft.world.entity.EntityType; + import net.minecraft.world.entity.player.Player; + import net.minecraft.world.item.Items; +-import net.minecraft.world.level.ItemLike; ++import net.minecraft.world.level.IMaterial; + import net.minecraft.world.level.Level; + + public class Skeleton extends AbstractSkeleton { + + private static final int TOTAL_CONVERSION_TIME = 300; +- private static final EntityDataAccessor<Boolean> DATA_STRAY_CONVERSION_ID = SynchedEntityData.defineId(Skeleton.class, EntityDataSerializers.BOOLEAN); ++ public static final EntityDataAccessor<Boolean> DATA_STRAY_CONVERSION_ID = SynchedEntityData.defineId(Skeleton.class, EntityDataSerializers.BOOLEAN); + public static final String CONVERSION_TAG = "StrayConversionTime"; + private int inPowderSnowTime; +- private int conversionTime; ++ public int conversionTime; + +- public Skeleton(EntityType<? extends Skeleton> entitytype, Level level) { +- super(entitytype, level); ++ public Skeleton(EntityType<? extends Skeleton> entityType, Level level) { ++ super(entityType, level); + } + + @Override +- @Override + protected void defineSynchedData() { + super.defineSynchedData(); + this.getEntityData().define(Skeleton.DATA_STRAY_CONVERSION_ID, false); +@@ -37,18 +36,16 @@ + return (Boolean) this.getEntityData().get(Skeleton.DATA_STRAY_CONVERSION_ID); + } + +- public void setFreezeConverting(boolean flag) { +- this.entityData.set(Skeleton.DATA_STRAY_CONVERSION_ID, flag); ++ public void setFreezeConverting(boolean isFrozen) { ++ this.entityData.set(Skeleton.DATA_STRAY_CONVERSION_ID, isFrozen); + } + + @Override +- @Override + public boolean isShaking() { + return this.isFreezeConverting(); + } + + @Override +- @Override + public void tick() { + if (!this.level().isClientSide && this.isAlive() && !this.isNoAi()) { + if (this.isInPowderSnow) { +@@ -73,29 +70,27 @@ + } + + @Override +- @Override +- public void addAdditionalSaveData(CompoundTag compoundtag) { +- super.addAdditionalSaveData(compoundtag); +- compoundtag.putInt("StrayConversionTime", this.isFreezeConverting() ? this.conversionTime : -1); ++ public void addAdditionalSaveData(CompoundTag compound) { ++ super.addAdditionalSaveData(compound); ++ compound.putInt("StrayConversionTime", this.isFreezeConverting() ? this.conversionTime : -1); + } + + @Override +- @Override +- public void readAdditionalSaveData(CompoundTag compoundtag) { +- super.readAdditionalSaveData(compoundtag); +- if (compoundtag.contains("StrayConversionTime", 99) && compoundtag.getInt("StrayConversionTime") > -1) { +- this.startFreezeConversion(compoundtag.getInt("StrayConversionTime")); ++ public void readAdditionalSaveData(CompoundTag compound) { ++ super.readAdditionalSaveData(compound); ++ if (compound.contains("StrayConversionTime", 99) && compound.getInt("StrayConversionTime") > -1) { ++ this.startFreezeConversion(compound.getInt("StrayConversionTime")); + } + + } + +- private void startFreezeConversion(int i) { +- this.conversionTime = i; ++ public void startFreezeConversion(int conversionTime) { ++ this.conversionTime = conversionTime; + this.setFreezeConverting(true); + } + + protected void doFreezeConversion() { +- this.convertTo(EntityType.STRAY, true); ++ this.convertTo(EntityType.STRAY, true, org.bukkit.event.entity.EntityTransformEvent.TransformReason.FROZEN, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.FROZEN); // CraftBukkit - add spawn and transform reasons + if (!this.isSilent()) { + this.level().levelEvent((Player) null, 1048, this.blockPosition(), 0); + } +@@ -103,47 +98,41 @@ + } + + @Override +- @Override + public boolean canFreeze() { + return false; + } + + @Override +- @Override + protected SoundEvent getAmbientSound() { + return SoundEvents.SKELETON_AMBIENT; + } + + @Override +- @Override +- protected SoundEvent getHurtSound(DamageSource damagesource) { ++ protected SoundEvent getHurtSound(DamageSource damageSource) { + return SoundEvents.SKELETON_HURT; + } + + @Override +- @Override + protected SoundEvent getDeathSound() { + return SoundEvents.SKELETON_DEATH; + } + + @Override +- @Override + SoundEvent getStepSound() { + return SoundEvents.SKELETON_STEP; + } + + @Override +- @Override +- protected void dropCustomDeathLoot(DamageSource damagesource, int i, boolean flag) { +- super.dropCustomDeathLoot(damagesource, i, flag); +- Entity entity = damagesource.getEntity(); ++ protected void dropCustomDeathLoot(DamageSource source, int looting, boolean recentlyHit) { ++ super.dropCustomDeathLoot(source, looting, recentlyHit); ++ Entity entity = source.getEntity(); + + if (entity instanceof Creeper) { +- Creeper creeper = (Creeper) entity; ++ Creeper entitycreeper = (Creeper) entity; + +- if (creeper.canDropMobsSkull()) { +- creeper.increaseDroppedSkulls(); +- this.spawnAtLocation((ItemLike) Items.SKELETON_SKULL); ++ if (entitycreeper.canDropMobsSkull()) { ++ entitycreeper.increaseDroppedSkulls(); ++ this.spawnAtLocation((IMaterial) Items.SKELETON_SKULL); + } + } + |