diff --git a/plugin/src/main/java/com/denizenscript/denizen/Denizen.java b/plugin/src/main/java/com/denizenscript/denizen/Denizen.java index 99646a10aa..319f8e883f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/Denizen.java +++ b/plugin/src/main/java/com/denizenscript/denizen/Denizen.java @@ -359,7 +359,6 @@ public void onEnable() { OldEventManager.registerSmartEvent(new CuboidEnterExitSmartEvent()); OldEventManager.registerSmartEvent(new FlagSmartEvent()); OldEventManager.registerSmartEvent(new NPCNavigationSmartEvent()); - eventManager().registerCoreMembers(); // Register all the modern script events ScriptEventRegistry.registerMainEvents(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/flags/FlagManager.java b/plugin/src/main/java/com/denizenscript/denizen/flags/FlagManager.java index 7f1a56a97e..2933a64029 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/flags/FlagManager.java +++ b/plugin/src/main/java/com/denizenscript/denizen/flags/FlagManager.java @@ -623,16 +623,16 @@ public String expirationTime() { String timeString = ""; if (days > 0) { - timeString = String.valueOf(days) + "d "; + timeString = days + "d "; } if (hours > 0) { - timeString = timeString + String.valueOf(hours) + "h "; + timeString = timeString + hours + "h "; } if (minutes > 0 && days == 0) { - timeString = timeString + String.valueOf(minutes) + "m "; + timeString = timeString + minutes + "m "; } if (seconds > 0 && minutes < 10 && hours == 0 && days == 0) { - timeString = timeString + String.valueOf(seconds) + "s"; + timeString = timeString + seconds + "s"; } return timeString.trim(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/nms/abstracts/ImprovedOfflinePlayer.java b/plugin/src/main/java/com/denizenscript/denizen/nms/abstracts/ImprovedOfflinePlayer.java index 77b7c7661d..083b7e48bd 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/nms/abstracts/ImprovedOfflinePlayer.java +++ b/plugin/src/main/java/com/denizenscript/denizen/nms/abstracts/ImprovedOfflinePlayer.java @@ -52,7 +52,7 @@ public abstract class ImprovedOfflinePlayer { protected UUID player; protected File file; protected CompoundTag compound; - protected boolean exists = false; + protected boolean exists; protected boolean autosave = true; public static Map offlineInventories = new HashMap<>(); public static Map offlineEnderChests = new HashMap<>(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java b/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java index b0e2755de7..cef409b96a 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java @@ -1558,7 +1558,7 @@ else if (object.getBukkitEntityType() == EntityType.PIG) { EntityHelper.MapTraceResult mtr = NMSHandler.getEntityHelper().mapTrace(object.getLivingEntity(), 200); if (mtr != null) { double x = 0; - double y = 0; + double y; double basex = mtr.hitLocation.getX() - Math.floor(mtr.hitLocation.getX()); double basey = mtr.hitLocation.getY() - Math.floor(mtr.hitLocation.getY()); double basez = mtr.hitLocation.getZ() - Math.floor(mtr.hitLocation.getZ()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java b/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java index e9140b49f4..ec4a237526 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java @@ -2109,8 +2109,7 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName // Returns the location of this inventory's holder. // --> registerTag("location", (attribute, object) -> { - LocationTag location = object.getLocation(); - return location; + return object.getLocation(); }); // <--[tag] @@ -2239,8 +2238,7 @@ else if (slot > object.getInventory().getSize() - 1) { // For horses, the order is saddle|armor. // --> registerTag("equipment", (attribute, object) -> { - ListTag equipment = object.getEquipment(); - return equipment; + return object.getEquipment(); }); // <--[tag] @@ -2339,8 +2337,7 @@ else if ((object.inventory instanceof FurnaceInventory)) { // Returns the item currently in the fuel section of a furnace or brewing stand inventory. // --> registerTag("fuel", (attribute, object) -> { - ItemTag fuel = object.getFuel(); - return fuel; + return object.getFuel(); }); // <--[tag] @@ -2351,8 +2348,7 @@ else if ((object.inventory instanceof FurnaceInventory)) { // Returns the item currently in the smelting slot of a furnace inventory, or the ingredient slot of a brewing stand inventory. // --> registerTag("input", (attribute, object) -> { - ItemTag smelting = object.getInput(); - return smelting; + return object.getInput(); }); registerTag("smelting", tagProcessor.registeredObjectTags.get("input")); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/PlayerTag.java b/plugin/src/main/java/com/denizenscript/denizen/objects/PlayerTag.java index 149cf240e8..3b000506b3 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/PlayerTag.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/PlayerTag.java @@ -233,7 +233,7 @@ public PlayerTag(Player player) { // INSTANCE FIELDS/METHODS ///////////////// - OfflinePlayer offlinePlayer = null; + OfflinePlayer offlinePlayer; public boolean isValid() { return getPlayerEntity() != null || getOfflinePlayer() != null; diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventoryHolder.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventoryHolder.java index 20618c2d3a..9e955822fd 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventoryHolder.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventoryHolder.java @@ -156,8 +156,7 @@ public static void registerTags() { // Returns Denizen's holder ID for this inventory. (player object, location object, etc.) // --> PropertyParser.registerTag("id_holder", (attribute, object) -> { - ObjectTag holder = object.holder; - return holder; + return object.holder; }); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/AgeCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/AgeCommand.java index 8a4305d3eb..256991d61d 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/AgeCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/AgeCommand.java @@ -94,7 +94,7 @@ public void execute(final ScriptEntry scriptEntry) { boolean lock = scriptEntry.hasObject("lock"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), (lock ? ArgumentHelper.debugObj("lock", lock) : "") + + Debug.report(scriptEntry, getName(), (lock ? ArgumentHelper.debugObj("lock", true) : "") + (ageType != null ? ArgumentHelper.debugObj("agetype", ageType) : ArgumentHelper.debugObj("age", age)) + ArgumentHelper.debugObj("entities", entities.toString())); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/AnnounceCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/AnnounceCommand.java index 869419e123..5e30755065 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/AnnounceCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/AnnounceCommand.java @@ -85,7 +85,7 @@ else if (!scriptEntry.hasObject("type") } else if (!scriptEntry.hasObject("format") && arg.matchesPrefix("format")) { - FormatScriptContainer format = null; + FormatScriptContainer format; String formatStr = arg.getValue(); format = ScriptRegistry.getScriptContainer(formatStr); if (format == null) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/BukkitWorldScriptHelper.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/BukkitWorldScriptHelper.java index 6ec8a51a64..84dc94bba0 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/BukkitWorldScriptHelper.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/BukkitWorldScriptHelper.java @@ -94,7 +94,7 @@ public void timeEvent() { doEvents(Arrays.asList ("time changes", "time changes in " + currentWorld.identifySimple(), - "time " + String.valueOf(hour) + " in " + currentWorld.identifySimple()), + "time " + hour + " in " + currentWorld.identifySimple()), null, null, context, true); current_time.put(currentWorld.identifySimple(), hour); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/EntityScriptContainer.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/EntityScriptContainer.java index 77db205fc9..468e9c3625 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/EntityScriptContainer.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/EntityScriptContainer.java @@ -67,7 +67,7 @@ public EntityTag getEntityFrom() { } public EntityTag getEntityFrom(PlayerTag player, NPCTag npc) { - EntityTag entity = null; + EntityTag entity; try { if (contains("entity_type")) { String entityType = TagManager.tag((getString("entity_type", "")), new BukkitTagContext(player, npc, new ScriptTag(this))); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/InteractScriptHelper.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/InteractScriptHelper.java index 9759def017..47e82293b4 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/InteractScriptHelper.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/InteractScriptHelper.java @@ -72,7 +72,7 @@ public static InteractScriptContainer getInteractScript(NPCTag npc, PlayerTag pl entry = entry.toUpperCase(); // Initialize the fields that will make up the PriorityPair - String name = null; + String name; int priority; // Make sure a priority exists, deal with it if it doesn't. diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/ItemScriptContainer.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/ItemScriptContainer.java index 48e3d09c08..8a66aec59f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/ItemScriptContainer.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/ItemScriptContainer.java @@ -186,7 +186,7 @@ public ItemTag getItemFrom(BukkitTagContext context) { context.script = new ScriptTag(this); } // Try to use this script to make an item. - ItemTag stack = null; + ItemTag stack; isProcessing = true; try { if (!contains("material")) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/ProximityTrigger.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/ProximityTrigger.java index bcf8cc86b1..8962c93849 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/ProximityTrigger.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/ProximityTrigger.java @@ -3,7 +3,6 @@ import com.denizenscript.denizen.scripts.containers.core.InteractScriptContainer; import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.events.bukkit.ScriptReloadEvent; import com.denizenscript.denizen.npc.traits.TriggerTrait; import com.denizenscript.denizen.objects.NPCTag; import com.denizenscript.denizen.objects.PlayerTag; @@ -13,7 +12,6 @@ import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import java.util.*; @@ -281,24 +279,6 @@ private boolean isCloseEnough(Player player, NPCTag npc) { return true; } - /** - * Checks all proximity ranges in scripts and finds the largest number. No need to - * calculate distances that exceed the largest number. - * - * @param event dScriptReloadEvent, fired upon server startup or '/denizen reload scripts' - */ - @EventHandler // TODO: Does this have any point? - public void checkMaxProximities(ScriptReloadEvent event) { - - //for (String script : ScriptRegistry._getScriptNames()) { - // - // TODO: Check interact scripts for proximity triggers and ranges. - // Find largest number, add 10, and set it as maxProximityRange. - // For now, let's assume 25. - // - //} - } - private static Map> proximityTracker = new HashMap<>(); // diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/ScoreboardHelper.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/ScoreboardHelper.java index e54db7c357..e29d43bead 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/ScoreboardHelper.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/ScoreboardHelper.java @@ -57,7 +57,7 @@ public static void _recallScoreboards() { return; } - Scoreboard board = null; + Scoreboard board; // Iterate through scoreboards for (String id : rootSection.getKeys(false)) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/Utilities.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/Utilities.java index f319fc6d33..ad90436b74 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/Utilities.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/Utilities.java @@ -203,17 +203,6 @@ public static boolean isWalkable(Location location) { && blockHelper.isSafeBlock(location.clone().add(0, 1, 0).getBlock().getType()); } - public static String[] wrapWords(String text, int width) { - StringBuilder sb = new StringBuilder(text); - - int i = 0; - while (i + width < sb.length() && (i = sb.lastIndexOf(" ", i + width)) != -1) { - sb.replace(i, i + 1, "\n"); - } - - return sb.toString().split("\n"); - } - /** * @param player the player doing the talking * @param npc the npc being talked to diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/debugging/Debug.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/debugging/Debug.java index c4beee05bb..3fcc85330b 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/debugging/Debug.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/debugging/Debug.java @@ -433,54 +433,54 @@ public static boolean shouldDebug(Debuggable caller) { // Handles checking whether the provided debuggable should submit to the debugger private static void echo(String string, Debuggable caller) { - if (shouldDebug(caller)) { - if (showSources && caller != null) { - String callerId; - if (caller instanceof ScriptContainer) { - callerId = "Script:" + ((ScriptContainer) caller).getName(); - } - else if (caller instanceof ScriptEntry) { - if (((ScriptEntry) caller).getScript() != null) { - callerId = "Command:" + ((ScriptEntry) caller).getCommandName() + " in Script:" + ((ScriptEntry) caller).getScript().getName(); - } - else { - callerId = "Command:" + ((ScriptEntry) caller).getCommandName(); - } - } - else if (caller instanceof ScriptQueue) { - if (((ScriptQueue) caller).script != null) { - callerId = "Queue:" + ((ScriptQueue) caller).id + " running Script:" + ((ScriptQueue) caller).script.getName(); - } - else { - callerId = "Queue:" + ((ScriptQueue) caller).id; - } - } - else if (caller instanceof TagContext) { - if (((TagContext) caller).entry != null) { - ScriptEntry sent = ((TagContext) caller).entry; - if (sent.getScript() != null) { - callerId = "Tag in Command:" + sent.getCommandName() + " in Script:" + sent.getScript().getName(); - } - else { - callerId = "Tag in Command:" + sent.getCommandName(); - } - } - else if (((TagContext) caller).script != null) { - callerId = "Tag in Script:" + ((TagContext) caller).script.getName(); - } - else { - callerId = "Tag:" + caller.toString(); - } + if (!shouldDebug(caller)) { + return; + } + if (!showSources || caller == null) { + finalOutputDebugText(string, caller); + return; + } + String callerId; + if (caller instanceof ScriptContainer) { + callerId = "Script:" + ((ScriptContainer) caller).getName(); + } + else if (caller instanceof ScriptEntry) { + if (((ScriptEntry) caller).getScript() != null) { + callerId = "Command:" + ((ScriptEntry) caller).getCommandName() + " in Script:" + ((ScriptEntry) caller).getScript().getName(); + } + else { + callerId = "Command:" + ((ScriptEntry) caller).getCommandName(); + } + } + else if (caller instanceof ScriptQueue) { + if (((ScriptQueue) caller).script != null) { + callerId = "Queue:" + ((ScriptQueue) caller).id + " running Script:" + ((ScriptQueue) caller).script.getName(); + } + else { + callerId = "Queue:" + ((ScriptQueue) caller).id; + } + } + else if (caller instanceof TagContext) { + if (((TagContext) caller).entry != null) { + ScriptEntry sent = ((TagContext) caller).entry; + if (sent.getScript() != null) { + callerId = "Tag in Command:" + sent.getCommandName() + " in Script:" + sent.getScript().getName(); } else { - callerId = caller.toString(); + callerId = "Tag in Command:" + sent.getCommandName(); } - finalOutputDebugText(ChatColor.DARK_GRAY + "[Src:" + ChatColor.GRAY + callerId + ChatColor.DARK_GRAY + "]" + ChatColor.WHITE + string, caller); + } + else if (((TagContext) caller).script != null) { + callerId = "Tag in Script:" + ((TagContext) caller).script.getName(); } else { - finalOutputDebugText(string, caller); + callerId = "Tag:" + caller.toString(); } } + else { + callerId = caller.toString(); + } + finalOutputDebugText(ChatColor.DARK_GRAY + "[Src:" + ChatColor.GRAY + callerId + ChatColor.DARK_GRAY + "]" + ChatColor.WHITE + string, caller); } static void finalOutputDebugText(String message, Debuggable caller) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/implementation/DenizenCoreImplementation.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/implementation/DenizenCoreImplementation.java index 7c35952a77..629b025cd8 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/implementation/DenizenCoreImplementation.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/implementation/DenizenCoreImplementation.java @@ -33,7 +33,7 @@ public class DenizenCoreImplementation implements DenizenImplementation { @Override public File getScriptFolder() { - File file = null; + File file; // Get the script directory if (Settings.useDefaultScriptPath()) { file = new File(DenizenAPI.getCurrentInstance().getDataFolder() + File.separator + "scripts"); diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/MapObject.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/MapObject.java index 152a662fb5..251c05611c 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/MapObject.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/MapObject.java @@ -14,7 +14,7 @@ public abstract class MapObject { protected String xTag; protected String yTag; - protected String visibilityTag = "true"; + protected String visibilityTag; protected Map currentX = new HashMap<>(); protected Map currentY = new HashMap<>(); protected Map currentVisibility = new HashMap<>(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/midi/NoteBlockReceiver.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/midi/NoteBlockReceiver.java index 5e85c520b5..d2ae2adfc2 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/midi/NoteBlockReceiver.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/midi/NoteBlockReceiver.java @@ -26,7 +26,7 @@ public class NoteBlockReceiver implements Receiver, MetaEventListener { private List entities; private LocationTag location; private Map channelPatches; - public String key = null; + public String key; public Sequencer sequencer; public boolean closing = false; diff --git a/v1_12/src/main/java/com/denizenscript/denizen/nms/v1_12/impl/packets/PacketOutWindowItemsImpl.java b/v1_12/src/main/java/com/denizenscript/denizen/nms/v1_12/impl/packets/PacketOutWindowItemsImpl.java index 71e1d9a22a..b400ae9bde 100644 --- a/v1_12/src/main/java/com/denizenscript/denizen/nms/v1_12/impl/packets/PacketOutWindowItemsImpl.java +++ b/v1_12/src/main/java/com/denizenscript/denizen/nms/v1_12/impl/packets/PacketOutWindowItemsImpl.java @@ -33,7 +33,7 @@ public PacketOutWindowItemsImpl(PacketPlayOutWindowItems internal) { @Override public org.bukkit.inventory.ItemStack[] getContents() { - return contents.toArray(new org.bukkit.inventory.ItemStack[contents.size()]); + return contents.toArray(new org.bukkit.inventory.ItemStack[0]); } @Override diff --git a/v1_13/src/main/java/com/denizenscript/denizen/nms/v1_13/helpers/ItemHelperImpl.java b/v1_13/src/main/java/com/denizenscript/denizen/nms/v1_13/helpers/ItemHelperImpl.java index 6c6211c10f..efb52efe97 100644 --- a/v1_13/src/main/java/com/denizenscript/denizen/nms/v1_13/helpers/ItemHelperImpl.java +++ b/v1_13/src/main/java/com/denizenscript/denizen/nms/v1_13/helpers/ItemHelperImpl.java @@ -34,8 +34,7 @@ public class ItemHelperImpl extends ItemHelper { public static IRecipe getNMSRecipe(NamespacedKey key) { MinecraftKey nmsKey = CraftNamespacedKey.toMinecraft(key); Object2ObjectLinkedOpenHashMap recipeMap = ((CraftServer) Bukkit.getServer()).getServer().getCraftingManager().recipes; - IRecipe recipe = recipeMap.get(nmsKey); - return recipe; + return recipeMap.get(nmsKey); } @Override @@ -92,7 +91,7 @@ public void registerShapelessRecipe(String keyName, String group, ItemStack resu itemRecipe.exact = exact[i]; ingredientList.add(itemRecipe); } - ShapelessRecipes recipe = new ShapelessRecipes(key, group, CraftItemStack.asNMSCopy(result), NonNullList.a(null, ingredientList.toArray(new RecipeItemStack[ingredientList.size()]))); + ShapelessRecipes recipe = new ShapelessRecipes(key, group, CraftItemStack.asNMSCopy(result), NonNullList.a(null, ingredientList.toArray(new RecipeItemStack[0]))); ((CraftServer) Bukkit.getServer()).getServer().getCraftingManager().a(recipe); } diff --git a/v1_13/src/main/java/com/denizenscript/denizen/nms/v1_13/impl/packets/PacketOutWindowItemsImpl.java b/v1_13/src/main/java/com/denizenscript/denizen/nms/v1_13/impl/packets/PacketOutWindowItemsImpl.java index bfcdac476f..fec4451fff 100644 --- a/v1_13/src/main/java/com/denizenscript/denizen/nms/v1_13/impl/packets/PacketOutWindowItemsImpl.java +++ b/v1_13/src/main/java/com/denizenscript/denizen/nms/v1_13/impl/packets/PacketOutWindowItemsImpl.java @@ -33,7 +33,7 @@ public PacketOutWindowItemsImpl(PacketPlayOutWindowItems internal) { @Override public org.bukkit.inventory.ItemStack[] getContents() { - return contents.toArray(new org.bukkit.inventory.ItemStack[contents.size()]); + return contents.toArray(new org.bukkit.inventory.ItemStack[0]); } @Override diff --git a/v1_14/src/main/java/com/denizenscript/denizen/nms/v1_14/helpers/ItemHelperImpl.java b/v1_14/src/main/java/com/denizenscript/denizen/nms/v1_14/helpers/ItemHelperImpl.java index 54d1b9e205..894c29a404 100644 --- a/v1_14/src/main/java/com/denizenscript/denizen/nms/v1_14/helpers/ItemHelperImpl.java +++ b/v1_14/src/main/java/com/denizenscript/denizen/nms/v1_14/helpers/ItemHelperImpl.java @@ -120,7 +120,7 @@ public void registerShapelessRecipe(String keyName, String group, ItemStack resu itemRecipe.exact = exact[i]; ingredientList.add(itemRecipe); } - ShapelessRecipes recipe = new ShapelessRecipes(key, group, CraftItemStack.asNMSCopy(result), NonNullList.a(null, ingredientList.toArray(new RecipeItemStack[ingredientList.size()]))); + ShapelessRecipes recipe = new ShapelessRecipes(key, group, CraftItemStack.asNMSCopy(result), NonNullList.a(null, ingredientList.toArray(new RecipeItemStack[0]))); ((CraftServer) Bukkit.getServer()).getServer().getCraftingManager().addRecipe(recipe); } diff --git a/v1_14/src/main/java/com/denizenscript/denizen/nms/v1_14/impl/network/handlers/FakeBlockHelper.java b/v1_14/src/main/java/com/denizenscript/denizen/nms/v1_14/impl/network/handlers/FakeBlockHelper.java index 60aeb98ded..80cc8339b3 100644 --- a/v1_14/src/main/java/com/denizenscript/denizen/nms/v1_14/impl/network/handlers/FakeBlockHelper.java +++ b/v1_14/src/main/java/com/denizenscript/denizen/nms/v1_14/impl/network/handlers/FakeBlockHelper.java @@ -15,7 +15,6 @@ public class FakeBlockHelper { public static Field BITMASK_MAPCHUNK = ReflectionHelper.getFields(PacketPlayOutMapChunk.class).get("c"); - public static Field HEIGHTMAPS_MAPCHUNK = ReflectionHelper.getFields(PacketPlayOutMapChunk.class).get("d"); public static Field DATA_MAPCHUNK = ReflectionHelper.getFields(PacketPlayOutMapChunk.class).get("e"); public static Field BLOCKENTITIES_MAPCHUNK = ReflectionHelper.getFields(PacketPlayOutMapChunk.class).get("f"); @@ -145,10 +144,6 @@ public static void handleMapChunkPacket(PacketPlayOutMapChunk packet, List