2018-09-13 12:03:28 -04:00
|
|
|
package noppes.npcs.entity;
|
|
|
|
|
|
|
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
|
|
|
|
import net.minecraft.util.ResourceLocation;
|
|
|
|
|
import net.minecraft.world.World;
|
2023-03-17 02:36:28 -05:00
|
|
|
import noppes.npcs.entity.data.ModelData;
|
2018-09-13 12:03:28 -04:00
|
|
|
|
2025-03-12 20:12:01 -04:00
|
|
|
public class EntityNpcPony extends EntityNPCInterface {
|
2018-09-13 12:03:28 -04:00
|
|
|
public boolean isPegasus = false;
|
|
|
|
|
public boolean isUnicorn = false;
|
|
|
|
|
public boolean isFlying = false;
|
2025-03-12 20:12:01 -04:00
|
|
|
|
2018-09-13 12:03:28 -04:00
|
|
|
public ResourceLocation checked = null;
|
2025-03-12 20:12:01 -04:00
|
|
|
|
|
|
|
|
public EntityNpcPony(World world) {
|
2018-09-13 12:03:28 -04:00
|
|
|
super(world);
|
|
|
|
|
display.texture = "customnpcs:textures/entity/ponies/MineLP Derpy Hooves.png";
|
|
|
|
|
}
|
2025-03-12 20:12:01 -04:00
|
|
|
|
|
|
|
|
public void onUpdate() {
|
|
|
|
|
isDead = true;
|
|
|
|
|
|
|
|
|
|
if (!worldObj.isRemote) {
|
|
|
|
|
NBTTagCompound compound = new NBTTagCompound();
|
|
|
|
|
|
|
|
|
|
writeToNBT(compound);
|
|
|
|
|
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
|
|
|
|
npc.readFromNBT(compound);
|
|
|
|
|
ModelData data = npc.modelData;
|
|
|
|
|
data.setEntityClass(EntityNpcPony.class);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
worldObj.spawnEntityInWorld(npc);
|
|
|
|
|
}
|
2018-09-13 12:03:28 -04:00
|
|
|
super.onUpdate();
|
|
|
|
|
}
|
2025-03-12 20:12:01 -04:00
|
|
|
|
2025-11-07 20:15:49 -05:00
|
|
|
@Override
|
|
|
|
|
public void onLivingUpdate() {
|
|
|
|
|
super.onLivingUpdate();
|
|
|
|
|
this.isFlying = isNpcFlying();
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-13 12:03:28 -04:00
|
|
|
}
|