diff --git a/src/main/java/ellpeck/actuallyadditions/event/EntityLivingEvent.java b/src/main/java/ellpeck/actuallyadditions/event/EntityLivingEvent.java index b296c813b..fad4a3934 100644 --- a/src/main/java/ellpeck/actuallyadditions/event/EntityLivingEvent.java +++ b/src/main/java/ellpeck/actuallyadditions/event/EntityLivingEvent.java @@ -22,6 +22,7 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; import java.util.Random; +import java.util.UUID; public class EntityLivingEvent{ @@ -29,12 +30,11 @@ public class EntityLivingEvent{ public void livingUpdateEvent(LivingUpdateEvent event){ //Ocelots dropping Hair Balls if(event.entityLiving != null && event.entityLiving.worldObj != null && !event.entityLiving.worldObj.isRemote){ - if(event.entityLiving instanceof EntityOcelot){ - EntityOcelot theOcelot = (EntityOcelot)event.entityLiving; - if(ConfigBoolValues.DO_CAT_DROPS.isEnabled() && theOcelot.isTamed()){ + if((event.entityLiving instanceof EntityOcelot && ((EntityOcelot)event.entityLiving).isTamed()) || (event.entityLiving instanceof EntityPlayer && event.entityLiving.getUniqueID().equals(/*KittyVanCat*/ UUID.fromString("681d4e20-10ef-40c9-a0a5-ba2f1995ef44")))){ + if(ConfigBoolValues.DO_CAT_DROPS.isEnabled()){ if(new Random().nextInt(ConfigIntValues.CAT_DROP_CHANCE.getValue())+1 == 1){ - EntityItem item = new EntityItem(theOcelot.worldObj, theOcelot.posX+0.5, theOcelot.posY+0.5, theOcelot.posZ+0.5, new ItemStack(InitItems.itemHairyBall)); - theOcelot.worldObj.spawnEntityInWorld(item); + EntityItem item = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX+0.5, event.entityLiving.posY+0.5, event.entityLiving.posZ+0.5, new ItemStack(InitItems.itemHairyBall)); + event.entityLiving.worldObj.spawnEntityInWorld(item); } } }