Run formatter
This commit is contained in:
parent
61c44a831b
commit
08258fd6ef
606 changed files with 13464 additions and 22975 deletions
|
@ -1,9 +1,13 @@
|
|||
package WayofTime.bloodmagic.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.livingArmour.LivingArmourHandler;
|
||||
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
|
||||
import WayofTime.bloodmagic.api.util.helper.ItemHelper.LivingUpgrades;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.item.armour.ItemLivingArmour;
|
||||
import WayofTime.bloodmagic.livingArmour.LivingArmour;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -16,23 +20,15 @@ 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.api.livingArmour.LivingArmourHandler;
|
||||
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
|
||||
import WayofTime.bloodmagic.api.util.helper.ItemHelper.LivingUpgrades;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.item.armour.ItemLivingArmour;
|
||||
import WayofTime.bloodmagic.livingArmour.LivingArmour;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
public class ItemUpgradeTome extends Item implements IVariantProvider
|
||||
{
|
||||
public ItemUpgradeTome()
|
||||
{
|
||||
public class ItemUpgradeTome extends Item implements IVariantProvider {
|
||||
public ItemUpgradeTome() {
|
||||
super();
|
||||
|
||||
setCreativeTab(BloodMagic.TAB_TOMES);
|
||||
|
@ -42,31 +38,25 @@ public class ItemUpgradeTome extends Item implements IVariantProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand)
|
||||
{
|
||||
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) {
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
if (world.isRemote)
|
||||
{
|
||||
if (world.isRemote) {
|
||||
return super.onItemRightClick(world, player, hand);
|
||||
}
|
||||
|
||||
LivingArmourUpgrade upgrade = LivingUpgrades.getUpgrade(stack);
|
||||
if (upgrade == null)
|
||||
{
|
||||
if (upgrade == null) {
|
||||
return super.onItemRightClick(world, player, hand);
|
||||
}
|
||||
|
||||
ItemStack chestStack = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
|
||||
if (chestStack.getItem() instanceof ItemLivingArmour)
|
||||
{
|
||||
if (chestStack.getItem() instanceof ItemLivingArmour) {
|
||||
LivingArmour armour = ItemLivingArmour.getLivingArmourFromStack(chestStack);
|
||||
if (armour == null)
|
||||
{
|
||||
if (armour == null) {
|
||||
return super.onItemRightClick(world, player, hand);
|
||||
}
|
||||
|
||||
if (armour.upgradeArmour(player, upgrade))
|
||||
{
|
||||
if (armour.upgradeArmour(player, upgrade)) {
|
||||
ItemLivingArmour.setLivingArmour(chestStack, armour);
|
||||
// ((ItemLivingArmour) chestStack.getItem()).setLivingArmour(stack, armour, false);
|
||||
stack.shrink(1);
|
||||
|
@ -89,17 +79,14 @@ public class ItemUpgradeTome extends Item implements IVariantProvider
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(CreativeTabs creativeTab, NonNullList<ItemStack> list)
|
||||
{
|
||||
public void getSubItems(CreativeTabs creativeTab, NonNullList<ItemStack> list) {
|
||||
if (!isInCreativeTab(creativeTab))
|
||||
return;
|
||||
|
||||
for (Entry<String, Integer> entry : LivingArmourHandler.upgradeMaxLevelMap.entrySet())
|
||||
{
|
||||
for (Entry<String, Integer> entry : LivingArmourHandler.upgradeMaxLevelMap.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
int maxLevel = entry.getValue();
|
||||
for (int i = 0; i < maxLevel; i++)
|
||||
{
|
||||
for (int i = 0; i < maxLevel; i++) {
|
||||
ItemStack stack = new ItemStack(this);
|
||||
LivingUpgrades.setKey(stack, key);
|
||||
LivingUpgrades.setLevel(stack, i);
|
||||
|
@ -109,8 +96,7 @@ public class ItemUpgradeTome extends Item implements IVariantProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants()
|
||||
{
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
ret.add(new ImmutablePair<Integer, String>(0, "type=upgradetome"));
|
||||
return ret;
|
||||
|
@ -118,13 +104,11 @@ public class ItemUpgradeTome extends Item implements IVariantProvider
|
|||
|
||||
@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;
|
||||
LivingArmourUpgrade upgrade = LivingUpgrades.getUpgrade(stack);
|
||||
if (upgrade != null)
|
||||
{
|
||||
if (upgrade != null) {
|
||||
tooltip.add(TextHelper.localizeEffect("tooltip.bloodmagic.livingArmour.upgrade.level", TextHelper.localize(upgrade.getUnlocalizedName()), upgrade.getUpgradeLevel() + 1));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue