From 9a4d1e95ea7784f0f98ea2913701a3a3c28aefaa Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Thu, 24 May 2018 16:03:42 -0400 Subject: Formatting pass --- .../java/darkknight/jewelrycraft/api/Curse.java | 139 ++++++++++--------- .../darkknight/jewelrycraft/api/IJewelryItem.java | 67 ++++----- .../jewelrycraft/api/ModifierEffects.java | 151 +++++++++++---------- 3 files changed, 188 insertions(+), 169 deletions(-) (limited to 'src/main/java/darkknight/jewelrycraft/api') diff --git a/src/main/java/darkknight/jewelrycraft/api/Curse.java b/src/main/java/darkknight/jewelrycraft/api/Curse.java index 1cd0288..c3af0f0 100755 --- a/src/main/java/darkknight/jewelrycraft/api/Curse.java +++ b/src/main/java/darkknight/jewelrycraft/api/Curse.java @@ -19,19 +19,19 @@ import net.minecraftforge.event.entity.player.PlayerSleepInBedEvent; import net.minecraftforge.event.world.BlockEvent; public abstract class Curse { - protected int textureID, ticksActive; - protected String name, description, texturePackName; - protected Random rand = new Random(); - private static ArrayList curses = new ArrayList<>(); + protected int textureID, ticksActive; + protected String name, description, texturePackName; + protected Random rand = new Random(); + private static ArrayList curses = new ArrayList<>(); public static ArrayList availableCurses = new ArrayList<>(); /** * @param name - * The name of the curse + * The name of the curse * @param txtID - * The texture ID of it + * The texture ID of it * @param texturepack - * The texturepack location + * The texturepack location */ protected Curse(String name, int txtID, String texturepack) { this.name = name; @@ -60,7 +60,7 @@ public abstract class Curse { /** * @param desc - * description of the curse + * description of the curse * @return The class */ public Curse setDescription(String desc) { @@ -86,9 +86,9 @@ public abstract class Curse { * This runs every tick * * @param world - * The worldthe player is in + * The worldthe player is in * @param player - * The cursed player + * The cursed player */ public void action(World world, EntityPlayer player) { ticksActive++; @@ -106,11 +106,11 @@ public abstract class Curse { * This runs when the player dies * * @param world - * The world the player is in + * The world the player is in * @param player - * The cursed player + * The cursed player * @param event - * The thing that killed the player + * The thing that killed the player */ public void playerDeathAction(World world, EntityPlayer player, LivingDeathEvent event) { @@ -121,11 +121,11 @@ public abstract class Curse { * This runs when the player is healed * * @param world - * The world the player is in + * The world the player is in * @param player - * The cursed player + * The cursed player * @param event - * The event that the player is healing from + * The event that the player is healing from */ public void playerHealAction(World world, EntityPlayer player, LivingHealEvent event) { @@ -137,11 +137,11 @@ public abstract class Curse { * causes) * * @param world - * The world the player is in + * The world the player is in * @param target - * The entity that died + * The entity that died * @param player - * The cursed player + * The cursed player */ public void entityDeathAction(World world, EntityLivingBase target, EntityPlayer player) { @@ -152,25 +152,26 @@ public abstract class Curse { * This runs when the player respawns * * @param world - * The world the player is in + * The world the player is in * @param player - * The cursed player + * The cursed player */ public void respawnAction(World world, EntityPlayer player) { // Do nothing } /** - * This runs when a player gets attacked by anything but another player + * This runs when a player gets attacked by anything but another + * player * * @param world - * The world the player is in + * The world the player is in * @param player - * The cursed player + * The cursed player * @param event - * The event that attacked the player + * The event that attacked the player * @param attacker - * The entity that attacked the player + * The entity that attacked the player */ public void attackedAction(World world, EntityPlayer player, LivingAttackEvent event, Entity attacker) { @@ -184,11 +185,11 @@ public abstract class Curse { * @param event * * @param world - * The world the player is in + * The world the player is in * @param player - * The player that caused the damage + * The player that caused the damage * @param target - * The entity damaged + * The entity damaged */ public void attackedByPlayerAction(LivingAttackEvent event, World world, EntityPlayer player, Entity target) { @@ -202,16 +203,16 @@ public abstract class Curse { * @param event * * @param world - * The world the player is in + * The world the player is in * @param player - * The player that caused the damage + * The player that caused the damage * @param target - * The entity damaged + * The entity damaged * @return Whether or not to cancel the event */ public boolean attackedByPlayerActionCancelable( - LivingAttackEvent event, World world, EntityPlayer player, - Entity target) { + LivingAttackEvent event, World world, + EntityPlayer player, Entity target) { return false; } @@ -219,11 +220,11 @@ public abstract class Curse { * This runs when an item is dropped by an entity * * @param player - * The cursed player + * The cursed player * @param target - * The entity that drops the item + * The entity that drops the item * @param drops - * An array list containing the dropped items + * An array list containing the dropped items */ public void entityDropItems(EntityPlayer player, Entity target, ArrayList drops) { @@ -232,13 +233,13 @@ public abstract class Curse { /** * This is for rendering special things on the player in 3rd person - * (meaning you won't see this render); This will also render in the - * inventory. + * (meaning you won't see this render); This will also render in + * the inventory. * * @param player - * The cursed player + * The cursed player * @param event - * The event used for this + * The event used for this */ @SideOnly(Side.CLIENT) public void playerRender(EntityPlayer player, @@ -247,13 +248,13 @@ public abstract class Curse { } /** - * This is for rendering special things on the player in 1st and 3rd - * person, but not in the player inventory. + * This is for rendering special things on the player in 1st and + * 3rd person, but not in the player inventory. * * @param player - * The cursed player + * The cursed player * @param event - * The event used for this + * The event used for this */ @SideOnly(Side.CLIENT) public void playerHandRender(EntityPlayer player, @@ -262,14 +263,14 @@ public abstract class Curse { } /** - * This runs when a block drops an item (such as breaking a block and - * dropping itself, or breaking like a Diamond ore and dropping + * This runs when a block drops an item (such as breaking a block + * and dropping itself, or breaking like a Diamond ore and dropping * diamonds) * * @param player - * The cursed player + * The cursed player * @param event - * The BlockEvent that triggers this + * The BlockEvent that triggers this */ public void onBlockItemsDrop(EntityPlayer player, BlockEvent.HarvestDropsEvent event) { @@ -280,9 +281,9 @@ public abstract class Curse { * This runs when a block is destroyed * * @param player - * The cursed player + * The cursed player * @param event - * The BlockEvent that runs this + * The BlockEvent that runs this */ public void onBlockDestroyed(EntityPlayer player, BlockEvent.BreakEvent event) { @@ -300,11 +301,11 @@ public abstract class Curse { } /** - * This controls whether a curse can be activated or not (makes it easy - * to do things like disable certain curses if in hardcore) + * This controls whether a curse can be activated or not (makes it + * easy to do things like disable certain curses if in hardcore) * * @param world - * The world the player is in + * The world the player is in * @return True for curses to be used; False otherwise (by default * true) */ @@ -313,8 +314,8 @@ public abstract class Curse { } /** - * This controls whether a curse can be activated or not (makes it easy - * to do things like disable certain curses if in hardcore) + * This controls whether a curse can be activated or not (makes it + * easy to do things like disable certain curses if in hardcore) * * @return True for curses to be used; False otherwise (by default * true) @@ -333,19 +334,20 @@ public abstract class Curse { } /** - * This is the weight of the curse when it chooses it. The lower the - * value, the less it gets chosen; the higher the value, the higher the - * chance of it getting picked. + * This is the weight of the curse when it chooses it. The lower + * the value, the less it gets chosen; the higher the value, the + * higher the chance of it getting picked. * * @param world - * The world the player is currently in + * The world the player is currently in * @param player - * The cursed player + * The cursed player * @param random - * A random class + * A random class * @return The weight of the curse (by default 10) */ - public int weight(World world, EntityPlayer player, Random random) { + public int weight(World world, EntityPlayer player, + Random random) { return 10; } @@ -360,12 +362,15 @@ public abstract class Curse { /** * This event is called whenever the player attempts to sleep. * - * @param worldObj the world - * @param player the cursed player - * @param event the sleeping event + * @param worldObj + * the world + * @param player + * the cursed player + * @param event + * the sleeping event */ public void playerSleepAction(World worldObj, EntityPlayer player, PlayerSleepInBedEvent event) { - + } } diff --git a/src/main/java/darkknight/jewelrycraft/api/IJewelryItem.java b/src/main/java/darkknight/jewelrycraft/api/IJewelryItem.java index c4a2c7a..ad15c7a 100755 --- a/src/main/java/darkknight/jewelrycraft/api/IJewelryItem.java +++ b/src/main/java/darkknight/jewelrycraft/api/IJewelryItem.java @@ -24,57 +24,59 @@ public interface IJewelryItem { * This is the action performed each player tick * * @param item - * The item stack of the item (allows for fine item search, - * like metadata and nbt) + * The item stack of the item (allows for fine item + * search, like metadata and nbt) * @param player - * The player wearing the jewelry + * The player wearing the jewelry */ public void onWearAction(ItemStack item, EntityPlayer player); /** - * This performs an action whenever a player gets attacked by an entity - * besides another Player + * This performs an action whenever a player gets attacked by an + * entity besides another Player * * @param item - * The item stack of the item (allows for fine item search, - * like metadata and nbt) + * The item stack of the item (allows for fine item + * search, like metadata and nbt) * @param player - * The player that was attacked + * The player that was attacked * @param source - * Source of the damage + * Source of the damage * @param amount - * The amount of damage taken + * The amount of damage taken */ - public void onPlayerAttackedAction(ItemStack item, EntityPlayer player, - DamageSource source, float amount); + public void onPlayerAttackedAction(ItemStack item, + EntityPlayer player, DamageSource source, + float amount); /** - * This does an action whenever an Entity gets attacked by a player, - * this includes other Players + * This does an action whenever an Entity gets attacked by a + * player, this includes other Players * * @param item - * The item stack of the item (allows for fine item search, - * like metadata and nbt) + * The item stack of the item (allows for fine item + * search, like metadata and nbt) * @param player - * The attacking player + * The attacking player * @param entity - * The target entity + * The target entity * @param amount - * The amount of damage dealt + * The amount of damage dealt */ public void onEntityAttackedByPlayer(ItemStack item, - EntityPlayer player, EntityLivingBase entity, float amount); + EntityPlayer player, EntityLivingBase entity, + float amount); /** * This runs whenever a player dies * * @param item - * The item stack of the item (allows for fine item search, - * like metadata and nbt) + * The item stack of the item (allows for fine item + * search, like metadata and nbt) * @param player - * The player that died + * The player that died * @param source - * The damage source that caused the death + * The damage source that caused the death */ public void onPlayerDeadAction(ItemStack item, EntityPlayer player, DamageSource source); @@ -84,11 +86,12 @@ public interface IJewelryItem { * respawns) * * @param item - * The item stack of the item (allows for fine item search, - * like metadata and nbt) + * The item stack of the item (allows for fine item + * search, like metadata and nbt) * @param event - * The clone event that runs whenever a player respawns, - * either because he died or switched dimensions + * The clone event that runs whenever a player + * respawns, either because he died or switched + * dimensions */ public void onPlayerRespawnAction(ItemStack item, PlayerEvent.Clone event); @@ -97,8 +100,8 @@ public interface IJewelryItem { * This runs when the item is equipped * * @param item - * The item stack of the item (allows for fine item search, - * like metadata and nbt) + * The item stack of the item (allows for fine item + * search, like metadata and nbt) */ public void onJewelryEquipped(ItemStack item); @@ -106,8 +109,8 @@ public interface IJewelryItem { * This runs when the item is unequipped * * @param item - * The item stack of the item (allows for fine item search, - * like metadata and nbt) + * The item stack of the item (allows for fine item + * search, like metadata and nbt) */ public void onJewelryUnequipped(ItemStack item); } diff --git a/src/main/java/darkknight/jewelrycraft/api/ModifierEffects.java b/src/main/java/darkknight/jewelrycraft/api/ModifierEffects.java index 05fee9d..389bafc 100755 --- a/src/main/java/darkknight/jewelrycraft/api/ModifierEffects.java +++ b/src/main/java/darkknight/jewelrycraft/api/ModifierEffects.java @@ -11,14 +11,13 @@ import net.minecraft.util.DamageSource; import net.minecraftforge.event.entity.player.PlayerEvent; public class ModifierEffects { - protected ItemStack modifier; - protected Random rand = new Random(); - protected static ArrayList effects = - new ArrayList<>(); + protected ItemStack modifier; + protected Random rand = new Random(); + protected static ArrayList effects = new ArrayList<>(); /** * @param modifier - * The item to use as modifier + * The item to use as modifier */ public ModifierEffects(ItemStack modifier) { this.modifier = modifier; @@ -43,35 +42,38 @@ public class ModifierEffects { * This runs every tick * * @param item - * The ItemStack representing the jewelry that runs the - * effect + * The ItemStack representing the jewelry that runs + * the effect * @param player - * The player wearing the jewelry wearing a jewelry with - * this modifier on it + * The player wearing the jewelry wearing a jewelry + * with this modifier on it * @param jewelry - * The actual jewelry item (used by me to determine the type - * of jewelry so I don't have to call item.getItem() blah - * blah blah) + * The actual jewelry item (used by me to determine + * the type of jewelry so I don't have to call + * item.getItem() blah blah blah) */ - public void action(ItemStack item, EntityPlayer player, Item jewelry) { + public void action(ItemStack item, EntityPlayer player, + Item jewelry) { // Do nothing }; /** - * This runs when an entity is attacked. This event can be canceled. + * This runs when an entity is attacked. This event can be + * canceled. * * @param item - * The ItemStack representing the jewelry that runs the - * effect + * The ItemStack representing the jewelry that runs + * the effect * @param player - * The player wearing the jewelry wearing a jewelry with - * this modifier on it + * The player wearing the jewelry wearing a jewelry + * with this modifier on it * @param target - * The attacked entity + * The attacked entity * @param jewelry - * The actual jewelry item (aka item.getItem(), almost) + * The actual jewelry item (aka item.getItem(), + * almost) * @param amount - * The amount of damage the entity took + * The amount of damage the entity took * @return The state of the event (true to cancel it, false to not) */ public boolean onEntityAttackedCancellable(ItemStack item, @@ -81,45 +83,48 @@ public class ModifierEffects { } /** - * This runs when a player gets damaged. This event can be canceled. + * This runs when a player gets damaged. This event can be + * canceled. * * @param item - * The ItemStack representing the jewelry that runs the - * effect + * The ItemStack representing the jewelry that runs + * the effect * @param player - * The attacked player wearing a jewelry with this modifier - * on it + * The attacked player wearing a jewelry with this + * modifier on it * @param source - * The source of the damage + * The source of the damage * @param jewelry - * The actual jewelry item (aka item.getItem(), almost) + * The actual jewelry item (aka item.getItem(), + * almost) * @param amount - * The amount of damage the player took + * The amount of damage the player took * @return The state of the event (true to cancel it, false to not) */ public boolean onPlayerAttackedCancellable(ItemStack item, - EntityPlayer player, DamageSource source, Item jewelry, - float amount) { + EntityPlayer player, DamageSource source, + Item jewelry, float amount) { return false; } /** - * This is the same as onEntityAttackedCacellable, but this can not be - * canceled. I recommend using this over onEntityAttackedCacellable, as - * it is more reliable. + * This is the same as onEntityAttackedCacellable, but this can not + * be canceled. I recommend using this over + * onEntityAttackedCacellable, as it is more reliable. * * @param item - * The ItemStack representing the jewelry that runs the - * effect + * The ItemStack representing the jewelry that runs + * the effect * @param player - * The player wearing the jewelry wearing a jewelry with - * this modifier on it + * The player wearing the jewelry wearing a jewelry + * with this modifier on it * @param target - * The attacked entity + * The attacked entity * @param jewelry - * The actual jewelry item (aka item.getItem(), almost) + * The actual jewelry item (aka item.getItem(), + * almost) * @param amount - * The amount of damage the entity took + * The amount of damage the entity took */ public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) { @@ -127,22 +132,23 @@ public class ModifierEffects { } /** - * This is just like onPlayerAttackedCacellable, only that this can not - * be canceled. I recommend using this over onPlayerAttackedCacellable, - * as it is more reliable. + * This is just like onPlayerAttackedCacellable, only that this can + * not be canceled. I recommend using this over + * onPlayerAttackedCacellable, as it is more reliable. * * @param item - * The ItemStack representing the jewelry that runs the - * effect + * The ItemStack representing the jewelry that runs + * the effect * @param player - * The attacked player wearing a jewelry with this modifier - * on it + * The attacked player wearing a jewelry with this + * modifier on it * @param source - * The source of the damage + * The source of the damage * @param jewelry - * The actual jewelry item (aka item.getItem(), almost) + * The actual jewelry item (aka item.getItem(), + * almost) * @param amount - * The amount of damage the player took + * The amount of damage the player took */ public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) { @@ -153,15 +159,16 @@ public class ModifierEffects { * This runs when the player dies * * @param item - * The ItemStack representing the jewelry that runs the - * effect + * The ItemStack representing the jewelry that runs + * the effect * @param player - * The player that died wearing a jewelry with this modifier - * on it + * The player that died wearing a jewelry with this + * modifier on it * @param source - * The source of the killing blow + * The source of the killing blow * @param jewelry - * The actual jewelry item (aka item.getItem(), almost) + * The actual jewelry item (aka item.getItem(), + * almost) */ public void onPlayerDead(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry) { @@ -172,16 +179,18 @@ public class ModifierEffects { * This runs when the player respawns * * @param item - * The ItemStack representing the jewelry that runs the - * effect + * The ItemStack representing the jewelry that runs + * the effect * @param event - * The PlayerEvent that runs when the player respawns (this - * is also called when a player moves between dimensions) + * The PlayerEvent that runs when the player + * respawns (this is also called when a player moves + * between dimensions) * @param jewelry - * The actual jewelry item (aka item.getItem(), almost) + * The actual jewelry item (aka item.getItem(), + * almost) */ - public void onPlayerRespawn(ItemStack item, PlayerEvent.Clone event, - Item jewelry) { + public void onPlayerRespawn(ItemStack item, + PlayerEvent.Clone event, Item jewelry) { // Do nothing } @@ -189,10 +198,11 @@ public class ModifierEffects { * This runs when the item containing this modifier is equipped * * @param item - * The ItemStack representing the jewelry that runs the - * effect + * The ItemStack representing the jewelry that runs + * the effect * @param jewelry - * The actual jewelry item (aka item.getItem(), almost) + * The actual jewelry item (aka item.getItem(), + * almost) */ public void onJewelryEquipped(ItemStack item, Item jewelry) { // Do nothing @@ -202,10 +212,11 @@ public class ModifierEffects { * This runs when the item containing this modifier is unquipped * * @param item - * The ItemStack representing the jewelry that runs the - * effect + * The ItemStack representing the jewelry that runs + * the effect * @param jewelry - * The actual jewelry item (aka item.getItem(), almost) + * The actual jewelry item (aka item.getItem(), + * almost) */ public void onJewelryUnequipped(ItemStack item, Item jewelry) { // Do nothing -- cgit v1.2.3