Normalized code formatting.
This commit is contained in:
parent
b1db7c5152
commit
134b11f177
122 changed files with 944 additions and 697 deletions
|
@ -14,7 +14,8 @@ public enum EnumDemonWillType implements IStringSerializable
|
|||
|
||||
public final String name;
|
||||
|
||||
EnumDemonWillType(String name) {
|
||||
EnumDemonWillType(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,21 +6,21 @@ public interface IDemonWill
|
|||
{
|
||||
/**
|
||||
* Obtains the amount of Will an ItemStack contains.
|
||||
*
|
||||
*
|
||||
* @param willStack
|
||||
* - The stack to retrieve the Will from
|
||||
*
|
||||
* - The stack to retrieve the Will from
|
||||
*
|
||||
* @return - The amount of Will an ItemStack contains
|
||||
*/
|
||||
double getWill(ItemStack willStack);
|
||||
|
||||
/**
|
||||
* Sets the amount of Will in a given ItemStack.
|
||||
*
|
||||
*
|
||||
* @param willStack
|
||||
* - The ItemStack of the Will
|
||||
* - The ItemStack of the Will
|
||||
* @param will
|
||||
* - The amount of will to set the stack to
|
||||
* - The amount of will to set the stack to
|
||||
*/
|
||||
void setWill(ItemStack willStack, double will);
|
||||
|
||||
|
@ -29,10 +29,10 @@ public interface IDemonWill
|
|||
* drained, the willStack will be removed.
|
||||
*
|
||||
* @param willStack
|
||||
* - The ItemStack of the will
|
||||
* - The ItemStack of the will
|
||||
* @param drainAmount
|
||||
* - The amount of Will to drain
|
||||
*
|
||||
* - The amount of Will to drain
|
||||
*
|
||||
* @return The amount of will drained.
|
||||
*/
|
||||
double drainWill(ItemStack willStack, double drainAmount);
|
||||
|
@ -42,10 +42,10 @@ public interface IDemonWill
|
|||
* should respect the number requested.
|
||||
*
|
||||
* @param meta
|
||||
* - The meta of the ItemStack to create
|
||||
* - The meta of the ItemStack to create
|
||||
* @param number
|
||||
* - The amount of Will to create the Stack with.
|
||||
*
|
||||
* - The amount of Will to create the Stack with.
|
||||
*
|
||||
* @return - An ItemStack with the set amount of Will
|
||||
*/
|
||||
ItemStack createWill(int meta, double number);
|
||||
|
|
|
@ -5,7 +5,7 @@ import net.minecraft.item.ItemStack;
|
|||
public interface IDemonWillGem
|
||||
{
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param willGemStack
|
||||
* - The ItemStack for this demon will gem.
|
||||
* @param willStack
|
||||
|
@ -18,7 +18,7 @@ public interface IDemonWillGem
|
|||
/**
|
||||
* Returns the number of souls that are left in the soul gem. Returns a
|
||||
* double because souls can be fractionally drained.
|
||||
*
|
||||
*
|
||||
*/
|
||||
double getWill(EnumDemonWillType type, ItemStack willGemStack);
|
||||
|
||||
|
|
|
@ -6,10 +6,10 @@ public interface IDiscreteDemonWill
|
|||
{
|
||||
/**
|
||||
* Obtains the amount of Will an ItemStack contains.
|
||||
*
|
||||
*
|
||||
* @param soulStack
|
||||
* - The stack to retrieve the Will from
|
||||
*
|
||||
* - The stack to retrieve the Will from
|
||||
*
|
||||
* @return - The amount of Will an ItemStack contains
|
||||
*/
|
||||
double getWill(ItemStack soulStack);
|
||||
|
@ -18,32 +18,32 @@ public interface IDiscreteDemonWill
|
|||
* Drains the demonic will from the willStack. If all of the will is
|
||||
* drained, the willStack will be removed. Will only drain in discrete
|
||||
* amounts, determined by getDiscretization.
|
||||
*
|
||||
*
|
||||
* @param willStack
|
||||
* - The ItemStack of the will
|
||||
* - The ItemStack of the will
|
||||
* @param drainAmount
|
||||
* - The amount of Will to drain
|
||||
*
|
||||
* - The amount of Will to drain
|
||||
*
|
||||
* @return The amount of will drained.
|
||||
*/
|
||||
double drainWill(ItemStack willStack, double drainAmount);
|
||||
|
||||
/**
|
||||
* Gets the discrete number for this demonic will.
|
||||
*
|
||||
*
|
||||
* @param willStack
|
||||
* - The ItemStack of the will
|
||||
*
|
||||
* - The ItemStack of the will
|
||||
*
|
||||
* @return - The discrete number for the given stack.
|
||||
*/
|
||||
double getDiscretization(ItemStack willStack);
|
||||
|
||||
/**
|
||||
* Obtains the type of will this is.
|
||||
*
|
||||
*
|
||||
* @param willStack
|
||||
* - The ItemStack of the will
|
||||
*
|
||||
* - The ItemStack of the will
|
||||
*
|
||||
* @return - The type of will this is.
|
||||
*/
|
||||
EnumDemonWillType getType(ItemStack willStack);
|
||||
|
|
|
@ -13,12 +13,12 @@ public class PlayerDemonWillHandler
|
|||
{
|
||||
/**
|
||||
* Gets the total amount of Will a player contains in their inventory
|
||||
*
|
||||
*
|
||||
* @param type
|
||||
* - The type of Will to check for
|
||||
* - The type of Will to check for
|
||||
* @param player
|
||||
* - The player to check the will of
|
||||
*
|
||||
* - The player to check the will of
|
||||
*
|
||||
* @return - The amount of will the player contains
|
||||
*/
|
||||
public static double getTotalDemonWill(EnumDemonWillType type, EntityPlayer player)
|
||||
|
@ -26,11 +26,15 @@ public class PlayerDemonWillHandler
|
|||
ItemStack[] inventory = player.inventory.mainInventory;
|
||||
double souls = 0;
|
||||
|
||||
for (ItemStack stack : inventory) {
|
||||
if (stack != null) {
|
||||
if (stack.getItem() instanceof IDemonWill) {
|
||||
for (ItemStack stack : inventory)
|
||||
{
|
||||
if (stack != null)
|
||||
{
|
||||
if (stack.getItem() instanceof IDemonWill)
|
||||
{
|
||||
souls += ((IDemonWill) stack.getItem()).getWill(stack);
|
||||
} else if (stack.getItem() instanceof IDemonWillGem) {
|
||||
} else if (stack.getItem() instanceof IDemonWillGem)
|
||||
{
|
||||
souls += ((IDemonWillGem) stack.getItem()).getWill(type, stack);
|
||||
}
|
||||
}
|
||||
|
@ -41,12 +45,12 @@ public class PlayerDemonWillHandler
|
|||
|
||||
/**
|
||||
* Checks if the player's Tartaric gems are completely full.
|
||||
*
|
||||
*
|
||||
* @param type
|
||||
* - The type of Will to check for
|
||||
* - The type of Will to check for
|
||||
* @param player
|
||||
* - The player to check the Will of
|
||||
*
|
||||
* - The player to check the Will of
|
||||
*
|
||||
* @return - True if all Will containers are full, false if not.
|
||||
*/
|
||||
public static boolean isDemonWillFull(EnumDemonWillType type, EntityPlayer player)
|
||||
|
@ -54,8 +58,10 @@ public class PlayerDemonWillHandler
|
|||
ItemStack[] inventory = player.inventory.mainInventory;
|
||||
|
||||
boolean hasGem = false;
|
||||
for (ItemStack stack : inventory) {
|
||||
if (stack != null && stack.getItem() instanceof IDemonWillGem) {
|
||||
for (ItemStack stack : inventory)
|
||||
{
|
||||
if (stack != null && stack.getItem() instanceof IDemonWillGem)
|
||||
{
|
||||
hasGem = true;
|
||||
if (((IDemonWillGem) stack.getItem()).getWill(type, stack) < ((IDemonWillGem) stack.getItem()).getMaxWill(type, stack))
|
||||
return false;
|
||||
|
@ -67,12 +73,12 @@ public class PlayerDemonWillHandler
|
|||
|
||||
/**
|
||||
* Consumes Will from the inventory of a given player
|
||||
*
|
||||
*
|
||||
* @param player
|
||||
* - The player to consume the will of
|
||||
* - The player to consume the will of
|
||||
* @param amount
|
||||
* - The amount of will to consume
|
||||
*
|
||||
* - The amount of will to consume
|
||||
*
|
||||
* @return - The amount of will consumed.
|
||||
*/
|
||||
public static double consumeDemonWill(EnumDemonWillType type, EntityPlayer player, double amount)
|
||||
|
@ -109,10 +115,10 @@ public class PlayerDemonWillHandler
|
|||
* the player's inventory.
|
||||
*
|
||||
* @param player
|
||||
* - The player to add will to
|
||||
* - The player to add will to
|
||||
* @param willStack
|
||||
* - ItemStack that contains an IDemonWill to be added
|
||||
*
|
||||
* - ItemStack that contains an IDemonWill to be added
|
||||
*
|
||||
* @return - The modified willStack
|
||||
*/
|
||||
public static ItemStack addDemonWill(EntityPlayer player, ItemStack willStack)
|
||||
|
@ -136,16 +142,16 @@ public class PlayerDemonWillHandler
|
|||
}
|
||||
|
||||
/**
|
||||
* Adds an IDiscreteDemonWill contained in an ItemStack to one of the Soul Gems in
|
||||
* the player's inventory.
|
||||
*
|
||||
* Adds an IDiscreteDemonWill contained in an ItemStack to one of the Soul
|
||||
* Gems in the player's inventory.
|
||||
*
|
||||
* @param type
|
||||
* - The type of Will to add
|
||||
* - The type of Will to add
|
||||
* @param player
|
||||
* - The player to check the Will of
|
||||
* - The player to check the Will of
|
||||
* @param amount
|
||||
* - The amount of will to add
|
||||
*
|
||||
* - The amount of will to add
|
||||
*
|
||||
* @return - The amount of will added
|
||||
*/
|
||||
public static double addDemonWill(EnumDemonWillType type, EntityPlayer player, double amount)
|
||||
|
@ -167,18 +173,18 @@ public class PlayerDemonWillHandler
|
|||
}
|
||||
|
||||
/**
|
||||
* Adds an IDiscreteDemonWill contained in an ItemStack to one of the Soul Gems in
|
||||
* the player's inventory while ignoring a specified stack.
|
||||
*
|
||||
* Adds an IDiscreteDemonWill contained in an ItemStack to one of the Soul
|
||||
* Gems in the player's inventory while ignoring a specified stack.
|
||||
*
|
||||
* @param type
|
||||
* - The type of Will to add
|
||||
* - The type of Will to add
|
||||
* @param player
|
||||
* - The player to check the Will of
|
||||
* - The player to check the Will of
|
||||
* @param amount
|
||||
* - The amount of will to add
|
||||
* - The amount of will to add
|
||||
* @param ignored
|
||||
* - A stack to ignore
|
||||
*
|
||||
* - A stack to ignore
|
||||
*
|
||||
* @return - The amount of will added
|
||||
*/
|
||||
public static double addDemonWill(EnumDemonWillType type, EntityPlayer player, double amount, ItemStack ignored)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue