1
0
Fork 0

organized imports, removed unused variables, suppressed warnings dealing with arraylists

This commit is contained in:
lightling 2019-09-19 15:47:38 -04:00
parent 7a0a5a5313
commit 12cfef6ef8
7 changed files with 17 additions and 8 deletions

View file

@ -1,13 +1,16 @@
package lightling.gibsoniacraft; package lightling.gibsoniacraft;
// Server related
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
// GibsoniaCraft related
import lightling.gibsoniacraft.crafting.Excavator; import lightling.gibsoniacraft.crafting.Excavator;
import lightling.gibsoniacraft.crafting.Hammer; import lightling.gibsoniacraft.crafting.Hammer;
import lightling.gibsoniacraft.crafting.LumberAxe; import lightling.gibsoniacraft.crafting.LumberAxe;
import lightling.gibsoniacraft.util.BlockListener; import lightling.gibsoniacraft.util.BlockListener;
import lightling.gibsoniacraft.util.PlayerInteractListener; import lightling.gibsoniacraft.util.PlayerInteractListener;
@SuppressWarnings("unused")
public final class GibsoniaCraft extends JavaPlugin { public final class GibsoniaCraft extends JavaPlugin {
private Excavator excavatorClass; private Excavator excavatorClass;

View file

@ -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 * An excavator is a shovel-based item that digs in a 3x3 radius as opposed to a singular block
* @author Lightling * @author Lightling
*/ */
@SuppressWarnings("serial")
public class Excavator public class Excavator
{ {
// The item variants for the excavators // The item variants for the excavators

View file

@ -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 * An Hammer is a pickaxe-based item that digs in a 3x3 radius as opposed to a singular block
* @author Lightling * @author Lightling
*/ */
@SuppressWarnings("serial")
public class Hammer public class Hammer
{ {
// The item variants for the Hammers // The item variants for the Hammers

View file

@ -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 * An LumberAxe is a AXE-based item that digs in a 3x3 radius as opposed to a singular block
* @author Lightling * @author Lightling
*/ */
@SuppressWarnings("serial")
public class LumberAxe public class LumberAxe
{ {
// The item variants for the LumberAxes // The item variants for the LumberAxes

View file

@ -1,15 +1,17 @@
package lightling.gibsoniacraft.util; package lightling.gibsoniacraft.lib;
// Collections
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
// For referencing block types
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
/** /**
* Contains constant blocks and items of a certain type * Contains constant blocks and items of a certain type
* @author Lightling * @author Lightling
*/ */
@SuppressWarnings("serial")
public class BlockRef public class BlockRef
{ {
/** /**

View file

@ -5,18 +5,19 @@ import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.Location;
// Collections
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Map; import java.util.Map;
import org.bukkit.Location;
// Needed for handling events // Needed for handling events
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockBreakEvent;
import lightling.gibsoniacraft.GibsoniaCraft; import lightling.gibsoniacraft.GibsoniaCraft;
import lightling.gibsoniacraft.lib.BlockRef;
// Needed for GibsoniaCraft tools // Needed for GibsoniaCraft tools
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -71,7 +72,6 @@ public class BlockListener implements Listener
ItemMeta meta = tool.getItemMeta(); ItemMeta meta = tool.getItemMeta();
Damageable dMeta = (Damageable)meta; Damageable dMeta = (Damageable)meta;
int currDur = dMeta.getDamage(); int currDur = dMeta.getDamage();
int maxDur = tool.getType().getMaxDurability();
Map<Enchantment, Integer> enchantments = tool.getEnchantments(); Map<Enchantment, Integer> enchantments = tool.getEnchantments();
// Used in determining if an extra block was broken (for durability) // Used in determining if an extra block was broken (for durability)
@ -258,7 +258,6 @@ public class BlockListener implements Listener
ItemMeta meta = item.getItemMeta(); ItemMeta meta = item.getItemMeta();
Damageable dMeta = (Damageable)meta; Damageable dMeta = (Damageable)meta;
int currDur = dMeta.getDamage(); int currDur = dMeta.getDamage();
int maxDur = item.getType().getMaxDurability();
// Used in determining if an extra block was broken (for durability) // Used in determining if an extra block was broken (for durability)
boolean success = false; boolean success = false;

View file

@ -1,15 +1,17 @@
package lightling.gibsoniacraft.util; package lightling.gibsoniacraft.util;
// Collections
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Stack;
// For functionality of various functions
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.World; import org.bukkit.World;
import lightling.gibsoniacraft.lib.BlockRef;
/** /**
* Manages calculations regarding added tools * Manages calculations regarding added tools
@ -240,7 +242,7 @@ public class ToolUtil
// Determine if there are still blocks left // Determine if there are still blocks left
Block tempAbove = world.getBlockAt(x + i, y + 1, z + j); Block tempAbove = world.getBlockAt(x + i, y + 1, z + j);
if (BlockRef.ValidLumberAxeBlocks.contains(temp.getType())) if (BlockRef.ValidLumberAxeBlocks.contains(tempAbove.getType()))
{ {
blocksAbove++; blocksAbove++;
} }