From 25108a5838ce3afac93c6dcf9551f7763603c4bb Mon Sep 17 00:00:00 2001 From: WayofTime Date: Mon, 2 May 2016 20:56:32 -0400 Subject: [PATCH] Formatting pass. --- .../api/util/helper/BindableHelper.java | 6 +-- .../api/util/helper/ItemHelper.java | 8 +-- .../api/util/helper/PlayerHelper.java | 4 +- .../util/helper/PlayerSacrificeHelper.java | 24 +++++---- .../bloodmagic/block/BlockBloodRune.java | 3 +- .../WayofTime/bloodmagic/block/BlockPath.java | 3 +- .../bloodmagic/block/BlockRitualStone.java | 3 +- .../bloodmagic/item/ItemBoundPickaxe.java | 2 +- .../item/ItemSacrificialDagger.java | 15 ++++-- .../item/gear/ItemPackSelfSacrifice.java | 3 +- .../item/sigil/ItemSigilTransposition.java | 2 +- .../util/handler/ClientEventHandler.java | 54 ++++++++++--------- .../bloodmagic/util/helper/NumeralHelper.java | 35 ++++++------ 13 files changed, 90 insertions(+), 72 deletions(-) diff --git a/src/main/java/WayofTime/bloodmagic/api/util/helper/BindableHelper.java b/src/main/java/WayofTime/bloodmagic/api/util/helper/BindableHelper.java index 28ec6844..46863274 100644 --- a/src/main/java/WayofTime/bloodmagic/api/util/helper/BindableHelper.java +++ b/src/main/java/WayofTime/bloodmagic/api/util/helper/BindableHelper.java @@ -86,7 +86,7 @@ public class BindableHelper * Deprecated. * * Now handled automatically with - * {@link WayofTime.bloodmagic.util.handler.EventHandler#onInteract(PlayerInteractEvent.RightClickItem)}} + * {@link WayofTime.bloodmagic.util.handler.EventHandler#onInteract(PlayerInteractEvent.RightClickItem)} * * @param stack * - The ItemStack to bind @@ -105,7 +105,7 @@ public class BindableHelper * Deprecated. * * Now handled automatically with - * {@link WayofTime.bloodmagic.util.handler.EventHandler#onInteract(PlayerInteractEvent.RightClickItem)}} + * {@link WayofTime.bloodmagic.util.handler.EventHandler#onInteract(PlayerInteractEvent.RightClickItem)} * * @param stack * - The ItemStack to bind @@ -145,7 +145,7 @@ public class BindableHelper * Deprecated. * * Now handled automatically with - * {@link WayofTime.bloodmagic.util.handler.EventHandler#onInteract(PlayerInteractEvent.RightClickItem)}} + * {@link WayofTime.bloodmagic.util.handler.EventHandler#onInteract(PlayerInteractEvent.RightClickItem)} * * @param stack * - ItemStack to check diff --git a/src/main/java/WayofTime/bloodmagic/api/util/helper/ItemHelper.java b/src/main/java/WayofTime/bloodmagic/api/util/helper/ItemHelper.java index eabb74b4..c7e3ab7a 100644 --- a/src/main/java/WayofTime/bloodmagic/api/util/helper/ItemHelper.java +++ b/src/main/java/WayofTime/bloodmagic/api/util/helper/ItemHelper.java @@ -18,7 +18,7 @@ public class ItemHelper { /** * Attempts to fill an altar with the contained LP - * + * * @param altar * - The altar in question * @param itemStack @@ -27,7 +27,7 @@ public class ItemHelper * - The world * @param altarPos * - The position of the altar - * + * * @return Whether or not the altar was filled (or at least attempted) */ public static boolean tryAndFillAltar(IBloodAltar altar, ItemStack itemStack, World world, BlockPos altarPos) @@ -55,14 +55,14 @@ public class ItemHelper /** * Adds the given LP into the {@link IItemLPContainer}'s storage - * + * * @param stack * - The item in question * @param toAdd * - How much LP should be added to the item * @param maxCapacity * - The item's maximum holding capacity - * + * * @return Whether or not LP was added to the item */ public static boolean addLPToItem(ItemStack stack, int toAdd, int maxCapacity) diff --git a/src/main/java/WayofTime/bloodmagic/api/util/helper/PlayerHelper.java b/src/main/java/WayofTime/bloodmagic/api/util/helper/PlayerHelper.java index 7de2303e..0b4a1163 100644 --- a/src/main/java/WayofTime/bloodmagic/api/util/helper/PlayerHelper.java +++ b/src/main/java/WayofTime/bloodmagic/api/util/helper/PlayerHelper.java @@ -71,10 +71,10 @@ public class PlayerHelper /** * Checks whether or not the given player is an "actual" player - * + * * @param player * - The player in question - * + * * @return If the player is fake or not */ public static boolean isFakePlayer(EntityPlayer player) diff --git a/src/main/java/WayofTime/bloodmagic/api/util/helper/PlayerSacrificeHelper.java b/src/main/java/WayofTime/bloodmagic/api/util/helper/PlayerSacrificeHelper.java index 78100b4d..8dd87fe6 100644 --- a/src/main/java/WayofTime/bloodmagic/api/util/helper/PlayerSacrificeHelper.java +++ b/src/main/java/WayofTime/bloodmagic/api/util/helper/PlayerSacrificeHelper.java @@ -44,11 +44,12 @@ public class PlayerSacrificeHelper } /** - * Sacrifices a player's health while the player is under the influence of incense - * + * Sacrifices a player's health while the player is under the influence of + * incense + * * @param player * - The player sacrificing - * + * * @return Whether or not the health sacrificing succeeded */ public static boolean sacrificePlayerHealth(EntityPlayer player) @@ -90,16 +91,17 @@ public class PlayerSacrificeHelper /** * Finds the nearest {@link IBloodAltar} and attempts to fill it - * + * * @param world * - The world * @param sacrificingEntity - * - The entity having the sacrifice done on (can be {@link EntityPlayer} for self-sacrifice) + * - The entity having the sacrifice done on (can be + * {@link EntityPlayer} for self-sacrifice) * @param amount * - The amount of which the altar should be filled * @param isSacrifice * - Whether this is a Sacrifice or a Self-Sacrifice - * + * * @return Whether the altar is found and (attempted) filled */ public static boolean findAndFillAltar(World world, EntityLivingBase sacrificingEntity, int amount, boolean isSacrifice) @@ -117,13 +119,15 @@ public class PlayerSacrificeHelper /** * Gets the nearest {@link IBloodAltar} - * + * * @param world * - The world * @param blockPos - * - The position of where the check should be in (in a 2 block radius from this) - * - * @return The nearest altar, if no altar is found, then this will return null + * - The position of where the check should be in (in a 2 block + * radius from this) + * + * @return The nearest altar, if no altar is found, then this will return + * null */ public static IBloodAltar getAltar(World world, BlockPos blockPos) { diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockBloodRune.java b/src/main/java/WayofTime/bloodmagic/block/BlockBloodRune.java index 74dcb8c3..ea9dd5e4 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockBloodRune.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockBloodRune.java @@ -38,7 +38,8 @@ public class BlockBloodRune extends BlockString implements IVariantProvider } @Override - public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) { + public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) + { tooltip.add(TextHelper.localizeEffect("tooltip.BloodMagic.decoration.safe")); super.addInformation(stack, player, tooltip, advanced); } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockPath.java b/src/main/java/WayofTime/bloodmagic/block/BlockPath.java index 83e7f452..6a7ff346 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockPath.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockPath.java @@ -46,7 +46,8 @@ public class BlockPath extends BlockString implements IIncensePath, IVariantProv } @Override - public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) { + public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) + { tooltip.add(TextHelper.localizeEffect("tooltip.BloodMagic.decoration.safe")); super.addInformation(stack, player, tooltip, advanced); } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockRitualStone.java b/src/main/java/WayofTime/bloodmagic/block/BlockRitualStone.java index 87dcd968..5132bf03 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockRitualStone.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockRitualStone.java @@ -40,7 +40,8 @@ public class BlockRitualStone extends BlockString implements IRitualStone, IVari } @Override - public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) { + public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) + { tooltip.add(TextHelper.localizeEffect("tooltip.BloodMagic.decoration.safe")); super.addInformation(stack, player, tooltip, advanced); } diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemBoundPickaxe.java b/src/main/java/WayofTime/bloodmagic/item/ItemBoundPickaxe.java index 78da0293..016fd0c4 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemBoundPickaxe.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemBoundPickaxe.java @@ -72,7 +72,7 @@ public class ItemBoundPickaxe extends ItemBoundTool implements IMeshProvider if (!getActivated(stack)) return 1.0F; - return state.getMaterial() != Material.IRON && state.getMaterial() != Material.ANVIL&& state.getMaterial() != Material.ROCK ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial; + return state.getMaterial() != Material.IRON && state.getMaterial() != Material.ANVIL && state.getMaterial() != Material.ROCK ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial; } @Override diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemSacrificialDagger.java b/src/main/java/WayofTime/bloodmagic/item/ItemSacrificialDagger.java index df088fc1..b7e3891f 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemSacrificialDagger.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemSacrificialDagger.java @@ -184,10 +184,13 @@ public class ItemSacrificialDagger extends Item implements IMeshProvider @Override @SideOnly(Side.CLIENT) - public ItemMeshDefinition getMeshDefinition() { - return new ItemMeshDefinition() { + public ItemMeshDefinition getMeshDefinition() + { + return new ItemMeshDefinition() + { @Override - public ModelResourceLocation getModelLocation(ItemStack stack) { + public ModelResourceLocation getModelLocation(ItemStack stack) + { String variant = "type=normal"; if (stack.getItemDamage() != 0) variant = "type=creative"; @@ -201,7 +204,8 @@ public class ItemSacrificialDagger extends Item implements IMeshProvider } @Override - public List getVariants() { + public List getVariants() + { List variants = new ArrayList(); variants.add("type=normal"); variants.add("type=creative"); @@ -211,7 +215,8 @@ public class ItemSacrificialDagger extends Item implements IMeshProvider @Nullable @Override - public ResourceLocation getCustomLocation() { + public ResourceLocation getCustomLocation() + { return null; } } \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/item/gear/ItemPackSelfSacrifice.java b/src/main/java/WayofTime/bloodmagic/item/gear/ItemPackSelfSacrifice.java index bb21103f..4e77b95d 100644 --- a/src/main/java/WayofTime/bloodmagic/item/gear/ItemPackSelfSacrifice.java +++ b/src/main/java/WayofTime/bloodmagic/item/gear/ItemPackSelfSacrifice.java @@ -64,8 +64,7 @@ public class ItemPackSelfSacrifice extends ItemArmor implements IAltarManipulato if (position == null) { return super.onItemRightClick(stack, world, player, EnumHand.MAIN_HAND); - } - else + } else { if (position.typeOfHit == RayTraceResult.Type.BLOCK) { diff --git a/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilTransposition.java b/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilTransposition.java index 201c9472..8bfbd395 100644 --- a/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilTransposition.java +++ b/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilTransposition.java @@ -77,7 +77,7 @@ public class ItemSigilTransposition extends ItemSigilBase NBTTagCompound tileNBTTag = new NBTTagCompound(); String blockName = rightClickedBlock.getBlock().getRegistryName().toString(); - byte metadata = (byte) rightClickedBlock.getMeta(); + byte metadata = (byte) rightClickedBlock.getMeta(); if (world.getTileEntity(blockPos) != null) { diff --git a/src/main/java/WayofTime/bloodmagic/util/handler/ClientEventHandler.java b/src/main/java/WayofTime/bloodmagic/util/handler/ClientEventHandler.java index 36417daa..123dcbf2 100644 --- a/src/main/java/WayofTime/bloodmagic/util/handler/ClientEventHandler.java +++ b/src/main/java/WayofTime/bloodmagic/util/handler/ClientEventHandler.java @@ -105,14 +105,17 @@ public class ClientEventHandler return textureMap.registerSprite(new ResourceLocation(Constants.Mod.DOMAIN + dir + "/" + name)); } - private void renderRitualInformation(EntityPlayerSP player, float partialTicks) { + private void renderRitualInformation(EntityPlayerSP player, float partialTicks) + { World world = player.worldObj; TileMasterRitualStone mrs = (TileMasterRitualStone) world.getTileEntity(minecraft.objectMouseOver.getBlockPos()); Ritual ritual = mrs.getCurrentRitual(); - if (ritual != null) { + if (ritual != null) + { List ranges = ritual.getListOfRanges(); - for (String range : ranges) { + for (String range : ranges) + { AreaDescriptor areaDescriptor = ritual.getBlockRange(range); for (BlockPos pos : areaDescriptor.getContainedPositions(minecraft.objectMouseOver.getBlockPos())) @@ -121,7 +124,8 @@ public class ClientEventHandler } } - private void renderRitualStones(EntityPlayerSP player, float partialTicks) { + private void renderRitualStones(EntityPlayerSP player, float partialTicks) + { World world = player.worldObj; ItemRitualDiviner ritualDiviner = (ItemRitualDiviner) player.inventory.getCurrentItem().getItem(); EnumFacing direction = ritualDiviner.getDirection(player.inventory.getCurrentItem()); @@ -152,27 +156,27 @@ public class ClientEventHandler switch (ritualComponent.getRuneType()) { - case BLANK: - texture = ritualStoneBlank; - break; - case WATER: - texture = ritualStoneWater; - break; - case FIRE: - texture = ritualStoneFire; - break; - case EARTH: - texture = ritualStoneEarth; - break; - case AIR: - texture = ritualStoneAir; - break; - case DAWN: - texture = ritualStoneDawn; - break; - case DUSK: - texture = ritualStoneDusk; - break; + case BLANK: + texture = ritualStoneBlank; + break; + case WATER: + texture = ritualStoneWater; + break; + case FIRE: + texture = ritualStoneFire; + break; + case EARTH: + texture = ritualStoneEarth; + break; + case AIR: + texture = ritualStoneAir; + break; + case DAWN: + texture = ritualStoneDawn; + break; + case DUSK: + texture = ritualStoneDusk; + break; } RenderFakeBlocks.drawFakeBlock(texture, minX, minY, minZ, world); diff --git a/src/main/java/WayofTime/bloodmagic/util/helper/NumeralHelper.java b/src/main/java/WayofTime/bloodmagic/util/helper/NumeralHelper.java index 90e93162..8cea0dfa 100644 --- a/src/main/java/WayofTime/bloodmagic/util/helper/NumeralHelper.java +++ b/src/main/java/WayofTime/bloodmagic/util/helper/NumeralHelper.java @@ -2,27 +2,30 @@ package WayofTime.bloodmagic.util.helper; import java.util.TreeMap; -public class NumeralHelper { +public class NumeralHelper +{ private static final TreeMap romanNumerals = new TreeMap(); - static { - romanNumerals.put(1000, "M" ); - romanNumerals.put(900 , "CM"); - romanNumerals.put(500 , "D" ); - romanNumerals.put(400 , "CD"); - romanNumerals.put(100 , "C" ); - romanNumerals.put(90 , "XC"); - romanNumerals.put(50 , "L" ); - romanNumerals.put(40 , "XL"); - romanNumerals.put(10 , "X" ); - romanNumerals.put(9 , "IX"); - romanNumerals.put(5 , "V" ); - romanNumerals.put(4 , "IV"); - romanNumerals.put(1 , "I" ); + static + { + romanNumerals.put(1000, "M"); + romanNumerals.put(900, "CM"); + romanNumerals.put(500, "D"); + romanNumerals.put(400, "CD"); + romanNumerals.put(100, "C"); + romanNumerals.put(90, "XC"); + romanNumerals.put(50, "L"); + romanNumerals.put(40, "XL"); + romanNumerals.put(10, "X"); + romanNumerals.put(9, "IX"); + romanNumerals.put(5, "V"); + romanNumerals.put(4, "IV"); + romanNumerals.put(1, "I"); } - public static String toRoman(int arabic) { + public static String toRoman(int arabic) + { int convert = romanNumerals.floorKey(arabic); if (arabic == convert) return romanNumerals.get(convert);