2015-12-30 22:24:40 +00:00
|
|
|
package WayofTime.bloodmagic.item;
|
|
|
|
|
2017-08-15 03:53:42 +00:00
|
|
|
import WayofTime.bloodmagic.BloodMagic;
|
2018-02-06 01:04:38 +00:00
|
|
|
import WayofTime.bloodmagic.apibutnotreally.util.helper.NetworkHelper;
|
|
|
|
import WayofTime.bloodmagic.apibutnotreally.util.helper.PlayerHelper;
|
2017-08-16 04:30:48 +00:00
|
|
|
import WayofTime.bloodmagic.client.IVariantProvider;
|
2017-08-15 03:53:42 +00:00
|
|
|
import com.google.common.collect.Lists;
|
2016-01-01 01:10:57 +00:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2016-03-18 20:50:33 +00:00
|
|
|
import net.minecraft.init.MobEffects;
|
2015-12-30 22:24:40 +00:00
|
|
|
import net.minecraft.item.ItemStack;
|
2016-01-01 01:47:01 +00:00
|
|
|
import net.minecraft.potion.PotionEffect;
|
2016-03-16 08:10:33 +00:00
|
|
|
import org.apache.commons.lang3.tuple.Pair;
|
2016-02-25 13:54:18 +00:00
|
|
|
|
2017-08-16 04:30:48 +00:00
|
|
|
import java.util.List;
|
2016-03-18 20:50:33 +00:00
|
|
|
|
2017-08-16 04:30:48 +00:00
|
|
|
public class ItemLavaCrystal extends ItemBindableBase implements IVariantProvider {
|
|
|
|
public ItemLavaCrystal() {
|
2015-12-30 22:24:40 +00:00
|
|
|
super();
|
2017-08-15 03:53:42 +00:00
|
|
|
setUnlocalizedName(BloodMagic.MODID + ".lavaCrystal");
|
2015-12-30 22:24:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-08-16 04:30:48 +00:00
|
|
|
public ItemStack getContainerItem(ItemStack itemStack) {
|
2016-05-01 14:01:00 +00:00
|
|
|
NetworkHelper.getSoulNetwork(this.getOwnerUUID(itemStack)).syphon(25);
|
2015-12-30 22:24:40 +00:00
|
|
|
ItemStack copiedStack = itemStack.copy();
|
|
|
|
copiedStack.setItemDamage(copiedStack.getItemDamage());
|
2017-01-02 06:26:42 +00:00
|
|
|
copiedStack.setCount(1);
|
2015-12-30 22:24:40 +00:00
|
|
|
return copiedStack;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-08-16 04:30:48 +00:00
|
|
|
public boolean hasContainerItem(ItemStack itemStack) {
|
2015-12-30 22:24:40 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-08-15 03:53:42 +00:00
|
|
|
public int getItemBurnTime(ItemStack stack) {
|
2017-08-16 03:21:54 +00:00
|
|
|
if (!stack.hasTagCompound())
|
|
|
|
return -1;
|
|
|
|
|
2017-08-15 03:53:42 +00:00
|
|
|
if (getOwnerUUID(stack) == null)
|
|
|
|
return -1;
|
2015-12-30 22:24:40 +00:00
|
|
|
|
2017-08-15 03:53:42 +00:00
|
|
|
if (NetworkHelper.canSyphonFromContainer(stack, 25))
|
|
|
|
return 200;
|
|
|
|
else {
|
|
|
|
EntityPlayer player = PlayerHelper.getPlayerFromUUID(getOwnerUUID(stack));
|
|
|
|
if (player != null)
|
|
|
|
player.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, 99));
|
2015-12-30 22:24:40 +00:00
|
|
|
}
|
|
|
|
|
2017-08-15 03:53:42 +00:00
|
|
|
return -1;
|
2015-12-30 22:24:40 +00:00
|
|
|
}
|
2016-03-16 08:10:33 +00:00
|
|
|
|
|
|
|
@Override
|
2017-08-16 04:30:48 +00:00
|
|
|
public List<Pair<Integer, String>> getVariants() {
|
2017-08-15 03:53:42 +00:00
|
|
|
List<Pair<Integer, String>> ret = Lists.newArrayList();
|
|
|
|
ret.add(Pair.of(0, "type=normal"));
|
2016-03-16 08:10:33 +00:00
|
|
|
return ret;
|
|
|
|
}
|
2015-12-30 22:24:40 +00:00
|
|
|
}
|