Search in sources :

Example 1 with ItemBucketSlime

use of net.mcft.copy.betterstorage.item.ItemBucketSlime in project BetterStorage by copygirl.

the class CommonProxy method onEntityInteract.

@SubscribeEvent
public void onEntityInteract(EntityInteractEvent event) {
    if (event.entity.worldObj.isRemote || event.isCanceled())
        return;
    EntityPlayer player = event.entityPlayer;
    Entity target = event.target;
    ItemStack holding = player.getCurrentEquippedItem();
    if ((target.getClass() == EntityChicken.class) && (holding != null) && (holding.getItem() == Items.name_tag)) {
        EntityChicken chicken = (EntityChicken) target;
        if (!chicken.isDead && !chicken.isChild() && "Cluckington".equals(holding.getDisplayName()))
            EntityCluckington.spawn(chicken);
    }
    if ((BetterStorageItems.slimeBucket != null) && (target instanceof EntityLiving) && (holding != null) && (holding.getItem() == Items.bucket)) {
        ItemBucketSlime.pickUpSlime(player, (EntityLiving) target);
        if (player.getCurrentEquippedItem().getItem() instanceof ItemBucketSlime)
            preventSlimeBucketUse = true;
    }
}
Also used : Entity(net.minecraft.entity.Entity) EntityChicken(net.minecraft.entity.passive.EntityChicken) EntityLiving(net.minecraft.entity.EntityLiving) ItemBucketSlime(net.mcft.copy.betterstorage.item.ItemBucketSlime) EntityPlayer(net.minecraft.entity.player.EntityPlayer) ItemStack(net.minecraft.item.ItemStack) SubscribeEvent(cpw.mods.fml.common.eventhandler.SubscribeEvent)

Aggregations

SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)1 ItemBucketSlime (net.mcft.copy.betterstorage.item.ItemBucketSlime)1 Entity (net.minecraft.entity.Entity)1 EntityLiving (net.minecraft.entity.EntityLiving)1 EntityChicken (net.minecraft.entity.passive.EntityChicken)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 ItemStack (net.minecraft.item.ItemStack)1