2015-12-30 22:24:40 +00:00
|
|
|
package WayofTime.bloodmagic.item;
|
|
|
|
|
2016-01-01 01:10:57 +00:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2015-12-30 22:24:40 +00:00
|
|
|
import net.minecraft.item.Item;
|
|
|
|
import net.minecraft.item.ItemStack;
|
2016-01-01 01:47:01 +00:00
|
|
|
import net.minecraft.potion.Potion;
|
|
|
|
import net.minecraft.potion.PotionEffect;
|
2015-12-30 22:24:40 +00:00
|
|
|
import net.minecraftforge.fml.common.IFuelHandler;
|
2016-01-01 01:10:57 +00:00
|
|
|
import WayofTime.bloodmagic.api.Constants;
|
|
|
|
import WayofTime.bloodmagic.api.util.helper.PlayerHelper;
|
2015-12-30 22:24:40 +00:00
|
|
|
|
2016-02-15 20:27:39 +00:00
|
|
|
import com.google.common.base.Strings;
|
|
|
|
|
2015-12-30 22:24:40 +00:00
|
|
|
public class ItemLavaCrystal extends ItemBindable implements IFuelHandler
|
|
|
|
{
|
|
|
|
public ItemLavaCrystal()
|
|
|
|
{
|
|
|
|
super();
|
|
|
|
setUnlocalizedName(Constants.Mod.MODID + ".lavaCrystal");
|
2016-01-19 06:34:12 +00:00
|
|
|
setRegistryName(Constants.BloodMagicItem.LAVA_CRYSTAL.getRegName());
|
2016-01-01 01:10:57 +00:00
|
|
|
setLPUsed(25);
|
2015-12-30 22:24:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ItemStack getContainerItem(ItemStack itemStack)
|
|
|
|
{
|
|
|
|
syphonNetwork(itemStack, getLPUsed());
|
|
|
|
ItemStack copiedStack = itemStack.copy();
|
|
|
|
copiedStack.setItemDamage(copiedStack.getItemDamage());
|
|
|
|
copiedStack.stackSize = 1;
|
|
|
|
return copiedStack;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean hasContainerItem(ItemStack itemStack)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getBurnTime(ItemStack fuel)
|
|
|
|
{
|
|
|
|
if (fuel == null)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
Item fuelItem = fuel.getItem();
|
|
|
|
|
|
|
|
if (fuelItem instanceof ItemLavaCrystal)
|
|
|
|
{
|
2016-02-15 13:11:18 +00:00
|
|
|
// if (FMLCommonHandler.instance().getSide() == Side.CLIENT)
|
|
|
|
// {
|
|
|
|
// return 200;
|
|
|
|
// }
|
2016-01-05 15:41:23 +00:00
|
|
|
|
2016-01-01 01:47:01 +00:00
|
|
|
if (canSyphonFromNetwork(fuel, getLPUsed()))
|
2015-12-30 22:24:40 +00:00
|
|
|
{
|
2016-01-01 01:10:57 +00:00
|
|
|
return 200;
|
2015-12-31 18:50:38 +00:00
|
|
|
} else
|
2015-12-30 22:24:40 +00:00
|
|
|
{
|
2016-01-01 09:06:56 +00:00
|
|
|
if (!Strings.isNullOrEmpty(getBindableOwner(fuel)))
|
2016-01-01 01:10:57 +00:00
|
|
|
{
|
2016-01-01 09:06:56 +00:00
|
|
|
EntityPlayer player = PlayerHelper.getPlayerFromUUID(getBindableOwner(fuel));
|
|
|
|
if (player != null)
|
|
|
|
{
|
|
|
|
player.addPotionEffect(new PotionEffect(Potion.confusion.getId(), 99));
|
|
|
|
}
|
2016-01-01 01:10:57 +00:00
|
|
|
}
|
2015-12-30 22:24:40 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|