From 7ebd59382f6d4175e2c0cc7215c47306311f677d Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 1 Jan 2016 10:52:42 -0800 Subject: [PATCH] Javadoc warning cleanup --- .../bloodmagic/api/altar/AltarComponent.java | 3 ++ .../bloodmagic/api/iface/IBindable.java | 9 +++-- .../bloodmagic/api/network/SoulNetwork.java | 10 ++++++ .../bloodmagic/api/ritual/AreaDescriptor.java | 4 +++ .../api/util/helper/BindableHelper.java | 5 +++ .../api/util/helper/NetworkHelper.java | 16 +++++++++ .../api/util/helper/RitualHelper.java | 12 ++++--- .../bloodmagic/compat/ICompatibility.java | 4 ++- .../bloodmagic/item/ItemBindable.java | 21 ++++++++---- .../bloodmagic/item/ItemRitualDiviner.java | 9 +++-- .../java/WayofTime/bloodmagic/util/Utils.java | 33 +++++++++++++++---- 11 files changed, 103 insertions(+), 23 deletions(-) diff --git a/src/main/java/WayofTime/bloodmagic/api/altar/AltarComponent.java b/src/main/java/WayofTime/bloodmagic/api/altar/AltarComponent.java index fdbcc8d3..d3d56c4a 100644 --- a/src/main/java/WayofTime/bloodmagic/api/altar/AltarComponent.java +++ b/src/main/java/WayofTime/bloodmagic/api/altar/AltarComponent.java @@ -31,6 +31,9 @@ public class AltarComponent /** * Use for setting a location at which there must be a block, but the type * of block does not matter. + * + * @param offset + * - Where the block should be in relation to the Altar */ public AltarComponent(BlockPos offset) { diff --git a/src/main/java/WayofTime/bloodmagic/api/iface/IBindable.java b/src/main/java/WayofTime/bloodmagic/api/iface/IBindable.java index 6cb71016..6a9debb0 100644 --- a/src/main/java/WayofTime/bloodmagic/api/iface/IBindable.java +++ b/src/main/java/WayofTime/bloodmagic/api/iface/IBindable.java @@ -10,8 +10,13 @@ public interface IBindable { /** * Called when the player attempts to bind the item. - * - * If false, binding fails. + * + * @param player + * - The Player attempting to bind the item + * @param stack + * - The ItemStack to attempt binding + * + * @return If binding was successful. */ boolean onBind(EntityPlayer player, ItemStack stack); } diff --git a/src/main/java/WayofTime/bloodmagic/api/network/SoulNetwork.java b/src/main/java/WayofTime/bloodmagic/api/network/SoulNetwork.java index 053656b0..022cb3e8 100644 --- a/src/main/java/WayofTime/bloodmagic/api/network/SoulNetwork.java +++ b/src/main/java/WayofTime/bloodmagic/api/network/SoulNetwork.java @@ -89,6 +89,11 @@ public class SoulNetwork extends WorldSavedData /** * Used to syphon LP from the network + * + * @param syphon + * - The amount of LP to syphon + * + * @return The amount of LP syphoned */ public int syphon(int syphon) { @@ -107,6 +112,11 @@ public class SoulNetwork extends WorldSavedData * instead take away from the user's health. * * Always returns false on the client side. + * + * @param user + * - The Player to syphon from + * @param toSyphon + * - The amount of LP to syphon * * @return - Whether the action should be performed. */ diff --git a/src/main/java/WayofTime/bloodmagic/api/ritual/AreaDescriptor.java b/src/main/java/WayofTime/bloodmagic/api/ritual/AreaDescriptor.java index f0da7bd1..a15a7097 100644 --- a/src/main/java/WayofTime/bloodmagic/api/ritual/AreaDescriptor.java +++ b/src/main/java/WayofTime/bloodmagic/api/ritual/AreaDescriptor.java @@ -39,7 +39,9 @@ public abstract class AreaDescriptor * (1,1,1), calling getContainedPositions() will only give (0,0,0). * * @param minimumOffset + * - * @param maximumOffset + * - */ public Rectangle(BlockPos minimumOffset, BlockPos maximumOffset) { @@ -93,7 +95,9 @@ public abstract class AreaDescriptor * minimumOffset the lowest corner * * @param offset1 + * - * @param offset2 + * - */ public void setOffsets(BlockPos offset1, BlockPos offset2) { 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 ba86e240..29e23e79 100644 --- a/src/main/java/WayofTime/bloodmagic/api/util/helper/BindableHelper.java +++ b/src/main/java/WayofTime/bloodmagic/api/util/helper/BindableHelper.java @@ -64,6 +64,11 @@ public class BindableHelper /** * @see BindableHelper#checkAndSetItemOwner(ItemStack, String) + * + * @param stack + * - ItemStack to check + * @param uuid + * - UUID of the Player */ public static boolean checkAndSetItemOwner(ItemStack stack, UUID uuid) { diff --git a/src/main/java/WayofTime/bloodmagic/api/util/helper/NetworkHelper.java b/src/main/java/WayofTime/bloodmagic/api/util/helper/NetworkHelper.java index 33216fca..e61e840e 100644 --- a/src/main/java/WayofTime/bloodmagic/api/util/helper/NetworkHelper.java +++ b/src/main/java/WayofTime/bloodmagic/api/util/helper/NetworkHelper.java @@ -46,6 +46,9 @@ public class NetworkHelper /** * @see NetworkHelper#getSoulNetwork(String) + * + * @param uuid + * - The Player's Mojang UUID */ public static SoulNetwork getSoulNetwork(UUID uuid) { @@ -54,6 +57,9 @@ public class NetworkHelper /** * @see NetworkHelper#getSoulNetwork(String) + * + * @param player + * - The Player */ public static SoulNetwork getSoulNetwork(EntityPlayer player) { @@ -127,6 +133,16 @@ public class NetworkHelper return !(MinecraftForge.EVENT_BUS.post(event) || event.getResult() == Event.Result.DENY) && network.syphon(event.syphon) >= toSyphon; } + /** + * Checks if the ItemStack has a user to be syphoned from. + * + * @param stack + * - ItemStack to check + * @param toSyphon + * - Amount of LP to syphon + * + * @return - If syphoning is possible + */ public static boolean canSyphonFromContainer(ItemStack stack, int toSyphon) { stack = NBTHelper.checkNBT(stack); diff --git a/src/main/java/WayofTime/bloodmagic/api/util/helper/RitualHelper.java b/src/main/java/WayofTime/bloodmagic/api/util/helper/RitualHelper.java index 1683ecec..261cf87b 100644 --- a/src/main/java/WayofTime/bloodmagic/api/util/helper/RitualHelper.java +++ b/src/main/java/WayofTime/bloodmagic/api/util/helper/RitualHelper.java @@ -45,7 +45,12 @@ public class RitualHelper /** * Checks the RitualRegistry to see if the configuration of the ritual * stones in the world is valid for the given EnumFacing. - * + * + * @param world + * - The world + * @param pos + * - Location of the MasterRitualStone + * * @return The ID of the valid ritual */ public static String getValidRitual(World world, BlockPos pos) @@ -126,10 +131,7 @@ public class RitualHelper * Adds your Ritual to the {@link RitualRegistry#enabledRituals} Map. This * is used to determine whether your effect is enabled or not. * - * The config option will be created as {@code B:ClassName=true} with a - * comment of {@code Enables the ClassName ritual}. - * - * Use {@link #} + * The config option will be created as {@code B:ClassName=true}. * * Should be safe to modify at any point. * diff --git a/src/main/java/WayofTime/bloodmagic/compat/ICompatibility.java b/src/main/java/WayofTime/bloodmagic/compat/ICompatibility.java index 3461b981..9670728a 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/ICompatibility.java +++ b/src/main/java/WayofTime/bloodmagic/compat/ICompatibility.java @@ -11,7 +11,7 @@ public interface ICompatibility void loadCompatibility(); /** - * The {@code modid} of the mod we are adding compatibility for. + * @return The {@code modid} of the mod we are adding compatibility for. */ String getModId(); @@ -20,6 +20,8 @@ public interface ICompatibility * found. * * Generally a determined by a config option. + * + * @return If Compatibility should load. */ boolean enableCompat(); } diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemBindable.java b/src/main/java/WayofTime/bloodmagic/item/ItemBindable.java index 9d3ba446..0de83eca 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemBindable.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemBindable.java @@ -43,9 +43,13 @@ public class ItemBindable extends Item implements IBindable * it will instead take the LP from the holder of the item. * * @param stack + * - The ItemStack to syphon from * @param player + * - The Player using the item * @param lpUsed - * @return + * - The amount of LP to syphon + * + * @return Whether syphoning was successful or not */ public static boolean syphonNetwork(ItemStack stack, EntityPlayer player, int lpUsed) { @@ -79,16 +83,19 @@ public class ItemBindable extends Item implements IBindable * without an online player. This will not take health from the owner if it * fails to find sufficient LP. * - * @param itemStack + * @param stack + * - The ItemStack to syphon from. * @param lpUsed - * @return + * - The amount of LP to syphon + * + * @return - If syphoning was successful or not */ - public static boolean syphonNetwork(ItemStack itemStack, int lpUsed) + public static boolean syphonNetwork(ItemStack stack, int lpUsed) { - if (itemStack.getItem() instanceof ItemBindable) + if (stack.getItem() instanceof ItemBindable) { - ItemBindable itemBindable = (ItemBindable) itemStack.getItem(); - return !Strings.isNullOrEmpty(itemBindable.getBindableOwner(itemStack)) && NetworkHelper.syphonFromContainer(itemStack, lpUsed); + ItemBindable itemBindable = (ItemBindable) stack.getItem(); + return !Strings.isNullOrEmpty(itemBindable.getBindableOwner(stack)) && NetworkHelper.syphonFromContainer(stack, lpUsed); } return false; diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemRitualDiviner.java b/src/main/java/WayofTime/bloodmagic/item/ItemRitualDiviner.java index 957b3f40..f8c0eb00 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemRitualDiviner.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemRitualDiviner.java @@ -78,11 +78,16 @@ public class ItemRitualDiviner extends Item /** * Adds a single rune to the ritual. - * + * + * @param stack + * - The Ritual Diviner stack * @param world - * - + * - The World * @param pos * - Block Position of the MRS. + * @param player + * - The Player attempting to place the ritual + * * @return - True if a rune was successfully added */ public boolean addRuneToRitual(ItemStack stack, World world, BlockPos pos, EntityPlayer player) diff --git a/src/main/java/WayofTime/bloodmagic/util/Utils.java b/src/main/java/WayofTime/bloodmagic/util/Utils.java index fae0d25e..0ad6f9f5 100644 --- a/src/main/java/WayofTime/bloodmagic/util/Utils.java +++ b/src/main/java/WayofTime/bloodmagic/util/Utils.java @@ -28,22 +28,35 @@ public class Utils } /** - * Used for inserting an ItemStack with a stacksize of 1 to a tile's - * inventory at slot 0. Returns {@code true} if the ItemStack is inserted, - * {@code false} otherwise - * - * EG: Block Altar - * + * @see #insertItemToTile(TileInventory, EntityPlayer, int) + * * @param tile * - The {@link TileInventory} to input the item to * @param player * - The player to take the item from. + * + * @return {@code true} if the ItemStack is inserted, {@code false} otherwise */ public static boolean insertItemToTile(TileInventory tile, EntityPlayer player) { return insertItemToTile(tile, player, 0); } + /** + * Used for inserting an ItemStack with a stacksize of 1 to a tile's + * inventory at slot 0 + * + * EG: Block Altar + * + * @param tile + * - The {@link TileInventory} to input the item to + * @param player + * - The player to take the item from. + * @param slot + * - The slot to attempt to insert to + * + * @return {@code true} if the ItemStack is inserted, {@code false} otherwise + */ public static boolean insertItemToTile(TileInventory tile, EntityPlayer player, int slot) { if (tile.getStackInSlot(slot) == null && player.getHeldItem() != null) @@ -67,6 +80,14 @@ public class Utils return false; } + /** + * Gets a default block for each type of {@link EnumAltarComponent} + * + * @param component + * - The Component to provide a block for. + * + * @return The default Block for the EnumAltarComponent + */ public static Block getBlockForComponent(EnumAltarComponent component) { switch (component)