Run formatter
This commit is contained in:
parent
61c44a831b
commit
08258fd6ef
606 changed files with 13464 additions and 22975 deletions
|
@ -1,9 +1,12 @@
|
|||
package WayofTime.bloodmagic.item.alchemy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.item.armour.ItemLivingArmour;
|
||||
import WayofTime.bloodmagic.livingArmour.LivingArmour;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import com.google.common.collect.Iterables;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
@ -20,27 +23,18 @@ import net.minecraft.util.NonNullList;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.item.armour.ItemLivingArmour;
|
||||
import WayofTime.bloodmagic.livingArmour.LivingArmour;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Iterables;
|
||||
|
||||
public class ItemLivingArmourPointsUpgrade extends Item implements IVariantProvider
|
||||
{
|
||||
public class ItemLivingArmourPointsUpgrade extends Item implements IVariantProvider {
|
||||
public static final String DRAFT_ANGELUS = "draftAngelus";
|
||||
private static ArrayList<String> names = new ArrayList<String>();
|
||||
|
||||
public static final String DRAFT_ANGELUS = "draftAngelus";
|
||||
|
||||
public ItemLivingArmourPointsUpgrade()
|
||||
{
|
||||
public ItemLivingArmourPointsUpgrade() {
|
||||
super();
|
||||
|
||||
setUnlocalizedName(BloodMagic.MODID + ".livingPointUpgrade.");
|
||||
|
@ -52,8 +46,7 @@ public class ItemLivingArmourPointsUpgrade extends Item implements IVariantProvi
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag)
|
||||
{
|
||||
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
|
||||
if (!stack.hasTagCompound())
|
||||
return;
|
||||
|
||||
|
@ -61,29 +54,23 @@ public class ItemLivingArmourPointsUpgrade extends Item implements IVariantProvi
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityLivingBase entityLiving)
|
||||
{
|
||||
public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityLivingBase entityLiving) {
|
||||
EntityPlayer player = entityLiving instanceof EntityPlayer ? (EntityPlayer) entityLiving : null;
|
||||
|
||||
if (player == null || !player.capabilities.isCreativeMode)
|
||||
{
|
||||
if (player == null || !player.capabilities.isCreativeMode) {
|
||||
stack.shrink(1);
|
||||
}
|
||||
|
||||
if (!worldIn.isRemote)
|
||||
{
|
||||
if (!worldIn.isRemote) {
|
||||
player.addPotionEffect(new PotionEffect(MobEffects.WITHER, 300, 5));
|
||||
player.addPotionEffect(new PotionEffect(MobEffects.POISON, 300, 5));
|
||||
player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 400, 1));
|
||||
|
||||
if (LivingArmour.hasFullSet(player))
|
||||
{
|
||||
if (LivingArmour.hasFullSet(player)) {
|
||||
ItemStack chestStack = Iterables.toArray(player.getArmorInventoryList(), ItemStack.class)[2];
|
||||
LivingArmour armour = ItemLivingArmour.getLivingArmour(chestStack);
|
||||
if (armour != null)
|
||||
{
|
||||
if (armour.maxUpgradePoints < 200)
|
||||
{
|
||||
if (armour != null) {
|
||||
if (armour.maxUpgradePoints < 200) {
|
||||
armour.maxUpgradePoints = 200;
|
||||
((ItemLivingArmour) chestStack.getItem()).setLivingArmour(chestStack, armour, true);
|
||||
ItemLivingArmour.setLivingArmour(chestStack, armour);
|
||||
|
@ -96,39 +83,33 @@ public class ItemLivingArmourPointsUpgrade extends Item implements IVariantProvi
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getMaxItemUseDuration(ItemStack stack)
|
||||
{
|
||||
public int getMaxItemUseDuration(ItemStack stack) {
|
||||
return 32;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumAction getItemUseAction(ItemStack stack)
|
||||
{
|
||||
public EnumAction getItemUseAction(ItemStack stack) {
|
||||
return EnumAction.DRINK;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand hand)
|
||||
{
|
||||
public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand hand) {
|
||||
playerIn.setActiveHand(hand);
|
||||
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, playerIn.getHeldItem(hand));
|
||||
}
|
||||
|
||||
private void buildItemList()
|
||||
{
|
||||
private void buildItemList() {
|
||||
names.add(0, DRAFT_ANGELUS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack)
|
||||
{
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return super.getUnlocalizedName(stack) + names.get(stack.getItemDamage());
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(CreativeTabs creativeTab, NonNullList<ItemStack> list)
|
||||
{
|
||||
public void getSubItems(CreativeTabs creativeTab, NonNullList<ItemStack> list) {
|
||||
if (!isInCreativeTab(creativeTab))
|
||||
return;
|
||||
|
||||
|
@ -136,22 +117,19 @@ public class ItemLivingArmourPointsUpgrade extends Item implements IVariantProvi
|
|||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
public static ItemStack getStack(String name)
|
||||
{
|
||||
return new ItemStack(RegistrarBloodMagicItems.POINTS_UPGRADE, 1, names.indexOf(name));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants()
|
||||
{
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
for (String name : names)
|
||||
ret.add(new ImmutablePair<Integer, String>(names.indexOf(name), "type=" + name));
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static ItemStack getStack(String key, int stackSize)
|
||||
{
|
||||
public static ItemStack getStack(String name) {
|
||||
return new ItemStack(RegistrarBloodMagicItems.POINTS_UPGRADE, 1, names.indexOf(name));
|
||||
}
|
||||
|
||||
public static ItemStack getStack(String key, int stackSize) {
|
||||
ItemStack stack = getStack(key);
|
||||
stack.setCount(stackSize);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue