Formatting pass.

This commit is contained in:
WayofTime 2016-05-02 20:56:32 -04:00
parent 1e9f3dadd3
commit 25108a5838
13 changed files with 90 additions and 72 deletions

View file

@ -86,7 +86,7 @@ public class BindableHelper
* Deprecated. * Deprecated.
* *
* Now handled automatically with * Now handled automatically with
* {@link WayofTime.bloodmagic.util.handler.EventHandler#onInteract(PlayerInteractEvent.RightClickItem)}} * {@link WayofTime.bloodmagic.util.handler.EventHandler#onInteract(PlayerInteractEvent.RightClickItem)}
* *
* @param stack * @param stack
* - The ItemStack to bind * - The ItemStack to bind
@ -105,7 +105,7 @@ public class BindableHelper
* Deprecated. * Deprecated.
* *
* Now handled automatically with * Now handled automatically with
* {@link WayofTime.bloodmagic.util.handler.EventHandler#onInteract(PlayerInteractEvent.RightClickItem)}} * {@link WayofTime.bloodmagic.util.handler.EventHandler#onInteract(PlayerInteractEvent.RightClickItem)}
* *
* @param stack * @param stack
* - The ItemStack to bind * - The ItemStack to bind
@ -145,7 +145,7 @@ public class BindableHelper
* Deprecated. * Deprecated.
* *
* Now handled automatically with * Now handled automatically with
* {@link WayofTime.bloodmagic.util.handler.EventHandler#onInteract(PlayerInteractEvent.RightClickItem)}} * {@link WayofTime.bloodmagic.util.handler.EventHandler#onInteract(PlayerInteractEvent.RightClickItem)}
* *
* @param stack * @param stack
* - ItemStack to check * - ItemStack to check

View file

@ -18,7 +18,7 @@ public class ItemHelper
{ {
/** /**
* Attempts to fill an altar with the contained LP * Attempts to fill an altar with the contained LP
* *
* @param altar * @param altar
* - The altar in question * - The altar in question
* @param itemStack * @param itemStack
@ -27,7 +27,7 @@ public class ItemHelper
* - The world * - The world
* @param altarPos * @param altarPos
* - The position of the altar * - The position of the altar
* *
* @return Whether or not the altar was filled (or at least attempted) * @return Whether or not the altar was filled (or at least attempted)
*/ */
public static boolean tryAndFillAltar(IBloodAltar altar, ItemStack itemStack, World world, BlockPos altarPos) 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 * Adds the given LP into the {@link IItemLPContainer}'s storage
* *
* @param stack * @param stack
* - The item in question * - The item in question
* @param toAdd * @param toAdd
* - How much LP should be added to the item * - How much LP should be added to the item
* @param maxCapacity * @param maxCapacity
* - The item's maximum holding capacity * - The item's maximum holding capacity
* *
* @return Whether or not LP was added to the item * @return Whether or not LP was added to the item
*/ */
public static boolean addLPToItem(ItemStack stack, int toAdd, int maxCapacity) public static boolean addLPToItem(ItemStack stack, int toAdd, int maxCapacity)

View file

@ -71,10 +71,10 @@ public class PlayerHelper
/** /**
* Checks whether or not the given player is an "actual" player * Checks whether or not the given player is an "actual" player
* *
* @param player * @param player
* - The player in question * - The player in question
* *
* @return If the player is fake or not * @return If the player is fake or not
*/ */
public static boolean isFakePlayer(EntityPlayer player) public static boolean isFakePlayer(EntityPlayer player)

View file

@ -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 * @param player
* - The player sacrificing * - The player sacrificing
* *
* @return Whether or not the health sacrificing succeeded * @return Whether or not the health sacrificing succeeded
*/ */
public static boolean sacrificePlayerHealth(EntityPlayer player) public static boolean sacrificePlayerHealth(EntityPlayer player)
@ -90,16 +91,17 @@ public class PlayerSacrificeHelper
/** /**
* Finds the nearest {@link IBloodAltar} and attempts to fill it * Finds the nearest {@link IBloodAltar} and attempts to fill it
* *
* @param world * @param world
* - The world * - The world
* @param sacrificingEntity * @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 * @param amount
* - The amount of which the altar should be filled * - The amount of which the altar should be filled
* @param isSacrifice * @param isSacrifice
* - Whether this is a Sacrifice or a Self-Sacrifice * - Whether this is a Sacrifice or a Self-Sacrifice
* *
* @return Whether the altar is found and (attempted) filled * @return Whether the altar is found and (attempted) filled
*/ */
public static boolean findAndFillAltar(World world, EntityLivingBase sacrificingEntity, int amount, boolean isSacrifice) public static boolean findAndFillAltar(World world, EntityLivingBase sacrificingEntity, int amount, boolean isSacrifice)
@ -117,13 +119,15 @@ public class PlayerSacrificeHelper
/** /**
* Gets the nearest {@link IBloodAltar} * Gets the nearest {@link IBloodAltar}
* *
* @param world * @param world
* - The world * - The world
* @param blockPos * @param blockPos
* - The position of where the check should be in (in a 2 block radius from this) * - 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 *
* @return The nearest altar, if no altar is found, then this will return
* null
*/ */
public static IBloodAltar getAltar(World world, BlockPos blockPos) public static IBloodAltar getAltar(World world, BlockPos blockPos)
{ {

View file

@ -38,7 +38,8 @@ public class BlockBloodRune extends BlockString implements IVariantProvider
} }
@Override @Override
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) { public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced)
{
tooltip.add(TextHelper.localizeEffect("tooltip.BloodMagic.decoration.safe")); tooltip.add(TextHelper.localizeEffect("tooltip.BloodMagic.decoration.safe"));
super.addInformation(stack, player, tooltip, advanced); super.addInformation(stack, player, tooltip, advanced);
} }

View file

@ -46,7 +46,8 @@ public class BlockPath extends BlockString implements IIncensePath, IVariantProv
} }
@Override @Override
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) { public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced)
{
tooltip.add(TextHelper.localizeEffect("tooltip.BloodMagic.decoration.safe")); tooltip.add(TextHelper.localizeEffect("tooltip.BloodMagic.decoration.safe"));
super.addInformation(stack, player, tooltip, advanced); super.addInformation(stack, player, tooltip, advanced);
} }

View file

@ -40,7 +40,8 @@ public class BlockRitualStone extends BlockString implements IRitualStone, IVari
} }
@Override @Override
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) { public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced)
{
tooltip.add(TextHelper.localizeEffect("tooltip.BloodMagic.decoration.safe")); tooltip.add(TextHelper.localizeEffect("tooltip.BloodMagic.decoration.safe"));
super.addInformation(stack, player, tooltip, advanced); super.addInformation(stack, player, tooltip, advanced);
} }

View file

@ -72,7 +72,7 @@ public class ItemBoundPickaxe extends ItemBoundTool implements IMeshProvider
if (!getActivated(stack)) if (!getActivated(stack))
return 1.0F; 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 @Override

View file

@ -184,10 +184,13 @@ public class ItemSacrificialDagger extends Item implements IMeshProvider
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public ItemMeshDefinition getMeshDefinition() { public ItemMeshDefinition getMeshDefinition()
return new ItemMeshDefinition() { {
return new ItemMeshDefinition()
{
@Override @Override
public ModelResourceLocation getModelLocation(ItemStack stack) { public ModelResourceLocation getModelLocation(ItemStack stack)
{
String variant = "type=normal"; String variant = "type=normal";
if (stack.getItemDamage() != 0) if (stack.getItemDamage() != 0)
variant = "type=creative"; variant = "type=creative";
@ -201,7 +204,8 @@ public class ItemSacrificialDagger extends Item implements IMeshProvider
} }
@Override @Override
public List<String> getVariants() { public List<String> getVariants()
{
List<String> variants = new ArrayList<String>(); List<String> variants = new ArrayList<String>();
variants.add("type=normal"); variants.add("type=normal");
variants.add("type=creative"); variants.add("type=creative");
@ -211,7 +215,8 @@ public class ItemSacrificialDagger extends Item implements IMeshProvider
@Nullable @Nullable
@Override @Override
public ResourceLocation getCustomLocation() { public ResourceLocation getCustomLocation()
{
return null; return null;
} }
} }

View file

@ -64,8 +64,7 @@ public class ItemPackSelfSacrifice extends ItemArmor implements IAltarManipulato
if (position == null) if (position == null)
{ {
return super.onItemRightClick(stack, world, player, EnumHand.MAIN_HAND); return super.onItemRightClick(stack, world, player, EnumHand.MAIN_HAND);
} } else
else
{ {
if (position.typeOfHit == RayTraceResult.Type.BLOCK) if (position.typeOfHit == RayTraceResult.Type.BLOCK)
{ {

View file

@ -77,7 +77,7 @@ public class ItemSigilTransposition extends ItemSigilBase
NBTTagCompound tileNBTTag = new NBTTagCompound(); NBTTagCompound tileNBTTag = new NBTTagCompound();
String blockName = rightClickedBlock.getBlock().getRegistryName().toString(); String blockName = rightClickedBlock.getBlock().getRegistryName().toString();
byte metadata = (byte) rightClickedBlock.getMeta(); byte metadata = (byte) rightClickedBlock.getMeta();
if (world.getTileEntity(blockPos) != null) if (world.getTileEntity(blockPos) != null)
{ {

View file

@ -105,14 +105,17 @@ public class ClientEventHandler
return textureMap.registerSprite(new ResourceLocation(Constants.Mod.DOMAIN + dir + "/" + name)); 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; World world = player.worldObj;
TileMasterRitualStone mrs = (TileMasterRitualStone) world.getTileEntity(minecraft.objectMouseOver.getBlockPos()); TileMasterRitualStone mrs = (TileMasterRitualStone) world.getTileEntity(minecraft.objectMouseOver.getBlockPos());
Ritual ritual = mrs.getCurrentRitual(); Ritual ritual = mrs.getCurrentRitual();
if (ritual != null) { if (ritual != null)
{
List<String> ranges = ritual.getListOfRanges(); List<String> ranges = ritual.getListOfRanges();
for (String range : ranges) { for (String range : ranges)
{
AreaDescriptor areaDescriptor = ritual.getBlockRange(range); AreaDescriptor areaDescriptor = ritual.getBlockRange(range);
for (BlockPos pos : areaDescriptor.getContainedPositions(minecraft.objectMouseOver.getBlockPos())) 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; World world = player.worldObj;
ItemRitualDiviner ritualDiviner = (ItemRitualDiviner) player.inventory.getCurrentItem().getItem(); ItemRitualDiviner ritualDiviner = (ItemRitualDiviner) player.inventory.getCurrentItem().getItem();
EnumFacing direction = ritualDiviner.getDirection(player.inventory.getCurrentItem()); EnumFacing direction = ritualDiviner.getDirection(player.inventory.getCurrentItem());
@ -152,27 +156,27 @@ public class ClientEventHandler
switch (ritualComponent.getRuneType()) switch (ritualComponent.getRuneType())
{ {
case BLANK: case BLANK:
texture = ritualStoneBlank; texture = ritualStoneBlank;
break; break;
case WATER: case WATER:
texture = ritualStoneWater; texture = ritualStoneWater;
break; break;
case FIRE: case FIRE:
texture = ritualStoneFire; texture = ritualStoneFire;
break; break;
case EARTH: case EARTH:
texture = ritualStoneEarth; texture = ritualStoneEarth;
break; break;
case AIR: case AIR:
texture = ritualStoneAir; texture = ritualStoneAir;
break; break;
case DAWN: case DAWN:
texture = ritualStoneDawn; texture = ritualStoneDawn;
break; break;
case DUSK: case DUSK:
texture = ritualStoneDusk; texture = ritualStoneDusk;
break; break;
} }
RenderFakeBlocks.drawFakeBlock(texture, minX, minY, minZ, world); RenderFakeBlocks.drawFakeBlock(texture, minX, minY, minZ, world);

View file

@ -2,27 +2,30 @@ package WayofTime.bloodmagic.util.helper;
import java.util.TreeMap; import java.util.TreeMap;
public class NumeralHelper { public class NumeralHelper
{
private static final TreeMap<Integer, String> romanNumerals = new TreeMap<Integer, String>(); private static final TreeMap<Integer, String> romanNumerals = new TreeMap<Integer, String>();
static { static
romanNumerals.put(1000, "M" ); {
romanNumerals.put(900 , "CM"); romanNumerals.put(1000, "M");
romanNumerals.put(500 , "D" ); romanNumerals.put(900, "CM");
romanNumerals.put(400 , "CD"); romanNumerals.put(500, "D");
romanNumerals.put(100 , "C" ); romanNumerals.put(400, "CD");
romanNumerals.put(90 , "XC"); romanNumerals.put(100, "C");
romanNumerals.put(50 , "L" ); romanNumerals.put(90, "XC");
romanNumerals.put(40 , "XL"); romanNumerals.put(50, "L");
romanNumerals.put(10 , "X" ); romanNumerals.put(40, "XL");
romanNumerals.put(9 , "IX"); romanNumerals.put(10, "X");
romanNumerals.put(5 , "V" ); romanNumerals.put(9, "IX");
romanNumerals.put(4 , "IV"); romanNumerals.put(5, "V");
romanNumerals.put(1 , "I" ); 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); int convert = romanNumerals.floorKey(arabic);
if (arabic == convert) if (arabic == convert)
return romanNumerals.get(convert); return romanNumerals.get(convert);