From 6da52b5808585e4c73b8a17ac82dfd7a866e054b Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 7 Oct 2015 20:11:25 +0200 Subject: [PATCH] "That wouldn't be cheaty at all!" --- .../actuallyadditions/event/EntityLivingEvent.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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); } } }