diff --git a/plugin/src/lightling/gibsoniacraft/GibsoniaCraft.java b/plugin/src/lightling/gibsoniacraft/GibsoniaCraft.java index fc0d30c..c89afbb 100644 --- a/plugin/src/lightling/gibsoniacraft/GibsoniaCraft.java +++ b/plugin/src/lightling/gibsoniacraft/GibsoniaCraft.java @@ -1,13 +1,16 @@ package lightling.gibsoniacraft; +// Server related import org.bukkit.plugin.java.JavaPlugin; +// GibsoniaCraft related import lightling.gibsoniacraft.crafting.Excavator; import lightling.gibsoniacraft.crafting.Hammer; import lightling.gibsoniacraft.crafting.LumberAxe; import lightling.gibsoniacraft.util.BlockListener; import lightling.gibsoniacraft.util.PlayerInteractListener; +@SuppressWarnings("unused") public final class GibsoniaCraft extends JavaPlugin { private Excavator excavatorClass; diff --git a/plugin/src/lightling/gibsoniacraft/crafting/Excavator.java b/plugin/src/lightling/gibsoniacraft/crafting/Excavator.java index ab90815..a8b34cb 100644 --- a/plugin/src/lightling/gibsoniacraft/crafting/Excavator.java +++ b/plugin/src/lightling/gibsoniacraft/crafting/Excavator.java @@ -21,6 +21,7 @@ import org.bukkit.Server; // For registering recipes on the server * An excavator is a shovel-based item that digs in a 3x3 radius as opposed to a singular block * @author Lightling */ +@SuppressWarnings("serial") public class Excavator { // The item variants for the excavators diff --git a/plugin/src/lightling/gibsoniacraft/crafting/Hammer.java b/plugin/src/lightling/gibsoniacraft/crafting/Hammer.java index 24fe800..cb29b30 100644 --- a/plugin/src/lightling/gibsoniacraft/crafting/Hammer.java +++ b/plugin/src/lightling/gibsoniacraft/crafting/Hammer.java @@ -21,6 +21,7 @@ import org.bukkit.Server; // For registering recipes on the server * An Hammer is a pickaxe-based item that digs in a 3x3 radius as opposed to a singular block * @author Lightling */ +@SuppressWarnings("serial") public class Hammer { // The item variants for the Hammers diff --git a/plugin/src/lightling/gibsoniacraft/crafting/LumberAxe.java b/plugin/src/lightling/gibsoniacraft/crafting/LumberAxe.java index 46990dc..39f8562 100644 --- a/plugin/src/lightling/gibsoniacraft/crafting/LumberAxe.java +++ b/plugin/src/lightling/gibsoniacraft/crafting/LumberAxe.java @@ -21,6 +21,7 @@ import org.bukkit.Server; // For registering recipes on the server * An LumberAxe is a AXE-based item that digs in a 3x3 radius as opposed to a singular block * @author Lightling */ +@SuppressWarnings("serial") public class LumberAxe { // The item variants for the LumberAxes diff --git a/plugin/src/lightling/gibsoniacraft/util/BlockRef.java b/plugin/src/lightling/gibsoniacraft/lib/BlockRef.java similarity index 97% rename from plugin/src/lightling/gibsoniacraft/util/BlockRef.java rename to plugin/src/lightling/gibsoniacraft/lib/BlockRef.java index 40c4699..74e7ae6 100644 --- a/plugin/src/lightling/gibsoniacraft/util/BlockRef.java +++ b/plugin/src/lightling/gibsoniacraft/lib/BlockRef.java @@ -1,15 +1,17 @@ -package lightling.gibsoniacraft.util; +package lightling.gibsoniacraft.lib; +// Collections import java.util.ArrayList; import java.util.HashMap; +// For referencing block types import org.bukkit.Material; -import org.bukkit.inventory.ItemStack; /** * Contains constant blocks and items of a certain type * @author Lightling */ +@SuppressWarnings("serial") public class BlockRef { /** diff --git a/plugin/src/lightling/gibsoniacraft/util/BlockListener.java b/plugin/src/lightling/gibsoniacraft/util/BlockListener.java index a339753..309d00d 100644 --- a/plugin/src/lightling/gibsoniacraft/util/BlockListener.java +++ b/plugin/src/lightling/gibsoniacraft/util/BlockListener.java @@ -5,18 +5,19 @@ import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.entity.Player; +import org.bukkit.Location; +// Collections import java.util.ArrayList; import java.util.Map; -import org.bukkit.Location; - // Needed for handling events import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockBreakEvent; import lightling.gibsoniacraft.GibsoniaCraft; +import lightling.gibsoniacraft.lib.BlockRef; // Needed for GibsoniaCraft tools import org.bukkit.inventory.ItemStack; @@ -71,7 +72,6 @@ public class BlockListener implements Listener ItemMeta meta = tool.getItemMeta(); Damageable dMeta = (Damageable)meta; int currDur = dMeta.getDamage(); - int maxDur = tool.getType().getMaxDurability(); Map enchantments = tool.getEnchantments(); // Used in determining if an extra block was broken (for durability) @@ -258,7 +258,6 @@ public class BlockListener implements Listener ItemMeta meta = item.getItemMeta(); Damageable dMeta = (Damageable)meta; int currDur = dMeta.getDamage(); - int maxDur = item.getType().getMaxDurability(); // Used in determining if an extra block was broken (for durability) boolean success = false; diff --git a/plugin/src/lightling/gibsoniacraft/util/ToolUtil.java b/plugin/src/lightling/gibsoniacraft/util/ToolUtil.java index 85150a3..5fe805f 100644 --- a/plugin/src/lightling/gibsoniacraft/util/ToolUtil.java +++ b/plugin/src/lightling/gibsoniacraft/util/ToolUtil.java @@ -1,15 +1,17 @@ package lightling.gibsoniacraft.util; +// Collections import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.Stack; +// For functionality of various functions import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.inventory.ItemStack; import org.bukkit.World; +import lightling.gibsoniacraft.lib.BlockRef; /** * Manages calculations regarding added tools @@ -240,7 +242,7 @@ public class ToolUtil // Determine if there are still blocks left Block tempAbove = world.getBlockAt(x + i, y + 1, z + j); - if (BlockRef.ValidLumberAxeBlocks.contains(temp.getType())) + if (BlockRef.ValidLumberAxeBlocks.contains(tempAbove.getType())) { blocksAbove++; }