Files
CustomNPC-Plus/src/main/java/noppes/npcs/entity/old/EntityNPCEnderman.java
T

65 lines
2.1 KiB
Java
Raw Normal View History

2018-09-13 12:03:28 -04:00
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
2024-02-15 17:54:28 -05:00
// Decompiler options: packimports(3) braces deadcode fieldsfirst
2018-09-13 12:03:28 -04:00
package noppes.npcs.entity.old;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import noppes.npcs.constants.EnumAnimation;
import noppes.npcs.controllers.data.SkinOverlay;
2018-09-13 12:03:28 -04:00
import noppes.npcs.entity.EntityCustomNpc;
2024-02-15 17:54: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 EntityNPCEnderman extends EntityNpcEnderchibi {
public EntityNPCEnderman(World world) {
2018-09-13 12:03:28 -04:00
super(world);
display.texture = "customnpcs:textures/entity/enderman/enderman.png";
//display.glowTexture = ;
2025-03-12 20:12:01 -04:00
display.skinOverlayData.overlayList.put(0, new SkinOverlay("customnpcs:textures/overlays/ender_eyes.png"));
2018-09-13 12:03:28 -04:00
this.width = 0.6F;
this.height = 2.9F;
}
2024-02-15 17:54:28 -05:00
2018-09-13 12:03:28 -04:00
public void updateHitbox() {
2024-02-15 17:54:28 -05:00
2025-10-20 14:41:45 -04:00
float newWidth;
float newHeight;
2025-03-12 20:12:01 -04:00
if (currentAnimation == EnumAnimation.LYING) {
2025-10-20 14:41:45 -04:00
newWidth = 0.2f;
newHeight = 0.2f;
2025-03-12 20:12:01 -04:00
} else if (currentAnimation == EnumAnimation.SITTING) {
2025-10-20 14:41:45 -04:00
newWidth = 0.6f;
newHeight = 2.3f;
2025-03-12 20:12:01 -04:00
} else {
2025-10-20 14:41:45 -04:00
newWidth = 0.6f;
newHeight = 2.9f;
}
newWidth = (newWidth / 5f) * display.modelSize;
newHeight = (newHeight / 5f) * display.modelSize;
newWidth = Math.max(newWidth, 0.00001f);
newHeight = Math.max(newHeight, 0.00001f);
setSize(newWidth, newHeight);
if (width / 2 > World.MAX_ENTITY_RADIUS) {
World.MAX_ENTITY_RADIUS = width / 2;
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(EntityEnderman.class);
worldObj.spawnEntityInWorld(npc);
}
2018-09-13 12:03:28 -04:00
super.onUpdate();
}
2024-02-15 17:54:28 -05:00
}