Fixed animations and burning states on disguised changelings

This commit is contained in:
Sollace 2019-02-03 19:58:54 +02:00
parent 40e9a9d2f3
commit 161f61b138

View file

@ -11,6 +11,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.passive.EntityChicken;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
@ -78,7 +79,8 @@ public class SpellDisguise extends AbstractSpell {
} }
if (entity != null) { if (entity != null) {
entity.onGround = owner.onGround;
entity.onUpdate();
if (entity instanceof EntityLiving) { if (entity instanceof EntityLiving) {
EntityLiving l = (EntityLiving)entity; EntityLiving l = (EntityLiving)entity;
@ -99,14 +101,11 @@ public class SpellDisguise extends AbstractSpell {
l.swingProgressInt = owner.swingProgressInt; l.swingProgressInt = owner.swingProgressInt;
l.isSwingInProgress = owner.isSwingInProgress; l.isSwingInProgress = owner.isSwingInProgress;
l.hurtTime = owner.hurtTime;
for (EntityEquipmentSlot i : EntityEquipmentSlot.values()) { for (EntityEquipmentSlot i : EntityEquipmentSlot.values()) {
l.setItemStackToSlot(i, owner.getItemStackFromSlot(i)); l.setItemStackToSlot(i, owner.getItemStackFromSlot(i));
} }
if (l.world.rand.nextInt(1000) < l.livingSoundTime++) {
l.playLivingSound();
l.livingSoundTime = -l.getTalkInterval();
}
} }
@ -129,6 +128,12 @@ public class SpellDisguise extends AbstractSpell {
entity.distanceWalkedModified = owner.distanceWalkedModified; entity.distanceWalkedModified = owner.distanceWalkedModified;
entity.prevDistanceWalkedModified = owner.prevDistanceWalkedModified; entity.prevDistanceWalkedModified = owner.prevDistanceWalkedModified;
if (owner.isBurning()) {
entity.setFire(1);
} else {
entity.extinguish();
}
entity.updateBlocked = true; entity.updateBlocked = true;
owner.height = entity.height; owner.height = entity.height;