mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-23 03:49:22 +01:00
"That wouldn't be cheaty at all!"
This commit is contained in:
parent
3474171df5
commit
6da52b5808
1 changed files with 5 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue