Package powercrystals.minefactoryreloaded.item

Source Code of powercrystals.minefactoryreloaded.item.ItemSyringeSlime

package powercrystals.minefactoryreloaded.item;

import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.monster.EntitySlime;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;

public class ItemSyringeSlime extends ItemSyringe
{
  public ItemSyringeSlime(int id)
  {
    super(id);
  }
 
  @Override
  public boolean canInject(World world, EntityLiving entity, ItemStack syringe)
  {
    return entity instanceof EntitySlime && ((EntitySlime)entity).getSlimeSize() < 8;
  }
 
  @Override
  public boolean inject(World world, EntityLiving entity, ItemStack syringe)
  {
    EntitySlime slime = (EntitySlime)entity;
    slime.setSlimeSize(slime.getSlimeSize() << 1);
    return true;
  }
 
}
TOP

Related Classes of powercrystals.minefactoryreloaded.item.ItemSyringeSlime

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.