diff --git a/plugin/src/main/java/com/denizenscript/denizen/BukkitScriptEntryData.java b/plugin/src/main/java/com/denizenscript/denizen/BukkitScriptEntryData.java index 3293cbecf8..953b0b372e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/BukkitScriptEntryData.java +++ b/plugin/src/main/java/com/denizenscript/denizen/BukkitScriptEntryData.java @@ -1,25 +1,25 @@ package com.denizenscript.denizen; -import com.denizenscript.denizen.objects.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.tags.BukkitTagContext; import com.denizenscript.denizencore.scripts.ScriptEntryData; import com.denizenscript.denizencore.tags.TagContext; public class BukkitScriptEntryData extends ScriptEntryData { - private dPlayer player; - private dNPC npc; + private PlayerTag player; + private NPCTag npc; - public BukkitScriptEntryData(dPlayer player, dNPC npc) { + public BukkitScriptEntryData(PlayerTag player, NPCTag npc) { this.player = player; this.npc = npc; } - public dPlayer getPlayer() { + public PlayerTag getPlayer() { return player; } - public dNPC getNPC() { + public NPCTag getNPC() { return npc != null && npc.getCitizen() != null ? npc : null; } @@ -31,11 +31,11 @@ public boolean hasPlayer() { return player != null; } - public void setPlayer(dPlayer player) { + public void setPlayer(PlayerTag player) { this.player = player; } - public void setNPC(dNPC npc) { + public void setNPC(NPCTag npc) { this.npc = npc; } diff --git a/plugin/src/main/java/com/denizenscript/denizen/CommonRegistries.java b/plugin/src/main/java/com/denizenscript/denizen/CommonRegistries.java index e4e0189dc5..7b7e8cdf9c 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/CommonRegistries.java +++ b/plugin/src/main/java/com/denizenscript/denizen/CommonRegistries.java @@ -20,7 +20,7 @@ public class CommonRegistries { // more! If you're just a beginner, you've probably been using them without even realizing it! // // ObjectTag is a broader term for a 'type' of object that more specifically represents something, - // such as a dLocation or dScript, often times just referred to as a 'location' or 'script'. Denizen + // such as a LocationTag or ScriptTag, often times just referred to as a 'location' or 'script'. Denizen // employs many object types that you should be familiar with. You'll notice that many times objects // are reference with their 'dObject notation' which is in the format of 'x@', the x being the specific // notation of an object type. Example: player objects use the p@ notation, and locations use l@. @@ -28,14 +28,14 @@ public class CommonRegistries { // // Let's take the tag system, for example. It uses the ObjectTags system pretty heavily. For instance, // every time you use or , you're using a ObjectTag, which brings us to a simple - // clarification: Why and not ? That's because Denizen allows Players, + // clarification: Why and not ? That's because Denizen allows Players, // NPCs and other 'in-context objects' to be linked to certain scripts. In short, already // contains a reference to a specific player, such as the player that died in a world event 'on player dies'. - // would incorrectly reference the player named 'player', however this format is often + // would incorrectly reference the player named 'player', however this format is often // used to help with usage of a tag, simply indicating 'any player object'. // // ObjectTags can be used to CREATE new instances of objects, too! Though not all types allow 'new' - // objects to be created, many do, such as dItems. With the use of tags, it's easy to reference a specific + // objects to be created, many do, such as ItemTags. With the use of tags, it's easy to reference a specific // item, say -- an item in the Player's hand -- items are also able to use a constructor to make a new item, // and say, drop it in the world. Take the case of the command/usage '- drop i@diamond_ore'. The item object // used is a brand new diamond_ore, which is then dropped by the command to a location of your choice -- just @@ -46,26 +46,26 @@ public class CommonRegistries { // // Here's an overview of each object type that is implemented by the Denizen core: // - // + ----- dPlayer ----- + + // + ----- PlayerTag ----- + // | object notation: p@ can reference unique objects: yes can be notable: no // | constructors: ( <>'s represent non-static information and are not literal) // | p@ - fetches an online or offline player with the specified UUID // | p@ - Outdated constructor for back-support, fetches by name instead of UUID // - // + ----- dNPC ---------+ + // + ----- NPCTag ---------+ // | object notation: n@ can reference unique objects: yes can be notable: no // | constructors: ( <>'s represent non-static information and are not literal) // | n@ - fetches the NPC with the specified ID // | n@ - fetches the first NPC found with the specified name // - // + ----- dLocation ----+ + // + ----- LocationTag ----+ // | object notation: l@ can reference unique objects: no can be notable: yes // | constructors: ( <>'s represent non-static information and are not literal) // | l@,,, - fetches a specific location // | l@,,,,, - fetches a specific location and direction // | l@ - fetches the location that has been 'noted' with the specified ID // - // + ----- dEntity ------+ + // + ----- EntityTag ------+ // | object notation: e@ can reference unique objects: yes can be notable: no // | constructors: ( <>'s represent non-static information and are not literal) // | e@ - fetches a new entity with the specified type as implemented by Bukkit's entity type enumeration @@ -74,7 +74,7 @@ public class CommonRegistries { // | e@ - fetches the entity that has the (temporary) entity ID set by Bukkit // | e@random - fetches a new, random entity // - // + ----- dItem --------+ + // + ----- ItemTag --------+ // | object notation: i@ can reference unique objects: no can be notable: yes // | constructors: ( <>'s represent non-static information and are not literal) // | i@ - fetches a new item of the specified material @@ -82,36 +82,36 @@ public class CommonRegistries { // | i@ - fetches a new custom item as specified by the referenced item script // | i@ - fetches the item that has been noted with the specified ID // - // + ----- dWorld -------+ + // + ----- WorldTag -------+ // | object notation: w@ can reference unique objects: yes can be notable: no // | constructors: ( <>'s represent non-static information and are not literal) // | w@ - fetches the world with the specified name // - // + ----- dColor -------+ + // + ----- ColorTag -------+ // | object notation: co@ can reference unique objects: no can be notable: soon // | constructors: ( <>'s represent non-static information and are not literal) // | co@ - fetches a named color, as implemented by Bukkit's color enumeration // | co@,, - fetches a color made of the specified Red,Green,Blue value // | co@random - fetches a random color // - // + ----- dCuboid ------+ + // + ----- CuboidTag ------+ // | object notation: cu@ can reference unique objects: no can be notable: yes // | constructors: ( <>'s represent non-static information and are not literal) // | cu@||... - fetches a new cuboid encompassing a region from position 1 to 2, from 3 to 4, ... // | cu@ - fetches the cuboid that has been noted with the specified ID // - // + ----- dEllipsoid ------+ + // + ----- EllipsoidTag ------+ // | object notation: ellipsoid@ can reference unique objects: no can be notable: yes // | constructors: ( <>'s represent non-static information and are not literal) // | ellipsoid@,,,,,, - fetches a new ellispoid at the position with the given radius // | ellipsoid@ - fetches the ellipsoid that has been noted with the specified ID // - // + ----- dChunk ------+ + // + ----- ChunkTag ------+ // | object notation: ch@ can reference unique objects: yes can be notable: no // | constructors: ( <>'s represent non-static information and are not literal) // | ch@,, - fetches a chunk at the given chunk location // - // + ----- dInventory ---+ + // + ----- InventoryTag ---+ // | object notation: in@ can reference unique objects: yes can be notable: yes // | constructors: ( <>'s represent non-static information and are not literal) // | in@player[holder=] - fetches the specified Player's inventory (Works for offline players) @@ -123,35 +123,35 @@ public class CommonRegistries { // | in@ - fetches a new custom inventory as specified by the referenced inventory script // | in@generic - represents a generic, customizable virtual inventory to be used with inventory properties (See <@link language Virtual Inventories>) // - // + ----- dMaterial ----+ + // + ----- MaterialTag ----+ // | object notation: m@ can reference unique objects: no can be notable: no // | constructors: ( <>'s represent non-static information and are not literal) // | m@ - fetches the material as specified by Bukkit's material enumeration // | m@, - fetches the material as specified by Bukkit's material enumeration with specified data (deprecated) - // | m@ - fetches the material specified by Denizen's 'data variety' dMaterials (deprecated) + // | m@ - fetches the material specified by Denizen's 'data variety' MaterialTags (deprecated) // | m@random - fetches a random material // - // + ----- dTrade -----+ + // + ----- TradeTag -----+ // | object notation: trade@ can reference unique objects: no can be notable: no - // | trade@trade - represents a generic, customizable merchant trade to be used with merchant trade properties (See <@link language Merchant Trades>) + // | TradeTag - represents a generic, customizable merchant trade to be used with merchant trade properties (See <@link language Merchant Trades>) // // + ----- ListTag -------+ // | object notation: li@ can reference unique objects: yes can be notable: no // | constructors: ( <>'s represent non-static information and are not literal) // | li@ - fetches a new list with the elements specified, separated by a pipe (|) character // - // + ----- dScript -------+ + // + ----- ScriptTag -------+ // | object notation: s@ can reference unique objects: yes can be notable: no // | constructors: ( <>'s represent non-static information and are not literal) // | s@ - fetches the script container with the specified name // - // + ----- Duration ------+ + // + ----- DurationTag ------+ // | object notation: d@ can reference unique objects: no can be notable: no // | constructors: ( <>'s represent non-static information and are not literal) // | d@ - fetches a duration object with the specified amount of time // | d@- - fetches a duration that is randomly selected between the specified 'low' and 'high' // - // + ----- dPlugin -------+ + // + ----- PluginTag -------+ // | object notation: pl@ can reference unique objects: yes can be notable: no // | constructors: ( <>'s represent non-static information and are not literal) // | pl@ - fetches the plugin with the specified name @@ -162,12 +162,12 @@ public class CommonRegistries { // | el@ - fetches an element with the specified value // | el@val[] - slightly more verbose, but tag friendly way to fetch a new element (allows periods) // - // + ----- Queue ------+ + // + ----- QueueTag ------+ // | object notation: q@ can reference unique objects: yes can be notable: no // | constructors: ( <>'s represent non-static information and are not literal) // | q@ - fetches the queue with the given ID // - // + ----- Custom Object ------+ + // + ----- CustomObjectTag ------+ // | object notation: custom@ can reference unique objects: no can be notable: no // | constructors: ( <>'s represent non-static information and are not literal) // | custom@ - fetches a custom object of the specified base custom script. @@ -209,31 +209,31 @@ public static void registerMainTagHandlers() { } public static void registerMainObjects() { - ObjectFetcher.registerWithObjectFetcher(dBiome.class); // b@ - dBiome.registerTags(); // TODO: Automate this once all classes have tag registries - ObjectFetcher.registerWithObjectFetcher(dChunk.class); // ch@ - dChunk.registerTags(); // TODO: Automate this once all classes have tag registries - ObjectFetcher.registerWithObjectFetcher(dColor.class); // co@ - dColor.registerTags(); // TODO: Automate this once all classes have tag registries - ObjectFetcher.registerWithObjectFetcher(dCuboid.class); // cu@ - dCuboid.registerTags(); // TODO: Automate this once all classes have tag registries - ObjectFetcher.registerWithObjectFetcher(dEllipsoid.class); // ellipsoid@ - dEllipsoid.registerTags(); // TODO: Automate this once all classes have tag registries - ObjectFetcher.registerWithObjectFetcher(dEntity.class); // e@ - ObjectFetcher.registerWithObjectFetcher(dInventory.class); // in@ - ObjectFetcher.registerWithObjectFetcher(dItem.class); // i@ - dItem.registerTags(); // TODO: Automate this once all classes have tag registries - ObjectFetcher.registerWithObjectFetcher(dLocation.class); // l@ - ObjectFetcher.registerWithObjectFetcher(dMaterial.class); // m@ - dMaterial.registerTags(); // TODO: Automate this once all classes have tag registries + ObjectFetcher.registerWithObjectFetcher(BiomeTag.class); // b@ + BiomeTag.registerTags(); // TODO: Automate this once all classes have tag registries + ObjectFetcher.registerWithObjectFetcher(ChunkTag.class); // ch@ + ChunkTag.registerTags(); // TODO: Automate this once all classes have tag registries + ObjectFetcher.registerWithObjectFetcher(ColorTag.class); // co@ + ColorTag.registerTags(); // TODO: Automate this once all classes have tag registries + ObjectFetcher.registerWithObjectFetcher(CuboidTag.class); // cu@ + CuboidTag.registerTags(); // TODO: Automate this once all classes have tag registries + ObjectFetcher.registerWithObjectFetcher(EllipsoidTag.class); // ellipsoid@ + EllipsoidTag.registerTags(); // TODO: Automate this once all classes have tag registries + ObjectFetcher.registerWithObjectFetcher(EntityTag.class); // e@ + ObjectFetcher.registerWithObjectFetcher(InventoryTag.class); // in@ + ObjectFetcher.registerWithObjectFetcher(ItemTag.class); // i@ + ItemTag.registerTags(); // TODO: Automate this once all classes have tag registries + ObjectFetcher.registerWithObjectFetcher(LocationTag.class); // l@ + ObjectFetcher.registerWithObjectFetcher(MaterialTag.class); // m@ + MaterialTag.registerTags(); // TODO: Automate this once all classes have tag registries if (Depends.citizens != null) { - ObjectFetcher.registerWithObjectFetcher(dNPC.class); // n@ + ObjectFetcher.registerWithObjectFetcher(NPCTag.class); // n@ } - ObjectFetcher.registerWithObjectFetcher(dPlayer.class); // p@ - ObjectFetcher.registerWithObjectFetcher(dPlugin.class); // pl@ - dPlugin.registerTags(); // TODO: Automate this once all classes have tag registries - ObjectFetcher.registerWithObjectFetcher(dTrade.class); // trade@ - ObjectFetcher.registerWithObjectFetcher(dWorld.class); // w@ - dWorld.registerTags(); // TODO: Automate this once all classes have tag registries + ObjectFetcher.registerWithObjectFetcher(PlayerTag.class); // p@ + ObjectFetcher.registerWithObjectFetcher(PluginTag.class); // pl@ + PluginTag.registerTags(); // TODO: Automate this once all classes have tag registries + ObjectFetcher.registerWithObjectFetcher(TradeTag.class); // trade@ + ObjectFetcher.registerWithObjectFetcher(WorldTag.class); // w@ + WorldTag.registerTags(); // TODO: Automate this once all classes have tag registries } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/Denizen.java b/plugin/src/main/java/com/denizenscript/denizen/Denizen.java index 4c91f331ea..1db7257085 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/Denizen.java +++ b/plugin/src/main/java/com/denizenscript/denizen/Denizen.java @@ -7,9 +7,9 @@ import com.denizenscript.denizen.events.core.FlagSmartEvent; import com.denizenscript.denizen.events.core.NPCNavigationSmartEvent; import com.denizenscript.denizen.flags.FlagManager; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.objects.notable.NotableManager; import com.denizenscript.denizen.objects.properties.PropertyRegistry; import com.denizenscript.denizen.scripts.commands.BukkitCommandRegistry; @@ -85,15 +85,15 @@ public CommandManager getCommandManager() { */ private BukkitCommandRegistry commandRegistry = new BukkitCommandRegistry(); private TriggerRegistry triggerRegistry = new TriggerRegistry(); - private DenizenNPCHelper dNPCRegistry; + private DenizenNPCHelper npcHelper; public BukkitCommandRegistry getCommandRegistry() { return commandRegistry; } - public DenizenNPCHelper getNPCRegistry() { - return dNPCRegistry; + public DenizenNPCHelper getNPCHelper() { + return npcHelper; } public TriggerRegistry getTriggerRegistry() { @@ -209,9 +209,9 @@ public void onEnable() { } try { - // If Citizens is enabled, Create the dNPC Registry + // If Citizens is enabled, Create the NPC Helper if (Depends.citizens != null) { - dNPCRegistry = new DenizenNPCHelper(this); + npcHelper = new DenizenNPCHelper(this); } // Create our CommandManager to handle '/denizen' commands @@ -228,9 +228,9 @@ public void onEnable() { DenizenEntityType.registerEntityType("FAKE_ARROW", FakeArrow.class); DenizenEntityType.registerEntityType("FAKE_PLAYER", FakePlayer.class); - // Track all player names for quick dPlayer matching + // Track all player names for quick PlayerTag matching for (OfflinePlayer player : Bukkit.getOfflinePlayers()) { - dPlayer.notePlayer(player); + PlayerTag.notePlayer(player); } } catch (Exception e) { @@ -645,12 +645,12 @@ public boolean onCommand(CommandSender sender, Command cmd, String cmdName, Stri entries.add(entry); InstantQueue queue = new InstantQueue("EXCOMMAND"); - dNPC npc = null; + NPCTag npc = null; if (Depends.citizens != null && Depends.citizens.getNPCSelector().getSelected(sender) != null) { - npc = new dNPC(Depends.citizens.getNPCSelector().getSelected(sender)); + npc = new NPCTag(Depends.citizens.getNPCSelector().getSelected(sender)); } List scriptEntries = ScriptBuilder.buildScriptEntries(entries, null, - new BukkitScriptEntryData(sender instanceof Player ? new dPlayer((Player) sender) : null, npc)); + new BukkitScriptEntryData(sender instanceof Player ? new PlayerTag((Player) sender) : null, npc)); queue.addEntries(scriptEntries); if (!quiet && sender instanceof Player) { @@ -688,8 +688,8 @@ public FlagManager.Flag getFlag(String string) { if (cb > 4) { String owner = string.substring(3, cb); String flag = string.substring(cb + 2); - if (dPlayer.matches(owner)) { - dPlayer player = dPlayer.valueOf(owner); + if (PlayerTag.matches(owner)) { + PlayerTag player = PlayerTag.valueOf(owner); if (FlagManager.playerHasFlag(player, flag)) { return flag_manager.getPlayerFlag(player, flag); } @@ -697,8 +697,8 @@ public FlagManager.Flag getFlag(String string) { Debug.echoError("Player '" + owner + "' flag '" + flag + "' not found."); } } - else if (Depends.citizens != null && dNPC.matches(owner)) { - dNPC npc = dNPC.valueOf(owner); + else if (Depends.citizens != null && NPCTag.matches(owner)) { + NPCTag npc = NPCTag.valueOf(owner); if (FlagManager.npcHasFlag(npc, flag)) { return flag_manager.getNPCFlag(npc.getId(), flag); } @@ -706,8 +706,8 @@ else if (Depends.citizens != null && dNPC.matches(owner)) { Debug.echoError("NPC '" + owner + "' flag '" + flag + "' not found."); } } - else if (dEntity.matches(owner)) { - dEntity entity = dEntity.valueOf(owner); + else if (EntityTag.matches(owner)) { + EntityTag entity = EntityTag.valueOf(owner); if (FlagManager.entityHasFlag(entity, flag)) { return flag_manager.getEntityFlag(entity, flag); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/DenizenCommandHandler.java b/plugin/src/main/java/com/denizenscript/denizen/DenizenCommandHandler.java index 45e8b8af2a..ef12f825b8 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/DenizenCommandHandler.java +++ b/plugin/src/main/java/com/denizenscript/denizen/DenizenCommandHandler.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.objects.notable.NotableManager; import com.denizenscript.denizen.scripts.containers.core.VersionScriptContainer; import com.denizenscript.denizen.utilities.DenizenAPI; @@ -430,7 +430,7 @@ else if (filter != null) { min = 2, max = 20, permission = "denizen.notable.basic") public void addnotable(CommandContext args, CommandSender sender) throws CommandException { - NotableManager.saveAs(new dLocation(((Player) sender).getLocation()), args.getString(1)); + NotableManager.saveAs(new LocationTag(((Player) sender).getLocation()), args.getString(1)); Messaging.send(sender, "Created new notable called " + (args.getString(1))); } @@ -440,6 +440,6 @@ public void addnotable(CommandContext args, CommandSender sender) throws Command min = 1, max = 1, permission = "denizen.notable.basic") public void listnotable(CommandContext args, CommandSender sender) throws CommandException { - Messaging.send(sender, NotableManager.getAllType(dLocation.class).toString()); + Messaging.send(sender, NotableManager.getAllType(LocationTag.class).toString()); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/DenizenCoreImplementation.java b/plugin/src/main/java/com/denizenscript/denizen/DenizenCoreImplementation.java index 09d8bb130a..c6c696d21a 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/DenizenCoreImplementation.java +++ b/plugin/src/main/java/com/denizenscript/denizen/DenizenCoreImplementation.java @@ -182,8 +182,8 @@ else if (data.hasNPC()) { @Override public TagContext getTagContextFor(ScriptEntry scriptEntry, boolean b) { - dPlayer player = scriptEntry != null ? Utilities.getEntryPlayer(scriptEntry) : null; - dNPC npc = scriptEntry != null ? Utilities.getEntryNPC(scriptEntry) : null; + PlayerTag player = scriptEntry != null ? Utilities.getEntryPlayer(scriptEntry) : null; + NPCTag npc = scriptEntry != null ? Utilities.getEntryNPC(scriptEntry) : null; return new BukkitTagContext(player, npc, b, scriptEntry, scriptEntry != null ? scriptEntry.shouldDebug() : true, scriptEntry != null ? scriptEntry.getScript() : null); @@ -200,7 +200,7 @@ public boolean handleCustomArgs(ScriptEntry scriptEntry, Argument arg, boolean i if (arg.matchesPrefix("player") && !if_ignore) { Debug.echoDebug(scriptEntry, "...replacing the linked player with " + arg.getValue()); String value = TagManager.tag(arg.getValue(), new BukkitTagContext(scriptEntry, false)); - dPlayer player = dPlayer.valueOf(value); + PlayerTag player = PlayerTag.valueOf(value); if (player == null || !player.isValid()) { Debug.echoError(scriptEntry.getResidingQueue(), value + " is an invalid player!"); } @@ -212,7 +212,7 @@ public boolean handleCustomArgs(ScriptEntry scriptEntry, Argument arg, boolean i else if (arg.matchesPrefix("npc, npcid") && !if_ignore) { Debug.echoDebug(scriptEntry, "...replacing the linked NPC with " + arg.getValue()); String value = TagManager.tag(arg.getValue(), new BukkitTagContext(scriptEntry, false)); - dNPC npc = dNPC.valueOf(value); + NPCTag npc = NPCTag.valueOf(value); if (npc == null || !npc.isValid()) { Debug.echoError(scriptEntry.getResidingQueue(), value + " is an invalid NPC!"); return false; @@ -253,8 +253,8 @@ public boolean matchesFlagListTag(String arg) { int cb = arg.indexOf(']'); if (cb > 4 && arg.indexOf('@') == (cb + 1)) { String owner = arg.substring(3, cb); - flag = arg.substring(cb + 2).length() > 0 && (dPlayer.matches(owner) - || (Depends.citizens != null && dNPC.matches(owner))); + flag = arg.substring(cb + 2).length() > 0 && (PlayerTag.matches(owner) + || (Depends.citizens != null && NPCTag.matches(owner))); } } else if (arg.indexOf('@') == 2) { @@ -337,40 +337,40 @@ public boolean matchesType(String comparable, String comparedto) { boolean outcome = false; if (comparedto.equalsIgnoreCase("location")) { - outcome = dLocation.matches(comparable); + outcome = LocationTag.matches(comparable); } else if (comparedto.equalsIgnoreCase("material")) { - outcome = dMaterial.matches(comparable); + outcome = MaterialTag.matches(comparable); } else if (comparedto.equalsIgnoreCase("materiallist")) { - outcome = ListTag.valueOf(comparable).containsObjectsFrom(dMaterial.class); + outcome = ListTag.valueOf(comparable).containsObjectsFrom(MaterialTag.class); } else if (comparedto.equalsIgnoreCase("entity")) { - outcome = dEntity.matches(comparable); + outcome = EntityTag.matches(comparable); } else if (comparedto.equalsIgnoreCase("spawnedentity")) { - outcome = (dEntity.matches(comparable) && dEntity.valueOf(comparable).isSpawned()); + outcome = (EntityTag.matches(comparable) && EntityTag.valueOf(comparable).isSpawned()); } else if (comparedto.equalsIgnoreCase("npc")) { - outcome = dNPC.matches(comparable); + outcome = NPCTag.matches(comparable); } else if (comparedto.equalsIgnoreCase("player")) { - outcome = dPlayer.matches(comparable); + outcome = PlayerTag.matches(comparable); } else if (comparedto.equalsIgnoreCase("offlineplayer")) { - outcome = (dPlayer.valueOf(comparable) != null && !dPlayer.valueOf(comparable).isOnline()); + outcome = (PlayerTag.valueOf(comparable) != null && !PlayerTag.valueOf(comparable).isOnline()); } else if (comparedto.equalsIgnoreCase("onlineplayer")) { - outcome = (dPlayer.valueOf(comparable) != null && dPlayer.valueOf(comparable).isOnline()); + outcome = (PlayerTag.valueOf(comparable) != null && PlayerTag.valueOf(comparable).isOnline()); } else if (comparedto.equalsIgnoreCase("item")) { - outcome = dItem.matches(comparable); + outcome = ItemTag.matches(comparable); } else if (comparedto.equalsIgnoreCase("cuboid")) { - outcome = dCuboid.matches(comparable); + outcome = CuboidTag.matches(comparable); } else if (comparedto.equalsIgnoreCase("trade")) { - outcome = dTrade.matches(comparable); + outcome = TradeTag.matches(comparable); } else { Debug.echoError("Invalid 'matches' type '" + comparedto + "'!"); diff --git a/plugin/src/main/java/com/denizenscript/denizen/NPCCommandHandler.java b/plugin/src/main/java/com/denizenscript/denizen/NPCCommandHandler.java index b3ba4da98f..42e699e71f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/NPCCommandHandler.java +++ b/plugin/src/main/java/com/denizenscript/denizen/NPCCommandHandler.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen; import com.denizenscript.denizen.npc.traits.*; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.utilities.command.messaging.Messaging; import com.denizenscript.denizencore.scripts.ScriptRegistry; @@ -214,7 +214,7 @@ public void assignment(CommandContext args, CommandSender sender, NPC npc) throw if (args.hasValueFlag("set")) { String script = args.getFlag("set").replace("\"", ""); - if (trait.setAssignment(script, dPlayer.mirrorBukkitPlayer(player))) { + if (trait.setAssignment(script, PlayerTag.mirrorBukkitPlayer(player))) { if (trait.hasAssignment()) { Messaging.sendInfo(sender, npc.getName() + "'s assignment is now: '" + trait.getAssignment().getName() + "'."); } @@ -232,7 +232,7 @@ else if (ScriptRegistry.containsScript(script)) { } else if (args.hasFlag('r')) { - trait.removeAssignment(dPlayer.mirrorBukkitPlayer(player)); + trait.removeAssignment(PlayerTag.mirrorBukkitPlayer(player)); Messaging.sendInfo(sender, npc.getName() + "'s assignment has been removed."); return; @@ -378,7 +378,7 @@ else if (args.hasValueFlag("location")) { Messaging.sendError(sender, "Usage: /npc sit --location x,y,z,world"); return; } - trait.sit(dLocation.valueOf(argsArray[0] + "," + argsArray[1] + "," + argsArray[2] + "," + argsArray[3])); + trait.sit(LocationTag.valueOf(argsArray[0] + "," + argsArray[1] + "," + argsArray[2] + "," + argsArray[3])); } else if (args.hasValueFlag("anchor")) { if (npc.hasTrait(Anchors.class)) { @@ -447,7 +447,7 @@ public void sleeping(CommandContext args, CommandSender sender, NPC npc) throws Messaging.sendError(sender, "Usage: /npc sleep --location x,y,z,world"); return; } - trait.toSleep(dLocation.valueOf(argsArray[0] + "," + argsArray[1] + "," + argsArray[2] + "," + argsArray[3])); + trait.toSleep(LocationTag.valueOf(argsArray[0] + "," + argsArray[1] + "," + argsArray[2] + "," + argsArray[3])); } else if (args.hasValueFlag("anchor")) { if (npc.hasTrait(Anchors.class)) { @@ -526,7 +526,7 @@ public void startFishing(CommandContext args, CommandSender sender, NPC npc) thr Messaging.sendError(sender, "Usage: /npc fish --location x,y,z,world"); return; } - trait.startFishing(dLocation.valueOf(argsArray[0] + "," + argsArray[1] + "," + argsArray[2] + "," + argsArray[3])); + trait.startFishing(LocationTag.valueOf(argsArray[0] + "," + argsArray[1] + "," + argsArray[2] + "," + argsArray[3])); } else if (args.hasValueFlag("anchor")) { if (npc.hasTrait(Anchors.class)) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/BukkitScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/BukkitScriptEvent.java index a0b806932e..45b021dd4f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/BukkitScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/BukkitScriptEvent.java @@ -208,10 +208,10 @@ public boolean runInCheck(ScriptPath path, Location location, String innote) { if (it.equals("notable")) { String subit = path.eventArgLowerAt(index + 2); if (subit.equals("cuboid")) { - return dCuboid.getNotableCuboidsContaining(location).size() > 0; + return CuboidTag.getNotableCuboidsContaining(location).size() > 0; } else if (subit.equals("ellipsoid")) { - return dEllipsoid.getNotableEllipsoidsContaining(location).size() > 0; + return EllipsoidTag.getNotableEllipsoidsContaining(location).size() > 0; } else { Debug.echoError("Invalid event 'IN ...' check [" + getName() + "] ('in notable ???'): '" + path.event + "' for " + path.container.getName()); @@ -221,20 +221,20 @@ else if (subit.equals("ellipsoid")) { } String lower = CoreUtilities.toLowerCase(it); if (lower.equals("cuboid")) { - return dCuboid.getNotableCuboidsContaining(location).size() > 0; + return CuboidTag.getNotableCuboidsContaining(location).size() > 0; } else if (lower.equals("ellipsoid")) { - return dEllipsoid.getNotableEllipsoidsContaining(location).size() > 0; + return EllipsoidTag.getNotableEllipsoidsContaining(location).size() > 0; } - else if (dWorld.matches(it)) { + else if (WorldTag.matches(it)) { return CoreUtilities.toLowerCase(location.getWorld().getName()).equals(lower); } - else if (dCuboid.matches(it)) { - dCuboid cuboid = dCuboid.valueOf(it); + else if (CuboidTag.matches(it)) { + CuboidTag cuboid = CuboidTag.valueOf(it); return cuboid.isInsideCuboid(location); } - else if (dEllipsoid.matches(it)) { - dEllipsoid ellipsoid = dEllipsoid.valueOf(it); + else if (EllipsoidTag.matches(it)) { + EllipsoidTag ellipsoid = EllipsoidTag.valueOf(it); return ellipsoid.contains(location); } else { @@ -243,7 +243,7 @@ else if (dEllipsoid.matches(it)) { } } - public boolean tryLocation(dLocation location, String comparedto) { + public boolean tryLocation(LocationTag location, String comparedto) { if (comparedto == null || comparedto.length() == 0) { Debug.echoError("Null or empty location string to compare"); return false; @@ -252,7 +252,7 @@ public boolean tryLocation(dLocation location, String comparedto) { return true; } comparedto = "l@" + comparedto; - dLocation loc = dLocation.valueOf(comparedto); + LocationTag loc = LocationTag.valueOf(comparedto); if (loc == null) { Debug.echoError("Invalid location in location comparison string: " + comparedto); return false; @@ -261,7 +261,7 @@ public boolean tryLocation(dLocation location, String comparedto) { } @Deprecated - public boolean runWithCheck(ScriptContainer scriptContainer, String s, String lower, dItem held) { + public boolean runWithCheck(ScriptContainer scriptContainer, String s, String lower, ItemTag held) { return runWithCheck(new ScriptPath(scriptContainer, s), held); } @@ -298,7 +298,7 @@ public boolean runGenericSwitchCheck(ScriptPath path, String switchName, String return true; } - public boolean runWithCheck(ScriptPath path, dItem held) { + public boolean runWithCheck(ScriptPath path, ItemTag held) { String with = path.switches.get("with"); if (with != null) { if (with.equalsIgnoreCase("item")) { @@ -311,7 +311,7 @@ public boolean runWithCheck(ScriptPath path, dItem held) { return true; } - public boolean tryInventory(dInventory inv, String comparedto) { + public boolean tryInventory(InventoryTag inv, String comparedto) { comparedto = CoreUtilities.toLowerCase(comparedto); if (comparedto.equals("inventory")) { return true; @@ -337,7 +337,7 @@ public boolean tryInventory(dInventory inv, String comparedto) { return false; } - public boolean tryItem(dItem item, String comparedto) { + public boolean tryItem(ItemTag item, String comparedto) { if (comparedto == null || comparedto.isEmpty() || item == null) { return false; } @@ -348,9 +348,9 @@ public boolean tryItem(dItem item, String comparedto) { if (comparedto.equals("potion") && CoreUtilities.toLowerCase(item.getItemStack().getType().name()).contains("potion")) { return true; } - dMaterial quickOf = dMaterial.quickOfNamed(comparedto); + MaterialTag quickOf = MaterialTag.quickOfNamed(comparedto); if (quickOf != null) { - dMaterial mat = item.getMaterial(); + MaterialTag mat = item.getMaterial(); if (quickOf.getMaterial() != mat.getMaterial()) { return false; } @@ -359,7 +359,7 @@ public boolean tryItem(dItem item, String comparedto) { } } Pattern regexd = regexHandle(comparedto); - item = new dItem(item.getItemStack().clone()); + item = new ItemTag(item.getItemStack().clone()); item.setAmount(1); if (equalityCheck(item.identify().substring("i@".length()), comparedto, regexd)) { return true; @@ -377,7 +377,7 @@ else if (equalityCheck(item.identifySimple().substring("i@".length()), comparedt return false; } - public boolean tryMaterial(dMaterial mat, String comparedto) { + public boolean tryMaterial(MaterialTag mat, String comparedto) { if (comparedto == null || comparedto.isEmpty() || mat == null) { return false; } @@ -385,7 +385,7 @@ public boolean tryMaterial(dMaterial mat, String comparedto) { if (comparedto.equals("block") || comparedto.equals("material")) { return true; } - dMaterial quickOf = dMaterial.quickOfNamed(comparedto); + MaterialTag quickOf = MaterialTag.quickOfNamed(comparedto); if (quickOf != null) { if (quickOf.getMaterial() != mat.getMaterial()) { return false; @@ -410,7 +410,7 @@ else if (equalityCheck(mat.identifyFullNoIdentifier(), comparedto, regexd)) { return false; } - public boolean tryEntity(dEntity entity, String comparedto) { + public boolean tryEntity(EntityTag entity, String comparedto) { if (comparedto == null || comparedto.isEmpty() || entity == null) { return false; } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockBuiltScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockBuiltScriptEvent.java index 8eea93ae09..347fa7c5f6 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockBuiltScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockBuiltScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.block; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -25,9 +25,9 @@ public class BlockBuiltScriptEvent extends BukkitScriptEvent implements Listener // @Triggers when an attempt is made to build a block on another block. Not necessarily caused by players. // // @Context - // returns the dLocation of the block the player is trying to build on. - // returns the dMaterial of the block the player is trying to build on. - // Deprecated, returns the dMaterial of the block the player is trying to build. + // returns the LocationTag of the block the player is trying to build on. + // returns the MaterialTag of the block the player is trying to build on. + // Deprecated, returns the MaterialTag of the block the player is trying to build. // // @Determine // "BUILDABLE" to allow the building. @@ -39,9 +39,9 @@ public BlockBuiltScriptEvent() { } public static BlockBuiltScriptEvent instance; - public dLocation location; - public dMaterial old_material; - public dMaterial new_material; + public LocationTag location; + public MaterialTag old_material; + public MaterialTag new_material; public BlockCanBuildEvent event; @Override @@ -99,9 +99,9 @@ else if (name.equals("old_material")) { @EventHandler public void onBlockBuilt(BlockCanBuildEvent event) { - location = new dLocation(event.getBlock().getLocation()); - old_material = new dMaterial(event.getBlock()); - new_material = new dMaterial(event.getMaterial()); // Deprecated because it doesn't have proper data + location = new LocationTag(event.getBlock().getLocation()); + old_material = new MaterialTag(event.getBlock()); + new_material = new MaterialTag(event.getMaterial()); // Deprecated because it doesn't have proper data cancelled = !event.isBuildable(); this.event = event; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockBurnsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockBurnsScriptEvent.java index ba9243e169..c9b098ecbf 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockBurnsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockBurnsScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.block; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -25,8 +25,8 @@ public class BlockBurnsScriptEvent extends BukkitScriptEvent implements Listener // @Triggers when a block is destroyed by fire. // // @Context - // returns the dLocation the block was burned at. - // returns the dMaterial of the block that was burned. + // returns the LocationTag the block was burned at. + // returns the MaterialTag of the block that was burned. // // --> @@ -35,8 +35,8 @@ public BlockBurnsScriptEvent() { } public static BlockBurnsScriptEvent instance; - public dLocation location; - public dMaterial material; + public LocationTag location; + public MaterialTag material; public BlockBurnEvent event; @Override @@ -81,8 +81,8 @@ else if (name.equals("material")) { @EventHandler public void onBlockBurns(BlockBurnEvent event) { - location = new dLocation(event.getBlock().getLocation()); - material = new dMaterial(event.getBlock()); + location = new LocationTag(event.getBlock().getLocation()); + material = new MaterialTag(event.getBlock()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockDispensesScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockDispensesScriptEvent.java index 0322b1f141..eecf769e8c 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockDispensesScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockDispensesScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.block; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ArgumentHelper; @@ -31,14 +31,14 @@ public class BlockDispensesScriptEvent extends BukkitScriptEvent implements List // @Triggers when a block dispenses an item. // // @Context - // returns the dLocation of the dispenser. - // returns the dItem of the item being dispensed. - // returns a dLocation vector of the velocity the item will be shot at. + // returns the LocationTag of the dispenser. + // returns the ItemTag of the item being dispensed. + // returns a LocationTag vector of the velocity the item will be shot at. // // @Determine // Element(Decimal) (DEPRECATED) to multiply the velocity by the given amount. - // dLocation to set the velocity the item will be shot at. - // dItem to set the item being shot. + // LocationTag to set the velocity the item will be shot at. + // ItemTag to set the item being shot. // // --> @@ -47,10 +47,10 @@ public BlockDispensesScriptEvent() { } public static BlockDispensesScriptEvent instance; - public dLocation location; - public dItem item; - private dLocation velocity; - private dMaterial material; + public LocationTag location; + public ItemTag item; + private LocationTag velocity; + private MaterialTag material; public BlockDispenseEvent event; @Override @@ -79,11 +79,11 @@ public String getName() { @Override public boolean applyDetermination(ScriptContainer container, String determination) { if (ArgumentHelper.matchesDouble(determination)) { - velocity = new dLocation(velocity.multiply(ArgumentHelper.getDoubleFrom(determination))); + velocity = new LocationTag(velocity.multiply(ArgumentHelper.getDoubleFrom(determination))); return true; } - else if (dLocation.matches(determination)) { - dLocation vel = dLocation.valueOf(determination); + else if (LocationTag.matches(determination)) { + LocationTag vel = LocationTag.valueOf(determination); if (vel == null) { Debug.echoError("[" + getName() + "] Invalid velocity!"); } @@ -91,8 +91,8 @@ else if (dLocation.matches(determination)) { velocity = vel; } } - else if (dItem.matches(determination)) { - dItem it = dItem.valueOf(determination, container); + else if (ItemTag.matches(determination)) { + ItemTag it = ItemTag.valueOf(determination, container); if (it == null) { Debug.echoError("[" + getName() + "] Invalid item!"); } @@ -119,10 +119,10 @@ else if (name.equals("velocity")) { @EventHandler public void onBlockDispenses(BlockDispenseEvent event) { - location = new dLocation(event.getBlock().getLocation()); - material = new dMaterial(event.getBlock()); - item = new dItem(event.getItem()); - velocity = new dLocation(null, event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ()); + location = new LocationTag(event.getBlock().getLocation()); + material = new MaterialTag(event.getBlock()); + item = new ItemTag(event.getItem()); + velocity = new LocationTag(null, event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ()); this.event = event; fire(event); event.setVelocity(velocity.toVector()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockFadesScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockFadesScriptEvent.java index cbffa15183..4890f4066f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockFadesScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockFadesScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.block; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -25,8 +25,8 @@ public class BlockFadesScriptEvent extends BukkitScriptEvent implements Listener // @Triggers when a block fades, melts or disappears based on world conditions. // // @Context - // returns the dLocation the block faded at. - // returns the dMaterial of the block that faded. + // returns the LocationTag the block faded at. + // returns the MaterialTag of the block that faded. // // --> @@ -35,8 +35,8 @@ public BlockFadesScriptEvent() { } public static BlockFadesScriptEvent instance; - public dLocation location; - public dMaterial material; + public LocationTag location; + public MaterialTag material; public BlockFadeEvent event; @Override @@ -79,8 +79,8 @@ else if (name.equals("material")) { @EventHandler public void onBlockFades(BlockFadeEvent event) { - location = new dLocation(event.getBlock().getLocation()); - material = new dMaterial(event.getBlock()); + location = new LocationTag(event.getBlock().getLocation()); + material = new MaterialTag(event.getBlock()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockFallsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockFallsScriptEvent.java index 2737f11e1e..826ea13431 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockFallsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockFallsScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.block; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -37,10 +37,10 @@ public BlockFallsScriptEvent() { public static BlockFallsScriptEvent instance; - public dLocation location; - public dMaterial material; + public LocationTag location; + public MaterialTag material; public EntityChangeBlockEvent event; - public dEntity entity; + public EntityTag entity; @Override public boolean couldMatch(ScriptContainer scriptContainer, String s) { @@ -82,9 +82,9 @@ else if (name.equals("entity")) { @EventHandler public void onBlockFalls(EntityChangeBlockEvent event) { - entity = new dEntity(event.getEntity()); - location = new dLocation(event.getBlock().getLocation()); - material = new dMaterial(event.getBlock()); + entity = new EntityTag(event.getEntity()); + location = new LocationTag(event.getBlock().getLocation()); + material = new MaterialTag(event.getBlock()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockFormsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockFormsScriptEvent.java index 7f1d6c1826..5511874127 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockFormsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockFormsScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.block; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -25,8 +25,8 @@ public class BlockFormsScriptEvent extends BukkitScriptEvent implements Listener // @Triggers when a block is formed based on world conditions, EG, when snow forms in a snow storm or ice forms in a cold biome. // // @Context - // returns the dLocation the block that is forming. - // returns the dMaterial of the block that is forming. + // returns the LocationTag the block that is forming. + // returns the MaterialTag of the block that is forming. // // --> @@ -35,8 +35,8 @@ public BlockFormsScriptEvent() { } public static BlockFormsScriptEvent instance; - public dLocation location; - public dMaterial material; + public LocationTag location; + public MaterialTag material; public BlockFormEvent event; @Override @@ -80,8 +80,8 @@ else if (name.equals("material")) { @EventHandler public void onBlockForms(BlockFormEvent event) { - location = new dLocation(event.getBlock().getLocation()); - material = new dMaterial(event.getNewState()); + location = new LocationTag(event.getBlock().getLocation()); + material = new MaterialTag(event.getNewState()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockGrowsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockGrowsScriptEvent.java index 14ff55c484..5c29d6296c 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockGrowsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockGrowsScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.block; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -24,8 +24,8 @@ public class BlockGrowsScriptEvent extends BukkitScriptEvent implements Listener // // @Triggers when a block grows naturally in the world, EG, when wheat, sugar canes, cacti, watermelons or pumpkins grow. // @Context - // returns the dLocation of the block that grew. - // returns the dMaterial of the block that grew. + // returns the LocationTag of the block that grew. + // returns the MaterialTag of the block that grew. // // --> @@ -34,8 +34,8 @@ public BlockGrowsScriptEvent() { } public static BlockGrowsScriptEvent instance; - public dLocation location; - public dMaterial material; + public LocationTag location; + public MaterialTag material; public BlockGrowEvent event; @Override @@ -49,7 +49,7 @@ public boolean couldMatch(ScriptContainer scriptContainer, String s) { if (block.equals("block")) { return true; } - dMaterial mat = dMaterial.valueOf(block); + MaterialTag mat = MaterialTag.valueOf(block); return mat != null && !mat.isStructure(); } @@ -88,8 +88,8 @@ else if (name.equals("material")) { @EventHandler public void onBlockGrows(BlockGrowEvent event) { - location = new dLocation(event.getBlock().getLocation()); - material = new dMaterial(event.getNewState()); + location = new LocationTag(event.getBlock().getLocation()); + material = new MaterialTag(event.getNewState()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockIgnitesScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockIgnitesScriptEvent.java index f2073182de..f67d4d2260 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockIgnitesScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockIgnitesScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.block; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.ObjectTag; @@ -27,10 +27,10 @@ public class BlockIgnitesScriptEvent extends BukkitScriptEvent implements Listen // @Triggers when a block is set on fire. // // @Context - // returns the dLocation of the block was set on fire at. - // returns the dMaterial of the block that was set on fire. - // returns the dEntity of the entity that ignited the block. - // returns the dLocation of the fire block that ignited this block. + // returns the LocationTag of the block was set on fire at. + // returns the MaterialTag of the block that was set on fire. + // returns the EntityTag of the entity that ignited the block. + // returns the LocationTag of the fire block that ignited this block. // returns an ElementTag of the cause of the event: ENDER_CRYSTAL, EXPLOSION, FIREBALL, FLINT_AND_STEEL, LAVA, or SPREAD. // // --> @@ -40,10 +40,10 @@ public BlockIgnitesScriptEvent() { } public static BlockIgnitesScriptEvent instance; - public dLocation location; - public dMaterial material; - public dEntity entity; - public dLocation origin_location; + public LocationTag location; + public MaterialTag material; + public EntityTag entity; + public LocationTag origin_location; public ElementTag cause; public BlockIgniteEvent event; @@ -96,15 +96,15 @@ else if (name.equals("cause")) { @EventHandler public void onBlockIgnites(BlockIgniteEvent event) { - location = new dLocation(event.getBlock().getLocation()); - material = new dMaterial(event.getBlock()); + location = new LocationTag(event.getBlock().getLocation()); + material = new MaterialTag(event.getBlock()); entity = null; if (event.getIgnitingEntity() != null) { - entity = new dEntity(event.getIgnitingEntity()); + entity = new EntityTag(event.getIgnitingEntity()); } origin_location = null; if (event.getIgnitingBlock() != null) { // TODO: Why would this be null? - origin_location = new dLocation(event.getIgnitingBlock().getLocation()); + origin_location = new LocationTag(event.getIgnitingBlock().getLocation()); } cause = new ElementTag(event.getCause().toString()); this.event = event; diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockPhysicsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockPhysicsScriptEvent.java index ec47fabbfb..472319a8ba 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockPhysicsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockPhysicsScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.block; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.utilities.MaterialCompat; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -29,8 +29,8 @@ public class BlockPhysicsScriptEvent extends BukkitScriptEvent implements Listen // @Triggers when a block's physics update. // // @Context - // returns a dLocation of the block the physics is affecting. - // returns a dMaterial of what the block is becoming. + // returns a LocationTag of the block the physics is affecting. + // returns a MaterialTag of what the block is becoming. // // --> @@ -40,9 +40,9 @@ public BlockPhysicsScriptEvent() { public static BlockPhysicsScriptEvent instance; - public dLocation location; - public dMaterial new_material; - public dMaterial material; + public LocationTag location; + public MaterialTag new_material; + public MaterialTag material; public BlockPhysicsEvent event; @Override @@ -92,9 +92,9 @@ public void onBlockPhysics(BlockPhysicsEvent event) { || MaterialCompat.isRepeater(changedType)) { return; } - location = new dLocation(event.getBlock().getLocation()); - new_material = new dMaterial(changedType); - material = new dMaterial(location.getBlock()); + location = new LocationTag(event.getBlock().getLocation()); + new_material = new MaterialTag(changedType); + material = new MaterialTag(location.getBlock()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockSpreadsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockSpreadsScriptEvent.java index 23173fe9ae..152caae8a2 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockSpreadsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockSpreadsScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.block; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -25,9 +25,9 @@ public class BlockSpreadsScriptEvent extends BukkitScriptEvent implements Listen // @Triggers when a block spreads based on world conditions, EG, when fire spreads, or when mushrooms spread. // // @Context - // returns the dLocation of the block that spread. - // returns the dLocation of the new block. - // returns the dMaterial of the block that spread. + // returns the LocationTag of the block that spread. + // returns the LocationTag of the new block. + // returns the MaterialTag of the block that spread. // // --> @@ -36,9 +36,9 @@ public BlockSpreadsScriptEvent() { } public static BlockSpreadsScriptEvent instance; - public dLocation location; - public dLocation source; - public dMaterial material; + public LocationTag location; + public LocationTag source; + public MaterialTag material; public BlockSpreadEvent event; @Override @@ -86,9 +86,9 @@ else if (name.equals("source_location")) { @EventHandler public void onBlockSpreads(BlockSpreadEvent event) { - source = new dLocation(event.getBlock().getLocation()); - location = new dLocation(event.getBlock().getLocation()); - material = new dMaterial(event.getSource()); + source = new LocationTag(event.getBlock().getLocation()); + location = new LocationTag(event.getBlock().getLocation()); + material = new MaterialTag(event.getSource()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/core/CommandSmartEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/core/CommandSmartEvent.java index 745f53ab0c..0e43eaffd6 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/core/CommandSmartEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/core/CommandSmartEvent.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.events.core; -import com.denizenscript.denizen.objects.dCuboid; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dWorld; +import com.denizenscript.denizen.objects.CuboidTag; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.WorldTag; import com.denizenscript.denizen.scripts.containers.core.BukkitWorldScriptHelper; import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.utilities.debugging.Debug; @@ -122,7 +122,7 @@ private List getAll(String cmd) { // returns a ListTag of the arguments. // returns true if the command was run from the console. // returns the command block's location (if the command was run from one). - // returns the dEntity of the command minecart (if the command was run from one). + // returns the EntityTag of the command minecart (if the command was run from one). // // @Determine // "FULFILLED" to tell Bukkit the command was handled. @@ -142,18 +142,18 @@ public void playerCommandPreprocess(PlayerCommandPreprocessEvent event) { events.addAll(getAll(command)); // Look for cuboids that contain the block's location - List cuboids = dCuboid.getNotableCuboidsContaining(event.getPlayer().getLocation()); + List cuboids = CuboidTag.getNotableCuboidsContaining(event.getPlayer().getLocation()); ListTag cuboid_context = new ListTag(); List cuboidEvents = new ArrayList<>(); - for (dCuboid cuboid : cuboids) { + for (CuboidTag cuboid : cuboids) { for (String str : events) { cuboidEvents.add(str + " in " + cuboid.identifySimple()); } cuboid_context.add(cuboid.identifySimple()); } for (String str : events) { - cuboidEvents.add(str + " in " + new dWorld(event.getPlayer().getLocation().getWorld()).identifySimple()); + cuboidEvents.add(str + " in " + new WorldTag(event.getPlayer().getLocation().getWorld()).identifySimple()); } events.addAll(cuboidEvents); // Add in cuboids context, with either the cuboids or an empty list @@ -172,7 +172,7 @@ public void playerCommandPreprocess(PlayerCommandPreprocessEvent event) { // Run any event scripts and get the determination. determination = BukkitWorldScriptHelper.doEvents(events, - null, dEntity.getPlayerFrom(event.getPlayer()), context, true).toUpperCase(); + null, EntityTag.getPlayerFrom(event.getPlayer()), context, true).toUpperCase(); // If a script has determined fulfilled, cancel this event so the player doesn't // receive the default 'Invalid command' gibberish from bukkit. @@ -210,10 +210,10 @@ public void serverCommand(ServerCommandEvent event) { CommandSender sender = event.getSender(); if (sender instanceof BlockCommandSender) { - context.put("command_block_location", new dLocation(((BlockCommandSender) sender).getBlock().getLocation())); + context.put("command_block_location", new LocationTag(((BlockCommandSender) sender).getBlock().getLocation())); } else if (sender instanceof CommandMinecart) { - context.put("command_minecart", new dEntity((CommandMinecart) sender)); + context.put("command_minecart", new EntityTag((CommandMinecart) sender)); } String determination = BukkitWorldScriptHelper.doEvents(events, null, null, context); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/core/CuboidEnterExitSmartEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/core/CuboidEnterExitSmartEvent.java index 3d3a369482..9428182df4 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/core/CuboidEnterExitSmartEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/core/CuboidEnterExitSmartEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.core; -import com.denizenscript.denizen.objects.dCuboid; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.CuboidTag; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.scripts.containers.core.BukkitWorldScriptHelper; import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.utilities.debugging.Debug; @@ -93,7 +93,7 @@ public void breakDown() { /////////// private boolean broad_detection = false; - private Map> player_cuboids = new ConcurrentHashMap<>(); + private Map> player_cuboids = new ConcurrentHashMap<>(); // <--[event] // @Events @@ -118,7 +118,7 @@ public void breakDown() { // --> @EventHandler public void onPlayerTeleport(PlayerTeleportEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } PlayerMoveEvent evt = new PlayerMoveEvent(event.getPlayer(), event.getFrom(), event.getTo()); @@ -130,7 +130,7 @@ public void onPlayerTeleport(PlayerTeleportEvent event) { @EventHandler public void onPlayerLeave(PlayerQuitEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } double pos = 10000000d; @@ -141,7 +141,7 @@ public void onPlayerLeave(PlayerQuitEvent event) { @EventHandler public void onPlayerJoin(PlayerJoinEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } double pos = 10000000d; @@ -151,7 +151,7 @@ public void onPlayerJoin(PlayerJoinEvent event) { } public void onWorldChange(PlayerChangedWorldEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } Location to = event.getPlayer().getLocation().clone(); @@ -164,7 +164,7 @@ public void onWorldChange(PlayerChangedWorldEvent event) { @EventHandler public void vehicleMoveEvent(VehicleMoveEvent event) { for (Entity entity : event.getVehicle().getPassengers()) { - if (dEntity.isPlayer(entity)) { + if (EntityTag.isPlayer(entity)) { PlayerMoveEvent evt = new PlayerMoveEvent((Player) entity, event.getFrom(), event.getTo()); internalRun(evt, "vehicle"); } @@ -177,7 +177,7 @@ public void playerMoveEvent(PlayerMoveEvent event) { } public void internalRun(PlayerMoveEvent event, String cause) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } @@ -186,18 +186,18 @@ public void internalRun(PlayerMoveEvent event, String cause) { } // Look for cuboids that contain the block's location - List cuboids = dCuboid.getNotableCuboidsContaining(event.getTo()); - List match = new ArrayList<>(); + List cuboids = CuboidTag.getNotableCuboidsContaining(event.getTo()); + List match = new ArrayList<>(); String namelow = CoreUtilities.toLowerCase(event.getPlayer().getName()); // TODO: UUID? if (player_cuboids.containsKey(namelow)) // TODO: Clear on quit? { match = player_cuboids.get(namelow); } - List exits = new ArrayList<>(match); + List exits = new ArrayList<>(match); exits.removeAll(cuboids); - List enters = new ArrayList<>(cuboids); + List enters = new ArrayList<>(cuboids); enters.removeAll(match); if (exits.isEmpty() && enters.isEmpty()) { @@ -207,14 +207,14 @@ public void internalRun(PlayerMoveEvent event, String cause) { if (!exits.isEmpty()) { if (broad_detection) { ListTag cuboid_context = new ListTag(); - for (dCuboid cuboid : exits) { + for (CuboidTag cuboid : exits) { cuboid_context.add(cuboid.identify()); } if (Fire(event, cuboid_context, "player exits notable cuboid", cause)) { return; } } - for (dCuboid cuboid : exits) { + for (CuboidTag cuboid : exits) { if (Fire(event, new ListTag(cuboid.identify()), "player exits " + cuboid.identifySimple(), cause)) { return; } @@ -224,14 +224,14 @@ public void internalRun(PlayerMoveEvent event, String cause) { if (!enters.isEmpty()) { if (broad_detection) { ListTag cuboid_context = new ListTag(); - for (dCuboid cuboid : enters) { + for (CuboidTag cuboid : enters) { cuboid_context.add(cuboid.identify()); } if (Fire(event, cuboid_context, "player enters notable cuboid", cause)) { return; } } - for (dCuboid cuboid : enters) { + for (CuboidTag cuboid : enters) { if (Fire(event, new ListTag(cuboid.identify()), "player enters " + cuboid.identifySimple(), cause)) { return; } @@ -247,14 +247,14 @@ public void internalRun(PlayerMoveEvent event, String cause) { private boolean Fire(PlayerMoveEvent event, ListTag cuboids, String EventName, String cause) { List events = new ArrayList<>(); Map context = new HashMap<>(); - context.put("from", new dLocation(event.getFrom())); - context.put("to", new dLocation(event.getTo())); + context.put("from", new LocationTag(event.getFrom())); + context.put("to", new LocationTag(event.getTo())); context.put("cuboids", cuboids); context.put("cause", new ElementTag(cause)); events.add(EventName); String determination = BukkitWorldScriptHelper.doEvents(events, - null, dEntity.getPlayerFrom(event.getPlayer()), context, true); + null, EntityTag.getPlayerFrom(event.getPlayer()), context, true); if (determination.toUpperCase().startsWith("CANCELLED")) { event.setCancelled(true); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/CreeperPoweredScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/CreeperPoweredScriptEvent.java index e73880566d..982dd07822 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/CreeperPoweredScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/CreeperPoweredScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.ObjectTag; @@ -24,8 +24,8 @@ public class CreeperPoweredScriptEvent extends BukkitScriptEvent implements List // @Triggers when a creeper is struck by lightning and turned into a powered creeper. // // @Context - // returns the dEntity of the creeper. - // returns the dEntity of the lightning. + // returns the EntityTag of the creeper. + // returns the EntityTag of the lightning. // returns an ElementTag of the cause for the creeper being powered. // // --> @@ -35,8 +35,8 @@ public CreeperPoweredScriptEvent() { } public static CreeperPoweredScriptEvent instance; - public dEntity lightning; - public dEntity entity; + public EntityTag lightning; + public EntityTag entity; public ElementTag cause; public CreeperPowerEvent event; @@ -87,8 +87,8 @@ else if (name.equals("cause")) { @EventHandler public void onCreeperPowered(CreeperPowerEvent event) { - lightning = new dEntity(event.getLightning()); - entity = new dEntity(event.getEntity()); + lightning = new EntityTag(event.getLightning()); + entity = new EntityTag(event.getEntity()); cause = new ElementTag(event.getCause().name()); this.event = event; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/DragonPhaseChangeScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/DragonPhaseChangeScriptEvent.java index 20dc81fa34..1c541d1037 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/DragonPhaseChangeScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/DragonPhaseChangeScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -30,7 +30,7 @@ public class DragonPhaseChangeScriptEvent extends BukkitScriptEvent implements L // @Triggers when a dragon's combat phase changes. // // @Context - // returns the dEntity of the dragon. + // returns the EntityTag of the dragon. // returns an ElementTag of the dragon's new phase. Phases: <@see link https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EnderDragonChangePhaseEvent.html> // returns an ElementTag of the dragon's old phase. Can be any phase or 'null' in some cases. // @@ -44,7 +44,7 @@ public DragonPhaseChangeScriptEvent() { } public static DragonPhaseChangeScriptEvent instance; - public dEntity entity; + public EntityTag entity; public EnderDragonChangePhaseEvent event; @Override @@ -111,7 +111,7 @@ else if (name.equals("new_phase")) { @EventHandler public void onEnderDragonChangePhase(EnderDragonChangePhaseEvent event) { - entity = new dEntity(event.getEntity()); + entity = new EntityTag(event.getEntity()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityAirLevelChangeScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityAirLevelChangeScriptEvent.java index 79118ce1c8..8916604a7e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityAirLevelChangeScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityAirLevelChangeScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -28,7 +28,7 @@ public class EntityAirLevelChangeScriptEvent extends BukkitScriptEvent implement // @Triggers when an entity's air level changes. // // @Context - // returns the dEntity. + // returns the EntityTag. // returns an Element(Number) of the entity's new air level (measured in ticks). // // @Determine @@ -45,7 +45,7 @@ public EntityAirLevelChangeScriptEvent() { } public static EntityAirLevelChangeScriptEvent instance; - public dEntity entity; + public EntityTag entity; public Integer air; public EntityAirChangeEvent event; @@ -85,8 +85,8 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(entity.isPlayer() ? dEntity.getPlayerFrom(event.getEntity()) : null, - entity.isCitizensNPC() ? dEntity.getNPCFrom(event.getEntity()) : null); + return new BukkitScriptEntryData(entity.isPlayer() ? EntityTag.getPlayerFrom(event.getEntity()) : null, + entity.isCitizensNPC() ? EntityTag.getNPCFrom(event.getEntity()) : null); } @Override @@ -102,7 +102,7 @@ else if (name.equals("air")) { @EventHandler public void onEntityAirLevelChanged(EntityAirChangeEvent event) { - entity = new dEntity(event.getEntity()); + entity = new EntityTag(event.getEntity()); air = event.getAmount(); this.event = event; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityBreaksHangingScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityBreaksHangingScriptEvent.java index a858e6b5a1..3132895a4a 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityBreaksHangingScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityBreaksHangingScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dCuboid; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.CuboidTag; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; @@ -34,8 +34,8 @@ public class EntityBreaksHangingScriptEvent extends BukkitScriptEvent implements // // @Context // returns the cause of the entity breaking. Causes list: <@link url http://bit.ly/1BeqxPX> - // returns the dEntity that broke the hanging entity, if any. - // returns the dEntity of the hanging. + // returns the EntityTag that broke the hanging entity, if any. + // returns the EntityTag of the hanging. // // @Player when the breaker is a player. // @@ -49,9 +49,9 @@ public EntityBreaksHangingScriptEvent() { public static EntityBreaksHangingScriptEvent instance; public ElementTag cause; - public dEntity breaker; - public dEntity hanging; - public dLocation location; + public EntityTag breaker; + public EntityTag hanging; + public LocationTag location; public HangingBreakByEntityEvent event; @Override @@ -119,7 +119,7 @@ else if (name.equals("hanging")) { else if (name.equals("cuboids")) { Debug.echoError("context.cuboids tag is deprecated in " + getName() + " script event"); ListTag cuboids = new ListTag(); - for (dCuboid cuboid : dCuboid.getNotableCuboidsContaining(location)) { + for (CuboidTag cuboid : CuboidTag.getNotableCuboidsContaining(location)) { cuboids.add(cuboid.identifySimple()); } return cuboids; @@ -132,10 +132,10 @@ else if (name.equals("location")) { @EventHandler public void onHangingBreaks(HangingBreakByEntityEvent event) { - hanging = new dEntity(event.getEntity()); + hanging = new EntityTag(event.getEntity()); cause = new ElementTag(event.getCause().name()); - location = new dLocation(hanging.getLocation()); - breaker = new dEntity(event.getRemover()); + location = new LocationTag(hanging.getLocation()); + breaker = new EntityTag(event.getRemover()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityBreedScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityBreedScriptEvent.java index 3bca50e9be..0475499d21 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityBreedScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityBreedScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizen.nms.NMSHandler; @@ -32,11 +32,11 @@ public class EntityBreedScriptEvent extends BukkitScriptEvent implements Listene // @Triggers when two entities breed. // // @Context - // returns the dEntity responsible for breeding, if it exists. - // returns the child dEntity. - // returns the parent dEntity creating the child. The child will spawn at the mother's location. - // returns the other parent dEntity. - // returns the dItem used to initiate breeding, if it exists. + // returns the EntityTag responsible for breeding, if it exists. + // returns the child EntityTag. + // returns the parent EntityTag creating the child. The child will spawn at the mother's location. + // returns the other parent EntityTag. + // returns the ItemTag used to initiate breeding, if it exists. // returns the amount of experience granted by breeding. // // @Determine @@ -49,11 +49,11 @@ public EntityBreedScriptEvent() { } public static EntityBreedScriptEvent instance; - private dEntity entity; - private dEntity breeder; - private dEntity father; - private dEntity mother; - private dItem item; + private EntityTag entity; + private EntityTag breeder; + private EntityTag father; + private EntityTag mother; + private ItemTag item; private int experience; public EntityBreedEvent event; @@ -117,17 +117,17 @@ else if (name.equals("experience")) { @EventHandler public void onEntityBreeds(EntityBreedEvent event) { Entity entity = event.getEntity(); - this.entity = new dEntity(entity); - breeder = new dEntity(event.getBreeder()); - father = new dEntity(event.getFather()); - mother = new dEntity(event.getMother()); - item = new dItem(event.getBredWith()); + this.entity = new EntityTag(entity); + breeder = new EntityTag(event.getBreeder()); + father = new EntityTag(event.getFather()); + mother = new EntityTag(event.getMother()); + item = new ItemTag(event.getBredWith()); experience = event.getExperience(); boolean wasCancelled = event.isCancelled(); this.event = event; - dEntity.rememberEntity(entity); + EntityTag.rememberEntity(entity); fire(event); - dEntity.forgetEntity(entity); + EntityTag.forgetEntity(entity); event.setExperience(experience); // Prevent entities from continuing to breed with each other diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityChangesBlockScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityChangesBlockScriptEvent.java index 6e1da41da0..af2f691d48 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityChangesBlockScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityChangesBlockScriptEvent.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dCuboid; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.CuboidTag; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; @@ -34,8 +34,8 @@ public class EntityChangesBlockScriptEvent extends BukkitScriptEvent implements // @Triggers when an entity changes the material of a block. // // @Context - // returns the dEntity that changed the block. - // returns the dLocation of the changed block. + // returns the EntityTag that changed the block. + // returns the LocationTag of the changed block. // returns the old material of the block. // returns the new material of the block. // @@ -48,10 +48,10 @@ public EntityChangesBlockScriptEvent() { } public static EntityChangesBlockScriptEvent instance; - public dEntity entity; - public dLocation location; - public dMaterial old_material; - public dMaterial new_material; + public EntityTag entity; + public LocationTag location; + public MaterialTag old_material; + public MaterialTag new_material; public ListTag cuboids; public EntityChangeBlockEvent event; @@ -103,8 +103,8 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(entity.isPlayer() ? dEntity.getPlayerFrom(event.getEntity()) : null, - entity.isCitizensNPC() ? dEntity.getNPCFrom(event.getEntity()) : null); + return new BukkitScriptEntryData(entity.isPlayer() ? EntityTag.getPlayerFrom(event.getEntity()) : null, + entity.isCitizensNPC() ? EntityTag.getNPCFrom(event.getEntity()) : null); } @Override @@ -115,7 +115,7 @@ public ObjectTag getContext(String name) { else if (name.equals("cuboids")) { // NOTE: Deprecated if (cuboids == null) { cuboids = new ListTag(); - for (dCuboid cuboid : dCuboid.getNotableCuboidsContaining(location)) { + for (CuboidTag cuboid : CuboidTag.getNotableCuboidsContaining(location)) { cuboids.add(cuboid.identifySimple()); } } @@ -135,10 +135,10 @@ else if (name.equals("old_material")) { @EventHandler public void onEntityChangesBlock(EntityChangeBlockEvent event) { - entity = new dEntity(event.getEntity()); - location = new dLocation(event.getBlock().getLocation()); - old_material = new dMaterial(location.getBlock()); - new_material = new dMaterial(event.getTo()); + entity = new EntityTag(event.getEntity()); + location = new LocationTag(event.getBlock().getLocation()); + old_material = new MaterialTag(location.getBlock()); + new_material = new MaterialTag(event.getTo()); cuboids = null; this.event = event; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityCombustsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityCombustsScriptEvent.java index 11e4cc9e30..f9e736a20c 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityCombustsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityCombustsScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.DurationTag; @@ -35,7 +35,7 @@ public class EntityCombustsScriptEvent extends BukkitScriptEvent implements List // @Context // returns the entity that caught fire. // returns the length of the burn. - // returns the dEntity or dLocation that caused the fire, if any. NOTE: Currently, if the source is a dLocation, the tag will return a null. It is expected that this will be fixed by Spigot in the future. + // returns the EntityTag or LocationTag that caused the fire, if any. NOTE: Currently, if the source is a LocationTag, the tag will return a null. It is expected that this will be fixed by Spigot in the future. // returns the type of the source, which can be: ENTITY, LOCATION, NONE. // // @Determine @@ -52,7 +52,7 @@ public EntityCombustsScriptEvent() { } public static EntityCombustsScriptEvent instance; - public dEntity entity; + public EntityTag entity; private int burntime; public EntityCombustEvent event; @@ -91,8 +91,8 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(entity.isPlayer() ? dEntity.getPlayerFrom(event.getEntity()) : null, - entity.isCitizensNPC() ? dEntity.getNPCFrom(event.getEntity()) : null); + return new BukkitScriptEntryData(entity.isPlayer() ? EntityTag.getPlayerFrom(event.getEntity()) : null, + entity.isCitizensNPC() ? EntityTag.getNPCFrom(event.getEntity()) : null); } @Override @@ -105,12 +105,12 @@ else if (name.equals("duration")) { } else if (name.equals("source")) { if (event instanceof EntityCombustByEntityEvent) { - return new dEntity(((EntityCombustByEntityEvent) event).getCombuster()); + return new EntityTag(((EntityCombustByEntityEvent) event).getCombuster()); } else if (event instanceof EntityCombustByBlockEvent) { Block combuster = ((EntityCombustByBlockEvent) event).getCombuster(); if (combuster != null) { - return new dLocation(combuster.getLocation()); + return new LocationTag(combuster.getLocation()); } } } @@ -128,7 +128,7 @@ else if (event instanceof EntityCombustByBlockEvent) { @EventHandler public void onEntityCombusts(EntityCombustEvent event) { - entity = new dEntity(event.getEntity()); + entity = new EntityTag(event.getEntity()); burntime = event.getDuration(); this.event = event; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityCreatePortalScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityCreatePortalScriptEvent.java index c6dbd575f8..e9239c8605 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityCreatePortalScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityCreatePortalScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -27,7 +27,7 @@ public class EntityCreatePortalScriptEvent extends BukkitScriptEvent implements // @Triggers when an entity creates a portal. // // @Context - // returns the dEntity that created the portal. + // returns the EntityTag that created the portal. // returns the type of portal: CUSTOM, ENDER, NETHER. // // @Player if the entity that created the portal is a player. @@ -39,7 +39,7 @@ public EntityCreatePortalScriptEvent() { } public static EntityCreatePortalScriptEvent instance; - public dEntity entity; + public EntityTag entity; public ElementTag portal_type; public EntityCreatePortalEvent event; @@ -74,8 +74,8 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(entity.isPlayer() ? dEntity.getPlayerFrom(event.getEntity()) : null, - entity.isCitizensNPC() ? dEntity.getNPCFrom(event.getEntity()) : null); + return new BukkitScriptEntryData(entity.isPlayer() ? EntityTag.getPlayerFrom(event.getEntity()) : null, + entity.isCitizensNPC() ? EntityTag.getNPCFrom(event.getEntity()) : null); } @Override @@ -91,13 +91,13 @@ else if (name.equals("portal_type")) { @EventHandler public void onEntityCreatesPortal(EntityCreatePortalEvent event) { - entity = new dEntity(event.getEntity()); + entity = new EntityTag(event.getEntity()); portal_type = new ElementTag(event.getPortalType().toString()); // TODO: Add this back? /* blocks = new ListTag(); for (int i=0; i < event.getBlocks().size(); i++) { - dLocation tempLoc = new dLocation(event.getBlocks().get(i).getBlock().getLocation()); + LocationTag tempLoc = new LocationTag(event.getBlocks().get(i).getBlock().getLocation()); blocks.add(tempLoc.identifySimple()); } */ diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityDamagedScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityDamagedScriptEvent.java index ba4ad6d0f3..7b4b965d8d 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityDamagedScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityDamagedScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -48,12 +48,12 @@ public class EntityDamagedScriptEvent extends BukkitScriptEvent implements Liste // @Triggers when an entity is damaged. // // @Context - // returns the dEntity that was damaged. - // returns the dEntity damaging the other entity, if any. + // returns the EntityTag that was damaged. + // returns the EntityTag damaging the other entity, if any. // returns the an ElementTag of reason the entity was damaged - see <@link language damage cause> for causes. // returns an Element(Decimal) of the amount of damage dealt. // returns an Element(Decimal) of the amount of damage dealt, after armor is calculated. - // returns a dEntity of the projectile, if one caused the event. + // returns a EntityTag of the projectile, if one caused the event. // returns the damage dealt by a specific damage type where TYPE can be any of: BASE, HARD_HAT, BLOCKING, ARMOR, RESISTANCE, MAGIC, ABSORPTION. // // @Determine @@ -71,13 +71,13 @@ public EntityDamagedScriptEvent() { public static EntityDamagedScriptEvent instance; - public dEntity entity; + public EntityTag entity; public ElementTag cause; public ElementTag damage; public ElementTag final_damage; - public dEntity damager; - public dEntity projectile; - public dItem held; + public EntityTag damager; + public EntityTag projectile; + public ItemTag held; public EntityDamageEvent event; @Override @@ -139,7 +139,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { return new BukkitScriptEntryData(damager != null && damager.isPlayer() ? damager.getDenizenPlayer() : entity.isPlayer() ? entity.getDenizenPlayer() : null, - damager != null && damager.isCitizensNPC() ? damager.getDenizenNPC() : entity.isCitizensNPC() ? dEntity.getNPCFrom(event.getEntity()) : null); + damager != null && damager.isCitizensNPC() ? damager.getDenizenNPC() : entity.isCitizensNPC() ? EntityTag.getNPCFrom(event.getEntity()) : null); } @Override @@ -174,7 +174,7 @@ else if (name.startsWith("damage_")) { @EventHandler public void onEntityDamaged(EntityDamageEvent event) { - entity = new dEntity(event.getEntity()); + entity = new EntityTag(event.getEntity()); damage = new ElementTag(event.getDamage()); final_damage = new ElementTag(event.getFinalDamage()); cause = new ElementTag(CoreUtilities.toLowerCase(event.getCause().name())); @@ -182,7 +182,7 @@ public void onEntityDamaged(EntityDamageEvent event) { projectile = null; held = null; if (event instanceof EntityDamageByEntityEvent) { - damager = new dEntity(((EntityDamageByEntityEvent) event).getDamager()); + damager = new EntityTag(((EntityDamageByEntityEvent) event).getDamager()); if (damager.isProjectile()) { projectile = damager; if (damager.hasShooter()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityDeathScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityDeathScriptEvent.java index a5dc52eca2..5c9d3c69da 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityDeathScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityDeathScriptEvent.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dInventory; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.InventoryTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.*; @@ -43,10 +43,10 @@ public class EntityDeathScriptEvent extends BukkitScriptEvent implements Listene // The death cannot be cancelled, only the death message (for players). // // @Context - // returns the dEntity that died. - // returns the dEntity damaging the other entity, if any. + // returns the EntityTag that died. + // returns the EntityTag damaging the other entity, if any. // returns an ElementTag of a player's death message. - // returns the dInventory of the entity if it was a player. + // returns the InventoryTag of the entity if it was a player. // returns an ElementTag of the cause of the death. See <@link language damage cause> for a list of possible damage causes. // returns a ListTag of all pending item drops. // returns an ElementTag of the amount of experience to be dropped. @@ -56,7 +56,7 @@ public class EntityDeathScriptEvent extends BukkitScriptEvent implements Listene // "NO_DROPS" to specify that any drops should be removed. // "NO_DROPS_OR_XP" to specify that any drops or XP orbs should be removed. // "NO_XP" to specify that any XP orbs should be removed. - // ListTag(dItem) to specify new items to be dropped. + // ListTag(ItemTag) to specify new items to be dropped. // Element(Number) to specify the new amount of XP to be dropped. // "KEEP_INV" to specify (if a player death) that the inventory should be kept. // "KEEP_LEVEL" to specify (if a player death) that the XP level should be kept. @@ -73,13 +73,13 @@ public EntityDeathScriptEvent() { public static EntityDeathScriptEvent instance; - public dEntity entity; + public EntityTag entity; public ObjectTag damager; public ElementTag message; - public dInventory inventory; + public InventoryTag inventory; public ElementTag cause; public ListTag drops; - public List dropItems; + public List dropItems; public Integer xp; public boolean keep_inv; public boolean keep_level; @@ -145,13 +145,13 @@ else if (ArgumentHelper.matchesInteger(determination)) { } // Change dropped items if ListTag detected - else if (Argument.valueOf(lower).matchesArgumentList(dItem.class)) { + else if (Argument.valueOf(lower).matchesArgumentList(ItemTag.class)) { drops.clear(); dropItems = new ArrayList<>(); ListTag drops_list = ListTag.valueOf(determination); - drops_list.filter(dItem.class, container); + drops_list.filter(ItemTag.class, container); for (String drop : drops_list) { - dItem item = dItem.valueOf(drop, container); + ItemTag item = ItemTag.valueOf(drop, container); if (item != null) { dropItems.add(item); drops.add(item.identify()); @@ -171,8 +171,8 @@ else if (event instanceof PlayerDeathEvent && !isDefaultDetermination(determinat @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(entity.isPlayer() ? dEntity.getPlayerFrom(event.getEntity()) : null, - entity.isCitizensNPC() ? dEntity.getNPCFrom(event.getEntity()) : null); + return new BukkitScriptEntryData(entity.isPlayer() ? EntityTag.getPlayerFrom(event.getEntity()) : null, + entity.isCitizensNPC() ? EntityTag.getNPCFrom(event.getEntity()) : null); } @Override @@ -205,10 +205,10 @@ else if (name.equals("xp") && xp != null) { public void onEntityDeath(EntityDeathEvent event) { LivingEntity livingEntity = event.getEntity(); - dEntity.rememberEntity(livingEntity); - entity = new dEntity(livingEntity); + EntityTag.rememberEntity(livingEntity); + entity = new EntityTag(livingEntity); - dPlayer player = null; + PlayerTag player = null; if (entity.isPlayer()) { player = entity.getDenizenPlayer(); @@ -220,8 +220,8 @@ public void onEntityDeath(EntityDeathEvent event) { if (lastDamage != null) { cause = new ElementTag(event.getEntity().getLastDamageCause().getCause().toString()); if (lastDamage instanceof EntityDamageByEntityEvent) { - dEntity damageEntity = new dEntity(((EntityDamageByEntityEvent) lastDamage).getDamager()); - dEntity shooter = damageEntity.getShooter(); + EntityTag damageEntity = new EntityTag(((EntityDamageByEntityEvent) lastDamage).getDamager()); + EntityTag shooter = damageEntity.getShooter(); if (shooter != null) { damager = shooter.getDenizenObject(); } @@ -230,7 +230,7 @@ public void onEntityDeath(EntityDeathEvent event) { } } else if (livingEntity.getKiller() != null) { - damager = new dEntity(livingEntity.getKiller()).getDenizenObject(); + damager = new EntityTag(livingEntity.getKiller()).getDenizenObject(); } } @@ -256,7 +256,7 @@ else if (livingEntity.getKiller() != null) { drops.add("i@air"); } else { - drops.add(new dItem(stack).identify()); + drops.add(new ItemTag(stack).identify()); } } cancelled = false; @@ -268,7 +268,7 @@ else if (livingEntity.getKiller() != null) { event.setDroppedExp(xp); if (dropItems != null) { event.getDrops().clear(); - for (dItem drop : dropItems) { + for (ItemTag drop : dropItems) { if (drop != null) { event.getDrops().add(drop.getItemStack()); } @@ -285,6 +285,6 @@ else if (livingEntity.getKiller() != null) { } } - dEntity.forgetEntity(livingEntity); + EntityTag.forgetEntity(livingEntity); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityDespawnScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityDespawnScriptEvent.java index 90c23ca7bf..c3811c1b91 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityDespawnScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityDespawnScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -39,7 +39,7 @@ public EntityDespawnScriptEvent() { } public static EntityDespawnScriptEvent instance; - public dEntity entity; + public EntityTag entity; public ElementTag cause; @Override @@ -78,8 +78,8 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(entity.isPlayer() ? dEntity.getPlayerFrom(entity.getBukkitEntity()) : null, - entity.isCitizensNPC() ? dEntity.getNPCFrom(entity.getBukkitEntity()) : null); + return new BukkitScriptEntryData(entity.isPlayer() ? EntityTag.getPlayerFrom(entity.getBukkitEntity()) : null, + entity.isCitizensNPC() ? EntityTag.getNPCFrom(entity.getBukkitEntity()) : null); } @Override diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityEntersPortalScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityEntersPortalScriptEvent.java index 4147e57d6e..f6f3d96b6d 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityEntersPortalScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityEntersPortalScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -25,8 +25,8 @@ public class EntityEntersPortalScriptEvent extends BukkitScriptEvent implements // @Triggers when an entity enters a portal. // // @Context - // returns the dEntity. - // returns the dLocation of the portal block touched by the entity. + // returns the EntityTag. + // returns the LocationTag of the portal block touched by the entity. // // @Player when the entity that entered the portal is a player // @@ -39,8 +39,8 @@ public EntityEntersPortalScriptEvent() { } public static EntityEntersPortalScriptEvent instance; - public dEntity entity; - public dLocation location; + public EntityTag entity; + public LocationTag location; public EntityPortalEnterEvent event; @Override @@ -75,8 +75,8 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(entity.isPlayer() ? dEntity.getPlayerFrom(event.getEntity()) : null, - entity.isCitizensNPC() ? dEntity.getNPCFrom(event.getEntity()) : null); + return new BukkitScriptEntryData(entity.isPlayer() ? EntityTag.getPlayerFrom(event.getEntity()) : null, + entity.isCitizensNPC() ? EntityTag.getNPCFrom(event.getEntity()) : null); } @Override @@ -92,8 +92,8 @@ else if (name.equals("location")) { @EventHandler public void onEntityEntersPortal(EntityPortalEnterEvent event) { - entity = new dEntity(event.getEntity()); - location = new dLocation(event.getLocation()); + entity = new EntityTag(event.getEntity()); + location = new LocationTag(event.getLocation()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityEntersVehicleScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityEntersVehicleScriptEvent.java index ea1a30e31c..8882152cda 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityEntersVehicleScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityEntersVehicleScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -28,8 +28,8 @@ public class EntityEntersVehicleScriptEvent extends BukkitScriptEvent implements // @Triggers when an entity enters a vehicle. // // @Context - // returns the dEntity of the vehicle. - // returns the dEntity of the entering entity. + // returns the EntityTag of the vehicle. + // returns the EntityTag of the entering entity. // // @Player when the entity that entered the vehicle is a player. // @@ -42,8 +42,8 @@ public EntityEntersVehicleScriptEvent() { } public static EntityEntersVehicleScriptEvent instance; - public dEntity vehicle; - public dEntity entity; + public EntityTag vehicle; + public EntityTag entity; public VehicleEnterEvent event; @Override @@ -98,8 +98,8 @@ else if (name.equals("entity")) { @EventHandler public void onEntityEntersVehicle(VehicleEnterEvent event) { - vehicle = new dEntity(event.getVehicle()); - entity = new dEntity(event.getEntered()); + vehicle = new EntityTag(event.getVehicle()); + entity = new EntityTag(event.getEntered()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityExitsPortalScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityExitsPortalScriptEvent.java index 4b65b9a1ae..42e713c2b3 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityExitsPortalScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityExitsPortalScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -25,8 +25,8 @@ public class EntityExitsPortalScriptEvent extends BukkitScriptEvent implements L // @Triggers when an entity exits a portal. // // @Context - // returns the dEntity. - // returns the dLocation of the portal block touched by the entity. + // returns the EntityTag. + // returns the LocationTag of the portal block touched by the entity. // // @Player when the entity that exits the portal is a player. // @@ -39,8 +39,8 @@ public EntityExitsPortalScriptEvent() { } public static EntityExitsPortalScriptEvent instance; - public dEntity entity; - public dLocation location; + public EntityTag entity; + public LocationTag location; public EntityPortalExitEvent event; @Override @@ -75,8 +75,8 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(entity.isPlayer() ? dEntity.getPlayerFrom(event.getEntity()) : null, - entity.isCitizensNPC() ? dEntity.getNPCFrom(event.getEntity()) : null); + return new BukkitScriptEntryData(entity.isPlayer() ? EntityTag.getPlayerFrom(event.getEntity()) : null, + entity.isCitizensNPC() ? EntityTag.getNPCFrom(event.getEntity()) : null); } @Override @@ -92,8 +92,8 @@ else if (name.equals("location")) { @EventHandler public void onEntityExitsPortal(EntityPortalExitEvent event) { - entity = new dEntity(event.getEntity()); - location = new dLocation(event.getTo()); + entity = new EntityTag(event.getEntity()); + location = new LocationTag(event.getTo()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityExitsVehicleScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityExitsVehicleScriptEvent.java index d0744062a0..dc999d257e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityExitsVehicleScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityExitsVehicleScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -28,8 +28,8 @@ public class EntityExitsVehicleScriptEvent extends BukkitScriptEvent implements // @Triggers when an entity exits a vehicle. // // @Context - // returns the dEntity of the vehicle. - // returns the dEntity of the exiting entity. + // returns the EntityTag of the vehicle. + // returns the EntityTag of the exiting entity. // // @Player when the entity that exits the vehicle is a player. // @@ -42,8 +42,8 @@ public EntityExitsVehicleScriptEvent() { } public static EntityExitsVehicleScriptEvent instance; - public dEntity vehicle; - public dEntity entity; + public EntityTag vehicle; + public EntityTag entity; public VehicleExitEvent event; @Override @@ -95,8 +95,8 @@ else if (name.equals("entity")) { @EventHandler public void onEntityExitsVehicle(VehicleExitEvent event) { - vehicle = new dEntity(event.getVehicle()); - entity = new dEntity(event.getExited()); + vehicle = new EntityTag(event.getVehicle()); + entity = new EntityTag(event.getExited()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityExplodesScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityExplodesScriptEvent.java index 4354f357dd..763dea01b5 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityExplodesScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityExplodesScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; @@ -33,12 +33,12 @@ public class EntityExplodesScriptEvent extends BukkitScriptEvent implements List // // @Context // returns a ListTag of blocks that the entity blew up. - // returns the dEntity that exploded. - // returns the dLocation the entity blew up at. + // returns the EntityTag that exploded. + // returns the LocationTag the entity blew up at. // returns an Element(Decimal) of the strength of the explosion. // // @Determine - // ListTag(dLocation) to set a new lists of blocks that are to be affected by the explosion. + // ListTag(LocationTag) to set a new lists of blocks that are to be affected by the explosion. // Element(Decimal) to change the strength of the explosion. // // --> @@ -48,9 +48,9 @@ public EntityExplodesScriptEvent() { } public static EntityExplodesScriptEvent instance; - public dEntity entity; + public EntityTag entity; public ListTag blocks; - public dLocation location; + public LocationTag location; public float strength; private Boolean blockSet; public EntityExplodeEvent event; @@ -90,7 +90,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio blocks = new ListTag(); blockSet = true; for (String loc : ListTag.valueOf(determination)) { - dLocation location = dLocation.valueOf(loc); + LocationTag location = LocationTag.valueOf(loc); if (location == null) { Debug.echoError("Invalid location '" + loc + "' check [" + getName() + "]: ' for " + container.getName()); } @@ -105,8 +105,8 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(entity.isPlayer() ? dEntity.getPlayerFrom(event.getEntity()) : null, - entity.isCitizensNPC() ? dEntity.getNPCFrom(event.getEntity()) : null); + return new BukkitScriptEntryData(entity.isPlayer() ? EntityTag.getPlayerFrom(event.getEntity()) : null, + entity.isCitizensNPC() ? EntityTag.getNPCFrom(event.getEntity()) : null); } @Override @@ -128,13 +128,13 @@ else if (name.equals("strength")) { @EventHandler public void onEntityExplodes(EntityExplodeEvent event) { - entity = new dEntity(event.getEntity()); - location = new dLocation(event.getLocation()); + entity = new EntityTag(event.getEntity()); + location = new LocationTag(event.getLocation()); strength = event.getYield(); blocks = new ListTag(); blockSet = false; for (Block block : event.blockList()) { - blocks.add(new dLocation(block.getLocation()).identify()); + blocks.add(new LocationTag(block.getLocation()).identify()); } this.event = event; fire(event); @@ -143,7 +143,7 @@ public void onEntityExplodes(EntityExplodeEvent event) { if (blocks.size() > 0) { event.blockList().clear(); for (String loc : blocks) { - dLocation location = dLocation.valueOf(loc); + LocationTag location = LocationTag.valueOf(loc); event.blockList().add(location.getWorld().getBlockAt(location)); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityExplosionPrimesScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityExplosionPrimesScriptEvent.java index c48f811b87..72f3b426e6 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityExplosionPrimesScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityExplosionPrimesScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -27,7 +27,7 @@ public class EntityExplosionPrimesScriptEvent extends BukkitScriptEvent implemen // @Triggers when an entity decides to explode. // // @Context - // returns the dEntity. + // returns the EntityTag. // returns an ElementTag of the explosion's radius. // returns an ElementTag with a value of "true" if the explosion will create fire and "false" otherwise. // --> @@ -37,7 +37,7 @@ public EntityExplosionPrimesScriptEvent() { } public static EntityExplosionPrimesScriptEvent instance; - public dEntity entity; + public EntityTag entity; public Float radius; public Boolean fire; public ExplosionPrimeEvent event; @@ -97,7 +97,7 @@ else if (name.equals("fire")) { @EventHandler public void onEntityExplosionPrimes(ExplosionPrimeEvent event) { - entity = new dEntity(event.getEntity()); + entity = new EntityTag(event.getEntity()); radius = event.getRadius(); fire = event.getFire(); this.event = event; diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityFoodLevelChangeScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityFoodLevelChangeScriptEvent.java index b38b39750c..0d4deec691 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityFoodLevelChangeScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityFoodLevelChangeScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -28,7 +28,7 @@ public class EntityFoodLevelChangeScriptEvent extends BukkitScriptEvent implemen // @Triggers when an entity's food level changes. // // @Context - // returns the dEntity. + // returns the EntityTag. // returns an Element(Number) of the entity's new food level. // // @Determine @@ -45,7 +45,7 @@ public EntityFoodLevelChangeScriptEvent() { } public static EntityFoodLevelChangeScriptEvent instance; - public dEntity entity; + public EntityTag entity; public Integer food; public FoodLevelChangeEvent event; @@ -85,8 +85,8 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(entity.isPlayer() ? dEntity.getPlayerFrom(event.getEntity()) : null, - entity.isCitizensNPC() ? dEntity.getNPCFrom(event.getEntity()) : null); + return new BukkitScriptEntryData(entity.isPlayer() ? EntityTag.getPlayerFrom(event.getEntity()) : null, + entity.isCitizensNPC() ? EntityTag.getNPCFrom(event.getEntity()) : null); } @Override @@ -102,7 +102,7 @@ else if (name.equals("food")) { @EventHandler public void onEntityFoodLevelChanged(FoodLevelChangeEvent event) { - entity = new dEntity(event.getEntity()); + entity = new EntityTag(event.getEntity()); food = event.getFoodLevel(); this.event = event; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityFormsBlockScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityFormsBlockScriptEvent.java index c040217a38..5af0407995 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityFormsBlockScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityFormsBlockScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -31,9 +31,9 @@ public class EntityFormsBlockScriptEvent extends BukkitScriptEvent implements Li // For example, when a snowman forms snow. // // @Context - // returns the dLocation the block. - // returns the dMaterial of the block. - // returns the dEntity that formed the block. + // returns the LocationTag the block. + // returns the MaterialTag of the block. + // returns the EntityTag that formed the block. // // --> @@ -42,9 +42,9 @@ public EntityFormsBlockScriptEvent() { } public static EntityFormsBlockScriptEvent instance; - public dMaterial material; - public dLocation location; - public dEntity entity; + public MaterialTag material; + public LocationTag location; + public EntityTag entity; public EntityBlockFormEvent event; @Override @@ -83,8 +83,8 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(entity.isPlayer() ? dEntity.getPlayerFrom(event.getEntity()) : null, - entity.isCitizensNPC() ? dEntity.getNPCFrom(event.getEntity()) : null); + return new BukkitScriptEntryData(entity.isPlayer() ? EntityTag.getPlayerFrom(event.getEntity()) : null, + entity.isCitizensNPC() ? EntityTag.getNPCFrom(event.getEntity()) : null); } @Override @@ -103,9 +103,9 @@ else if (name.equals("entity")) { @EventHandler public void onEntityFormsBlock(EntityBlockFormEvent event) { - location = new dLocation(event.getBlock().getLocation()); - material = new dMaterial(event.getBlock()); - entity = new dEntity(event.getEntity()); + location = new LocationTag(event.getBlock().getLocation()); + material = new MaterialTag(event.getBlock()); + entity = new EntityTag(event.getEntity()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityGlideScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityGlideScriptEvent.java index 7d66d6c9f3..a173b8a718 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityGlideScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityGlideScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -28,7 +28,7 @@ public class EntityGlideScriptEvent extends BukkitScriptEvent implements Listene // @Triggers when an entity starts or stops gliding. // // @Context - // returns the dEntity of this event. + // returns the EntityTag of this event. // returns an Element(Boolean) with a value of "true" if the entity is now gliding and "false" otherwise. // // @Player when the entity is a player. @@ -42,7 +42,7 @@ public EntityGlideScriptEvent() { } public static EntityGlideScriptEvent instance; - public dEntity entity; + public EntityTag entity; public Boolean state; @Override @@ -101,7 +101,7 @@ else if (name.equals("state")) { @EventHandler public void onEntityToggleGlide(EntityToggleGlideEvent event) { - entity = new dEntity(event.getEntity()); + entity = new EntityTag(event.getEntity()); state = event.isGliding(); fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityHealsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityHealsScriptEvent.java index 1a1ad4f6c9..d3a5a649ae 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityHealsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityHealsScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -29,7 +29,7 @@ public class EntityHealsScriptEvent extends BukkitScriptEvent implements Listene // // @Context // returns the amount the entity healed. - // returns the dEntity that healed. + // returns the EntityTag that healed. // returns the cause of the entity healing. Can be: <@link url http://bit.ly/2GTtxsf> // // @Determine @@ -46,7 +46,7 @@ public EntityHealsScriptEvent() { } public static EntityHealsScriptEvent instance; - public dEntity entity; + public EntityTag entity; public ElementTag amount; public ElementTag reason; public EntityRegainHealthEvent event; @@ -91,8 +91,8 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(entity.isPlayer() ? dEntity.getPlayerFrom(event.getEntity()) : null, - entity.isCitizensNPC() ? dEntity.getNPCFrom(event.getEntity()) : null); + return new BukkitScriptEntryData(entity.isPlayer() ? EntityTag.getPlayerFrom(event.getEntity()) : null, + entity.isCitizensNPC() ? EntityTag.getNPCFrom(event.getEntity()) : null); } @Override @@ -111,7 +111,7 @@ else if (name.equals("amount")) { @EventHandler public void onEntityHeals(EntityRegainHealthEvent event) { - entity = new dEntity(event.getEntity()); + entity = new EntityTag(event.getEntity()); amount = new ElementTag(event.getAmount()); reason = new ElementTag(event.getRegainReason().toString()); this.event = event; diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityInteractScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityInteractScriptEvent.java index ce004b275a..b391dbe574 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityInteractScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityInteractScriptEvent.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dCuboid; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.CuboidTag; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; @@ -33,8 +33,8 @@ public class EntityInteractScriptEvent extends BukkitScriptEvent implements List // @Triggers when an entity interacts with a block (EG an arrow hits a button) // // @Context - // returns a dLocation of the block being interacted with. - // returns a dEntity of the entity doing the interaction. + // returns a LocationTag of the block being interacted with. + // returns a EntityTag of the entity doing the interaction. // // --> @@ -43,9 +43,9 @@ public EntityInteractScriptEvent() { } public static EntityInteractScriptEvent instance; - public dEntity entity; - public dLocation location; - private dMaterial material; + public EntityTag entity; + public LocationTag location; + private MaterialTag material; public EntityInteractEvent event; @Override @@ -83,8 +83,8 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(entity.isPlayer() ? dEntity.getPlayerFrom(event.getEntity()) : null, - entity.isCitizensNPC() ? dEntity.getNPCFrom(event.getEntity()) : null); + return new BukkitScriptEntryData(entity.isPlayer() ? EntityTag.getPlayerFrom(event.getEntity()) : null, + entity.isCitizensNPC() ? EntityTag.getNPCFrom(event.getEntity()) : null); } @Override @@ -98,7 +98,7 @@ else if (name.equals("location")) { else if (name.equals("cuboids")) { Debug.echoError("context.cuboids tag is deprecated in " + getName() + " script event"); ListTag cuboids = new ListTag(); - for (dCuboid cuboid : dCuboid.getNotableCuboidsContaining(location)) { + for (CuboidTag cuboid : CuboidTag.getNotableCuboidsContaining(location)) { cuboids.add(cuboid.identifySimple()); } return cuboids; @@ -108,9 +108,9 @@ else if (name.equals("cuboids")) { @EventHandler public void onEntityInteract(EntityInteractEvent event) { - entity = new dEntity(event.getEntity()); - location = new dLocation(event.getBlock().getLocation()); - material = new dMaterial(event.getBlock()); + entity = new EntityTag(event.getEntity()); + location = new LocationTag(event.getBlock().getLocation()); + material = new MaterialTag(event.getBlock()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityKilledScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityKilledScriptEvent.java index dcccf5ccf5..3a0aafc276 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityKilledScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityKilledScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -44,12 +44,12 @@ public class EntityKilledScriptEvent extends BukkitScriptEvent implements Listen // @Warning This event may mis-fire in some cases, particularly with plugins or scripts modify the damage from scripts. If you need reliable death tracking, the entity death event may be better. // // @Context - // returns the dEntity that was killed. + // returns the EntityTag that was killed. // returns the an ElementTag of reason the entity was damaged - see <@link language damage cause> for causes. // returns an Element(Decimal) of the amount of damage dealt. // returns an Element(Decimal) of the amount of damage dealt, after armor is calculated. - // returns the dEntity damaging the other entity. - // returns a dEntity of the projectile shot by the damager, if any. + // returns the EntityTag damaging the other entity. + // returns a EntityTag of the projectile shot by the damager, if any. // returns the damage dealt by a specific damage type where TYPE can be any of: BASE, HARD_HAT, BLOCKING, ARMOR, RESISTANCE, MAGIC, ABSORPTION. // // @Determine @@ -67,12 +67,12 @@ public EntityKilledScriptEvent() { public static EntityKilledScriptEvent instance; - public dEntity entity; + public EntityTag entity; public ElementTag cause; public ElementTag damage; public ElementTag final_damage; - public dEntity damager; - public dEntity projectile; + public EntityTag damager; + public EntityTag projectile; public EntityDamageEvent event; @Override @@ -130,13 +130,13 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - dPlayer player = entity.isPlayer() ? dEntity.getPlayerFrom(event.getEntity()) : null; + PlayerTag player = entity.isPlayer() ? EntityTag.getPlayerFrom(event.getEntity()) : null; if (damager != null && player == null && damager.isPlayer()) { - player = dEntity.getPlayerFrom(damager.getBukkitEntity()); + player = EntityTag.getPlayerFrom(damager.getBukkitEntity()); } - dNPC npc = entity.isCitizensNPC() ? dEntity.getNPCFrom(event.getEntity()) : null; + NPCTag npc = entity.isCitizensNPC() ? EntityTag.getNPCFrom(event.getEntity()) : null; if (damager != null && npc == null && damager.isCitizensNPC()) { - npc = dEntity.getNPCFrom(damager.getBukkitEntity()); + npc = EntityTag.getNPCFrom(damager.getBukkitEntity()); } return new BukkitScriptEntryData(player, npc); } @@ -173,7 +173,7 @@ else if (name.startsWith("damage_")) { @EventHandler(priority = EventPriority.HIGH) public void onEntityKilled(EntityDamageEvent event) { - entity = new dEntity(event.getEntity()); + entity = new EntityTag(event.getEntity()); // Check for possibility of death first if (entity.isValid() && entity.isLivingEntity()) { if (event.getFinalDamage() < entity.getLivingEntity().getHealth()) { @@ -189,7 +189,7 @@ public void onEntityKilled(EntityDamageEvent event) { damager = null; projectile = null; if (event instanceof EntityDamageByEntityEvent) { - damager = new dEntity(((EntityDamageByEntityEvent) event).getDamager()); + damager = new EntityTag(((EntityDamageByEntityEvent) event).getDamager()); if (damager.isProjectile()) { projectile = damager; if (damager.hasShooter()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityPotionEffectScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityPotionEffectScriptEvent.java index 7f1dcb2674..fc019fe404 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityPotionEffectScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityPotionEffectScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.objects.properties.entity.EntityPotionEffects; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; @@ -32,12 +32,12 @@ public class EntityPotionEffectScriptEvent extends BukkitScriptEvent implements // @Triggers when an entity's potion effects change. // // @Context - // returns the dEntity. + // returns the EntityTag. // returns the cause of the effect change, based on <@see link https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityPotionEffectEvent.Cause.html> // returns the action of the effect changed, which can be 'added', 'changed', 'cleared', or 'removed' // returns whether the new potion effect will override the old. - // returns the new potion effect (in the same format as <@link tag e@entity.list_effects>). - // returns the new potion effect (in the same format as <@link tag e@entity.list_effects>). + // returns the new potion effect (in the same format as <@link tag EntityTag.list_effects>). + // returns the new potion effect (in the same format as <@link tag EntityTag.list_effects>). // returns the name of the modified potion effect type. // // @Determine @@ -54,7 +54,7 @@ public EntityPotionEffectScriptEvent() { } public static EntityPotionEffectScriptEvent instance; - public dEntity entity; + public EntityTag entity; public EntityPotionEffectEvent event; @Override @@ -107,8 +107,8 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(entity.isPlayer() ? dEntity.getPlayerFrom(event.getEntity()) : null, - entity.isCitizensNPC() ? dEntity.getNPCFrom(event.getEntity()) : null); + return new BukkitScriptEntryData(entity.isPlayer() ? EntityTag.getPlayerFrom(event.getEntity()) : null, + entity.isCitizensNPC() ? EntityTag.getNPCFrom(event.getEntity()) : null); } @Override @@ -139,7 +139,7 @@ else if (name.equals("old_effect") && event.getOldEffect() != null) { @EventHandler public void onEntityPotionEffect(EntityPotionEffectEvent event) { - entity = new dEntity(event.getEntity()); + entity = new EntityTag(event.getEntity()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityResurrectScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityResurrectScriptEvent.java index 71dc750316..3d73e2cdb5 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityResurrectScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityResurrectScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -26,7 +26,7 @@ public class EntityResurrectScriptEvent extends BukkitScriptEvent implements Lis // @Triggers when an entity dies and is resurrected by a totem. // // @Context - // returns the dEntity being resurrected. + // returns the EntityTag being resurrected. // // @Player when the entity being resurrected is a player. // @@ -37,7 +37,7 @@ public EntityResurrectScriptEvent() { } public static EntityResurrectScriptEvent instance; - public dEntity entity; + public EntityTag entity; public EntityResurrectEvent event; @Override @@ -72,8 +72,8 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(entity.isPlayer() ? dEntity.getPlayerFrom(event.getEntity()) : null, - entity.isCitizensNPC() ? dEntity.getNPCFrom(event.getEntity()) : null); + return new BukkitScriptEntryData(entity.isPlayer() ? EntityTag.getPlayerFrom(event.getEntity()) : null, + entity.isCitizensNPC() ? EntityTag.getNPCFrom(event.getEntity()) : null); } @Override @@ -86,7 +86,7 @@ public ObjectTag getContext(String name) { @EventHandler public void onEntityResurrect(EntityResurrectEvent event) { - entity = new dEntity(event.getEntity()); + entity = new EntityTag(event.getEntity()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityShootsBowEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityShootsBowEvent.java index 921f4d1ae6..9f3dd9c3a8 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityShootsBowEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityShootsBowEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizen.utilities.Conversion; import com.denizenscript.denizen.utilities.entity.Position; import com.denizenscript.denizen.BukkitScriptEntryData; @@ -36,13 +36,13 @@ public class EntityShootsBowEvent extends BukkitScriptEvent implements Listener // @Triggers when an entity shoots something out of a bow. // // @Context - // returns the dEntity that shot the bow. - // returns a dEntity of the projectile. - // returns the dItem of the bow used to shoot. + // returns the EntityTag that shot the bow. + // returns a EntityTag of the projectile. + // returns the ItemTag of the bow used to shoot. // returns the force of the shot. // // @Determine - // ListTag(dEntity) to change the projectile(s) being shot. + // ListTag(EntityTag) to change the projectile(s) being shot. // // @Player when the entity that shot the bow is a player. // @@ -56,10 +56,10 @@ public EntityShootsBowEvent() { public static EntityShootsBowEvent instance; - public dEntity entity; + public EntityTag entity; public Float force; - public dItem bow; - public dEntity projectile; + public ItemTag bow; + public EntityTag projectile; public EntityShootBowEvent event; @Override @@ -95,13 +95,13 @@ public String getName() { @Override public boolean applyDetermination(ScriptContainer container, String determination) { - if (Argument.valueOf(determination).matchesArgumentList(dEntity.class)) { + if (Argument.valueOf(determination).matchesArgumentList(EntityTag.class)) { cancelled = true; // Get the list of entities - List newProjectiles = ListTag.valueOf(determination).filter(dEntity.class, container); + List newProjectiles = ListTag.valueOf(determination).filter(EntityTag.class, container); // Go through all the entities, spawning/teleporting them - for (dEntity newProjectile : newProjectiles) { + for (EntityTag newProjectile : newProjectiles) { newProjectile.spawnAt(entity.getEyeLocation() .add(entity.getEyeLocation().getDirection())); // Set the entity as the shooter of the projectile, @@ -129,8 +129,8 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(entity.isPlayer() ? dEntity.getPlayerFrom(event.getEntity()) : null, - entity.isCitizensNPC() ? dEntity.getNPCFrom(event.getEntity()) : null); + return new BukkitScriptEntryData(entity.isPlayer() ? EntityTag.getPlayerFrom(event.getEntity()) : null, + entity.isCitizensNPC() ? EntityTag.getNPCFrom(event.getEntity()) : null); } @Override @@ -152,14 +152,14 @@ else if (name.equals("projectile")) { @EventHandler public void onEntityShootsBow(EntityShootBowEvent event) { - entity = new dEntity(event.getEntity()); + entity = new EntityTag(event.getEntity()); force = event.getForce() * 3; - bow = new dItem(event.getBow()); + bow = new ItemTag(event.getBow()); Entity projectileEntity = event.getProjectile(); - dEntity.rememberEntity(projectileEntity); - projectile = new dEntity(projectileEntity); + EntityTag.rememberEntity(projectileEntity); + projectile = new EntityTag(projectileEntity); this.event = event; fire(event); - dEntity.forgetEntity(projectileEntity); + EntityTag.forgetEntity(projectileEntity); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntitySpawnScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntitySpawnScriptEvent.java index 4f5074a12a..6305b00209 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntitySpawnScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntitySpawnScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dCuboid; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.CuboidTag; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; @@ -36,7 +36,7 @@ public class EntitySpawnScriptEvent extends BukkitScriptEvent implements Listene // @Triggers when an entity spawns. // // @Context - // returns the dEntity that spawned. + // returns the EntityTag that spawned. // returns the location the entity will spawn at. // returns the reason the entity spawned. // Reasons: <@link url https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/entity/CreatureSpawnEvent.SpawnReason.html> @@ -48,8 +48,8 @@ public EntitySpawnScriptEvent() { } public static EntitySpawnScriptEvent instance; - public dEntity entity; - public dLocation location; + public EntityTag entity; + public LocationTag location; public ElementTag reason; public CreatureSpawnEvent event; @@ -90,8 +90,8 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(entity.isPlayer() ? dEntity.getPlayerFrom(event.getEntity()) : null, - entity.isCitizensNPC() ? dEntity.getNPCFrom(event.getEntity()) : null); + return new BukkitScriptEntryData(entity.isPlayer() ? EntityTag.getPlayerFrom(event.getEntity()) : null, + entity.isCitizensNPC() ? EntityTag.getNPCFrom(event.getEntity()) : null); } @Override @@ -105,7 +105,7 @@ else if (name.equals("location")) { else if (name.equals("cuboids")) { Debug.echoError("context.cuboids tag is deprecated in " + getName() + " script event"); ListTag cuboids = new ListTag(); - for (dCuboid cuboid : dCuboid.getNotableCuboidsContaining(location)) { + for (CuboidTag cuboid : CuboidTag.getNotableCuboidsContaining(location)) { cuboids.add(cuboid.identifySimple()); } return cuboids; @@ -119,13 +119,13 @@ else if (name.equals("reason")) { @EventHandler public void onCreatureSpawn(CreatureSpawnEvent event) { Entity entity = event.getEntity(); - this.entity = new dEntity(entity); - location = new dLocation(event.getLocation()); + this.entity = new EntityTag(entity); + location = new LocationTag(event.getLocation()); reason = new ElementTag(event.getSpawnReason().name()); this.event = event; - dEntity.rememberEntity(entity); + EntityTag.rememberEntity(entity); fire(event); - dEntity.forgetEntity(entity); + EntityTag.forgetEntity(entity); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntitySpawnerSpawnScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntitySpawnerSpawnScriptEvent.java index b6a4c77e01..d488a68dc2 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntitySpawnerSpawnScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntitySpawnerSpawnScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -28,9 +28,9 @@ public class EntitySpawnerSpawnScriptEvent extends BukkitScriptEvent implements // @Triggers when an entity spawns from a monster spawner. // // @Context - // returns the dEntity that spawned. - // returns the dLocation the entity will spawn at. - // returns the dLocation of the monster spawner. + // returns the EntityTag that spawned. + // returns the LocationTag the entity will spawn at. + // returns the LocationTag of the monster spawner. // // --> @@ -39,9 +39,9 @@ public EntitySpawnerSpawnScriptEvent() { } public static EntitySpawnerSpawnScriptEvent instance; - private dEntity entity; - private dLocation location; - private dLocation spawnerLocation; + private EntityTag entity; + private LocationTag location; + private LocationTag spawnerLocation; public SpawnerSpawnEvent event; @Override @@ -71,8 +71,8 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(entity.isPlayer() ? dEntity.getPlayerFrom(event.getEntity()) : null, - entity.isCitizensNPC() ? dEntity.getNPCFrom(event.getEntity()) : null); + return new BukkitScriptEntryData(entity.isPlayer() ? EntityTag.getPlayerFrom(event.getEntity()) : null, + entity.isCitizensNPC() ? EntityTag.getNPCFrom(event.getEntity()) : null); } @Override @@ -92,12 +92,12 @@ else if (name.equals("spawner_location")) { @EventHandler public void onSpawnerSpawn(SpawnerSpawnEvent event) { Entity entity = event.getEntity(); - this.entity = new dEntity(entity); - location = new dLocation(event.getLocation()); - spawnerLocation = new dLocation(event.getSpawner().getLocation()); + this.entity = new EntityTag(entity); + location = new LocationTag(event.getLocation()); + spawnerLocation = new LocationTag(event.getSpawner().getLocation()); this.event = event; - dEntity.rememberEntity(entity); + EntityTag.rememberEntity(entity); fire(event); - dEntity.forgetEntity(entity); + EntityTag.forgetEntity(entity); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntitySwimScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntitySwimScriptEvent.java index 4a02db0ff3..23659747fe 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntitySwimScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntitySwimScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -28,7 +28,7 @@ public class EntitySwimScriptEvent extends BukkitScriptEvent implements Listener // @Triggers when an entity starts or stops swimming. // // @Context - // returns the dEntity of this event. + // returns the EntityTag of this event. // returns an Element(Boolean) with a value of "true" if the entity is now swimming and "false" otherwise. // // @Player when the entity is a player. @@ -42,7 +42,7 @@ public EntitySwimScriptEvent() { } public static EntitySwimScriptEvent instance; - public dEntity entity; + public EntityTag entity; public Boolean state; @Override @@ -101,7 +101,7 @@ else if (name.equals("state")) { @EventHandler public void onEntityToggleSwim(EntityToggleSwimEvent event) { - entity = new dEntity(event.getEntity()); + entity = new EntityTag(event.getEntity()); state = event.isSwimming(); fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityTamesScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityTamesScriptEvent.java index 6296aff74c..0576c2ad1c 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityTamesScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityTamesScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -29,8 +29,8 @@ public class EntityTamesScriptEvent extends BukkitScriptEvent implements Listene // @Triggers when an entity is tamed. // // @Context - // returns a dEntity of the tamed entity. - // returns a dEntity of the owner. + // returns a EntityTag of the tamed entity. + // returns a EntityTag of the owner. // // @Player when a player tames an entity and using the 'players tames entity' event. // @@ -41,8 +41,8 @@ public EntityTamesScriptEvent() { } public static EntityTamesScriptEvent instance; - public dEntity entity; - public dEntity owner; + public EntityTag entity; + public EntityTag owner; public EntityTameEvent event; @@ -99,8 +99,8 @@ else if (name.equals("owner")) { @EventHandler public void onEntityTames(EntityTameEvent event) { - entity = new dEntity(event.getEntity()); - owner = new dEntity((Entity) event.getOwner()); + entity = new EntityTag(event.getEntity()); + owner = new EntityTag((Entity) event.getOwner()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityTargetsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityTargetsScriptEvent.java index ba2b069829..05d08be5f4 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityTargetsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityTargetsScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dCuboid; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.CuboidTag; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; @@ -36,7 +36,7 @@ public class EntityTargetsScriptEvent extends BukkitScriptEvent implements Liste // returns the targeted entity. // // @Determine - // dEntity to make the entity target a different entity instead. + // EntityTag to make the entity target a different entity instead. // // @Player when the entity being targetted is a player. // @@ -47,10 +47,10 @@ public EntityTargetsScriptEvent() { } public static EntityTargetsScriptEvent instance; - public dEntity entity; + public EntityTag entity; public ElementTag reason; - public dEntity target; - private dLocation location; + public EntityTag target; + private LocationTag location; public EntityTargetEvent event; @Override @@ -89,16 +89,16 @@ public String getName() { @Override public boolean applyDetermination(ScriptContainer container, String determination) { - if (dEntity.matches(determination)) { - target = dEntity.valueOf(determination); + if (EntityTag.matches(determination)) { + target = EntityTag.valueOf(determination); } return super.applyDetermination(container, determination); } @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(entity.isPlayer() ? dEntity.getPlayerFrom(event.getEntity()) : null, - entity.isCitizensNPC() ? dEntity.getNPCFrom(event.getEntity()) : null); + return new BukkitScriptEntryData(entity.isPlayer() ? EntityTag.getPlayerFrom(event.getEntity()) : null, + entity.isCitizensNPC() ? EntityTag.getNPCFrom(event.getEntity()) : null); } @Override @@ -112,7 +112,7 @@ else if (name.equals("reason")) { else if (name.equals("cuboids")) { Debug.echoError("context.cuboids tag is deprecated in " + getName() + " script event"); ListTag cuboids = new ListTag(); - for (dCuboid cuboid : dCuboid.getNotableCuboidsContaining(location)) { + for (CuboidTag cuboid : CuboidTag.getNotableCuboidsContaining(location)) { cuboids.add(cuboid.identifySimple()); } return cuboids; @@ -125,10 +125,10 @@ else if (name.equals("target") && target != null) { @EventHandler public void onEntityTargets(EntityTargetEvent event) { - entity = new dEntity(event.getEntity()); + entity = new EntityTag(event.getEntity()); reason = new ElementTag(event.getReason().toString()); - target = event.getTarget() != null ? new dEntity(event.getTarget()) : null; - location = new dLocation(event.getEntity().getLocation()); + target = event.getTarget() != null ? new EntityTag(event.getTarget()) : null; + location = new LocationTag(event.getEntity().getLocation()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityTeleportScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityTeleportScriptEvent.java index 010136f460..761684cfa4 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityTeleportScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityTeleportScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -32,15 +32,15 @@ public class EntityTeleportScriptEvent extends BukkitScriptEvent implements List // @Cancellable true // // @Context - // returns the dEntity. - // returns the dLocation the entity teleported from. - // returns the dLocation the entity teleported to. + // returns the EntityTag. + // returns the LocationTag the entity teleported from. + // returns the LocationTag the entity teleported to. // returns an ElementTag of the teleport cause. Can be: // COMMAND, END_PORTAL, ENDER_PEARL, NETHER_PORTAL, PLUGIN, END_GATEWAY, CHORUS_FRUIT, SPECTATE, UNKNOWN, or ENTITY_TELEPORT // // @Determine - // "ORIGIN:" + dLocation to change the location the entity teleported from. - // "DESTINATION:" + dLocation to change the location the entity teleports to. + // "ORIGIN:" + LocationTag to change the location the entity teleported from. + // "DESTINATION:" + LocationTag to change the location the entity teleports to. // // @Player when the entity being teleported is a player. // @@ -53,9 +53,9 @@ public EntityTeleportScriptEvent() { } public static EntityTeleportScriptEvent instance; - public dEntity entity; - public dLocation from; - public dLocation to; + public EntityTag entity; + public LocationTag from; + public LocationTag to; public String cause; public EntityTeleportEvent event; public PlayerTeleportEvent pEvent; @@ -93,21 +93,21 @@ public String getName() { public boolean applyDetermination(ScriptContainer container, String determination) { String dlow = CoreUtilities.toLowerCase(determination); if (dlow.startsWith("origin:")) { - dLocation new_from = dLocation.valueOf(determination.substring("origin:".length())); + LocationTag new_from = LocationTag.valueOf(determination.substring("origin:".length())); if (new_from != null) { from = new_from; return true; } } else if (dlow.startsWith("destination:")) { - dLocation new_to = dLocation.valueOf(determination.substring("destination:".length())); + LocationTag new_to = LocationTag.valueOf(determination.substring("destination:".length())); if (new_to != null) { to = new_to; return true; } } - else if (dLocation.matches(determination)) { - dLocation new_to = dLocation.valueOf(determination); + else if (LocationTag.matches(determination)) { + LocationTag new_to = LocationTag.valueOf(determination); if (new_to != null) { to = new_to; return true; @@ -119,7 +119,7 @@ else if (dLocation.matches(determination)) { @Override public ScriptEntryData getScriptEntryData() { // TODO: Store the player / npc? - return new BukkitScriptEntryData(pEvent != null ? dEntity.getPlayerFrom(pEvent.getPlayer()) : null, + return new BukkitScriptEntryData(pEvent != null ? EntityTag.getPlayerFrom(pEvent.getPlayer()) : null, entity.isCitizensNPC() ? entity.getDenizenNPC() : null); } @@ -145,9 +145,9 @@ public void onEntityTeleports(EntityTeleportEvent event) { if (event.getEntity() instanceof Player) { return; } - to = new dLocation(event.getTo()); - from = new dLocation(event.getFrom()); - entity = new dEntity(event.getEntity()); + to = new LocationTag(event.getTo()); + from = new LocationTag(event.getFrom()); + entity = new EntityTag(event.getEntity()); cause = "ENTITY_TELEPORT"; this.event = event; pEvent = null; @@ -158,9 +158,9 @@ public void onEntityTeleports(EntityTeleportEvent event) { @EventHandler public void onPlayerTeleports(PlayerTeleportEvent event) { - from = new dLocation(event.getFrom()); - to = new dLocation(event.getTo()); - entity = new dEntity(event.getPlayer()); + from = new LocationTag(event.getFrom()); + to = new LocationTag(event.getTo()); + entity = new EntityTag(event.getPlayer()); cause = event.getCause().name(); this.event = null; pEvent = event; diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityUnleashedScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityUnleashedScriptEvent.java index 1f9dc8f769..ea04c0f2b9 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityUnleashedScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityUnleashedScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.ObjectTag; @@ -25,7 +25,7 @@ public class EntityUnleashedScriptEvent extends BukkitScriptEvent implements Lis // @Triggers when an entity is unleashed. // // @Context - // returns the dEntity. + // returns the EntityTag. // returns an ElementTag of the reason for the unleashing. // Reasons include DISTANCE, HOLDER_GONE, PLAYER_UNLEASH, and UNKNOWN // @@ -38,7 +38,7 @@ public EntityUnleashedScriptEvent() { } public static EntityUnleashedScriptEvent instance; - public dEntity entity; + public EntityTag entity; public ElementTag reason; public EntityUnleashEvent event; @@ -90,7 +90,7 @@ else if (name.equals("reason")) { @EventHandler public void onEntityUnleashed(EntityUnleashEvent event) { - entity = new dEntity(event.getEntity()); + entity = new EntityTag(event.getEntity()); reason = new ElementTag(event.getReason().toString()); this.event = event; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/FireworkBurstsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/FireworkBurstsScriptEvent.java index 391cdd06e0..2c2401b1af 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/FireworkBurstsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/FireworkBurstsScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.utilities.MaterialCompat; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -29,7 +29,7 @@ public class FireworkBurstsScriptEvent extends BukkitScriptEvent implements List // @Context // returns the firework that exploded. // returns the firework item. - // returns the dLocation the firework exploded at. + // returns the LocationTag the firework exploded at. // // --> @@ -39,8 +39,8 @@ public FireworkBurstsScriptEvent() { public static FireworkBurstsScriptEvent instance; public FireworkExplodeEvent event; - public dEntity entity; - public dLocation location; + public EntityTag entity; + public LocationTag location; @Override public boolean couldMatch(ScriptContainer scriptContainer, String s) { @@ -76,15 +76,15 @@ else if (name.equals("location")) { else if (name.equals("item")) { ItemStack itemStack = new ItemStack(MaterialCompat.FIREWORK_ROCKET); itemStack.setItemMeta(event.getEntity().getFireworkMeta()); - return new dItem(itemStack); + return new ItemTag(itemStack); } return super.getContext(name); } @EventHandler public void onFireworkBursts(FireworkExplodeEvent event) { - entity = new dEntity(event.getEntity()); - location = new dLocation(entity.getLocation()); + entity = new EntityTag(event.getEntity()); + location = new LocationTag(entity.getLocation()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/HangingBreaksScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/HangingBreaksScriptEvent.java index aa66caf4db..8c88298a58 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/HangingBreaksScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/HangingBreaksScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dCuboid; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.CuboidTag; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; @@ -33,8 +33,8 @@ public class HangingBreaksScriptEvent extends BukkitScriptEvent implements Liste // // @Context // returns the cause of the entity breaking. Causes: ENTITY, EXPLOSION, OBSTRUCTION, PHYSICS, and DEFAULT. - // returns the dEntity that broke the hanging entity, if any. - // returns the dEntity of the hanging. + // returns the EntityTag that broke the hanging entity, if any. + // returns the EntityTag of the hanging. // --> public HangingBreaksScriptEvent() { @@ -43,9 +43,9 @@ public HangingBreaksScriptEvent() { public static HangingBreaksScriptEvent instance; public ElementTag cause; - public dEntity entity; - public dEntity hanging; - public dLocation location; + public EntityTag entity; + public EntityTag hanging; + public LocationTag location; public HangingBreakEvent event; @Override @@ -87,8 +87,8 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(entity != null && entity.isPlayer() ? dEntity.getPlayerFrom(event.getEntity()) : null, - entity != null && entity.isCitizensNPC() ? dEntity.getNPCFrom(event.getEntity()) : null); + return new BukkitScriptEntryData(entity != null && entity.isPlayer() ? EntityTag.getPlayerFrom(event.getEntity()) : null, + entity != null && entity.isCitizensNPC() ? EntityTag.getNPCFrom(event.getEntity()) : null); } @Override @@ -105,7 +105,7 @@ else if (name.equals("hanging")) { else if (name.equals("cuboids")) { Debug.echoError("context.cuboids tag is deprecated in " + getName() + " script event"); ListTag cuboids = new ListTag(); - for (dCuboid cuboid : dCuboid.getNotableCuboidsContaining(location)) { + for (CuboidTag cuboid : CuboidTag.getNotableCuboidsContaining(location)) { cuboids.add(cuboid.identifySimple()); } return cuboids; @@ -118,11 +118,11 @@ else if (name.equals("location")) { // NOTE: Deprecated @EventHandler public void onHangingBreaks(HangingBreakEvent event) { - hanging = new dEntity(event.getEntity()); + hanging = new EntityTag(event.getEntity()); cause = new ElementTag(event.getCause().name()); - location = new dLocation(hanging.getLocation()); + location = new LocationTag(hanging.getLocation()); if (event instanceof HangingBreakByEntityEvent) { - entity = new dEntity(((HangingBreakByEntityEvent) event).getRemover()); + entity = new EntityTag(((HangingBreakByEntityEvent) event).getRemover()); } else { entity = null; diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/HorseJumpsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/HorseJumpsScriptEvent.java index ffa048795e..ad455c25de 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/HorseJumpsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/HorseJumpsScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.ArgumentHelper; @@ -27,7 +27,7 @@ public class HorseJumpsScriptEvent extends BukkitScriptEvent implements Listener // @Triggers when a horse jumps. // // @Context - // returns the dEntity of the horse. + // returns the EntityTag of the horse. // returns an ElementTag of the horse's color. // returns an ElementTag of the horse's variant. // returns an Element(Decimal) of the jump's power. @@ -42,7 +42,7 @@ public HorseJumpsScriptEvent() { } public static HorseJumpsScriptEvent instance; - public dEntity entity; + public EntityTag entity; public ElementTag color; public ElementTag variant; public Float power; @@ -110,7 +110,7 @@ else if (name.equals("power")) { @EventHandler public void onHorseJumps(HorseJumpEvent event) { if (event.getEntity() instanceof Horse) { - entity = new dEntity(event.getEntity()); + entity = new EntityTag(event.getEntity()); color = new ElementTag(((Horse) event.getEntity()).getColor().name()); variant = new ElementTag(event.getEntity().getVariant().name()); power = event.getPower(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/ItemDespawnsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/ItemDespawnsScriptEvent.java index d07f4ad50f..86dbed7562 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/ItemDespawnsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/ItemDespawnsScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -28,8 +28,8 @@ public class ItemDespawnsScriptEvent extends BukkitScriptEvent implements Listen // @Triggers when an item entity despawns. // // @Context - // returns the dItem of the entity. - // returns the dEntity. + // returns the ItemTag of the entity. + // returns the EntityTag. // returns the location of the entity to be despawned. // // --> @@ -39,9 +39,9 @@ public ItemDespawnsScriptEvent() { } public static ItemDespawnsScriptEvent instance; - public dItem item; - public dLocation location; - public dEntity entity; + public ItemTag item; + public LocationTag location; + public EntityTag entity; public ItemDespawnEvent event; @Override @@ -92,9 +92,9 @@ else if (name.equals("entity")) { @EventHandler public void onItemDespawns(ItemDespawnEvent event) { - location = new dLocation(event.getLocation()); - item = new dItem(event.getEntity().getItemStack()); - entity = new dEntity(event.getEntity()); + location = new LocationTag(event.getLocation()); + item = new ItemTag(event.getEntity().getItemStack()); + entity = new EntityTag(event.getEntity()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/ItemEnchantedScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/ItemEnchantedScriptEvent.java index 3e217f22eb..bb97f7167c 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/ItemEnchantedScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/ItemEnchantedScriptEvent.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dInventory; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.InventoryTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -33,17 +33,17 @@ public class ItemEnchantedScriptEvent extends BukkitScriptEvent implements Liste // @Triggers when an item is enchanted. // // @Context - // returns the dEntity of the enchanter (if applicable) - // returns the dLocation of the enchanting table. - // returns the dInventory of the enchanting table. - // returns the dItem to be enchanted. + // returns the EntityTag of the enchanter (if applicable) + // returns the LocationTag of the enchanting table. + // returns the InventoryTag of the enchanting table. + // returns the ItemTag to be enchanted. // returns which button was pressed to initiate the enchanting. // returns the experience level cost of the enchantment. // // @Determine // Element(Number) to set the experience level cost of the enchantment. - // "RESULT:" + dItem to change the item result (only affects metadata (like enchantments), not material/quantity/etc!). - // "ENCHANTS:" + dItem to change the resultant enchantments based on a dItem. + // "RESULT:" + ItemTag to change the item result (only affects metadata (like enchantments), not material/quantity/etc!). + // "ENCHANTS:" + ItemTag to change the resultant enchantments based on a ItemTag. // --> public ItemEnchantedScriptEvent() { @@ -51,15 +51,15 @@ public ItemEnchantedScriptEvent() { } public static ItemEnchantedScriptEvent instance; - public dEntity entity; - public dLocation location; - public dInventory inventory; - public dItem item; + public EntityTag entity; + public LocationTag location; + public InventoryTag inventory; + public ItemTag item; public ElementTag button; public int cost; public EnchantItemEvent event; public boolean itemEdited; - public dItem enchantsRes; + public ItemTag enchantsRes; @Override public boolean couldMatch(ScriptContainer scriptContainer, String s) { @@ -96,13 +96,13 @@ public boolean applyDetermination(ScriptContainer container, String determinatio } else if (CoreUtilities.toLowerCase(determination).startsWith("result:")) { String ditem = determination.substring("result:".length()); - item = dItem.valueOf(ditem, container); + item = ItemTag.valueOf(ditem, container); itemEdited = true; return true; } else if (CoreUtilities.toLowerCase(determination).startsWith("enchants:")) { String ditem = determination.substring("enchants:".length()); - enchantsRes = dItem.valueOf(ditem, container); + enchantsRes = ItemTag.valueOf(ditem, container); return true; } else { @@ -141,10 +141,10 @@ else if (name.equals("cost")) { @EventHandler public void onItemEnchanted(EnchantItemEvent event) { - entity = new dEntity(event.getEnchanter()); - location = new dLocation(event.getEnchantBlock().getLocation()); - inventory = dInventory.mirrorBukkitInventory(event.getInventory()); - item = new dItem(event.getItem()); + entity = new EntityTag(event.getEnchanter()); + location = new LocationTag(event.getEnchantBlock().getLocation()); + inventory = InventoryTag.mirrorBukkitInventory(event.getInventory()); + item = new ItemTag(event.getItem()); button = new ElementTag(event.whichButton()); cost = event.getExpLevelCost(); itemEdited = false; diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/ItemMergesScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/ItemMergesScriptEvent.java index 19fa8179ae..138f151a75 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/ItemMergesScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/ItemMergesScriptEvent.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -29,9 +29,9 @@ public class ItemMergesScriptEvent extends BukkitScriptEvent implements Listener // @Triggers when an item entity merges into another item entity. // // @Context - // returns the dItem of the entity. - // returns the dEntity. - // returns the dEntity being merged into. + // returns the ItemTag of the entity. + // returns the EntityTag. + // returns the EntityTag being merged into. // returns the location of the entity to be spawned. // // --> @@ -41,9 +41,9 @@ public ItemMergesScriptEvent() { } public static ItemMergesScriptEvent instance; - public dItem item; - public dLocation location; - public dEntity entity; + public ItemTag item; + public LocationTag location; + public EntityTag entity; public ItemMergeEvent event; @Override @@ -52,7 +52,7 @@ public boolean couldMatch(ScriptContainer scriptContainer, String s) { String cmd = CoreUtilities.getXthArg(1, lower); String entTest = CoreUtilities.getXthArg(0, lower); return cmd.equals("merges") - && (entTest.equals("item") || dMaterial.matches(entTest) || dItem.matches(entTest)); + && (entTest.equals("item") || MaterialTag.matches(entTest) || ItemTag.matches(entTest)); } @Override @@ -92,7 +92,7 @@ else if (name.equals("entity")) { return entity; } else if (name.equals("target")) { - return new dEntity(event.getTarget()); + return new EntityTag(event.getTarget()); } return super.getContext(name); } @@ -101,9 +101,9 @@ else if (name.equals("target")) { public void onItemMerges(ItemMergeEvent event) { Item entity = event.getEntity(); Item target = event.getTarget(); - location = new dLocation(target.getLocation()); - item = new dItem(entity.getItemStack()); - this.entity = new dEntity(entity); + location = new LocationTag(target.getLocation()); + item = new ItemTag(entity.getItemStack()); + this.entity = new EntityTag(entity); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/ItemSpawnsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/ItemSpawnsScriptEvent.java index feac58dfae..4d86d00c7b 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/ItemSpawnsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/ItemSpawnsScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -28,8 +28,8 @@ public class ItemSpawnsScriptEvent extends BukkitScriptEvent implements Listener // @Triggers when an item entity spawns. // // @Context - // returns the dItem of the entity. - // returns the dEntity. + // returns the ItemTag of the entity. + // returns the EntityTag. // returns the location of the entity to be spawned. // // --> @@ -39,9 +39,9 @@ public ItemSpawnsScriptEvent() { } public static ItemSpawnsScriptEvent instance; - public dItem item; - public dLocation location; - public dEntity entity; + public ItemTag item; + public LocationTag location; + public EntityTag entity; public ItemSpawnEvent event; // TODO: De-collide with 'entity spawns' @@ -98,12 +98,12 @@ else if (name.equals("entity")) { @EventHandler public void onItemSpawns(ItemSpawnEvent event) { Item entity = event.getEntity(); - location = new dLocation(event.getLocation()); - item = new dItem(entity.getItemStack()); - this.entity = new dEntity(entity); + location = new LocationTag(event.getLocation()); + item = new ItemTag(entity.getItemStack()); + this.entity = new EntityTag(entity); this.event = event; - dEntity.rememberEntity(entity); + EntityTag.rememberEntity(entity); fire(event); - dEntity.forgetEntity(entity); + EntityTag.forgetEntity(entity); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/NPCSpawnScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/NPCSpawnScriptEvent.java index 88040fe48e..ea8bc65359 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/NPCSpawnScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/NPCSpawnScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dNPC; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.NPCTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -35,8 +35,8 @@ public NPCSpawnScriptEvent() { } public static NPCSpawnScriptEvent instance; - public dNPC npc; - public dLocation location; + public NPCTag npc; + public LocationTag location; public NPCSpawnEvent event; @Override @@ -79,8 +79,8 @@ public ObjectTag getContext(String name) { @EventHandler public void onNPCSpawn(NPCSpawnEvent event) { - this.npc = new dNPC(event.getNPC()); - location = new dLocation(event.getLocation()); + this.npc = new NPCTag(event.getNPC()); + location = new LocationTag(event.getLocation()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/PigZappedScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/PigZappedScriptEvent.java index b56e1c1c0d..62f032cb40 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/PigZappedScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/PigZappedScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -24,9 +24,9 @@ public class PigZappedScriptEvent extends BukkitScriptEvent implements Listener // @Triggers when a pig is zapped by lightning and turned into a pig zombie. // // @Context - // returns the dEntity of the pig. - // returns the dEntity of the pig zombie. - // returns the dEntity of the lightning. + // returns the EntityTag of the pig. + // returns the EntityTag of the pig zombie. + // returns the EntityTag of the lightning. // // --> @@ -35,9 +35,9 @@ public PigZappedScriptEvent() { } public static PigZappedScriptEvent instance; - public dEntity pig; - public dEntity pig_zombie; - private dEntity lightning; + public EntityTag pig; + public EntityTag pig_zombie; + private EntityTag lightning; public PigZapEvent event; @Override @@ -80,13 +80,13 @@ else if (name.equals("lightning")) { @EventHandler public void onPigZapped(PigZapEvent event) { - pig = new dEntity(event.getEntity()); + pig = new EntityTag(event.getEntity()); Entity pigZombie = event.getPigZombie(); - dEntity.rememberEntity(pigZombie); - pig_zombie = new dEntity(pigZombie); - lightning = new dEntity(event.getLightning()); + EntityTag.rememberEntity(pigZombie); + pig_zombie = new EntityTag(pigZombie); + lightning = new EntityTag(event.getLightning()); this.event = event; fire(event); - dEntity.forgetEntity(pigZombie); + EntityTag.forgetEntity(pigZombie); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/ProjectileHitsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/ProjectileHitsScriptEvent.java index d02430f460..390ce34490 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/ProjectileHitsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/ProjectileHitsScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -29,9 +29,9 @@ public class ProjectileHitsScriptEvent extends BukkitScriptEvent implements List // @Triggers when a projectile hits a block. // // @Context - // returns the dEntity of the projectile. - // returns the dEntity of the shooter, if there is one. - // returns the dLocation of the block that was hit. + // returns the EntityTag of the projectile. + // returns the EntityTag of the shooter, if there is one. + // returns the LocationTag of the block that was hit. // // --> @@ -48,9 +48,9 @@ public class ProjectileHitsScriptEvent extends BukkitScriptEvent implements List // @Triggers when a projectile shot by an entity hits a block. // // @Context - // returns the dEntity of the projectile. - // returns the dEntity of the shooter, if there is one. - // returns the dLocation of the block that was hit. + // returns the EntityTag of the projectile. + // returns the EntityTag of the shooter, if there is one. + // returns the LocationTag of the block that was hit. // // --> public ProjectileHitsScriptEvent() { @@ -58,10 +58,10 @@ public ProjectileHitsScriptEvent() { } public static ProjectileHitsScriptEvent instance; - public dEntity projectile; - public dEntity shooter; - public dLocation location; - private dMaterial material; + public EntityTag projectile; + public EntityTag shooter; + public LocationTag location; + private MaterialTag material; public ProjectileHitEvent event; @Override @@ -110,8 +110,8 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(shooter != null && shooter.isPlayer() ? dEntity.getPlayerFrom(event.getEntity()) : null, - shooter != null && shooter.isCitizensNPC() ? dEntity.getNPCFrom(event.getEntity()) : null); + return new BukkitScriptEntryData(shooter != null && shooter.isPlayer() ? EntityTag.getPlayerFrom(event.getEntity()) : null, + shooter != null && shooter.isCitizensNPC() ? EntityTag.getNPCFrom(event.getEntity()) : null); } @Override @@ -130,7 +130,7 @@ else if (name.equals("shooter") && shooter != null) { @EventHandler public void onProjectileHits(ProjectileHitEvent event) { - projectile = new dEntity(event.getEntity()); + projectile = new EntityTag(event.getEntity()); if (projectile.getLocation() == null) { return; // No, I can't explain how or why this would ever happen... nonetheless, it appears it does happen sometimes. } @@ -144,9 +144,9 @@ public void onProjectileHits(ProjectileHitEvent event) { if (block == null) { return; } - material = new dMaterial(block); + material = new MaterialTag(block); shooter = projectile.getShooter(); - location = new dLocation(block.getLocation()); + location = new LocationTag(block.getLocation()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/ProjectileLaunchedScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/ProjectileLaunchedScriptEvent.java index e8985e6805..ca6fa91645 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/ProjectileLaunchedScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/ProjectileLaunchedScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -35,8 +35,8 @@ public ProjectileLaunchedScriptEvent() { } public static ProjectileLaunchedScriptEvent instance; - public dEntity projectile; - private dLocation location; + public EntityTag projectile; + private LocationTag location; public ProjectileLaunchEvent event; @Override @@ -82,11 +82,11 @@ public ObjectTag getContext(String name) { @EventHandler public void onProjectileLaunched(ProjectileLaunchEvent event) { Entity projectile = event.getEntity(); - dEntity.rememberEntity(projectile); - this.projectile = new dEntity(projectile); - location = new dLocation(event.getEntity().getLocation()); + EntityTag.rememberEntity(projectile); + this.projectile = new EntityTag(projectile); + location = new LocationTag(event.getEntity().getLocation()); this.event = event; fire(event); - dEntity.forgetEntity(projectile); + EntityTag.forgetEntity(projectile); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/SheepDyedScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/SheepDyedScriptEvent.java index 503c31000e..cdf2ca4dc0 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/SheepDyedScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/SheepDyedScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -30,7 +30,7 @@ public class SheepDyedScriptEvent extends BukkitScriptEvent implements Listener // @Triggers when a sheep is dyed by a player. // // @Context - // returns the dEntity of the sheep. + // returns the EntityTag of the sheep. // returns an ElementTag of the color the sheep is being dyed. // // @Determine @@ -45,7 +45,7 @@ public SheepDyedScriptEvent() { } public static SheepDyedScriptEvent instance; - public dEntity entity; + public EntityTag entity; public DyeColor color; public SheepDyeWoolEvent event; @@ -107,7 +107,7 @@ else if (name.equals("entity")) { @EventHandler public void onSheepDyed(SheepDyeWoolEvent event) { - entity = new dEntity(event.getEntity()); + entity = new EntityTag(event.getEntity()); color = DyeColor.valueOf(event.getColor().toString()); this.event = event; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/SheepRegrowsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/SheepRegrowsScriptEvent.java index 199ff6480d..2f146363fa 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/SheepRegrowsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/SheepRegrowsScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -24,7 +24,7 @@ public class SheepRegrowsScriptEvent extends BukkitScriptEvent implements Listen // @Triggers when a sheep regrows wool. // // @Context - // returns the dEntity of the sheep. + // returns the EntityTag of the sheep. // // --> @@ -33,8 +33,8 @@ public SheepRegrowsScriptEvent() { } public static SheepRegrowsScriptEvent instance; - public dEntity entity; - private dLocation location; + public EntityTag entity; + private LocationTag location; public SheepRegrowWoolEvent event; @Override @@ -73,8 +73,8 @@ public ObjectTag getContext(String name) { @EventHandler public void onSheepRegrows(SheepRegrowWoolEvent event) { - entity = new dEntity(event.getEntity()); - location = new dLocation(entity.getLocation()); + entity = new EntityTag(event.getEntity()); + location = new LocationTag(entity.getLocation()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/SlimeSplitsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/SlimeSplitsScriptEvent.java index 1478da353a..6dc08f780b 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/SlimeSplitsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/SlimeSplitsScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.ArgumentHelper; @@ -25,7 +25,7 @@ public class SlimeSplitsScriptEvent extends BukkitScriptEvent implements Listene // @Triggers when a slime splits into smaller slimes. // // @Context - // returns the dEntity of the slime. + // returns the EntityTag of the slime. // returns an Element(Number) of the number of smaller slimes it will split into. // // @Determine @@ -38,7 +38,7 @@ public SlimeSplitsScriptEvent() { } public static SlimeSplitsScriptEvent instance; - public dEntity entity; + public EntityTag entity; public int count; public SlimeSplitEvent event; @@ -98,7 +98,7 @@ else if (name.equals("count")) { @EventHandler public void onSlimeSplits(SlimeSplitEvent event) { - entity = new dEntity(event.getEntity()); + entity = new EntityTag(event.getEntity()); count = event.getCount(); this.event = event; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/VehicleCollidesBlockScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/VehicleCollidesBlockScriptEvent.java index a3a7f443e7..d80b74f74b 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/VehicleCollidesBlockScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/VehicleCollidesBlockScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -27,8 +27,8 @@ public class VehicleCollidesBlockScriptEvent extends BukkitScriptEvent implement // @Triggers when a vehicle collides with a block. // // @Context - // returns the dEntity of the vehicle. - // returns the dLocation of the block. + // returns the EntityTag of the vehicle. + // returns the LocationTag of the block. // // --> @@ -38,9 +38,9 @@ public VehicleCollidesBlockScriptEvent() { public static VehicleCollidesBlockScriptEvent instance; - public dEntity vehicle; - public dLocation location; - private dMaterial material; + public EntityTag vehicle; + public LocationTag location; + private MaterialTag material; public VehicleBlockCollisionEvent event; @Override @@ -90,9 +90,9 @@ else if (name.equals("location")) { @EventHandler public void onVehicleCollidesBlock(VehicleBlockCollisionEvent event) { - vehicle = new dEntity(event.getVehicle()); - location = new dLocation(event.getBlock().getLocation()); - material = new dMaterial(event.getBlock()); + vehicle = new EntityTag(event.getVehicle()); + location = new LocationTag(event.getBlock().getLocation()); + material = new MaterialTag(event.getBlock()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/VehicleCollidesEntityScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/VehicleCollidesEntityScriptEvent.java index 603c194338..15d7de48d2 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/VehicleCollidesEntityScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/VehicleCollidesEntityScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.Argument; @@ -30,8 +30,8 @@ public class VehicleCollidesEntityScriptEvent extends BukkitScriptEvent implemen // @Triggers when a vehicle collides with an entity. // // @Context - // returns the dEntity of the vehicle. - // returns the dEntity of the entity the vehicle has collided with. + // returns the EntityTag of the vehicle. + // returns the EntityTag of the entity the vehicle has collided with. // returns whether the vehicle can pick up the entity. // // @Determine @@ -50,8 +50,8 @@ public VehicleCollidesEntityScriptEvent() { public static VehicleCollidesEntityScriptEvent instance; - public dEntity vehicle; - public dEntity entity; + public EntityTag vehicle; + public EntityTag entity; private Boolean pickup_cancel; public VehicleEntityCollisionEvent event; @@ -115,8 +115,8 @@ else if (name.equals("pickup")) { @EventHandler public void onVehicleCollidesEntity(VehicleEntityCollisionEvent event) { - entity = new dEntity(event.getEntity()); - vehicle = new dEntity(event.getVehicle()); + entity = new EntityTag(event.getEntity()); + vehicle = new EntityTag(event.getVehicle()); pickup_cancel = event.isPickupCancelled(); this.event = event; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/VehicleCreatedScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/VehicleCreatedScriptEvent.java index b71a462672..67bd0a71a7 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/VehicleCreatedScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/VehicleCreatedScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -25,7 +25,7 @@ public class VehicleCreatedScriptEvent extends BukkitScriptEvent implements List // @Triggers when a vehicle is created. // // @Context - // returns the dEntity of the vehicle. + // returns the EntityTag of the vehicle. // // --> @@ -34,7 +34,7 @@ public VehicleCreatedScriptEvent() { } public static VehicleCreatedScriptEvent instance; - public dEntity vehicle; + public EntityTag vehicle; public VehicleCreateEvent event; @Override @@ -80,10 +80,10 @@ public ObjectTag getContext(String name) { @EventHandler public void onVehicleCreated(VehicleCreateEvent event) { Entity entity = event.getVehicle(); - dEntity.rememberEntity(entity); - vehicle = new dEntity(entity); + EntityTag.rememberEntity(entity); + vehicle = new EntityTag(entity); this.event = event; fire(event); - dEntity.forgetEntity(entity); + EntityTag.forgetEntity(entity); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/VehicleDamagedScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/VehicleDamagedScriptEvent.java index 9f564bf3f4..56b800c9e5 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/VehicleDamagedScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/VehicleDamagedScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ArgumentHelper; @@ -33,8 +33,8 @@ public class VehicleDamagedScriptEvent extends BukkitScriptEvent implements List // @Triggers when a vehicle is damaged. // // @Context - // returns the dEntity of the vehicle. - // returns the dEntity of the attacking entity. + // returns the EntityTag of the vehicle. + // returns the EntityTag of the attacking entity. // // @Determine // Element(Decimal) to set the value of the damage received by the vehicle. @@ -50,8 +50,8 @@ public VehicleDamagedScriptEvent() { } public static VehicleDamagedScriptEvent instance; - public dEntity vehicle; - public dEntity entity; + public EntityTag vehicle; + public EntityTag entity; private double damage; public VehicleDamageEvent event; @@ -127,8 +127,8 @@ else if (name.equals("entity") && entity != null) { @EventHandler public void onVehicleDestroyed(VehicleDamageEvent event) { - vehicle = new dEntity(event.getVehicle()); - entity = event.getAttacker() != null ? new dEntity(event.getAttacker()) : null; + vehicle = new EntityTag(event.getVehicle()); + entity = event.getAttacker() != null ? new EntityTag(event.getAttacker()) : null; damage = event.getDamage(); this.event = event; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/VehicleDestroyedScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/VehicleDestroyedScriptEvent.java index 7eaea0666c..94949640ad 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/VehicleDestroyedScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/VehicleDestroyedScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -30,8 +30,8 @@ public class VehicleDestroyedScriptEvent extends BukkitScriptEvent implements Li // @Triggers when a vehicle is destroyed. // // @Context - // returns the dEntity of the vehicle. - // returns the dEntity of the attacking entity. + // returns the EntityTag of the vehicle. + // returns the EntityTag of the attacking entity. // // @NPC when the entity that destroyed the vehicle is a player.. // @@ -44,8 +44,8 @@ public VehicleDestroyedScriptEvent() { } public static VehicleDestroyedScriptEvent instance; - public dEntity vehicle; - public dEntity entity; + public EntityTag vehicle; + public EntityTag entity; public VehicleDestroyEvent event; @Override @@ -108,8 +108,8 @@ else if (name.equals("entity") && entity != null) { @EventHandler public void onVehicleDestroyed(VehicleDestroyEvent event) { - vehicle = new dEntity(event.getVehicle()); - entity = event.getAttacker() != null ? new dEntity(event.getAttacker()) : null; + vehicle = new EntityTag(event.getVehicle()); + entity = event.getAttacker() != null ? new EntityTag(event.getAttacker()) : null; this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/VehicleMoveScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/VehicleMoveScriptEvent.java index 0035ff3eeb..05e6d6062c 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/VehicleMoveScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/VehicleMoveScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -25,7 +25,7 @@ public class VehicleMoveScriptEvent extends BukkitScriptEvent implements Listene // @Triggers when a vehicle moves in the slightest. // // @Context - // returns the dEntity of the vehicle. + // returns the EntityTag of the vehicle. // returns the location of where the vehicle was. // returns the location of where the vehicle is. // @@ -36,9 +36,9 @@ public VehicleMoveScriptEvent() { } public static VehicleMoveScriptEvent instance; - public dEntity vehicle; - public dLocation from; - public dLocation to; + public EntityTag vehicle; + public LocationTag from; + public LocationTag to; public VehicleMoveEvent event; @Override @@ -89,9 +89,9 @@ else if (name.equals("vehicle")) { @EventHandler public void onVehicleMove(VehicleMoveEvent event) { - to = new dLocation(event.getTo()); - from = new dLocation(event.getFrom()); - vehicle = new dEntity(event.getVehicle()); + to = new LocationTag(event.getTo()); + from = new LocationTag(event.getFrom()); + vehicle = new EntityTag(event.getVehicle()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/BiomeEnterExitScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/BiomeEnterExitScriptEvent.java index 33124304d4..f44c25f83a 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/BiomeEnterExitScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/BiomeEnterExitScriptEvent.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.ScriptEntryData; @@ -45,8 +45,8 @@ public BiomeEnterExitScriptEvent() { public static BiomeEnterExitScriptEvent instance; - public dLocation from; - public dLocation to; + public LocationTag from; + public LocationTag to; public ElementTag old_biome; public ElementTag new_biome; public PlayerMoveEvent event; @@ -81,7 +81,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { // TODO: Store the player / npc? - return new BukkitScriptEntryData(event != null ? dEntity.getPlayerFrom(event.getPlayer()) : null, null); + return new BukkitScriptEntryData(event != null ? EntityTag.getPlayerFrom(event.getPlayer()) : null, null); } @Override @@ -103,8 +103,8 @@ else if (name.equals("new_biome")) { @EventHandler public void onPlayerEntersExitsBiome(PlayerMoveEvent event) { - from = new dLocation(event.getFrom()); - to = new dLocation(event.getTo()); + from = new LocationTag(event.getFrom()); + to = new LocationTag(event.getTo()); old_biome = new ElementTag(from.getBlock().getBiome().name()); new_biome = new ElementTag(to.getBlock().getBiome().name()); if (old_biome.identify().equals(new_biome.identify())) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/ChatScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/ChatScriptEvent.java index 7dc336dd4a..e358d78f4b 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/ChatScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/ChatScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.scripts.containers.core.FormatScriptContainer; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.BukkitScriptEntryData; @@ -46,9 +46,9 @@ public class ChatScriptEvent extends BukkitScriptEvent implements Listener { // // @Determine // ElementTag to change the message. - // "FORMAT:" + dScript to set the format script the message should use. + // "FORMAT:" + ScriptTag to set the format script the message should use. // "RAW_FORMAT:" + ElementTag to set the format directly (without a format script). (Use with caution, avoid if possible). - // "RECIPIENTS:" + ListTag(dPlayer) to set the list of players that will receive the message. + // "RECIPIENTS:" + ListTag(PlayerTag) to set the list of players that will receive the message. // // --> @@ -62,7 +62,7 @@ public ChatScriptEvent() { public AsyncPlayerChatEvent apcEvent; public ElementTag message; public ElementTag format; - public dPlayer player; + public PlayerTag player; public Set recipients; public SyncChatHandler sch = new SyncChatHandler(); @@ -121,9 +121,9 @@ else if (lower.startsWith("raw_format:")) { else if (lower.startsWith("recipients:")) { String rec_new = determination.substring("recipients:".length()); ListTag recs = ListTag.valueOf(rec_new); - List players = recs.filter(dPlayer.class, container); + List players = recs.filter(PlayerTag.class, container); recipients.clear(); - for (dPlayer player : players) { + for (PlayerTag player : players) { recipients.add(player.getPlayerEntity()); } } @@ -152,7 +152,7 @@ else if (name.equals("format")) { if (name.equals("recipients")) { ListTag list = new ListTag(); for (Player tplayer : recipients) { - list.add(dPlayer.mirrorBukkitPlayer(tplayer).identify()); + list.add(PlayerTag.mirrorBukkitPlayer(tplayer).identify()); } return list; } @@ -167,7 +167,7 @@ public void onSyncChat(PlayerChatEvent event) { recipients = new HashSet<>(event.getRecipients()); pcEvent = event; apcEvent = null; - player = dEntity.getPlayerFrom(event.getPlayer()); + player = EntityTag.getPlayerFrom(event.getPlayer()); fire(event); event.setMessage(message.asString()); event.setFormat(format.asString()); @@ -184,7 +184,7 @@ public void onAsyncChat(AsyncPlayerChatEvent event) { recipients = new HashSet<>(event.getRecipients()); pcEvent = null; apcEvent = event; - player = dEntity.getPlayerFrom(event.getPlayer()); + player = EntityTag.getPlayerFrom(event.getPlayer()); fire(event); event.setMessage(message.asString()); event.setFormat(format.asString()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/ItemRecipeFormedScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/ItemRecipeFormedScriptEvent.java index ea48e387d2..51f9fad0c4 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/ItemRecipeFormedScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/ItemRecipeFormedScriptEvent.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dInventory; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.InventoryTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ListTag; @@ -32,12 +32,12 @@ // // @Triggers when an item's recipe is correctly formed. // @Context -// returns the dInventory of the crafting inventory. -// returns the dItem to be formed in the result slot. -// returns a ListTag of dItems in the recipe. +// returns the InventoryTag of the crafting inventory. +// returns the ItemTag to be formed in the result slot. +// returns a ListTag of ItemTags in the recipe. // // @Determine -// dItem to change the item that is formed in the result slot. +// ItemTag to change the item that is formed in the result slot. // // --> @@ -50,10 +50,10 @@ public ItemRecipeFormedScriptEvent() { public static ItemRecipeFormedScriptEvent instance; public boolean resultChanged; - public dItem result; + public ItemTag result; public ListTag recipe; public CraftingInventory inventory; - public dPlayer player; + public PlayerTag player; @Override public boolean couldMatch(ScriptContainer scriptContainer, String s) { @@ -80,8 +80,8 @@ public String getName() { @Override public boolean applyDetermination(ScriptContainer container, String determination) { - if (dItem.matches(determination)) { - result = dItem.valueOf(determination, container); + if (ItemTag.matches(determination)) { + result = ItemTag.valueOf(determination, container); resultChanged = true; return true; } @@ -101,7 +101,7 @@ public ObjectTag getContext(String name) { return result; } else if (name.equals("inventory")) { - return dInventory.mirrorBukkitInventory(inventory); + return InventoryTag.mirrorBukkitInventory(inventory); } else if (name.equals("recipe")) { return recipe; @@ -112,7 +112,7 @@ else if (name.equals("recipe")) { @EventHandler public void onRecipeFormed(PrepareItemCraftEvent event) { HumanEntity humanEntity = event.getView().getPlayer(); - if (dEntity.isNPC(humanEntity)) { + if (EntityTag.isNPC(humanEntity)) { return; } Recipe eRecipe = event.getRecipe(); @@ -120,17 +120,17 @@ public void onRecipeFormed(PrepareItemCraftEvent event) { return; } inventory = event.getInventory(); - result = new dItem(eRecipe.getResult()); + result = new ItemTag(eRecipe.getResult()); recipe = new ListTag(); for (ItemStack itemStack : inventory.getMatrix()) { if (itemStack != null && itemStack.getType() != Material.AIR) { - recipe.add(new dItem(itemStack).identify()); + recipe.add(new ItemTag(itemStack).identify()); } else { - recipe.add(new dItem(Material.AIR).identify()); + recipe.add(new ItemTag(Material.AIR).identify()); } } - player = dEntity.getPlayerFrom(humanEntity); + player = EntityTag.getPlayerFrom(humanEntity); resultChanged = false; cancelled = false; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/ItemScrollScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/ItemScrollScriptEvent.java index 0282cd5d40..4f7ff96728 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/ItemScrollScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/ItemScrollScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -67,7 +67,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(dPlayer.mirrorBukkitPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(PlayerTag.mirrorBukkitPlayer(event.getPlayer()), null); } @Override diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerAnimatesScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerAnimatesScriptEvent.java index d2ab7b105a..4a8ef9d681 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerAnimatesScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerAnimatesScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -38,7 +38,7 @@ public PlayerAnimatesScriptEvent() { public static PlayerAnimatesScriptEvent instance; public String animation; - private dLocation location; + private LocationTag location; public PlayerAnimationEvent event; @Override @@ -48,7 +48,7 @@ public boolean couldMatch(ScriptContainer scriptContainer, String s) { @Override public boolean matches(ScriptPath path) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return false; } @@ -72,7 +72,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(new dPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(new PlayerTag(event.getPlayer()), null); } @Override @@ -85,10 +85,10 @@ public ObjectTag getContext(String name) { @EventHandler public void onPlayerAnimates(PlayerAnimationEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - location = new dLocation(event.getPlayer().getLocation()); + location = new LocationTag(event.getPlayer().getLocation()); animation = event.getAnimationType().name(); this.event = event; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerBreaksBlockScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerBreaksBlockScriptEvent.java index 20da72213f..1e3c705594 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerBreaksBlockScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerBreaksBlockScriptEvent.java @@ -36,13 +36,13 @@ public class PlayerBreaksBlockScriptEvent extends BukkitScriptEvent implements L // @Triggers when a player breaks a block. // // @Context - // returns the dLocation the block was broken at. - // returns the dMaterial of the block that was broken. + // returns the LocationTag the block was broken at. + // returns the MaterialTag of the block that was broken. // returns how much XP will be dropped. // // @Determine // "NOTHING" to make the block drop no items. - // ListTag(dItem) to make the block drop a specified list of items. + // ListTag(ItemTag) to make the block drop a specified list of items. // Element(Number) to set the amount of xp to drop. // // --> @@ -52,8 +52,8 @@ public PlayerBreaksBlockScriptEvent() { } public static PlayerBreaksBlockScriptEvent instance; - public dLocation location; - public dMaterial material; + public LocationTag location; + public MaterialTag material; public ElementTag xp; public BlockBreakEvent event; @@ -71,12 +71,12 @@ public boolean matches(ScriptPath path) { if (!runInCheck(path, location)) { return false; } - if (!runWithCheck(path, new dItem(event.getPlayer().getItemInHand()))) { + if (!runWithCheck(path, new ItemTag(event.getPlayer().getItemInHand()))) { return false; } // Deprecated in favor of with: format if (path.eventArgLowerAt(3).equals("with") - && !tryItem(new dItem(event.getPlayer().getItemInHand()), path.eventArgLowerAt(4))) { + && !tryItem(new ItemTag(event.getPlayer().getItemInHand()), path.eventArgLowerAt(4))) { return false; } return true; @@ -98,11 +98,11 @@ public boolean applyDetermination(ScriptContainer container, String determinatio else if (ArgumentHelper.matchesInteger(determination)) { xp = Argument.valueOf(lower).asElement(); } - else if (Argument.valueOf(lower).matchesArgumentList(dItem.class)) { + else if (Argument.valueOf(lower).matchesArgumentList(ItemTag.class)) { cancelled = true; block.setType(Material.AIR); - for (dItem newItem : ListTag.valueOf(determination).filter(dItem.class, container)) { + for (ItemTag newItem : ListTag.valueOf(determination).filter(ItemTag.class, container)) { block.getWorld().dropItemNaturally(block.getLocation(), newItem.getItemStack()); // Drop each item } } @@ -114,7 +114,7 @@ else if (Argument.valueOf(lower).matchesArgumentList(dItem.class)) { @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(dPlayer.mirrorBukkitPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(PlayerTag.mirrorBukkitPlayer(event.getPlayer()), null); } @Override @@ -128,7 +128,7 @@ else if (name.equals("material")) { else if (name.equals("cuboids")) { Debug.echoError("context.cuboids tag is deprecated in " + getName() + " script event"); ListTag cuboids = new ListTag(); - for (dCuboid cuboid : dCuboid.getNotableCuboidsContaining(location)) { + for (CuboidTag cuboid : CuboidTag.getNotableCuboidsContaining(location)) { cuboids.add(cuboid.identifySimple()); } return cuboids; @@ -141,11 +141,11 @@ else if (name.equals("xp")) { @EventHandler public void onPlayerBreaksBlock(BlockBreakEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - material = new dMaterial(event.getBlock()); - location = new dLocation(event.getBlock().getLocation()); + material = new MaterialTag(event.getBlock()); + location = new LocationTag(event.getBlock().getLocation()); xp = new ElementTag(event.getExpToDrop()); this.event = event; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerBreaksItemScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerBreaksItemScriptEvent.java index 52a5ea8226..d405b56a98 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerBreaksItemScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerBreaksItemScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; @@ -41,7 +41,7 @@ public PlayerBreaksItemScriptEvent() { } public static PlayerBreaksItemScriptEvent instance; - public dItem item; + public ItemTag item; public PlayerItemBreakEvent event; @Override @@ -70,7 +70,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(new dPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(new PlayerTag(event.getPlayer()), null); } @Override @@ -83,10 +83,10 @@ public ObjectTag getContext(String name) { @EventHandler public void onPlayerItemBreak(PlayerItemBreakEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - item = new dItem(event.getBrokenItem()); + item = new ItemTag(event.getBrokenItem()); this.event = event; cancelled = false; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerChangesGamemodeScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerChangesGamemodeScriptEvent.java index 7aab74988c..35457a6ec8 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerChangesGamemodeScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerChangesGamemodeScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -66,7 +66,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(new dPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(new PlayerTag(event.getPlayer()), null); } @Override @@ -79,7 +79,7 @@ public ObjectTag getContext(String name) { @EventHandler public void onPlayerChangesGamemode(PlayerGameModeChangeEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } gamemode = new ElementTag(event.getNewGameMode().name()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerChangesSignScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerChangesSignScriptEvent.java index 57ba60e8c0..d90a55adc1 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerChangesSignScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerChangesSignScriptEvent.java @@ -33,10 +33,10 @@ public class PlayerChangesSignScriptEvent extends BukkitScriptEvent implements L // @Triggers when a player changes a sign. // // @Context - // returns the dLocation of the sign. + // returns the LocationTag of the sign. // returns the new sign text as a ListTag. // returns the old sign text as a ListTag. - // returns the dMaterial of the sign. + // returns the MaterialTag of the sign. // // @Determine // ListTag to change the lines (Uses escaping, see <@link language Property Escaping>) @@ -48,10 +48,10 @@ public PlayerChangesSignScriptEvent() { } public static PlayerChangesSignScriptEvent instance; - public dLocation location; + public LocationTag location; public ListTag new_sign; public ListTag old_sign; - public dMaterial material; + public MaterialTag material; public ListTag new_text; public SignChangeEvent event; @@ -60,7 +60,7 @@ public boolean couldMatch(ScriptContainer scriptContainer, String s) { String lower = CoreUtilities.toLowerCase(s); String sign = CoreUtilities.getXthArg(2, lower); return lower.startsWith("player changes") - && (sign.equals("sign") || dMaterial.matches(sign)); + && (sign.equals("sign") || MaterialTag.matches(sign)); } @Override @@ -68,7 +68,7 @@ public boolean matches(ScriptPath path) { String mat = path.eventArgLowerAt(2); if (!mat.equals("sign") - && (!(dLocation.getBlockStateFor(event.getBlock()) instanceof Sign) + && (!(LocationTag.getBlockStateFor(event.getBlock()) instanceof Sign) && (!mat.equals(material.identifyNoIdentifier()) && !mat.equals(material.identifyFullNoIdentifier())))) { return false; } @@ -96,7 +96,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(dPlayer.mirrorBukkitPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(PlayerTag.mirrorBukkitPlayer(event.getPlayer()), null); } @Override @@ -116,7 +116,7 @@ else if (name.equals("old")) { else if (name.equals("cuboids")) { Debug.echoError("context.cuboids tag is deprecated in " + getName() + " script event"); ListTag cuboids = new ListTag(); - for (dCuboid cuboid : dCuboid.getNotableCuboidsContaining(location)) { + for (CuboidTag cuboid : CuboidTag.getNotableCuboidsContaining(location)) { cuboids.add(cuboid.identifySimple()); } return cuboids; @@ -126,16 +126,16 @@ else if (name.equals("cuboids")) { @EventHandler public void onPlayerChangesSign(SignChangeEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - BlockState state = dLocation.getBlockStateFor(event.getBlock()); + BlockState state = LocationTag.getBlockStateFor(event.getBlock()); if (!(state instanceof Sign)) { return; } Sign sign = (Sign) state; - material = new dMaterial(event.getBlock()); - location = new dLocation(event.getBlock().getLocation()); + material = new MaterialTag(event.getBlock()); + location = new LocationTag(event.getBlock().getLocation()); old_sign = new ListTag(Arrays.asList(sign.getLines())); new_sign = new ListTag(Arrays.asList(event.getLines())); new_text = null; diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerChangesWorldScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerChangesWorldScriptEvent.java index 2e010a2c21..9ce4c15115 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerChangesWorldScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerChangesWorldScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dPlayer; -import com.denizenscript.denizen.objects.dWorld; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.PlayerTag; +import com.denizenscript.denizen.objects.WorldTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -25,8 +25,8 @@ public class PlayerChangesWorldScriptEvent extends BukkitScriptEvent implements // @Triggers when a player moves to a different world. // // @Context - // returns the dWorld that the player was previously on. - // returns the dWorld that the player is now in. + // returns the WorldTag that the player was previously on. + // returns the WorldTag that the player is now in. // // --> @@ -35,8 +35,8 @@ public PlayerChangesWorldScriptEvent() { } public static PlayerChangesWorldScriptEvent instance; - public dWorld origin_world; - public dWorld destination_world; + public WorldTag origin_world; + public WorldTag destination_world; public PlayerChangedWorldEvent event; @Override @@ -76,7 +76,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(new dPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(new PlayerTag(event.getPlayer()), null); } @Override @@ -92,11 +92,11 @@ else if (name.equals("destination_world")) { @EventHandler public void onPlayerChangesWorld(PlayerChangedWorldEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - origin_world = new dWorld(event.getFrom()); - destination_world = new dWorld(event.getPlayer().getWorld()); + origin_world = new WorldTag(event.getFrom()); + destination_world = new WorldTag(event.getPlayer().getWorld()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerChangesXPScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerChangesXPScriptEvent.java index 940cade900..df25daf41b 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerChangesXPScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerChangesXPScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -43,7 +43,7 @@ public PlayerChangesXPScriptEvent() { public static PlayerChangesXPScriptEvent instance; public PlayerExpChangeEvent event; public int amount; - public dPlayer player; + public PlayerTag player; @Override public boolean couldMatch(ScriptContainer scriptContainer, String s) { @@ -89,11 +89,11 @@ public ObjectTag getContext(String name) { @EventHandler public void onPlayerChangesXP(PlayerExpChangeEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } amount = event.getAmount(); - player = dPlayer.mirrorBukkitPlayer(event.getPlayer()); + player = PlayerTag.mirrorBukkitPlayer(event.getPlayer()); this.event = event; cancelled = false; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerClicksBlockScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerClicksBlockScriptEvent.java index f131bfc28e..14dda95971 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerClicksBlockScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerClicksBlockScriptEvent.java @@ -35,9 +35,9 @@ public class PlayerClicksBlockScriptEvent extends BukkitScriptEvent implements L // @Triggers when a player clicks on a block or in the air. // // @Context - // returns the dItem the player is clicking with. - // returns the dLocation the player is clicking on. - // returns a dLocation of the air block in front of the clicked block. + // returns the ItemTag the player is clicking with. + // returns the LocationTag the player is clicking on. + // returns a LocationTag of the air block in front of the clicked block. // returns an ElementTag of the Spigot API click type <@link url https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/block/Action.html>. // returns an ElementTag of the used hand. // @@ -49,12 +49,12 @@ public PlayerClicksBlockScriptEvent() { PlayerClicksBlockScriptEvent instance; PlayerInteractEvent event; - dItem item; - dLocation location; + ItemTag item; + LocationTag location; ElementTag click_type; ElementTag hand; - dLocation relative; - dMaterial blockMaterial; + LocationTag relative; + MaterialTag blockMaterial; private boolean couldMatchIn(String lower) { int index = CoreUtilities.split(lower, ' ').indexOf("in"); @@ -63,7 +63,7 @@ private boolean couldMatchIn(String lower) { } String in = CoreUtilities.getXthArg(index + 1, lower); - if (dInventory.matches(in) || in.equalsIgnoreCase("inventory")) { + if (InventoryTag.matches(in) || in.equalsIgnoreCase("inventory")) { return false; } if (in.equalsIgnoreCase("notable")) { @@ -100,7 +100,7 @@ private boolean runUsingCheck(ScriptPath path) { return true; } - public boolean nonSwitchWithCheck(ScriptPath path, dItem held) { + public boolean nonSwitchWithCheck(ScriptPath path, ItemTag held) { int index; for (index = 0; index < path.eventArgsLower.length; index++) { if (path.eventArgsLower[index].equals("with")) { @@ -128,7 +128,7 @@ public boolean couldMatch(ScriptContainer scriptContainer, String s) { || lower.startsWith("player left clicks") || (lower.startsWith("player right clicks") && !matchHelpList.contains(CoreUtilities.getXthArg(3, lower)) - && !dEntity.matches(CoreUtilities.getXthArg(3, lower)))) + && !EntityTag.matches(CoreUtilities.getXthArg(3, lower)))) && couldMatchIn(lower); // Avoid matching "clicks in inventory" } @@ -150,7 +150,7 @@ public boolean matches(ScriptPath path) { return false; } - if (!nonSwitchWithCheck(path, new dItem(event.getItem()))) { + if (!nonSwitchWithCheck(path, new ItemTag(event.getItem()))) { return false; } @@ -181,7 +181,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(dEntity.getPlayerFrom(event.getPlayer()), null); + return new BukkitScriptEntryData(EntityTag.getPlayerFrom(event.getPlayer()), null); } @Override @@ -209,11 +209,11 @@ public void playerClicksBlock(PlayerInteractEvent event) { if (event.getAction() == Action.PHYSICAL) { return; } - blockMaterial = event.hasBlock() ? new dMaterial(event.getClickedBlock()) : new dMaterial(Material.AIR); + blockMaterial = event.hasBlock() ? new MaterialTag(event.getClickedBlock()) : new MaterialTag(Material.AIR); hand = new ElementTag(event.getHand().name()); - item = new dItem(event.getItem()); - location = event.hasBlock() ? new dLocation(event.getClickedBlock().getLocation()) : null; - relative = event.hasBlock() ? new dLocation(event.getClickedBlock().getRelative(event.getBlockFace()).getLocation()) : null; + item = new ItemTag(event.getItem()); + location = event.hasBlock() ? new LocationTag(event.getClickedBlock().getLocation()) : null; + relative = event.hasBlock() ? new LocationTag(event.getClickedBlock().getRelative(event.getBlockFace()).getLocation()) : null; click_type = new ElementTag(event.getAction().name()); cancelled = event.isCancelled() && event.useItemInHand() == Event.Result.DENY; // Spigot is dumb! this.event = event; diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerClosesInvScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerClosesInvScriptEvent.java index 490c6dd292..a850d5e487 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerClosesInvScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerClosesInvScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dInventory; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.InventoryTag; import com.denizenscript.denizen.objects.notable.NotableManager; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; @@ -27,7 +27,7 @@ public class PlayerClosesInvScriptEvent extends BukkitScriptEvent implements Lis // @Triggers when a player closes an inventory. (EG, chests, not the player's main inventory.) // // @Context - // returns the dInventory. + // returns the InventoryTag. // // --> @@ -37,8 +37,8 @@ public PlayerClosesInvScriptEvent() { public static PlayerClosesInvScriptEvent instance; - public dInventory inventory; - private dEntity entity; + public InventoryTag inventory; + private EntityTag entity; public InventoryCloseEvent event; @Override @@ -93,11 +93,11 @@ public ObjectTag getContext(String name) { @EventHandler public void onPlayerClosesInv(InventoryCloseEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - inventory = dInventory.mirrorBukkitInventory(event.getInventory()); - entity = new dEntity(event.getPlayer()); + inventory = InventoryTag.mirrorBukkitInventory(event.getInventory()); + entity = new EntityTag(event.getPlayer()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerCompletesAdvancementScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerCompletesAdvancementScriptEvent.java index fb793e1484..86683cac04 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerCompletesAdvancementScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerCompletesAdvancementScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ListTag; @@ -60,7 +60,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(dPlayer.mirrorBukkitPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(PlayerTag.mirrorBukkitPlayer(event.getPlayer()), null); } @Override diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerConsumesScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerConsumesScriptEvent.java index 08b91406a5..0f0654af3a 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerConsumesScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerConsumesScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; @@ -28,10 +28,10 @@ public class PlayerConsumesScriptEvent extends BukkitScriptEvent implements List // @Triggers when a player consumes an item. // // @Context - // returns the dItem. + // returns the ItemTag. // // @Determine - // dItem to change the item being consumed. + // ItemTag to change the item being consumed. // // --> @@ -41,7 +41,7 @@ public PlayerConsumesScriptEvent() { public static PlayerConsumesScriptEvent instance; - public dItem item; + public ItemTag item; public PlayerItemConsumeEvent event; @Override @@ -62,8 +62,8 @@ public String getName() { @Override public boolean applyDetermination(ScriptContainer container, String determination) { - if (dItem.matches(determination)) { - dItem newitem = dItem.valueOf(determination, dEntity.getPlayerFrom(event.getPlayer()), null); + if (ItemTag.matches(determination)) { + ItemTag newitem = ItemTag.valueOf(determination, EntityTag.getPlayerFrom(event.getPlayer()), null); if (newitem != null) { event.setItem(newitem.getItemStack()); return true; @@ -79,7 +79,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { // TODO: Store the player / npc? - return new BukkitScriptEntryData(event != null ? dEntity.getPlayerFrom(event.getPlayer()) : null, null); + return new BukkitScriptEntryData(event != null ? EntityTag.getPlayerFrom(event.getPlayer()) : null, null); } @Override @@ -92,10 +92,10 @@ public ObjectTag getContext(String name) { @EventHandler public void onPlayerConsumes(PlayerItemConsumeEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - item = new dItem(event.getItem()); + item = new ItemTag(event.getItem()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerCraftsItemScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerCraftsItemScriptEvent.java index d43d0e0884..149aa9bfae 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerCraftsItemScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerCraftsItemScriptEvent.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dInventory; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.InventoryTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ListTag; @@ -33,12 +33,12 @@ public class PlayerCraftsItemScriptEvent extends BukkitScriptEvent implements Li // // @Triggers when a player fully crafts an item. // @Context - // returns the dInventory of the crafting inventory. - // returns the dItem to be crafted. - // returns a ListTag of dItems in the recipe. + // returns the InventoryTag of the crafting inventory. + // returns the ItemTag to be crafted. + // returns a ListTag of ItemTags in the recipe. // // @Determine - // dItem to change the item that is crafted. + // ItemTag to change the item that is crafted. // // --> @@ -48,10 +48,10 @@ public PlayerCraftsItemScriptEvent() { public static PlayerCraftsItemScriptEvent instance; public boolean resultChanged; - public dItem result; + public ItemTag result; public ListTag recipe; public CraftingInventory inventory; - public dPlayer player; + public PlayerTag player; @Override public boolean couldMatch(ScriptContainer scriptContainer, String s) { @@ -77,8 +77,8 @@ public String getName() { @Override public boolean applyDetermination(ScriptContainer container, String determination) { - if (dItem.matches(determination)) { - result = dItem.valueOf(determination, container); + if (ItemTag.matches(determination)) { + result = ItemTag.valueOf(determination, container); resultChanged = true; return true; } @@ -97,7 +97,7 @@ public ObjectTag getContext(String name) { return result; } else if (name.equals("inventory")) { - return dInventory.mirrorBukkitInventory(inventory); + return InventoryTag.mirrorBukkitInventory(inventory); } else if (name.equals("recipe")) { return recipe; @@ -108,7 +108,7 @@ else if (name.equals("recipe")) { @EventHandler public void onCraftItem(CraftItemEvent event) { HumanEntity humanEntity = event.getWhoClicked(); - if (dEntity.isNPC(humanEntity)) { + if (EntityTag.isNPC(humanEntity)) { return; } Recipe eRecipe = event.getRecipe(); @@ -116,17 +116,17 @@ public void onCraftItem(CraftItemEvent event) { return; } inventory = event.getInventory(); - result = new dItem(eRecipe.getResult()); + result = new ItemTag(eRecipe.getResult()); recipe = new ListTag(); for (ItemStack itemStack : inventory.getMatrix()) { if (itemStack != null) { - recipe.add(new dItem(itemStack).identify()); + recipe.add(new ItemTag(itemStack).identify()); } else { - recipe.add(new dItem(Material.AIR).identify()); + recipe.add(new ItemTag(Material.AIR).identify()); } } - this.player = dEntity.getPlayerFrom(humanEntity); + this.player = EntityTag.getPlayerFrom(humanEntity); this.resultChanged = false; this.cancelled = false; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerDamagesBlockScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerDamagesBlockScriptEvent.java index 041591ef7a..91e05a3eb2 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerDamagesBlockScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerDamagesBlockScriptEvent.java @@ -28,8 +28,8 @@ public class PlayerDamagesBlockScriptEvent extends BukkitScriptEvent implements // @Triggers when a block is damaged by a player. // // @Context - // returns the dLocation the block that was damaged. - // returns the dMaterial of the block that was damaged. + // returns the LocationTag the block that was damaged. + // returns the MaterialTag of the block that was damaged. // // @Determine // "INSTABREAK" to make the block get broken instantly. @@ -41,8 +41,8 @@ public PlayerDamagesBlockScriptEvent() { } public static PlayerDamagesBlockScriptEvent instance; - public dLocation location; - public dMaterial material; + public LocationTag location; + public MaterialTag material; public Boolean instabreak; public BlockDamageEvent event; @@ -51,7 +51,7 @@ public boolean couldMatch(ScriptContainer scriptContainer, String s) { String lower = CoreUtilities.toLowerCase(s); String mat = CoreUtilities.getXthArg(2, lower); return lower.startsWith("player damages") - && (mat.equals("block") || dMaterial.matches(mat)); + && (mat.equals("block") || MaterialTag.matches(mat)); } @Override @@ -85,7 +85,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(dPlayer.mirrorBukkitPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(PlayerTag.mirrorBukkitPlayer(event.getPlayer()), null); } @Override @@ -99,7 +99,7 @@ else if (name.equals("material")) { else if (name.equals("cuboids")) { Debug.echoError("context.cuboids tag is deprecated in " + getName() + " script event"); ListTag cuboids = new ListTag(); - for (dCuboid cuboid : dCuboid.getNotableCuboidsContaining(location)) { + for (CuboidTag cuboid : CuboidTag.getNotableCuboidsContaining(location)) { cuboids.add(cuboid.identifySimple()); } return cuboids; @@ -109,11 +109,11 @@ else if (name.equals("cuboids")) { @EventHandler public void onPlayerDamagesBlock(BlockDamageEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - material = new dMaterial(event.getBlock()); - location = new dLocation(event.getBlock().getLocation()); + material = new MaterialTag(event.getBlock()); + location = new LocationTag(event.getBlock().getLocation()); instabreak = event.getInstaBreak(); this.event = event; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerDragsInInvScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerDragsInInvScriptEvent.java index 5ed1fc57eb..05c14f5f48 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerDragsInInvScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerDragsInInvScriptEvent.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dInventory; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.InventoryTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; @@ -35,9 +35,9 @@ public class PlayerDragsInInvScriptEvent extends BukkitScriptEvent implements Li // @Triggers when a player drags in an inventory. // // @Context - // returns the dItem the player has dragged. - // returns the dInventory (the 'top' inventory, regardless of which slot was clicked). - // returns the dInventory that was clicked in. + // returns the ItemTag the player has dragged. + // returns the InventoryTag (the 'top' inventory, regardless of which slot was clicked). + // returns the InventoryTag that was clicked in. // returns a ListTag of the slot numbers dragged through. // returns a ListTag of the raw slot numbers dragged through. // @@ -50,9 +50,9 @@ public PlayerDragsInInvScriptEvent() { public static PlayerDragsInInvScriptEvent instance; public Inventory inventory; - public dItem item; - private dPlayer entity; - private dInventory dInv; + public ItemTag item; + private PlayerTag entity; + private InventoryTag dInv; public InventoryDragEvent event; @Override @@ -115,7 +115,7 @@ else if (name.equals("item")) { return item; } else if (name.equals("clicked_inventory")) { - return dInventory.mirrorBukkitInventory(event.getView() + return InventoryTag.mirrorBukkitInventory(event.getView() .getInventory(event.getRawSlots().stream().findFirst().orElse(0))); } return super.getContext(name); @@ -123,13 +123,13 @@ else if (name.equals("clicked_inventory")) { @EventHandler public void onPlayerDragsInInv(InventoryDragEvent event) { - if (dEntity.isCitizensNPC(event.getWhoClicked())) { + if (EntityTag.isCitizensNPC(event.getWhoClicked())) { return; } - entity = dEntity.getPlayerFrom(event.getWhoClicked()); + entity = EntityTag.getPlayerFrom(event.getWhoClicked()); inventory = event.getInventory(); - dInv = dInventory.mirrorBukkitInventory(inventory); - item = new dItem(event.getOldCursor()); + dInv = InventoryTag.mirrorBukkitInventory(inventory); + item = new ItemTag(event.getOldCursor()); boolean wasCancelled = event.isCancelled(); this.event = event; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerDropsItemScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerDropsItemScriptEvent.java index 2cb4e01a0e..aba250b2f9 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerDropsItemScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerDropsItemScriptEvent.java @@ -1,11 +1,11 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.ScriptEntryData; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -30,9 +30,9 @@ public class PlayerDropsItemScriptEvent extends BukkitScriptEvent implements Lis // @Triggers when a player drops an item. // // @Context - // returns the dItem. - // returns a dEntity of the item. - // returns a dLocation of the item's location. + // returns the ItemTag. + // returns a EntityTag of the item. + // returns a LocationTag of the item's location. // // --> @@ -41,9 +41,9 @@ public PlayerDropsItemScriptEvent() { } public static PlayerDropsItemScriptEvent instance; - public dItem item; - public dEntity entity; - public dLocation location; + public ItemTag item; + public EntityTag entity; + public LocationTag location; public PlayerDropItemEvent event; @Override @@ -76,7 +76,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(new dPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(new PlayerTag(event.getPlayer()), null); } @Override @@ -95,14 +95,14 @@ else if (name.equals("location")) { @EventHandler public void onPlayerDropsItem(PlayerDropItemEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - location = new dLocation(event.getPlayer().getLocation()); + location = new LocationTag(event.getPlayer().getLocation()); Item itemDrop = event.getItemDrop(); - dEntity.rememberEntity(itemDrop); - item = new dItem(itemDrop.getItemStack()); - entity = new dEntity(itemDrop); + EntityTag.rememberEntity(itemDrop); + item = new ItemTag(itemDrop.getItemStack()); + entity = new EntityTag(itemDrop); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerEditsBookScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerEditsBookScriptEvent.java index f83c1da927..83077ba2ac 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerEditsBookScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerEditsBookScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.scripts.containers.core.BookScriptContainer; import com.denizenscript.denizen.utilities.MaterialCompat; import com.denizenscript.denizen.utilities.debugging.Debug; @@ -45,8 +45,8 @@ public class PlayerEditsBookScriptEvent extends BukkitScriptEvent implements Lis ElementTag signing; ElementTag title; ElementTag pages; - dItem book; - dPlayer player; + ItemTag book; + PlayerTag player; BookMeta bookMeta; @Override @@ -80,7 +80,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio else if (ScriptTag.matches(determination)) { ScriptTag script = ScriptTag.valueOf(determination); if (script.getContainer() instanceof BookScriptContainer) { - dItem dBook = ((BookScriptContainer) script.getContainer()).getBookFrom(player, null); + ItemTag dBook = ((BookScriptContainer) script.getContainer()).getBookFrom(player, null); bookMeta = (BookMeta) dBook.getItemStack().getItemMeta(); if (dBook.getMaterial().getMaterial() == MaterialCompat.WRITABLE_BOOK) { signing = new ElementTag(false); @@ -114,12 +114,12 @@ else if (name.equals("book")) { @EventHandler public void onPlayerEditsBook(PlayerEditBookEvent event) { - player = dPlayer.mirrorBukkitPlayer(event.getPlayer()); + player = PlayerTag.mirrorBukkitPlayer(event.getPlayer()); signing = new ElementTag(event.isSigning()); bookMeta = event.getNewBookMeta(); pages = new ElementTag(bookMeta.getPageCount()); title = event.isSigning() ? new ElementTag(bookMeta.getTitle()) : null; - book = new dItem(event.getPlayer().getInventory().getItem(event.getSlot())); + book = new ItemTag(event.getPlayer().getInventory().getItem(event.getSlot())); this.event = event; fire(event); event.setNewBookMeta(bookMeta); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerEmptiesBucketScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerEmptiesBucketScriptEvent.java index 196326b694..5da7bc3188 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerEmptiesBucketScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerEmptiesBucketScriptEvent.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -29,9 +29,9 @@ public class PlayerEmptiesBucketScriptEvent extends BukkitScriptEvent implements // @Cancellable true // // @Context - // returns the dItem of the bucket being emptied. - // returns the dLocation of the block clicked with the bucket. - // returns the dLocation of the block in front of the clicked block. + // returns the ItemTag of the bucket being emptied. + // returns the LocationTag of the block clicked with the bucket. + // returns the LocationTag of the block in front of the clicked block. // // --> @@ -42,11 +42,11 @@ public PlayerEmptiesBucketScriptEvent() { public static PlayerEmptiesBucketScriptEvent instance; - public dEntity entity; - public dItem item; - public dMaterial material; - public dLocation location; - public dLocation relative; + public EntityTag entity; + public ItemTag item; + public MaterialTag material; + public LocationTag location; + public LocationTag relative; public PlayerBucketEmptyEvent event; @@ -75,7 +75,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(event != null ? dEntity.getPlayerFrom(event.getPlayer()) : null, null); + return new BukkitScriptEntryData(event != null ? EntityTag.getPlayerFrom(event.getPlayer()) : null, null); } @Override @@ -94,10 +94,10 @@ else if (name.equals("item")) { @EventHandler public void onBucketEmpty(PlayerBucketEmptyEvent event) { - entity = new dEntity(event.getPlayer()); - location = new dLocation(event.getBlockClicked().getLocation()); - relative = new dLocation(event.getBlockClicked().getRelative(event.getBlockFace()).getLocation()); - item = new dItem(event.getBucket()); + entity = new EntityTag(event.getPlayer()); + location = new LocationTag(event.getBlockClicked().getLocation()); + relative = new LocationTag(event.getBlockClicked().getRelative(event.getBlockFace()).getLocation()); + item = new ItemTag(event.getBucket()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerEntersBedScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerEntersBedScriptEvent.java index 2072edd6b7..434ce6dfd0 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerEntersBedScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerEntersBedScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -27,7 +27,7 @@ public class PlayerEntersBedScriptEvent extends BukkitScriptEvent implements Lis // @Triggers when a player enters a bed. // // @Context - // returns the dLocation of the bed. + // returns the LocationTag of the bed. // // --> @@ -36,7 +36,7 @@ public PlayerEntersBedScriptEvent() { } public static PlayerEntersBedScriptEvent instance; - public dLocation location; + public LocationTag location; public PlayerBedEnterEvent event; @Override @@ -61,7 +61,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(new dPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(new PlayerTag(event.getPlayer()), null); } @Override @@ -74,10 +74,10 @@ public ObjectTag getContext(String name) { @EventHandler public void onPlayerEntersBed(PlayerBedEnterEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - location = new dLocation(event.getBed().getLocation()); + location = new LocationTag(event.getBed().getLocation()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerEquipsArmorScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerEquipsArmorScriptEvent.java index 34082798a2..3a1ba890da 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerEquipsArmorScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerEquipsArmorScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.BukkitScriptEntryData; @@ -44,7 +44,7 @@ public class PlayerEquipsArmorScriptEvent extends BukkitScriptEvent implements L // @Triggers when a player (un)equips armor. // // @Context - // returns the dItem that was (un)equipped. + // returns the ItemTag that was (un)equipped. // returns the reason that the armor was (un)equipped. Can be "INVENTORY", "INTERACT", "DISPENSER", or "BREAK". // --> @@ -56,8 +56,8 @@ public PlayerEquipsArmorScriptEvent() { public ElementTag equipType; public ElementTag armorType; public ElementTag reason; - public dItem armor; - public dPlayer player; + public ItemTag armor; + public PlayerTag player; @Override public boolean couldMatch(ScriptContainer scriptContainer, String s) { @@ -159,8 +159,8 @@ private void fireEquipsEvent(Player bukkitPlayer, String type, ItemStack newItem equipType = new ElementTag("equips"); armorType = new ElementTag(type); reason = new ElementTag(reasonString); - armor = new dItem(newItem); - player = dPlayer.mirrorBukkitPlayer(bukkitPlayer); + armor = new ItemTag(newItem); + player = PlayerTag.mirrorBukkitPlayer(bukkitPlayer); cancelled = false; fire(); } @@ -169,8 +169,8 @@ private void fireUnequipsEvent(Player bukkitPlayer, String type, ItemStack oldIt equipType = new ElementTag("unequips"); armorType = new ElementTag(type); reason = new ElementTag(reasonString); - armor = new dItem(oldItem); - player = dPlayer.mirrorBukkitPlayer(bukkitPlayer); + armor = new ItemTag(oldItem); + player = PlayerTag.mirrorBukkitPlayer(bukkitPlayer); cancelled = false; fire(); } @@ -194,7 +194,7 @@ private boolean isAir(ItemStack item) { public void onBlockDispense(final BlockDispenseEvent event) { final Location location = event.getBlock().getLocation(); for (Player player : location.getWorld().getPlayers()) { - if (!dEntity.isNPC(player) && Utilities.checkLocation(player, location, 2.5)) { + if (!EntityTag.isNPC(player) && Utilities.checkLocation(player, location, 2.5)) { handleChangedArmor(player, "DISPENSER"); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerFillsBucketScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerFillsBucketScriptEvent.java index eec6ee1e60..d8036ac4d9 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerFillsBucketScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerFillsBucketScriptEvent.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -29,9 +29,9 @@ public class PlayerFillsBucketScriptEvent extends BukkitScriptEvent implements L // @Cancellable true // // @Context - // returns the dItem of the filled bucket. - // returns the dLocation of the block clicked with the bucket. - // returns the dMaterial of the dLocation. + // returns the ItemTag of the filled bucket. + // returns the LocationTag of the block clicked with the bucket. + // returns the MaterialTag of the LocationTag. // // --> @@ -42,10 +42,10 @@ public PlayerFillsBucketScriptEvent() { public static PlayerFillsBucketScriptEvent instance; - public dEntity entity; - public dItem item; - public dMaterial material; - public dLocation location; + public EntityTag entity; + public ItemTag item; + public MaterialTag material; + public LocationTag location; public PlayerBucketFillEvent event; @@ -75,7 +75,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { // TODO: Store the player / npc? - return new BukkitScriptEntryData(event != null ? dEntity.getPlayerFrom(event.getPlayer()) : null, + return new BukkitScriptEntryData(event != null ? EntityTag.getPlayerFrom(event.getPlayer()) : null, entity.isNPC() ? entity.getDenizenNPC() : null); } @@ -95,10 +95,10 @@ else if (name.equals("material")) { @EventHandler public void onBucketFill(PlayerBucketFillEvent event) { - entity = new dEntity(event.getPlayer()); - location = new dLocation(event.getBlockClicked().getLocation()); - item = new dItem(event.getItemStack()); - material = new dMaterial(event.getBlockClicked()); + entity = new EntityTag(event.getPlayer()); + location = new LocationTag(event.getBlockClicked().getLocation()); + item = new ItemTag(event.getItemStack()); + material = new MaterialTag(event.getBlockClicked()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerFishesScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerFishesScriptEvent.java index 86654ac11d..c0d68a6010 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerFishesScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerFishesScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizen.nms.NMSHandler; @@ -30,10 +30,10 @@ public class PlayerFishesScriptEvent extends BukkitScriptEvent implements Listen // @Triggers when a player uses a fishing rod. // // @Context - // returns a dEntity of the hook. + // returns a EntityTag of the hook. // returns an ElementTag of the fishing state. - // returns a dEntity of the entity that got caught. - // returns a dItem of the item gotten, if any. + // returns a EntityTag of the entity that got caught. + // returns a ItemTag of the item gotten, if any. // // --> @@ -42,10 +42,10 @@ public PlayerFishesScriptEvent() { } public static PlayerFishesScriptEvent instance; - public dEntity hook; + public EntityTag hook; public ElementTag state; - public dEntity entity; - public dItem item; + public EntityTag entity; + public ItemTag item; public PlayerFishEvent event; @Override @@ -97,10 +97,10 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(dEntity.isPlayer(event.getPlayer()) ? dEntity.getPlayerFrom(event.getPlayer()) : - dEntity.isPlayer(event.getCaught()) ? dEntity.getPlayerFrom(event.getCaught()) : null, - dEntity.isCitizensNPC(event.getPlayer()) ? dEntity.getNPCFrom(event.getPlayer()) : - dEntity.isCitizensNPC(event.getCaught()) ? dEntity.getNPCFrom(event.getCaught()) : null); + return new BukkitScriptEntryData(EntityTag.isPlayer(event.getPlayer()) ? EntityTag.getPlayerFrom(event.getPlayer()) : + EntityTag.isPlayer(event.getCaught()) ? EntityTag.getPlayerFrom(event.getCaught()) : null, + EntityTag.isCitizensNPC(event.getPlayer()) ? EntityTag.getNPCFrom(event.getPlayer()) : + EntityTag.isCitizensNPC(event.getCaught()) ? EntityTag.getNPCFrom(event.getCaught()) : null); } @Override @@ -122,26 +122,26 @@ else if (name.equals("state")) { @EventHandler public void onPlayerFishes(PlayerFishEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } Entity hookEntity = NMSHandler.getInstance().getEntityHelper().getFishHook(event); - dEntity.rememberEntity(hookEntity); - hook = new dEntity(hookEntity); + EntityTag.rememberEntity(hookEntity); + hook = new EntityTag(hookEntity); state = new ElementTag(event.getState().toString()); item = null; entity = null; Entity caughtEntity = event.getCaught(); if (caughtEntity != null) { - dEntity.rememberEntity(caughtEntity); - entity = new dEntity(caughtEntity); + EntityTag.rememberEntity(caughtEntity); + entity = new EntityTag(caughtEntity); if (caughtEntity instanceof Item) { - item = new dItem(((Item) caughtEntity).getItemStack()); + item = new ItemTag(((Item) caughtEntity).getItemStack()); } } this.event = event; fire(event); - dEntity.forgetEntity(hookEntity); - dEntity.forgetEntity(caughtEntity); + EntityTag.forgetEntity(hookEntity); + EntityTag.forgetEntity(caughtEntity); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerFlyingScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerFlyingScriptEvent.java index 2aa8726c45..8c12be577c 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerFlyingScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerFlyingScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -72,7 +72,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(new dPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(new PlayerTag(event.getPlayer()), null); } @Override @@ -85,7 +85,7 @@ public ObjectTag getContext(String name) { @EventHandler public void onPlayerFlying(PlayerToggleFlightEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } state = event.isFlying(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerItemTakesDamageScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerItemTakesDamageScriptEvent.java index a8b9fc1518..a164ee5262 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerItemTakesDamageScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerItemTakesDamageScriptEvent.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; @@ -44,8 +44,8 @@ public class PlayerItemTakesDamageScriptEvent extends BukkitScriptEvent implemen PlayerItemTakesDamageScriptEvent instance; PlayerItemDamageEvent event; ElementTag damage; - dItem item; - dLocation location; + ItemTag item; + LocationTag location; public PlayerItemTakesDamageScriptEvent() { @@ -89,7 +89,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public BukkitScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(dPlayer.mirrorBukkitPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(PlayerTag.mirrorBukkitPlayer(event.getPlayer()), null); } @Override @@ -105,12 +105,12 @@ else if (name.equals("damage")) { @EventHandler public void onPlayerItemTakesDamage(PlayerItemDamageEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - item = new dItem(event.getItem()); + item = new ItemTag(event.getItem()); damage = new ElementTag(event.getDamage()); - location = new dLocation(event.getPlayer().getLocation()); + location = new LocationTag(event.getPlayer().getLocation()); boolean wasCancelled = event.isCancelled(); this.event = event; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerJoinsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerJoinsScriptEvent.java index f4db836ffa..6b98c4258d 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerJoinsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerJoinsScriptEvent.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.ScriptEntryData; @@ -70,7 +70,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(new dPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(new PlayerTag(event.getPlayer()), null); } @Override @@ -83,7 +83,7 @@ public ObjectTag getContext(String name) { @EventHandler public void onPlayerJoins(PlayerJoinEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } message = event.getJoinMessage(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerJumpScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerJumpScriptEvent.java index a6aa022d09..651a43703c 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerJumpScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerJumpScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -34,7 +34,7 @@ public PlayerJumpScriptEvent() { public static PlayerJumpScriptEvent instance; - public dLocation location; + public LocationTag location; public PlayerMoveEvent event; @Override @@ -63,7 +63,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { // TODO: Store the player / npc? - return new BukkitScriptEntryData(event != null ? dEntity.getPlayerFrom(event.getPlayer()) : null, null); + return new BukkitScriptEntryData(event != null ? EntityTag.getPlayerFrom(event.getPlayer()) : null, null); } @Override @@ -76,7 +76,7 @@ public ObjectTag getContext(String name) { @EventHandler public void onPlayerJumps(PlayerMoveEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } // Check that the block level changed (Upward) @@ -86,7 +86,7 @@ public void onPlayerJumps(PlayerMoveEvent event) { // and that the player isn't in any form of fast moving vehicle && event.getPlayer().getVehicle() == null) { // Not perfect checking, but close enough until Bukkit adds a proper event - location = new dLocation(event.getFrom()); + location = new LocationTag(event.getFrom()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerKickedScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerKickedScriptEvent.java index 43501ecbc2..1d1a6f07c7 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerKickedScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerKickedScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizen.nms.NMSHandler; @@ -35,7 +35,7 @@ public class PlayerKickedScriptEvent extends BukkitScriptEvent implements Listen // @Determine // "MESSAGE:" + ElementTag to change the kick message. // "REASON:" + ElementTag to change the kick reason. - // "FLY_COOLDOWN:" + Duration to cancel the automatic fly kick and set its next cooldown. + // "FLY_COOLDOWN:" + DurationTag to cancel the automatic fly kick and set its next cooldown. // // --> @@ -44,7 +44,7 @@ public PlayerKickedScriptEvent() { } public static PlayerKickedScriptEvent instance; - public dPlayer player; + public PlayerTag player; public ElementTag message; public ElementTag reason; public PlayerKickEvent event; @@ -114,10 +114,10 @@ else if (name.equals("flying")) { @EventHandler public void onPlayerKicked(PlayerKickEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - player = dPlayer.mirrorBukkitPlayer(event.getPlayer()); + player = PlayerTag.mirrorBukkitPlayer(event.getPlayer()); message = new ElementTag(event.getLeaveMessage()); reason = new ElementTag(event.getReason()); this.event = event; diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerLeashesEntityScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerLeashesEntityScriptEvent.java index 363e0668b8..5515ab45c8 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerLeashesEntityScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerLeashesEntityScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -27,8 +27,8 @@ public class PlayerLeashesEntityScriptEvent extends BukkitScriptEvent implements // @Triggers when a player leashes an entity. // // @Context - // returns the dEntity of the leashed entity. - // returns the dEntity that is holding the leash. + // returns the EntityTag of the leashed entity. + // returns the EntityTag that is holding the leash. // // --> @@ -37,8 +37,8 @@ public PlayerLeashesEntityScriptEvent() { } public static PlayerLeashesEntityScriptEvent instance; - public dEntity entity; - public dPlayer holder; + public EntityTag entity; + public PlayerTag holder; public PlayerLeashEntityEvent event; @Override @@ -88,11 +88,11 @@ else if (name.equals("entity")) { @EventHandler public void onPlayerLeashes(PlayerLeashEntityEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - holder = dPlayer.mirrorBukkitPlayer(event.getPlayer()); - entity = new dEntity(event.getEntity()); + holder = PlayerTag.mirrorBukkitPlayer(event.getPlayer()); + entity = new EntityTag(event.getEntity()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerLeavesBedScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerLeavesBedScriptEvent.java index d731aa95d0..b565411a75 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerLeavesBedScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerLeavesBedScriptEvent.java @@ -1,10 +1,10 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.ScriptEntryData; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -27,7 +27,7 @@ public class PlayerLeavesBedScriptEvent extends BukkitScriptEvent implements Lis // @Triggers when a player leaves a bed. // // @Context - // returns the dLocation of the bed. + // returns the LocationTag of the bed. // // --> @@ -36,7 +36,7 @@ public PlayerLeavesBedScriptEvent() { } public static PlayerLeavesBedScriptEvent instance; - public dLocation location; + public LocationTag location; public PlayerBedLeaveEvent event; @Override @@ -61,7 +61,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(new dPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(new PlayerTag(event.getPlayer()), null); } @Override @@ -74,10 +74,10 @@ public ObjectTag getContext(String name) { @EventHandler public void onPlayerLeavesBed(PlayerBedLeaveEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - location = new dLocation(event.getBed().getLocation()); + location = new LocationTag(event.getBed().getLocation()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerLevelsUpScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerLevelsUpScriptEvent.java index 6539220e52..7dccda8dcf 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerLevelsUpScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerLevelsUpScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -38,7 +38,7 @@ public PlayerLevelsUpScriptEvent() { public static PlayerLevelsUpScriptEvent instance; public int new_level; public int old_level; - public dPlayer player; + public PlayerTag player; public PlayerLevelChangeEvent event; @Override @@ -97,10 +97,10 @@ else if (name.equals("old_level")) { @EventHandler public void onPlayerLevels(PlayerLevelChangeEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - player = dPlayer.mirrorBukkitPlayer(event.getPlayer()); + player = PlayerTag.mirrorBukkitPlayer(event.getPlayer()); old_level = event.getOldLevel(); new_level = event.getNewLevel(); this.event = event; diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerLoginScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerLoginScriptEvent.java index e487927025..3e2a7a5988 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerLoginScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerLoginScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -50,7 +50,7 @@ public boolean couldMatch(ScriptContainer scriptContainer, String s) { @Override public boolean matches(ScriptContainer scriptContainer, String s) { - if (CoreUtilities.toLowerCase(s).contains("first") && dPlayer.isNoted(event.getPlayer())) { + if (CoreUtilities.toLowerCase(s).contains("first") && PlayerTag.isNoted(event.getPlayer())) { return false; } return true; @@ -73,7 +73,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(new dPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(new PlayerTag(event.getPlayer()), null); } @Override @@ -86,7 +86,7 @@ public ObjectTag getContext(String name) { @EventHandler public void onPlayerLogin(PlayerLoginEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } kicked = false; diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerMendsItemScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerMendsItemScriptEvent.java index bda2f070d4..a58582b7d2 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerMendsItemScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerMendsItemScriptEvent.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -45,11 +45,11 @@ public PlayerMendsItemScriptEvent() { } public static PlayerMendsItemScriptEvent instance; - public dItem item; - public dEntity experienceOrb; + public ItemTag item; + public EntityTag experienceOrb; public ElementTag repairAmount; public PlayerItemMendEvent event; - public dLocation location; + public LocationTag location; @Override public boolean couldMatch(ScriptContainer scriptContainer, String s) { @@ -85,7 +85,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(dPlayer.mirrorBukkitPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(PlayerTag.mirrorBukkitPlayer(event.getPlayer()), null); } @Override @@ -104,12 +104,12 @@ else if (name.equals("xp_orb")) { @EventHandler public void onPlayerItemMend(PlayerItemMendEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - item = new dItem(event.getItem()); - experienceOrb = new dEntity(event.getExperienceOrb()); - location = new dLocation(event.getPlayer().getLocation()); + item = new ItemTag(event.getItem()); + experienceOrb = new EntityTag(event.getExperienceOrb()); + location = new LocationTag(event.getPlayer().getLocation()); repairAmount = new ElementTag(event.getRepairAmount()); this.event = event; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerOpensInvScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerOpensInvScriptEvent.java index f49cadc813..8afd60bbf5 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerOpensInvScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerOpensInvScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dInventory; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.InventoryTag; import com.denizenscript.denizen.objects.notable.NotableManager; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; @@ -26,7 +26,7 @@ public class PlayerOpensInvScriptEvent extends BukkitScriptEvent implements List // @Triggers when a player opens an inventory. (EG, chests, not the player's main inventory.) // // @Context - // returns the dInventory. + // returns the InventoryTag. // // --> @@ -36,7 +36,7 @@ public PlayerOpensInvScriptEvent() { public static PlayerOpensInvScriptEvent instance; - public dInventory inventory; + public InventoryTag inventory; public InventoryOpenEvent event; @Override @@ -74,7 +74,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { // TODO: Store the player / npc? - return new BukkitScriptEntryData(event != null ? dEntity.getPlayerFrom(event.getPlayer()) : null, null); + return new BukkitScriptEntryData(event != null ? EntityTag.getPlayerFrom(event.getPlayer()) : null, null); } @Override @@ -87,10 +87,10 @@ public ObjectTag getContext(String name) { @EventHandler public void onPlayerOpensInv(InventoryOpenEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - inventory = dInventory.mirrorBukkitInventory(event.getInventory()); + inventory = InventoryTag.mirrorBukkitInventory(event.getInventory()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerPicksUpScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerPicksUpScriptEvent.java index c1d5d1723e..65961f6074 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerPicksUpScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerPicksUpScriptEvent.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -36,12 +36,12 @@ public class PlayerPicksUpScriptEvent extends BukkitScriptEvent implements Liste // @Triggers when a player picks up an item. // // @Context - // returns the dItem. - // returns a dEntity of the item. - // returns a dLocation of the item's location. + // returns the ItemTag. + // returns a EntityTag of the item. + // returns a LocationTag of the item's location. // // @Determine - // "ITEM:" + dItem to changed the item being picked up. + // "ITEM:" + ItemTag to changed the item being picked up. // // --> @@ -50,10 +50,10 @@ public PlayerPicksUpScriptEvent() { } public static PlayerPicksUpScriptEvent instance; - public dItem item; + public ItemTag item; public boolean itemChanged; - public dEntity entity; - public dLocation location; + public EntityTag entity; + public LocationTag location; public PlayerPickupItemEvent event; private static final Set editedItems = new HashSet<>(); @@ -86,7 +86,7 @@ public String getName() { public boolean applyDetermination(ScriptContainer container, String determination) { String lower = CoreUtilities.toLowerCase(determination); if (lower.startsWith("item:")) { - item = dItem.valueOf(determination.substring("item:".length()), container); + item = ItemTag.valueOf(determination.substring("item:".length()), container); itemChanged = true; return true; } @@ -95,7 +95,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(new dPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(new PlayerTag(event.getPlayer()), null); } @Override @@ -114,7 +114,7 @@ else if (name.equals("location")) { @EventHandler public void onPlayerPicksUp(PlayerPickupItemEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } Item itemEntity = event.getItem(); @@ -123,9 +123,9 @@ public void onPlayerPicksUp(PlayerPickupItemEvent event) { editedItems.remove(itemUUID); return; } - location = new dLocation(itemEntity.getLocation()); - item = new dItem(itemEntity.getItemStack()); - entity = new dEntity(itemEntity); + location = new LocationTag(itemEntity.getLocation()); + item = new ItemTag(itemEntity.getItemStack()); + entity = new EntityTag(itemEntity); itemChanged = false; this.event = event; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerPlacesBlockScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerPlacesBlockScriptEvent.java index 0e7ebbeb89..f978274c52 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerPlacesBlockScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerPlacesBlockScriptEvent.java @@ -31,10 +31,10 @@ public class PlayerPlacesBlockScriptEvent extends BukkitScriptEvent implements L // @Triggers when a player places a block. // // @Context - // returns the dLocation of the block that was placed. - // returns the dMaterial of the block that was placed. - // returns the dMaterial of the block that was replaced. - // returns the dItem of the item in hand. + // returns the LocationTag of the block that was placed. + // returns the MaterialTag of the block that was placed. + // returns the MaterialTag of the block that was replaced. + // returns the ItemTag of the item in hand. // returns the name of the hand that the block was in (HAND or OFF_HAND). // // --> @@ -44,10 +44,10 @@ public PlayerPlacesBlockScriptEvent() { } public static PlayerPlacesBlockScriptEvent instance; - public dLocation location; - public dMaterial material; + public LocationTag location; + public MaterialTag material; public ElementTag hand; - public dItem item_in_hand; + public ItemTag item_in_hand; public BlockPlaceEvent event; @Override @@ -89,7 +89,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(dPlayer.mirrorBukkitPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(PlayerTag.mirrorBukkitPlayer(event.getPlayer()), null); } @Override @@ -101,7 +101,7 @@ else if (name.equals("material")) { return material; } else if (name.equals("old_material")) { - return new dMaterial(event.getBlockReplacedState()); + return new MaterialTag(event.getBlockReplacedState()); } else if (name.equals("item_in_hand")) { return item_in_hand; @@ -112,7 +112,7 @@ else if (name.equals("hand")) { else if (name.equals("cuboids")) { Debug.echoError("context.cuboids tag is deprecated in " + getName() + " script event"); ListTag cuboids = new ListTag(); - for (dCuboid cuboid : dCuboid.getNotableCuboidsContaining(location)) { + for (CuboidTag cuboid : CuboidTag.getNotableCuboidsContaining(location)) { cuboids.add(cuboid.identifySimple()); } return cuboids; @@ -122,13 +122,13 @@ else if (name.equals("cuboids")) { @EventHandler public void onPlayerPlacesBlock(BlockPlaceEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } hand = new ElementTag(event.getHand().name()); - material = new dMaterial(event.getBlock()); - location = new dLocation(event.getBlock().getLocation()); - item_in_hand = new dItem(event.getItemInHand()); + material = new MaterialTag(event.getBlock()); + location = new LocationTag(event.getBlock().getLocation()); + item_in_hand = new ItemTag(event.getItemInHand()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerPlacesHangingScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerPlacesHangingScriptEvent.java index 43bc4105f8..1516c71caa 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerPlacesHangingScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerPlacesHangingScriptEvent.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dCuboid; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.CuboidTag; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; @@ -33,8 +33,8 @@ public class PlayerPlacesHangingScriptEvent extends BukkitScriptEvent implements // @Triggers when a hanging entity (painting or itemframe) is placed. // // @Context - // returns the dEntity of the hanging. - // returns the dLocation of the block the hanging was placed on. + // returns the EntityTag of the hanging. + // returns the LocationTag of the block the hanging was placed on. // // --> @@ -43,8 +43,8 @@ public PlayerPlacesHangingScriptEvent() { } public static PlayerPlacesHangingScriptEvent instance; - public dEntity hanging; - public dLocation location; + public EntityTag hanging; + public LocationTag location; public HangingPlaceEvent event; @Override @@ -76,7 +76,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(dPlayer.mirrorBukkitPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(PlayerTag.mirrorBukkitPlayer(event.getPlayer()), null); } @Override @@ -90,7 +90,7 @@ else if (name.equals("location")) { else if (name.equals("cuboids")) { Debug.echoError("context.cuboids tag is deprecated in " + getName() + " script event"); ListTag cuboids = new ListTag(); - for (dCuboid cuboid : dCuboid.getNotableCuboidsContaining(location)) { + for (CuboidTag cuboid : CuboidTag.getNotableCuboidsContaining(location)) { cuboids.add(cuboid.identifySimple()); } return cuboids; @@ -100,15 +100,15 @@ else if (name.equals("cuboids")) { @EventHandler public void pnPlayerPlacesHanging(HangingPlaceEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } Entity hangingEntity = event.getEntity(); - dEntity.rememberEntity(hangingEntity); - hanging = new dEntity(hangingEntity); - location = new dLocation(event.getBlock().getLocation()); + EntityTag.rememberEntity(hangingEntity); + hanging = new EntityTag(hangingEntity); + location = new LocationTag(event.getBlock().getLocation()); this.event = event; fire(event); - dEntity.forgetEntity(hangingEntity); + EntityTag.forgetEntity(hangingEntity); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerPreparesAnvilCraftScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerPreparesAnvilCraftScriptEvent.java index 575435f2b5..2090a4d58a 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerPreparesAnvilCraftScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerPreparesAnvilCraftScriptEvent.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dInventory; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.InventoryTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -30,14 +30,14 @@ // @Warning The player doing the crafting is estimated and may be inaccurate. // // @Context -// returns the dInventory of the anvil inventory. -// returns the dItem to be crafted. +// returns the InventoryTag of the anvil inventory. +// returns the ItemTag to be crafted. // returns an Element(Number) of the repair cost. // returns an ElementTag of the new name. // // @Determine // Element(Number) to set the repair cost. -// dItem to change the item that is crafted. +// ItemTag to change the item that is crafted. // // --> @@ -49,9 +49,9 @@ public PlayerPreparesAnvilCraftScriptEvent() { public static PlayerPreparesAnvilCraftScriptEvent instance; public boolean resultChanged; - public dItem result; + public ItemTag result; public AnvilInventory inventory; - public dPlayer player; + public PlayerTag player; public ElementTag repairCost; public ElementTag newName; @@ -83,8 +83,8 @@ public boolean applyDetermination(ScriptContainer container, String determinatio repairCost = new ElementTag(determination); return true; } - else if (dItem.matches(determination)) { - result = dItem.valueOf(determination, container); + else if (ItemTag.matches(determination)) { + result = ItemTag.valueOf(determination, container); resultChanged = true; return true; } @@ -110,7 +110,7 @@ else if (name.equals("new_name")) { return newName; } else if (name.equals("inventory")) { - return dInventory.mirrorBukkitInventory(inventory); + return InventoryTag.mirrorBukkitInventory(inventory); } return super.getContext(name); } @@ -121,14 +121,14 @@ public void onCraftItem(PrepareAnvilEvent event) { return; } HumanEntity humanEntity = event.getInventory().getViewers().get(0); - if (dEntity.isNPC(humanEntity)) { + if (EntityTag.isNPC(humanEntity)) { return; } inventory = event.getInventory(); repairCost = new ElementTag(inventory.getRepairCost()); newName = new ElementTag(inventory.getRenameText()); - result = new dItem(event.getResult()); - this.player = dEntity.getPlayerFrom(humanEntity); + result = new ItemTag(event.getResult()); + this.player = EntityTag.getPlayerFrom(humanEntity); this.resultChanged = false; this.cancelled = false; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerQuitsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerQuitsScriptEvent.java index 53408690d7..7e5e9d6720 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerQuitsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerQuitsScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -70,7 +70,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(new dPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(new PlayerTag(event.getPlayer()), null); } @Override @@ -83,7 +83,7 @@ public ObjectTag getContext(String name) { @EventHandler public void onPlayerQuits(PlayerQuitEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } message = event.getQuitMessage(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerReceivesCommandsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerReceivesCommandsScriptEvent.java index fbfea62c93..45c4ce5adc 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerReceivesCommandsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerReceivesCommandsScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ListTag; @@ -69,7 +69,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(new dPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(new PlayerTag(event.getPlayer()), null); } @Override @@ -84,7 +84,7 @@ public ObjectTag getContext(String name) { @EventHandler public void onPlayerCommandSend(PlayerCommandSendEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } commands = event.getCommands(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerReceivesMessageScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerReceivesMessageScriptEvent.java index 81d65f0718..46eac2d48e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerReceivesMessageScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerReceivesMessageScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -42,7 +42,7 @@ public PlayerReceivesMessageScriptEvent() { public ElementTag message; public ElementTag rawJson; public ElementTag system; - public dPlayer player; + public PlayerTag player; public boolean messageModified; public boolean rawJsonModified; diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerRespawnsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerRespawnsScriptEvent.java index 2fad6674ff..52efa9f412 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerRespawnsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerRespawnsScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -24,10 +24,10 @@ public class PlayerRespawnsScriptEvent extends BukkitScriptEvent implements List // @Triggers when a player respawns. // // @Context - // returns a dLocation of the respawn location. + // returns a LocationTag of the respawn location. // // @Determine - // dLocation to change the respawn location. + // LocationTag to change the respawn location. // // --> @@ -36,7 +36,7 @@ public PlayerRespawnsScriptEvent() { } public static PlayerRespawnsScriptEvent instance; - public dLocation location; + public LocationTag location; public PlayerRespawnEvent event; @Override @@ -64,7 +64,7 @@ public String getName() { @Override public boolean applyDetermination(ScriptContainer container, String determination) { if (!CoreUtilities.toLowerCase(determination).equals("none")) { - dLocation loc = dLocation.valueOf(determination); + LocationTag loc = LocationTag.valueOf(determination); if (loc != null) { location = loc; return true; @@ -75,7 +75,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(new dPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(new PlayerTag(event.getPlayer()), null); } @Override @@ -88,10 +88,10 @@ public ObjectTag getContext(String name) { @EventHandler public void onPlayerRespawns(PlayerRespawnEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - location = new dLocation(event.getRespawnLocation()); + location = new LocationTag(event.getRespawnLocation()); this.event = event; fire(event); event.setRespawnLocation(location); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerRightClicksEntityScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerRightClicksEntityScriptEvent.java index 919864e596..cbeb41bd85 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerRightClicksEntityScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerRightClicksEntityScriptEvent.java @@ -33,18 +33,18 @@ public class PlayerRightClicksEntityScriptEvent extends BukkitScriptEvent implem // @Triggers when a player right clicks on an entity. // // @Context - // returns the dEntity the player is clicking on. - // returns the dItem the player is clicking with. - // returns a dLocation of the clicked entity. NOTE: DEPRECATED IN FAVOR OF - // returns a dLocation of the click position (as a world-less vector, relative to the entity's center). This is only available when clicking armor stands. + // returns the EntityTag the player is clicking on. + // returns the ItemTag the player is clicking with. + // returns a LocationTag of the clicked entity. NOTE: DEPRECATED IN FAVOR OF + // returns a LocationTag of the click position (as a world-less vector, relative to the entity's center). This is only available when clicking armor stands. // // --> PlayerRightClicksEntityScriptEvent instance; PlayerInteractEntityEvent event; - dEntity entity; - dItem item; - dLocation location; + EntityTag entity; + ItemTag item; + LocationTag location; @Override public boolean couldMatch(ScriptContainer scriptContainer, String s) { @@ -84,7 +84,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(dPlayer.mirrorBukkitPlayer(event.getPlayer()), entity.isNPC() ? entity.getDenizenNPC() : null); + return new BukkitScriptEntryData(PlayerTag.mirrorBukkitPlayer(event.getPlayer()), entity.isNPC() ? entity.getDenizenNPC() : null); } @Override @@ -99,12 +99,12 @@ else if (name.equals("location")) { return location; } else if (name.equals("click_position") && event instanceof PlayerInteractAtEntityEvent) { - return new dLocation(((PlayerInteractAtEntityEvent) event).getClickedPosition()); + return new LocationTag(((PlayerInteractAtEntityEvent) event).getClickedPosition()); } else if (name.equals("cuboids")) { Debug.echoError("context.cuboids tag is deprecated in " + getName() + " script event"); ListTag cuboids = new ListTag(); - for (dCuboid cuboid : dCuboid.getNotableCuboidsContaining(location)) { + for (CuboidTag cuboid : CuboidTag.getNotableCuboidsContaining(location)) { cuboids.addObject(cuboid); } return cuboids; @@ -122,9 +122,9 @@ public void playerRightClicksEntity(PlayerInteractEntityEvent event) { if (event.getHand() == EquipmentSlot.OFF_HAND) { return; } - entity = new dEntity(event.getRightClicked()); - item = new dItem(event.getPlayer().getItemInHand()); - location = new dLocation(event.getRightClicked().getLocation()); + entity = new EntityTag(event.getRightClicked()); + item = new ItemTag(event.getPlayer().getItemInHand()); + location = new LocationTag(event.getRightClicked().getLocation()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerRiptideScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerRiptideScriptEvent.java index a241f764a8..e29fa113c4 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerRiptideScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerRiptideScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -27,7 +27,7 @@ public class PlayerRiptideScriptEvent extends BukkitScriptEvent implements Liste // @Triggers when a player activates the riptide effect. // // @Context - // returns the dItem of the trident. + // returns the ItemTag of the trident. // // --> @@ -37,7 +37,7 @@ public PlayerRiptideScriptEvent() { public static PlayerRiptideScriptEvent instance; public PlayerRiptideEvent event; - private dItem item; + private ItemTag item; @Override public boolean couldMatch(ScriptContainer scriptContainer, String s) { @@ -61,7 +61,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(new dPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(new PlayerTag(event.getPlayer()), null); } @Override @@ -74,10 +74,10 @@ public ObjectTag getContext(String name) { @EventHandler public void onPlayerRiptide(PlayerRiptideEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - this.item = new dItem(event.getItem()); + this.item = new ItemTag(event.getItem()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerShearsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerShearsScriptEvent.java index c3a2cc35f4..6c9ddfc43f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerShearsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerShearsScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -29,7 +29,7 @@ public class PlayerShearsScriptEvent extends BukkitScriptEvent implements Listen // @Triggers when a player shears an entity. // // @Context - // returns the dEntity of the sheep. + // returns the EntityTag of the sheep. // // --> @@ -38,7 +38,7 @@ public PlayerShearsScriptEvent() { } public static PlayerShearsScriptEvent instance; - public dEntity entity; + public EntityTag entity; public PlayerShearEntityEvent event; @Override @@ -78,7 +78,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(new dPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(new PlayerTag(event.getPlayer()), null); } @Override @@ -94,10 +94,10 @@ else if (name.equals("state")) { // NOTE: Deprecated @EventHandler public void onPlayerShears(PlayerShearEntityEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - entity = new dEntity(event.getEntity()); + entity = new EntityTag(event.getEntity()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerSneakScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerSneakScriptEvent.java index e205ee56e1..bf5ebea1b9 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerSneakScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerSneakScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -75,7 +75,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(new dPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(new PlayerTag(event.getPlayer()), null); } @Override @@ -88,7 +88,7 @@ public ObjectTag getContext(String name) { @EventHandler public void onPlayerSneak(PlayerToggleSneakEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } state = event.isSneaking(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerSprintScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerSprintScriptEvent.java index 88f0b6eb9a..f3dd12dea8 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerSprintScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerSprintScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -71,7 +71,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(new dPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(new PlayerTag(event.getPlayer()), null); } @Override @@ -84,7 +84,7 @@ public ObjectTag getContext(String name) { @EventHandler public void onPlayerSprint(PlayerToggleSprintEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } state = event.isSprinting(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerStandsOnScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerStandsOnScriptEvent.java index 4e8937b02e..195f458481 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerStandsOnScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerStandsOnScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -28,8 +28,8 @@ public class PlayerStandsOnScriptEvent extends BukkitScriptEvent implements List // // @Triggers when a player stands on a pressure plate, tripwire, or redstone ore. // @Context - // returns the dLocation the player is interacting with. - // returns the dMaterial the player is interacting with. + // returns the LocationTag the player is interacting with. + // returns the MaterialTag the player is interacting with. // // @Determine // @@ -41,8 +41,8 @@ public PlayerStandsOnScriptEvent() { PlayerStandsOnScriptEvent instance; PlayerInteractEvent event; - dLocation location; - dMaterial material; + LocationTag location; + MaterialTag material; @Override public boolean couldMatch(ScriptContainer scriptContainer, String s) { @@ -79,7 +79,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(dEntity.getPlayerFrom(event.getPlayer()), null); + return new BukkitScriptEntryData(EntityTag.getPlayerFrom(event.getPlayer()), null); } @Override @@ -98,8 +98,8 @@ public void playerStandsOn(PlayerInteractEvent event) { if (event.getAction() != Action.PHYSICAL) { return; } - material = new dMaterial(event.getClickedBlock()); - location = new dLocation(event.getClickedBlock().getLocation()); + material = new MaterialTag(event.getClickedBlock()); + location = new LocationTag(event.getClickedBlock().getLocation()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerStatisticIncrementsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerStatisticIncrementsScriptEvent.java index bfae1f327d..76eca9833d 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerStatisticIncrementsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerStatisticIncrementsScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dMaterial; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.MaterialTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.utilities.entity.DenizenEntityType; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; @@ -45,8 +45,8 @@ public PlayerStatisticIncrementsScriptEvent() { public Statistic statistic; public Integer previous_value; public Integer new_value; - public dMaterial material; - public dEntity entity; + public MaterialTag material; + public EntityTag entity; public PlayerStatisticIncrementEvent event; @Override @@ -77,7 +77,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(dPlayer.mirrorBukkitPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(PlayerTag.mirrorBukkitPlayer(event.getPlayer()), null); } @Override @@ -104,7 +104,7 @@ else if (statistic.getType() == Statistic.Type.ENTITY) { @EventHandler public void onPlayerStatisticIncrements(PlayerStatisticIncrementEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } material = null; @@ -112,10 +112,10 @@ public void onPlayerStatisticIncrements(PlayerStatisticIncrementEvent event) { previous_value = null; statistic = event.getStatistic(); if (statistic.getType() == Statistic.Type.BLOCK || statistic.getType() == Statistic.Type.ITEM) { - material = new dMaterial(event.getMaterial()); + material = new MaterialTag(event.getMaterial()); } else if (statistic.getType() == Statistic.Type.ENTITY) { - entity = new dEntity(DenizenEntityType.getByName(event.getEntityType().name())); + entity = new EntityTag(DenizenEntityType.getByName(event.getEntityType().name())); } previous_value = event.getPreviousValue(); new_value = event.getNewValue(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerSteersEntityScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerSteersEntityScriptEvent.java index e71d07a5be..4147e220c0 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerSteersEntityScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerSteersEntityScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -25,7 +25,7 @@ public class PlayerSteersEntityScriptEvent extends BukkitScriptEvent { // @Triggers every tick that a player is controlling a vehicle. // // @Context - // returns the dEntity being steered by the player. + // returns the EntityTag being steered by the player. // returns an Element(Decimal) where a positive number signifies leftward movement. // returns an Element(Decimal) where a positive number signifies forward movement. // returns an Element(Boolean) that signifies whether the player is attempting to jump with the entity. @@ -39,8 +39,8 @@ public PlayerSteersEntityScriptEvent() { public static PlayerSteersEntityScriptEvent instance; public boolean enabled; - public dEntity entity; - public dPlayer player; + public EntityTag entity; + public PlayerTag player; public ElementTag sideways; public ElementTag forward; public ElementTag jump; diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerStepsOnScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerStepsOnScriptEvent.java index 057337cd00..bf2781abcf 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerStepsOnScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerStepsOnScriptEvent.java @@ -31,9 +31,9 @@ public class PlayerStepsOnScriptEvent extends BukkitScriptEvent implements Liste // @Triggers when a player steps onto a material. // // @Context - // returns a dLocation of the block the player is stepping on. - // returns a dLocation of where the player was before stepping onto the block. - // returns a dLocation of where the player is now. + // returns a LocationTag of the block the player is stepping on. + // returns a LocationTag of where the player was before stepping onto the block. + // returns a LocationTag of where the player is now. // // --> @@ -42,9 +42,9 @@ public PlayerStepsOnScriptEvent() { } public static PlayerStepsOnScriptEvent instance; - public dLocation location; - public dLocation previous_location; - public dLocation new_location; + public LocationTag location; + public LocationTag previous_location; + public LocationTag new_location; public PlayerMoveEvent event; @Override @@ -56,7 +56,7 @@ public boolean couldMatch(ScriptContainer scriptContainer, String s) { public boolean matches(ScriptPath path) { String mat = path.eventArgLowerAt(3); - dMaterial material = new dMaterial(location.getBlock()); + MaterialTag material = new MaterialTag(location.getBlock()); if (!tryMaterial(material, mat)) { return false; } @@ -80,7 +80,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(dPlayer.mirrorBukkitPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(PlayerTag.mirrorBukkitPlayer(event.getPlayer()), null); } @Override @@ -97,7 +97,7 @@ else if (name.equals("new_location")) { else if (name.equals("cuboids")) { Debug.echoError("context.cuboids tag is deprecated in " + getName() + " script event"); ListTag cuboids = new ListTag(); - for (dCuboid cuboid : dCuboid.getNotableCuboidsContaining(location)) { + for (CuboidTag cuboid : CuboidTag.getNotableCuboidsContaining(location)) { cuboids.add(cuboid.identifySimple()); } return cuboids; @@ -107,22 +107,22 @@ else if (name.equals("cuboids")) { @EventHandler public void onPlayerStepsOn(PlayerMoveEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } if (event.getTo().getBlock().getLocation().equals(event.getFrom().getBlock().getLocation())) { return; } - location = new dLocation(event.getTo().clone().subtract(0, 1, 0)); - previous_location = new dLocation(event.getFrom()); - new_location = new dLocation(event.getTo()); + location = new LocationTag(event.getTo().clone().subtract(0, 1, 0)); + previous_location = new LocationTag(event.getFrom()); + new_location = new LocationTag(event.getTo()); this.event = event; fire(event); } @EventHandler public void onPlayerTeleport(PlayerTeleportEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } PlayerMoveEvent evt = new PlayerMoveEvent(event.getPlayer(), event.getFrom(), event.getTo()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerSwapsItemsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerSwapsItemsScriptEvent.java index 54be9e714d..70c05824b8 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerSwapsItemsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerSwapsItemsScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -25,12 +25,12 @@ public class PlayerSwapsItemsScriptEvent extends BukkitScriptEvent implements Li // @Triggers when a player swaps the items in their main and off hands. // // @Context - // returns the dItem switched to the main hand. - // returns the dItem switched to the off hand. + // returns the ItemTag switched to the main hand. + // returns the ItemTag switched to the off hand. // // @Determine - // "MAIN:" + dItem to set the item in the main hand. - // "OFFHAND:" + dItem to set the item in the off hand. + // "MAIN:" + ItemTag to set the item in the main hand. + // "OFFHAND:" + ItemTag to set the item in the off hand. // // --> @@ -39,9 +39,9 @@ public PlayerSwapsItemsScriptEvent() { } public static PlayerSwapsItemsScriptEvent instance; - public dPlayer player; - public dItem mainhand; - public dItem offhand; + public PlayerTag player; + public ItemTag mainhand; + public ItemTag offhand; public PlayerSwapHandItemsEvent event; @Override @@ -63,11 +63,11 @@ public String getName() { public boolean applyDetermination(ScriptContainer container, String determination) { String lower = CoreUtilities.toLowerCase(determination); if (lower.startsWith("main:")) { - event.setMainHandItem(dItem.valueOf(determination.substring("main:".length()), container).getItemStack()); + event.setMainHandItem(ItemTag.valueOf(determination.substring("main:".length()), container).getItemStack()); return true; } else if (lower.startsWith("offhand:")) { - event.setOffHandItem(dItem.valueOf(determination.substring("offhand:".length()), container).getItemStack()); + event.setOffHandItem(ItemTag.valueOf(determination.substring("offhand:".length()), container).getItemStack()); return true; } return super.applyDetermination(container, determination); @@ -91,9 +91,9 @@ else if (name.equals("offhand")) { @EventHandler public void playerSwapsItems(PlayerSwapHandItemsEvent event) { - player = dPlayer.mirrorBukkitPlayer(event.getPlayer()); - mainhand = new dItem(event.getMainHandItem()); - offhand = new dItem(event.getOffHandItem()); + player = PlayerTag.mirrorBukkitPlayer(event.getPlayer()); + mainhand = new ItemTag(event.getMainHandItem()); + offhand = new ItemTag(event.getOffHandItem()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerTabCompleteScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerTabCompleteScriptEvent.java index 51f754153c..02d0b8a71b 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerTabCompleteScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerTabCompleteScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -92,7 +92,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(sender instanceof Player ? new dPlayer((Player) sender) : null, null); + return new BukkitScriptEntryData(sender instanceof Player ? new PlayerTag((Player) sender) : null, null); } @Override diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerTakesFromFurnaceScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerTakesFromFurnaceScriptEvent.java index 8dede76bbb..c75b6517ce 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerTakesFromFurnaceScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerTakesFromFurnaceScriptEvent.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ArgumentHelper; @@ -28,8 +28,8 @@ public class PlayerTakesFromFurnaceScriptEvent extends BukkitScriptEvent impleme // // @Triggers when a player takes an item from a furnace. // @Context - // returns the dLocation of the furnace. - // returns the dItem taken out of the furnace. + // returns the LocationTag of the furnace. + // returns the ItemTag taken out of the furnace. // // @Determine // Element(Number) to set the amount of experience the player will get. @@ -41,8 +41,8 @@ public PlayerTakesFromFurnaceScriptEvent() { } public static PlayerTakesFromFurnaceScriptEvent instance; - public dLocation location; - public dItem item; + public LocationTag location; + public ItemTag item; private int xp; public FurnaceExtractEvent event; @@ -76,7 +76,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(dPlayer.mirrorBukkitPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(PlayerTag.mirrorBukkitPlayer(event.getPlayer()), null); } @Override @@ -92,11 +92,11 @@ else if (name.equals("item")) { @EventHandler public void onPlayerTakesFromFurnace(FurnaceExtractEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - item = new dItem(event.getItemType(), event.getItemAmount()); - location = new dLocation(event.getBlock().getLocation()); + item = new ItemTag(event.getItemType(), event.getItemAmount()); + location = new LocationTag(event.getBlock().getLocation()); xp = event.getExpToDrop(); this.event = event; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerTakesFromLecternScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerTakesFromLecternScriptEvent.java index a57b40e389..d5000d453a 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerTakesFromLecternScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerTakesFromLecternScriptEvent.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.events.ScriptEvent; @@ -30,8 +30,8 @@ public class PlayerTakesFromLecternScriptEvent extends BukkitScriptEvent impleme // @Triggers when a player takes a book from a lectern. // // @Context - // returns the dLocation of the lectern. - // returns the book dItem taken out of the lectern. + // returns the LocationTag of the lectern. + // returns the book ItemTag taken out of the lectern. // // --> @@ -40,8 +40,8 @@ public PlayerTakesFromLecternScriptEvent() { } public static PlayerTakesFromLecternScriptEvent instance; - public dLocation location; - public dItem item; + public LocationTag location; + public ItemTag item; public PlayerTakeLecternBookEvent event; @Override @@ -64,7 +64,7 @@ public String getName() { @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(dPlayer.mirrorBukkitPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(PlayerTag.mirrorBukkitPlayer(event.getPlayer()), null); } @Override @@ -80,11 +80,11 @@ else if (name.equals("item")) { @EventHandler public void onPlayerTakesFromLectern(PlayerTakeLecternBookEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - item = new dItem(event.getBook()); - location = new dLocation(event.getLectern().getLocation()); + item = new ItemTag(event.getBook()); + location = new LocationTag(event.getLectern().getLocation()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerThrowsEggScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerThrowsEggScriptEvent.java index 9afd4f772f..a721186831 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerThrowsEggScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerThrowsEggScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; @@ -30,11 +30,11 @@ public class PlayerThrowsEggScriptEvent extends BukkitScriptEvent implements Lis // @Triggers when a player throws an egg. // // @Context - // returns the dEntity of the egg. + // returns the EntityTag of the egg. // returns an ElementTag with a value of "true" if the egg will hatch and "false" otherwise. // // @Determine - // dEntity to set the type of the hatching entity. + // EntityTag to set the type of the hatching entity. // // --> @@ -43,7 +43,7 @@ public PlayerThrowsEggScriptEvent() { } public static PlayerThrowsEggScriptEvent instance; - public dEntity egg; + public EntityTag egg; public Boolean is_hatching; private EntityType type; public PlayerEggThrowEvent event; @@ -74,9 +74,9 @@ public String getName() { @Override public boolean applyDetermination(ScriptContainer container, String determination) { String lower = CoreUtilities.toLowerCase(determination); - if (dEntity.matches(lower)) { + if (EntityTag.matches(lower)) { is_hatching = true; - type = dEntity.valueOf(determination).getBukkitEntityType(); + type = EntityTag.valueOf(determination).getBukkitEntityType(); return true; } return super.applyDetermination(container, determination); @@ -84,7 +84,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(new dPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(new PlayerTag(event.getPlayer()), null); } @Override @@ -100,14 +100,14 @@ else if (name.equals("egg")) { @EventHandler public void onPlayerThrowsEgg(PlayerEggThrowEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } Debug.log("Is this even firing?"); is_hatching = event.isHatching(); Entity eggEntity = event.getEgg(); - dEntity.rememberEntity(eggEntity); - egg = new dEntity(event.getEgg()); + EntityTag.rememberEntity(eggEntity); + egg = new EntityTag(event.getEgg()); type = event.getHatchingType(); this.event = event; cancelled = false; @@ -115,7 +115,7 @@ public void onPlayerThrowsEgg(PlayerEggThrowEvent event) { if (cancelled) { is_hatching = false; } - dEntity.forgetEntity(eggEntity); + EntityTag.forgetEntity(eggEntity); event.setHatching(is_hatching); event.setHatchingType(type); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerUsesPortalScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerUsesPortalScriptEvent.java index 1fe0498556..6f6d37f618 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerUsesPortalScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerUsesPortalScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -28,7 +28,7 @@ public class PlayerUsesPortalScriptEvent extends BukkitScriptEvent implements Li // returns the location teleported to. // // @Determine - // dLocation to change the destination. + // LocationTag to change the destination. // --> public PlayerUsesPortalScriptEvent() { @@ -36,9 +36,9 @@ public PlayerUsesPortalScriptEvent() { } public static PlayerUsesPortalScriptEvent instance; - public dEntity entity; - public dLocation to; - public dLocation from; + public EntityTag entity; + public LocationTag to; + public LocationTag from; public PlayerPortalEvent event; @Override @@ -58,8 +58,8 @@ public String getName() { @Override public boolean applyDetermination(ScriptContainer container, String determination) { - if (dLocation.matches(determination)) { - to = dLocation.valueOf(determination); + if (LocationTag.matches(determination)) { + to = LocationTag.valueOf(determination); return true; } return super.applyDetermination(container, determination); @@ -86,12 +86,12 @@ else if (name.equals("from")) { @EventHandler public void onPlayerEntersPortal(PlayerPortalEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - entity = new dEntity(event.getPlayer()); - to = event.getTo() == null ? null : new dLocation(event.getTo()); - from = new dLocation(event.getFrom()); + entity = new EntityTag(event.getPlayer()); + to = event.getTo() == null ? null : new LocationTag(event.getTo()); + from = new LocationTag(event.getFrom()); this.event = event; fire(event); event.setTo(to); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerWalkScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerWalkScriptEvent.java index abab1f7551..bc9633ad9f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerWalkScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerWalkScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -40,8 +40,8 @@ public PlayerWalkScriptEvent() { public static PlayerWalkScriptEvent instance; - public dLocation old_location; - public dLocation new_location; + public LocationTag old_location; + public LocationTag new_location; public PlayerMoveEvent event; @Override @@ -67,7 +67,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(dPlayer.mirrorBukkitPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(PlayerTag.mirrorBukkitPlayer(event.getPlayer()), null); } @Override @@ -83,11 +83,11 @@ else if (name.equals("new_location")) { @EventHandler public void onPlayerMoves(PlayerMoveEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - old_location = new dLocation(event.getFrom()); - new_location = new dLocation(event.getTo()); + old_location = new LocationTag(event.getFrom()); + new_location = new LocationTag(event.getTo()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerWalksOverScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerWalksOverScriptEvent.java index 530afae0d1..21e2a823e6 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerWalksOverScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerWalksOverScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.objects.notable.NotableManager; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; @@ -50,7 +50,7 @@ public boolean couldMatch(ScriptContainer scriptContainer, String s) { @Override public boolean matches(ScriptPath path) { String loc = path.eventArgLowerAt(3); - return loc.equals(CoreUtilities.toLowerCase(notable)) || tryLocation(new dLocation(event.getPlayer().getLocation()), loc); + return loc.equals(CoreUtilities.toLowerCase(notable)) || tryLocation(new LocationTag(event.getPlayer().getLocation()), loc); } @Override @@ -65,7 +65,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio @Override public ScriptEntryData getScriptEntryData() { - return new BukkitScriptEntryData(new dPlayer(event.getPlayer()), null); + return new BukkitScriptEntryData(new PlayerTag(event.getPlayer()), null); } @Override @@ -81,10 +81,10 @@ public void onPlayerWalksOver(PlayerMoveEvent event) { if (event.getFrom().getBlock().equals(event.getTo().getBlock())) { return; } - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - notable = NotableManager.getSavedId(new dLocation(event.getTo().getBlock().getLocation())); + notable = NotableManager.getSavedId(new LocationTag(event.getTo().getBlock().getLocation())); if (notable == null) { return; } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/player/ResourcePackStatusScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/player/ResourcePackStatusScriptEvent.java index e54c5dd37b..7d94f6ceae 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/player/ResourcePackStatusScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/player/ResourcePackStatusScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.player; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -33,7 +33,7 @@ public ResourcePackStatusScriptEvent() { public ElementTag hash; public ElementTag status; - public dPlayer player; + public PlayerTag player; @Override public boolean couldMatch(ScriptContainer scriptContainer, String s) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/world/BrewsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/world/BrewsScriptEvent.java index 0195185941..b3b2f1ffc6 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/world/BrewsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/world/BrewsScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.world; -import com.denizenscript.denizen.objects.dInventory; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.InventoryTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -24,8 +24,8 @@ public class BrewsScriptEvent extends BukkitScriptEvent implements Listener { // @Triggers when a brewing stand brews a potion. // // @Context - // returns the dLocation of the brewing stand. - // returns the dInventory of the brewing stand's contents. + // returns the LocationTag of the brewing stand. + // returns the InventoryTag of the brewing stand's contents. // // --> @@ -34,8 +34,8 @@ public BrewsScriptEvent() { } public static BrewsScriptEvent instance; - public dInventory inventory; - public dLocation location; + public InventoryTag inventory; + public LocationTag location; public BrewEvent event; @Override @@ -71,8 +71,8 @@ else if (name.equals("inventory")) { @EventHandler public void onBrews(BrewEvent event) { - location = new dLocation(event.getBlock().getLocation()); - inventory = dInventory.mirrorBukkitInventory(event.getContents()); + location = new LocationTag(event.getBlock().getLocation()); + inventory = InventoryTag.mirrorBukkitInventory(event.getContents()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/world/ChunkLoadScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/world/ChunkLoadScriptEvent.java index dc24b02ec3..8b6ca2d485 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/world/ChunkLoadScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/world/ChunkLoadScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.world; -import com.denizenscript.denizen.objects.dChunk; -import com.denizenscript.denizen.objects.dWorld; +import com.denizenscript.denizen.objects.ChunkTag; +import com.denizenscript.denizen.objects.WorldTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -34,8 +34,8 @@ public ChunkLoadScriptEvent() { public static ChunkLoadScriptEvent instance; - public dChunk chunk; - public dWorld world; + public ChunkTag chunk; + public WorldTag world; public ChunkLoadEvent event; @Override @@ -77,8 +77,8 @@ public void onChunkLoad(ChunkLoadEvent event) { if (!event.isNewChunk()) { return; } - chunk = new dChunk(event.getChunk()); - world = new dWorld(event.getWorld()); + chunk = new ChunkTag(event.getChunk()); + world = new WorldTag(event.getWorld()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/world/ChunkUnloadScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/world/ChunkUnloadScriptEvent.java index 0af602ff73..bd90eae845 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/world/ChunkUnloadScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/world/ChunkUnloadScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.world; -import com.denizenscript.denizen.objects.dChunk; -import com.denizenscript.denizen.objects.dWorld; +import com.denizenscript.denizen.objects.ChunkTag; +import com.denizenscript.denizen.objects.WorldTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -36,8 +36,8 @@ public ChunkUnloadScriptEvent() { public static ChunkUnloadScriptEvent instance; - public dChunk chunk; - public dWorld world; + public ChunkTag chunk; + public WorldTag world; public ChunkUnloadEvent event; @Override @@ -75,8 +75,8 @@ else if (name.equals("world")) { // NOTE: Deprecated in favor of context.chunk.w @EventHandler public void onChunkUnload(ChunkUnloadEvent event) { - chunk = new dChunk(event.getChunk()); - world = new dWorld(event.getWorld()); + chunk = new ChunkTag(event.getChunk()); + world = new WorldTag(event.getWorld()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/world/FurnaceBurnsItemScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/world/FurnaceBurnsItemScriptEvent.java index d03a9af26f..f9ae242a0e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/world/FurnaceBurnsItemScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/world/FurnaceBurnsItemScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.world; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ArgumentHelper; import com.denizenscript.denizencore.objects.ObjectTag; @@ -26,8 +26,8 @@ public class FurnaceBurnsItemScriptEvent extends BukkitScriptEvent implements Li // @Triggers when a furnace burns an item used as fuel. // // @Context - // returns the dLocation of the furnace. - // returns the dItem burnt. + // returns the LocationTag of the furnace. + // returns the ItemTag burnt. // // @Determine // Element(Number) to set the burn time for this fuel. @@ -39,8 +39,8 @@ public FurnaceBurnsItemScriptEvent() { } public static FurnaceBurnsItemScriptEvent instance; - public dItem item; - public dLocation location; + public ItemTag item; + public LocationTag location; private Integer burntime; public FurnaceBurnEvent event; @@ -83,8 +83,8 @@ else if (name.equals("item")) { @EventHandler public void onBrews(FurnaceBurnEvent event) { - location = new dLocation(event.getBlock().getLocation()); - item = new dItem(event.getFuel()); + location = new LocationTag(event.getBlock().getLocation()); + item = new ItemTag(event.getFuel()); burntime = event.getBurnTime(); this.event = event; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/world/FurnaceSmeltsItemScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/world/FurnaceSmeltsItemScriptEvent.java index 75b4fcbec5..68fb6601b8 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/world/FurnaceSmeltsItemScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/world/FurnaceSmeltsItemScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.world; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -25,12 +25,12 @@ public class FurnaceSmeltsItemScriptEvent extends BukkitScriptEvent implements L // @Triggers when a furnace smelts an item. // // @Context - // returns the dLocation of the furnace. - // returns the dItem that is being smelted. - // returns the dItem that is the result of the smelting. + // returns the LocationTag of the furnace. + // returns the ItemTag that is being smelted. + // returns the ItemTag that is the result of the smelting. // // @Determine - // dItem to set the item that is the result of the smelting. + // ItemTag to set the item that is the result of the smelting. // // --> @@ -39,9 +39,9 @@ public FurnaceSmeltsItemScriptEvent() { } public static FurnaceSmeltsItemScriptEvent instance; - public dItem source_item; - public dItem result_item; - public dLocation location; + public ItemTag source_item; + public ItemTag result_item; + public LocationTag location; public FurnaceSmeltEvent event; @Override @@ -72,8 +72,8 @@ public String getName() { @Override public boolean applyDetermination(ScriptContainer container, String determination) { - if (dItem.matches(determination)) { - result_item = dItem.valueOf(determination, container); + if (ItemTag.matches(determination)) { + result_item = ItemTag.valueOf(determination, container); return true; } return super.applyDetermination(container, determination); @@ -95,9 +95,9 @@ else if (name.equals("result_item")) { @EventHandler public void onFurnaceSmelts(FurnaceSmeltEvent event) { - location = new dLocation(event.getBlock().getLocation()); - source_item = new dItem(event.getSource()); - result_item = new dItem(event.getResult()); + location = new LocationTag(event.getBlock().getLocation()); + source_item = new ItemTag(event.getSource()); + result_item = new ItemTag(event.getResult()); this.event = event; fire(event); event.setResult(result_item.getItemStack()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/world/InventoryPicksUpItemScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/world/InventoryPicksUpItemScriptEvent.java index d406a39dcc..60cee2b526 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/world/InventoryPicksUpItemScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/world/InventoryPicksUpItemScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.world; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dInventory; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.InventoryTag; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -28,9 +28,9 @@ public class InventoryPicksUpItemScriptEvent extends BukkitScriptEvent implement // @Triggers when a hopper or hopper minecart picks up an item. // // @Context - // returns the dInventory that picked up the item. - // returns the dItem. - // returns a dEntity of the item entity. + // returns the InventoryTag that picked up the item. + // returns the ItemTag. + // returns a EntityTag of the item entity. // // --> @@ -39,9 +39,9 @@ public InventoryPicksUpItemScriptEvent() { } public static InventoryPicksUpItemScriptEvent instance; - public dInventory inventory; - public dItem item; - public dEntity entity; + public InventoryTag inventory; + public ItemTag item; + public EntityTag entity; public InventoryPickupItemEvent event; @Override @@ -93,9 +93,9 @@ else if (name.equals("entity")) { @EventHandler public void onInvPicksUpItem(InventoryPickupItemEvent event) { - inventory = dInventory.mirrorBukkitInventory(event.getInventory()); - item = new dItem(event.getItem()); - entity = new dEntity(event.getItem()); + inventory = InventoryTag.mirrorBukkitInventory(event.getInventory()); + item = new ItemTag(event.getItem()); + entity = new EntityTag(event.getItem()); fire(event); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/world/ItemMoveScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/world/ItemMoveScriptEvent.java index 0822c0a69d..bf69ac007e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/world/ItemMoveScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/world/ItemMoveScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.world; -import com.denizenscript.denizen.objects.dInventory; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.InventoryTag; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -27,13 +27,13 @@ public class ItemMoveScriptEvent extends BukkitScriptEvent implements Listener { // @Triggers when an entity or block moves an item from one inventory to another. (Hopper-style movement, not player-induced movement). // // @Context - // returns the origin dInventory. - // returns the destination dInventory. - // returns the dInventory that initiatied the item's transfer. - // returns the dItem that was moved. + // returns the origin InventoryTag. + // returns the destination InventoryTag. + // returns the InventoryTag that initiatied the item's transfer. + // returns the ItemTag that was moved. // // @Determine - // dItem to set a different item to be moved. NOTE: The original item will not be moved! + // ItemTag to set a different item to be moved. NOTE: The original item will not be moved! // // --> @@ -43,10 +43,10 @@ public ItemMoveScriptEvent() { public static ItemMoveScriptEvent instance; - public dInventory origin; - public dInventory destination; - public dInventory initiator; - public dItem item; + public InventoryTag origin; + public InventoryTag destination; + public InventoryTag initiator; + public ItemTag item; public boolean itemSet; public InventoryMoveItemEvent event; @@ -82,8 +82,8 @@ public String getName() { @Override public boolean applyDetermination(ScriptContainer container, String determination) { - if (dItem.matches(determination)) { - item = dItem.valueOf(determination, container); + if (ItemTag.matches(determination)) { + item = ItemTag.valueOf(determination, container); itemSet = true; return true; } @@ -109,10 +109,10 @@ else if (name.equals("item")) { @EventHandler public void onInventoryMoveItemEvent(InventoryMoveItemEvent event) { - origin = dInventory.mirrorBukkitInventory(event.getSource()); - destination = dInventory.mirrorBukkitInventory(event.getDestination()); - initiator = dInventory.mirrorBukkitInventory(event.getInitiator()); - item = new dItem(event.getItem()); + origin = InventoryTag.mirrorBukkitInventory(event.getSource()); + destination = InventoryTag.mirrorBukkitInventory(event.getDestination()); + initiator = InventoryTag.mirrorBukkitInventory(event.getInitiator()); + item = new ItemTag(event.getItem()); itemSet = false; fire(event); if (itemSet) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/world/LeafDecaysScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/world/LeafDecaysScriptEvent.java index e55c2ba896..d3a625bb73 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/world/LeafDecaysScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/world/LeafDecaysScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.world; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -25,8 +25,8 @@ public class LeafDecaysScriptEvent extends BukkitScriptEvent implements Listener // @Triggers when leaves decay. // // @Context - // returns the dLocation of the leaves. - // returns the dMaterial of the leaves. + // returns the LocationTag of the leaves. + // returns the MaterialTag of the leaves. // // --> @@ -35,8 +35,8 @@ public LeafDecaysScriptEvent() { } public static LeafDecaysScriptEvent instance; - public dLocation location; - public dMaterial material; + public LocationTag location; + public MaterialTag material; public LeavesDecayEvent event; @Override @@ -75,8 +75,8 @@ else if (name.equals("material")) { @EventHandler public void onLeafDecays(LeavesDecayEvent event) { - location = new dLocation(event.getBlock().getLocation()); - material = new dMaterial(event.getBlock()); + location = new LocationTag(event.getBlock().getLocation()); + material = new MaterialTag(event.getBlock()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/world/LightningStrikesScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/world/LightningStrikesScriptEvent.java index c6ca8c69b1..ffa58487d9 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/world/LightningStrikesScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/world/LightningStrikesScriptEvent.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.events.world; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dWorld; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.WorldTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -27,8 +27,8 @@ public class LightningStrikesScriptEvent extends BukkitScriptEvent implements Li // // @Context // DEPRECATED - // returns the dEntity of the lightning. - // returns the dLocation where the lightning struck. + // returns the EntityTag of the lightning. + // returns the LocationTag where the lightning struck. // // --> @@ -37,8 +37,8 @@ public LightningStrikesScriptEvent() { } public static LightningStrikesScriptEvent instance; - public dEntity lightning; - public dLocation location; + public EntityTag lightning; + public LocationTag location; public LightningStrikeEvent event; @Override @@ -70,15 +70,15 @@ else if (name.equals("location")) { return location; } else if (name.equals("world")) { // NOTE: Deprecated in favor of context.location.world - return new dWorld(location.getWorld()); + return new WorldTag(location.getWorld()); } return super.getContext(name); } @EventHandler public void onLightningStrikes(LightningStrikeEvent event) { - lightning = new dEntity(event.getLightning()); - location = new dLocation(event.getLightning().getLocation()); + lightning = new EntityTag(event.getLightning()); + location = new LocationTag(event.getLightning().getLocation()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/world/LingeringPotionSplashScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/world/LingeringPotionSplashScriptEvent.java index 4d522e2c5c..3776405ac5 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/world/LingeringPotionSplashScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/world/LingeringPotionSplashScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.world; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.ObjectTag; @@ -28,9 +28,9 @@ public class LingeringPotionSplashScriptEvent extends BukkitScriptEvent implemen // @Triggers when a lingering splash potion breaks open // // @Context - // returns a dItem of the potion that broke open. - // returns the dLocation the splash potion broke open at. - // returns a dEntity of the splash potion. + // returns a ItemTag of the potion that broke open. + // returns the LocationTag the splash potion broke open at. + // returns a EntityTag of the splash potion. // returns the radius of the effect cloud. // returns the lingering duration of the effect cloud. // @@ -42,11 +42,11 @@ public LingeringPotionSplashScriptEvent() { public static LingeringPotionSplashScriptEvent instance; public LingeringPotionSplashEvent event; - public dLocation location; + public LocationTag location; public ElementTag duration; - public dEntity entity; + public EntityTag entity; public ElementTag radius; - public dItem item; + public ItemTag item; @Override public boolean couldMatch(ScriptContainer scriptContainer, String s) { @@ -107,9 +107,9 @@ else if (name.equals("entity")) { @EventHandler public void onLingeringPotionSplash(LingeringPotionSplashEvent event) { AreaEffectCloud cloud = event.getAreaEffectCloud(); - item = new dItem(event.getEntity().getItem()); + item = new ItemTag(event.getEntity().getItem()); duration = new ElementTag(cloud.getDuration()); - entity = new dEntity(event.getEntity()); + entity = new EntityTag(event.getEntity()); location = entity.getLocation(); radius = new ElementTag(cloud.getRadius()); this.event = event; diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/world/LiquidSpreadScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/world/LiquidSpreadScriptEvent.java index 4d57383534..ab6e83c13f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/world/LiquidSpreadScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/world/LiquidSpreadScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.world; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -25,9 +25,9 @@ public class LiquidSpreadScriptEvent extends BukkitScriptEvent implements Listen // @Triggers when a liquid block spreads or dragon egg moves. // // @Context - // returns the dLocation the block spread to. - // returns the dLocation the block spread location. - // returns the dMaterial of the block that spread. + // returns the LocationTag the block spread to. + // returns the LocationTag the block spread location. + // returns the MaterialTag of the block that spread. // // --> @@ -37,9 +37,9 @@ public LiquidSpreadScriptEvent() { } public static LiquidSpreadScriptEvent instance; - public dMaterial material; - public dLocation location; - public dLocation destination; + public MaterialTag material; + public LocationTag location; + public LocationTag destination; public BlockFromToEvent event; @Override @@ -82,9 +82,9 @@ else if (name.equals("material")) { @EventHandler public void onLiquidSpreads(BlockFromToEvent event) { - destination = new dLocation(event.getToBlock().getLocation()); - location = new dLocation(event.getBlock().getLocation()); - material = new dMaterial(event.getBlock()); + destination = new LocationTag(event.getToBlock().getLocation()); + location = new LocationTag(event.getBlock().getLocation()); + material = new MaterialTag(event.getBlock()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/world/PistonExtendsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/world/PistonExtendsScriptEvent.java index 35cd3c37fb..fd97fd7f81 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/world/PistonExtendsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/world/PistonExtendsScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.world; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.core.ListTag; @@ -28,12 +28,12 @@ public class PistonExtendsScriptEvent extends BukkitScriptEvent implements Liste // @Triggers when a piston extends. // // @Context - // returns the dLocation of the piston. - // returns the dMaterial of the piston. + // returns the LocationTag of the piston. + // returns the MaterialTag of the piston. // returns an ElementTag of the number of blocks that will be moved by the piston. // returns a ListTag of all block locations about to be moved. // returns an ElementTag of whether the piston is sticky. - // returns a dLocation of the block in front of the piston. + // returns a LocationTag of the block in front of the piston. // // --> @@ -42,12 +42,12 @@ public PistonExtendsScriptEvent() { } public static PistonExtendsScriptEvent instance; - public dLocation location; - public dMaterial material; + public LocationTag location; + public MaterialTag material; public ElementTag length; public ListTag blocks; public ElementTag sticky; - public dLocation relative; + public LocationTag relative; public BlockPistonExtendEvent event; @Override @@ -99,13 +99,13 @@ else if (name.equals("length")) { @EventHandler public void onPistonExtends(BlockPistonExtendEvent event) { - location = new dLocation(event.getBlock().getLocation()); - material = new dMaterial(event.getBlock()); + location = new LocationTag(event.getBlock().getLocation()); + material = new MaterialTag(event.getBlock()); sticky = new ElementTag(event.isSticky() ? "true" : "false"); - relative = new dLocation(event.getBlock().getRelative(event.getDirection()).getLocation()); + relative = new LocationTag(event.getBlock().getRelative(event.getDirection()).getLocation()); blocks = new ListTag(); for (Block block : event.getBlocks()) { - blocks.add(new dLocation(block.getLocation()).identify()); + blocks.add(new LocationTag(block.getLocation()).identify()); } length = new ElementTag(blocks.size()); this.event = event; diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/world/PistonRetractsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/world/PistonRetractsScriptEvent.java index cfc84ac042..55cb690688 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/world/PistonRetractsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/world/PistonRetractsScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.world; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.core.ListTag; @@ -28,13 +28,13 @@ public class PistonRetractsScriptEvent extends BukkitScriptEvent implements List // @Triggers when a piston retracts. // // @Context - // returns the dLocation of the piston. - // returns the new dLocation of the block that + // returns the LocationTag of the piston. + // returns the new LocationTag of the block that // will be moved by the piston if it is sticky. // returns a ListTag of all block locations about to be moved. - // returns the dMaterial of the piston. + // returns the MaterialTag of the piston. // returns an ElementTag of whether the piston is sticky. - // returns a dLocation of the block in front of the piston. + // returns a LocationTag of the block in front of the piston. // // --> @@ -43,12 +43,12 @@ public PistonRetractsScriptEvent() { } public static PistonRetractsScriptEvent instance; - public dLocation location; - public dMaterial material; - public dLocation retract_location; + public LocationTag location; + public MaterialTag material; + public LocationTag retract_location; public ListTag blocks; public ElementTag sticky; - public dLocation relative; + public LocationTag relative; public BlockPistonRetractEvent event; @Override @@ -101,15 +101,15 @@ else if (name.equals("retract_location")) { @EventHandler public void onPistonRetracts(BlockPistonRetractEvent event) { - location = new dLocation(event.getBlock().getLocation()); - material = new dMaterial(event.getBlock()); + location = new LocationTag(event.getBlock().getLocation()); + material = new MaterialTag(event.getBlock()); sticky = new ElementTag(event.isSticky() ? "true" : "false"); - relative = new dLocation(event.getBlock().getRelative(event.getDirection().getOppositeFace()).getLocation()); + relative = new LocationTag(event.getBlock().getRelative(event.getDirection().getOppositeFace()).getLocation()); blocks = new ListTag(); for (Block block : event.getBlocks()) { - blocks.add(new dLocation(block.getLocation()).identify()); + blocks.add(new LocationTag(block.getLocation()).identify()); } - retract_location = new dLocation(event.getBlock().getRelative(event.getDirection().getOppositeFace(), 2).getLocation()); + retract_location = new LocationTag(event.getBlock().getRelative(event.getDirection().getOppositeFace(), 2).getLocation()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/world/PortalCreateScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/world/PortalCreateScriptEvent.java index e553b05c56..b3f6d06575 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/world/PortalCreateScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/world/PortalCreateScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.world; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dWorld; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.WorldTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -29,7 +29,7 @@ public class PortalCreateScriptEvent extends BukkitScriptEvent implements Listen // @Triggers when a portal is created. // // @Context - // returns the dWorld the portal was created in. + // returns the WorldTag the portal was created in. // returns an ElementTag of the reason the portal was created. (FIRE or OBC_DESTINATION) // returns a ListTag of all the blocks that will become portal blocks. // @@ -40,7 +40,7 @@ public PortalCreateScriptEvent() { } public static PortalCreateScriptEvent instance; - public dWorld world; + public WorldTag world; public ElementTag reason; public ListTag blocks; public PortalCreateEvent event; @@ -56,7 +56,7 @@ public boolean matches(ScriptPath path) { if (rCheck.length() > 0 && !rCheck.equals(CoreUtilities.toLowerCase(reason.asString()))) { return false; } - return runInCheck(path, dLocation.valueOf(blocks.get(0))); + return runInCheck(path, LocationTag.valueOf(blocks.get(0))); } @Override @@ -85,11 +85,11 @@ else if (name.equals("blocks")) { @EventHandler public void onPortalCreate(PortalCreateEvent event) { - world = new dWorld(event.getWorld()); + world = new WorldTag(event.getWorld()); reason = new ElementTag(event.getReason().toString()); blocks = new ListTag(); for (Location location : NMSHandler.getInstance().getBlockHelper().getBlocksList(event)) { - blocks.add(new dLocation(location).identify()); + blocks.add(new LocationTag(location).identify()); } this.event = event; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/world/PotionSplashScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/world/PotionSplashScriptEvent.java index 4156564ec2..8467bc99b1 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/world/PotionSplashScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/world/PotionSplashScriptEvent.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.events.world; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ListTag; import com.denizenscript.denizencore.objects.ObjectTag; @@ -28,10 +28,10 @@ public class PotionSplashScriptEvent extends BukkitScriptEvent implements Listen // @Triggers when a splash potion breaks open // // @Context - // returns a dItem of the potion that broke open. + // returns a ItemTag of the potion that broke open. // returns a ListTag of effected entities. - // returns the dLocation the splash potion broke open at. - // returns a dEntity of the splash potion. + // returns the LocationTag the splash potion broke open at. + // returns a EntityTag of the splash potion. // // --> @@ -40,10 +40,10 @@ public PotionSplashScriptEvent() { } public static PotionSplashScriptEvent instance; - public dItem potion; + public ItemTag potion; public ListTag entities; - public dLocation location; - public dEntity entity; + public LocationTag location; + public EntityTag entity; public PotionSplashEvent event; @Override @@ -88,12 +88,12 @@ else if (name.equals("potion")) { @EventHandler public void onPotionSplash(PotionSplashEvent event) { - entity = new dEntity(event.getEntity()); - potion = new dItem(event.getPotion().getItem()); - location = new dLocation(entity.getLocation()); + entity = new EntityTag(event.getEntity()); + potion = new ItemTag(event.getPotion().getItem()); + location = new LocationTag(entity.getLocation()); entities = new ListTag(); for (Entity e : event.getAffectedEntities()) { - entities.add(new dEntity(e).identify()); + entities.add(new EntityTag(e).identify()); } this.event = event; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/world/RedstoneScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/world/RedstoneScriptEvent.java index df8c750dcb..e8dbc6a093 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/world/RedstoneScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/world/RedstoneScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.world; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.ObjectTag; @@ -39,7 +39,7 @@ public RedstoneScriptEvent() { public static RedstoneScriptEvent instance; - public dLocation location; + public LocationTag location; public ElementTag old_current; public ElementTag new_current; public BlockRedstoneEvent event; @@ -86,7 +86,7 @@ else if (name.equals("new_current")) { @EventHandler public void onBlockRedstone(BlockRedstoneEvent event) { - location = new dLocation(event.getBlock().getLocation()); + location = new LocationTag(event.getBlock().getLocation()); old_current = new ElementTag(event.getOldCurrent()); new_current = new ElementTag(event.getNewCurrent()); this.event = event; diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/world/SpawnChangeScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/world/SpawnChangeScriptEvent.java index 13422d6e88..b33c6a5a6f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/world/SpawnChangeScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/world/SpawnChangeScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.world; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dWorld; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.WorldTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -21,9 +21,9 @@ public class SpawnChangeScriptEvent extends BukkitScriptEvent implements Listene // @Triggers when the world's spawn point changes. // // @Context - // returns the dWorld that the spawn point changed in. - // returns the dLocation of the old spawn point. - // returns the dLocation of the new spawn point. + // returns the WorldTag that the spawn point changed in. + // returns the LocationTag of the old spawn point. + // returns the LocationTag of the new spawn point. // // --> @@ -32,9 +32,9 @@ public SpawnChangeScriptEvent() { } public static SpawnChangeScriptEvent instance; - public dWorld world; - public dLocation old_location; - public dLocation new_location; + public WorldTag world; + public LocationTag old_location; + public LocationTag new_location; public SpawnChangeEvent event; @Override @@ -73,9 +73,9 @@ else if (name.equals("new_location")) { @EventHandler public void onSpawnChange(SpawnChangeEvent event) { - world = new dWorld(event.getWorld()); - old_location = new dLocation(event.getPreviousLocation()); - new_location = new dLocation(event.getWorld().getSpawnLocation()); + world = new WorldTag(event.getWorld()); + old_location = new LocationTag(event.getPreviousLocation()); + new_location = new LocationTag(event.getWorld().getSpawnLocation()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/world/StructureGrowsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/world/StructureGrowsScriptEvent.java index edfd94acf5..a8f988a696 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/world/StructureGrowsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/world/StructureGrowsScriptEvent.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.events.world; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; -import com.denizenscript.denizen.objects.dWorld; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; +import com.denizenscript.denizen.objects.WorldTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.core.ListTag; @@ -32,8 +32,8 @@ public class StructureGrowsScriptEvent extends BukkitScriptEvent implements List // @Triggers when a structure (a tree or a mushroom) grows in a world. // // @Context - // returns the dWorld the structure grew in. - // returns the dLocation the structure grew at. + // returns the WorldTag the structure grew in. + // returns the LocationTag the structure grew at. // returns an ElementTag of the structure's type. // returns a ListTag of all block locations to be modified. // returns a ListTag of the new block materials, to go with . @@ -45,8 +45,8 @@ public StructureGrowsScriptEvent() { } public static StructureGrowsScriptEvent instance; - public dWorld world; - public dLocation location; + public WorldTag world; + public LocationTag location; public ElementTag structure; public ListTag blocks; public ListTag new_materials; @@ -57,7 +57,7 @@ public boolean couldMatch(ScriptContainer scriptContainer, String s) { String lower = CoreUtilities.toLowerCase(s); String cmd = CoreUtilities.getXthArg(1, lower); String block = CoreUtilities.getXthArg(0, lower); - dMaterial mat = dMaterial.valueOf(block); + MaterialTag mat = MaterialTag.valueOf(block); return cmd.equals("grows") && (block.equals("structure") || (mat != null && mat.isStructure())); } @@ -110,14 +110,14 @@ else if (name.equals("new_materials")) { @EventHandler public void onStructureGrow(StructureGrowEvent event) { - world = new dWorld(event.getWorld()); - location = new dLocation(event.getLocation()); + world = new WorldTag(event.getWorld()); + location = new LocationTag(event.getLocation()); structure = new ElementTag(event.getSpecies().name()); blocks = new ListTag(); new_materials = new ListTag(); for (BlockState block : event.getBlocks()) { - blocks.add(new dLocation(block.getLocation()).identify()); - new_materials.add(new dMaterial(block.getType(), block.getRawData()).identify()); + blocks.add(new LocationTag(block.getLocation()).identify()); + new_materials.add(new MaterialTag(block.getType(), block.getRawData()).identify()); } this.event = event; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/world/WeatherChangesScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/world/WeatherChangesScriptEvent.java index 0c29acf72f..33352384ae 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/world/WeatherChangesScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/world/WeatherChangesScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.world; -import com.denizenscript.denizen.objects.dWorld; +import com.denizenscript.denizen.objects.WorldTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.ObjectTag; @@ -23,7 +23,7 @@ public class WeatherChangesScriptEvent extends BukkitScriptEvent implements List // @Triggers when weather changes in a world. // // @Context - // returns the dWorld the weather changed in. + // returns the WorldTag the weather changed in. // returns an ElementTag with the name of the new weather. (rain or clear). // // --> @@ -33,7 +33,7 @@ public WeatherChangesScriptEvent() { } public static WeatherChangesScriptEvent instance; - public dWorld world; + public WorldTag world; public ElementTag weather; public WeatherChangeEvent event; @@ -78,7 +78,7 @@ else if (name.equals("weather")) { @EventHandler public void onWeatherChanges(WeatherChangeEvent event) { - world = new dWorld(event.getWorld()); + world = new WorldTag(event.getWorld()); weather = new ElementTag(event.toWeatherState() ? "rains" : "clears"); this.event = event; fire(event); diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/world/WorldInitsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/world/WorldInitsScriptEvent.java index d0fd792a88..07e12c7a41 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/world/WorldInitsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/world/WorldInitsScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.world; -import com.denizenscript.denizen.objects.dWorld; +import com.denizenscript.denizen.objects.WorldTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -21,7 +21,7 @@ public class WorldInitsScriptEvent extends BukkitScriptEvent implements Listener // @Triggers when a world is initialized. // // @Context - // returns the dWorld that was initialized. + // returns the WorldTag that was initialized. // // --> @@ -30,7 +30,7 @@ public WorldInitsScriptEvent() { } public static WorldInitsScriptEvent instance; - public dWorld world; + public WorldTag world; public WorldInitEvent event; @Override @@ -67,7 +67,7 @@ public ObjectTag getContext(String name) { @EventHandler public void onWorldInits(WorldInitEvent event) { - world = new dWorld(event.getWorld()); + world = new WorldTag(event.getWorld()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/world/WorldLoadsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/world/WorldLoadsScriptEvent.java index 8179e4784c..a04cf49609 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/world/WorldLoadsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/world/WorldLoadsScriptEvent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.events.world; -import com.denizenscript.denizen.objects.dWorld; +import com.denizenscript.denizen.objects.WorldTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -22,7 +22,7 @@ public class WorldLoadsScriptEvent extends BukkitScriptEvent implements Listener // @Triggers when a world is loaded. // // @Context - // returns the dWorld that was loaded. + // returns the WorldTag that was loaded. // // --> @@ -31,7 +31,7 @@ public WorldLoadsScriptEvent() { } public static WorldLoadsScriptEvent instance; - public dWorld world; + public WorldTag world; public WorldLoadEvent event; @Override @@ -68,7 +68,7 @@ public ObjectTag getContext(String name) { @EventHandler public void onWorldLoads(WorldLoadEvent event) { - world = new dWorld(event.getWorld()); + world = new WorldTag(event.getWorld()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/world/WorldSavesScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/world/WorldSavesScriptEvent.java index 4abea954c3..eb9abb19d9 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/world/WorldSavesScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/world/WorldSavesScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.world; -import com.denizenscript.denizen.objects.dWorld; +import com.denizenscript.denizen.objects.WorldTag; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; @@ -22,7 +22,7 @@ public class WorldSavesScriptEvent extends BukkitScriptEvent implements Listener // @Triggers when a world is saved. // // @Context - // returns the dWorld that was saved. + // returns the WorldTag that was saved. // // --> @@ -31,7 +31,7 @@ public WorldSavesScriptEvent() { } public static WorldSavesScriptEvent instance; - public dWorld world; + public WorldTag world; public WorldSaveEvent event; @Override @@ -69,7 +69,7 @@ public ObjectTag getContext(String name) { @EventHandler public void onWorldSaves(WorldSaveEvent event) { - world = new dWorld(event.getWorld()); + world = new WorldTag(event.getWorld()); this.event = event; fire(event); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/world/WorldUnloadsScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/world/WorldUnloadsScriptEvent.java index d67d9e8aa4..091a4b38df 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/world/WorldUnloadsScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/world/WorldUnloadsScriptEvent.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.events.world; -import com.denizenscript.denizen.objects.dWorld; +import com.denizenscript.denizen.objects.WorldTag; import com.denizenscript.denizen.events.BukkitScriptEvent; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -23,7 +23,7 @@ public class WorldUnloadsScriptEvent extends BukkitScriptEvent implements Listen // @Triggers when a world is unloaded. // // @Context - // returns the dWorld that was unloaded. + // returns the WorldTag that was unloaded. // // --> @@ -32,7 +32,7 @@ public WorldUnloadsScriptEvent() { } public static WorldUnloadsScriptEvent instance; - public dWorld world; + public WorldTag world; public WorldUnloadEvent event; @Override @@ -71,7 +71,7 @@ public ObjectTag getContext(String name) { @EventHandler public void onWorldUnloads(WorldUnloadEvent event) { - world = new dWorld(event.getWorld()); + world = new WorldTag(event.getWorld()); this.event = event; fire(event); } 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 66e487ce8e..73b3c2c086 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/flags/FlagManager.java +++ b/plugin/src/main/java/com/denizenscript/denizen/flags/FlagManager.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.flags; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.utilities.depends.Depends; import com.denizenscript.denizencore.objects.*; @@ -36,7 +36,7 @@ public FlagManager(Denizen denizen) { } // Static methods - public static boolean playerHasFlag(dPlayer player, String flagName) { + public static boolean playerHasFlag(PlayerTag player, String flagName) { if (player == null || flagName == null) { return false; } @@ -44,7 +44,7 @@ public static boolean playerHasFlag(dPlayer player, String flagName) { .getPlayerFlag(player, flagName).size() > 0; } - public static boolean entityHasFlag(dEntity entity, String flagName) { + public static boolean entityHasFlag(EntityTag entity, String flagName) { if (entity == null || flagName == null) { return false; } @@ -52,7 +52,7 @@ public static boolean entityHasFlag(dEntity entity, String flagName) { .getEntityFlag(entity, flagName).size() > 0; } - public static boolean npcHasFlag(dNPC npc, String flagName) { + public static boolean npcHasFlag(NPCTag npc, String flagName) { if (npc == null || flagName == null) { return false; } @@ -72,7 +72,7 @@ public static void clearNPCFlags(int npcid) { DenizenAPI.getCurrentInstance().getSaves().set("NPCs." + npcid, null); } - public static void clearEntityFlags(dEntity entity) { + public static void clearEntityFlags(EntityTag entity) { DenizenAPI.getCurrentInstance().getSaves().set("Entities." + entity.getSaveName(), null); } @@ -99,14 +99,14 @@ public Flag getGlobalFlag(String flagName) { * it will be populated with the current values. If the flag does NOT exist, * it will be created with blank values. */ - public Flag getPlayerFlag(dPlayer player, String flagName) { + public Flag getPlayerFlag(PlayerTag player, String flagName) { if (player == null) { return new Flag("players.00.UNKNOWN.Flags." + flagName.toUpperCase(), flagName, "p@null"); } return new Flag("Players." + player.getSaveName() + ".Flags." + flagName.toUpperCase(), flagName, player.identify()); } - public Flag getEntityFlag(dEntity entity, String flagName) { + public Flag getEntityFlag(EntityTag entity, String flagName) { if (entity == null) { return new Flag("Entities.00.UNKNOWN.Flags." + flagName.toUpperCase(), flagName, "e@null"); } @@ -129,7 +129,7 @@ public void shrinkGlobalFlags(Collection set) { } } - public void shrinkPlayerFlags(dPlayer player, Collection set) { + public void shrinkPlayerFlags(PlayerTag player, Collection set) { for (String str : new HashSet<>(set)) { if (!playerHasFlag(player, str)) { set.remove(str); @@ -137,7 +137,7 @@ public void shrinkPlayerFlags(dPlayer player, Collection set) { } } - public void shrinkEntityFlags(dEntity entity, Collection set) { + public void shrinkEntityFlags(EntityTag entity, Collection set) { for (String str : new HashSet<>(set)) { if (!entityHasFlag(entity, str)) { set.remove(str); @@ -156,12 +156,12 @@ public Set listGlobalFlags() { /** * Returns a list of flag names currently attached to a player. */ - public Set listPlayerFlags(dPlayer player) { + public Set listPlayerFlags(PlayerTag player) { ConfigurationSection section = denizen.getSaves().getConfigurationSection("Players." + player.getSaveName() + ".Flags"); return section != null ? _filterExpirations(section.getValues(true).keySet()) : null; } - public Set listEntityFlags(dEntity entity) { + public Set listEntityFlags(EntityTag entity) { ConfigurationSection section = denizen.getSaves().getConfigurationSection("Entities." + entity.getSaveName() + ".Flags"); return section != null ? _filterExpirations(section.getValues(true).keySet()) : null; } @@ -256,13 +256,13 @@ public void clear() { List world_script_events = new ArrayList<>(); Map context = new HashMap<>(); - dPlayer player = null; - if (dPlayer.matches(OldOwner)) { - player = dPlayer.valueOf(OldOwner); + PlayerTag player = null; + if (PlayerTag.matches(OldOwner)) { + player = PlayerTag.valueOf(OldOwner); } - dNPC npc = null; - if (Depends.citizens != null && dNPC.matches(OldOwner)) { - npc = dNPC.valueOf(OldOwner); + NPCTag npc = null; + if (Depends.citizens != null && NPCTag.matches(OldOwner)) { + npc = NPCTag.valueOf(OldOwner); } String type; @@ -547,17 +547,17 @@ public void save() { List world_script_events = new ArrayList<>(); Map context = new HashMap<>(); - dPlayer player = null; - if (dPlayer.matches(oldOwner)) { - player = dPlayer.valueOf(oldOwner); + PlayerTag player = null; + if (PlayerTag.matches(oldOwner)) { + player = PlayerTag.valueOf(oldOwner); } - dNPC npc = null; - if (Depends.citizens != null && dNPC.matches(oldOwner)) { - npc = dNPC.valueOf(oldOwner); + NPCTag npc = null; + if (Depends.citizens != null && NPCTag.matches(oldOwner)) { + npc = NPCTag.valueOf(oldOwner); } - dEntity entity = null; - if (dEntity.matches(oldOwner)) { - entity = dEntity.valueOf(oldOwner); + EntityTag entity = null; + if (EntityTag.matches(oldOwner)) { + entity = EntityTag.valueOf(oldOwner); } String type; @@ -644,17 +644,17 @@ public boolean checkExpired() { List world_script_events = new ArrayList<>(); Map context = new HashMap<>(); - dPlayer player = null; - if (dPlayer.matches(oldOwner)) { - player = dPlayer.valueOf(oldOwner); + PlayerTag player = null; + if (PlayerTag.matches(oldOwner)) { + player = PlayerTag.valueOf(oldOwner); } - dNPC npc = null; - if (Depends.citizens != null && dNPC.matches(oldOwner)) { - npc = dNPC.valueOf(oldOwner); + NPCTag npc = null; + if (Depends.citizens != null && NPCTag.matches(oldOwner)) { + npc = NPCTag.valueOf(oldOwner); } - dEntity entity = null; - if (dEntity.matches(oldOwner)) { - entity = dEntity.valueOf(oldOwner); + EntityTag entity = null; + if (EntityTag.matches(oldOwner)) { + entity = EntityTag.valueOf(oldOwner); } String type; diff --git a/plugin/src/main/java/com/denizenscript/denizen/npc/DenizenNPCHelper.java b/plugin/src/main/java/com/denizenscript/denizen/npc/DenizenNPCHelper.java index d766c00376..f29b145c41 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/npc/DenizenNPCHelper.java +++ b/plugin/src/main/java/com/denizenscript/denizen/npc/DenizenNPCHelper.java @@ -3,7 +3,7 @@ import com.denizenscript.denizen.Denizen; import com.denizenscript.denizen.flags.FlagManager; import com.denizenscript.denizen.npc.actions.ActionHandler; -import com.denizenscript.denizen.objects.dNPC; +import com.denizenscript.denizen.objects.NPCTag; import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.utilities.depends.Depends; @@ -30,7 +30,7 @@ public class DenizenNPCHelper implements Listener { public static DenizenNPCHelper getCurrentInstance() { - return DenizenAPI.getCurrentInstance().getNPCRegistry(); + return DenizenAPI.getCurrentInstance().getNPCHelper(); } private Denizen plugin; @@ -56,25 +56,25 @@ public ActionHandler getActionHandler() { /** - * Returns a dNPC object when given a valid NPC. DenizenNPCs have some methods + * Returns a NPCTag object when given a valid NPC. DenizenNPCs have some methods * specific to Denizen functionality as well as easy access to the attached NPC and LivingEntity. * * @param npc the Citizens NPC - * @return a dNPC + * @return a NPCTag */ - public static dNPC getDenizen(NPC npc) { - return new dNPC(npc); + public static NPCTag getDenizen(NPC npc) { + return new NPCTag(npc); } - public static dNPC getDenizen(int id) { - return new dNPC(CitizensAPI.getNPCRegistry().getById(id)); + public static NPCTag getDenizen(int id) { + return new NPCTag(CitizensAPI.getNPCRegistry().getById(id)); } /** - * Returns a dInventory object from the Inventory trait of a valid NPC. + * Returns a InventoryTag object from the Inventory trait of a valid NPC. * * @param npc the Citizens NPC - * @return the NPC's dInventory + * @return the NPC's InventoryTag */ public static Inventory getInventory(NPC npc) { if (npc == null) { @@ -131,7 +131,7 @@ public void onSpawn(NPCSpawnEvent event) { return; } // On Spawn action - new dNPC(event.getNPC()).action("spawn", null); + new NPCTag(event.getNPC()).action("spawn", null); } @@ -152,7 +152,7 @@ public void onSpawn(NPCSpawnEvent event) { */ @EventHandler public void despawn(NPCDespawnEvent event) { - dNPC npc = getDenizen(event.getNPC()); + NPCTag npc = getDenizen(event.getNPC()); // Do world script event 'On NPC Despawns' if (npc != null && npc.isValid()) { @@ -189,8 +189,8 @@ public void onRemove(NPCRemoveEvent event) { @EventHandler public void onInventoryClick(InventoryClickEvent event) { Inventory inventory = event.getInventory(); - if (inventory.getHolder() instanceof dNPC) { - dNPC npc = (dNPC) inventory.getHolder(); + if (inventory.getHolder() instanceof NPCTag) { + NPCTag npc = (NPCTag) inventory.getHolder(); npc.getInventory().setContents(inventory.getContents()); Equipment equipment = npc.getEquipmentTrait(); for (int i = 0; i < 5; i++) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/npc/actions/ActionHandler.java b/plugin/src/main/java/com/denizenscript/denizen/npc/actions/ActionHandler.java index 14a6ce7f69..7fc162d408 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/npc/actions/ActionHandler.java +++ b/plugin/src/main/java/com/denizenscript/denizen/npc/actions/ActionHandler.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.npc.actions; -import com.denizenscript.denizen.objects.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.scripts.containers.core.AssignmentScriptContainer; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.BukkitScriptEntryData; @@ -27,12 +27,12 @@ public ActionHandler(Denizen denizen) { this.denizen = denizen; } - public String doAction(String actionName, dNPC npc, dPlayer player, AssignmentScriptContainer assignment) { + public String doAction(String actionName, NPCTag npc, PlayerTag player, AssignmentScriptContainer assignment) { return doAction(actionName, npc, player, assignment, null); } - public String doAction(String actionName, dNPC npc, dPlayer player, AssignmentScriptContainer assignment, Map context) { + public String doAction(String actionName, NPCTag npc, PlayerTag player, AssignmentScriptContainer assignment, Map context) { if (context == null) { context = new HashMap<>(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/npc/speech/DenizenChat.java b/plugin/src/main/java/com/denizenscript/denizen/npc/speech/DenizenChat.java index c6e70fbece..8348b36283 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/npc/speech/DenizenChat.java +++ b/plugin/src/main/java/com/denizenscript/denizen/npc/speech/DenizenChat.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.npc.speech; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.tags.BukkitTagContext; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.Settings; @@ -48,7 +48,7 @@ public void talk(SpeechContext speechContext) { if (queue.hasDefinition("talker")) { defTalker = queue.getDefinition("talker"); } - queue.addDefinition("talker", new dEntity(talker.getEntity()).identify()); + queue.addDefinition("talker", new EntityTag(talker.getEntity()).identify()); String defMessage = null; if (queue.hasDefinition("message")) { @@ -75,7 +75,7 @@ else if (context.size() <= 1) { if (queue.hasDefinition("target")) { defTarget = queue.getDefinition("target"); } - queue.addDefinition("target", new dEntity(context.iterator().next().getEntity()).identify()); + queue.addDefinition("target", new EntityTag(context.iterator().next().getEntity()).identify()); String bystanderText = TagManager.tag(Settings.chatWithTargetToBystandersFormat(), new BukkitTagContext(entry, false)); talkToBystanders(talker, bystanderText, context); if (defTarget != null) { @@ -104,7 +104,7 @@ else if (context.size() <= 1) { parsed.append(format[i]); break; } - parsed.append(format[i]).append(new dEntity(iter.next().getEntity()).getName()); + parsed.append(format[i]).append(new EntityTag(iter.next().getEntity()).getName()); i++; } String targets = TagManager.tag(parsed.toString(), new BukkitTagContext(entry, false)); diff --git a/plugin/src/main/java/com/denizenscript/denizen/npc/traits/AssignmentTrait.java b/plugin/src/main/java/com/denizenscript/denizen/npc/traits/AssignmentTrait.java index bddc536489..125e8f4006 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/npc/traits/AssignmentTrait.java +++ b/plugin/src/main/java/com/denizenscript/denizen/npc/traits/AssignmentTrait.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.npc.traits; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.scripts.containers.core.AssignmentScriptContainer; import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.utilities.debugging.Debug; @@ -81,7 +81,7 @@ public void load(DataKey key) throws NPCLoadException { * @param player the player adding the assignment, can be null * @return false if the assignment is invalid */ - public boolean setAssignment(String assignment, dPlayer player) { + public boolean setAssignment(String assignment, PlayerTag player) { if (ScriptRegistry.containsScript(assignment, AssignmentScriptContainer.class)) { this.assignment = assignment.toUpperCase(); // Add Constants/Trigger trait if not already added to the NPC. @@ -150,7 +150,7 @@ public boolean hasAssignment() { * * @param player the player removing the assignment, can be null */ - public void removeAssignment(dPlayer player) { + public void removeAssignment(PlayerTag player) { DenizenNPCHelper.getDenizen(npc).action("remove assignment", player); assignment = ""; } @@ -267,20 +267,20 @@ public void onDeath(EntityDeathEvent deathEvent) { Map context = new HashMap<>(); context.put("damage", new ElementTag(event == null ? 0 : event.getDamage())); context.put("death_cause", new ElementTag(deathCause)); - dPlayer player = null; + PlayerTag player = null; if (event instanceof EntityDamageByEntityEvent) { Entity killerEntity = ((EntityDamageByEntityEvent) event).getDamager(); - context.put("killer", new dEntity(killerEntity)); + context.put("killer", new EntityTag(killerEntity)); if (killerEntity instanceof Player) { - player = dPlayer.mirrorBukkitPlayer((Player) killerEntity); + player = PlayerTag.mirrorBukkitPlayer((Player) killerEntity); } else if (killerEntity instanceof Projectile) { ProjectileSource shooter = ((Projectile) killerEntity).getShooter(); if (shooter != null && shooter instanceof LivingEntity) { - context.put("shooter", new dEntity((LivingEntity) shooter)); + context.put("shooter", new EntityTag((LivingEntity) shooter)); if (shooter instanceof Player) { - player = dPlayer.mirrorBukkitPlayer((Player) shooter); + player = PlayerTag.mirrorBukkitPlayer((Player) shooter); } DenizenAPI.getDenizenNPC(npc).action("death by " + @@ -347,11 +347,11 @@ public void onHit(EntityDamageByEntityEvent event) { } } - dPlayer player = null; + PlayerTag player = null; // Check if the entity hit by this NPC is a player if (event.getEntity() instanceof Player) { - player = dPlayer.mirrorBukkitPlayer((Player) event.getEntity()); + player = PlayerTag.mirrorBukkitPlayer((Player) event.getEntity()); } // TODO: Context containing the entity hit diff --git a/plugin/src/main/java/com/denizenscript/denizen/npc/traits/HealthTrait.java b/plugin/src/main/java/com/denizenscript/denizen/npc/traits/HealthTrait.java index 9e415bef65..c3b830b308 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/npc/traits/HealthTrait.java +++ b/plugin/src/main/java/com/denizenscript/denizen/npc/traits/HealthTrait.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.npc.traits; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dNPC; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.NPCTag; import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.Settings; import com.denizenscript.denizen.tags.BukkitTagContext; @@ -114,8 +114,8 @@ public String getRespawnLocationAsString() { } public Location getRespawnLocation() { - return dLocation.valueOf(TagManager.tag(respawnLocation, new BukkitTagContext(null, - dNPC.mirrorCitizensNPC(npc), false, null, false, null))); + return LocationTag.valueOf(TagManager.tag(respawnLocation, new BukkitTagContext(null, + NPCTag.mirrorCitizensNPC(npc), false, null, false, null))); } public void setRespawnable(boolean respawnable) { @@ -274,7 +274,7 @@ public void onDamage(EntityDamageEvent event) { return; } - loc = dLocation.valueOf(TagManager.tag(respawnLocation, // TODO: debug option? + loc = LocationTag.valueOf(TagManager.tag(respawnLocation, // TODO: debug option? new BukkitTagContext(null, DenizenAPI.getDenizenNPC(npc), false, null, true, null))); if (loc == null) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/npc/traits/MobproxTrait.java b/plugin/src/main/java/com/denizenscript/denizen/npc/traits/MobproxTrait.java index 072aa6dcd2..b01c07644f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/npc/traits/MobproxTrait.java +++ b/plugin/src/main/java/com/denizenscript/denizen/npc/traits/MobproxTrait.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.npc.traits; import com.denizenscript.denizen.flags.FlagManager; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dNPC; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.NPCTag; import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizencore.objects.ObjectTag; import net.citizensnpcs.api.event.NPCTraitCommandAttachEvent; @@ -28,7 +28,7 @@ public MobproxTrait() { int checkTimer = 0; int timerBounce = 0; LivingEntity liveEnt; - dNPC dnpc; + NPCTag dnpc; FlagManager.Flag frange; FlagManager.Flag facceptnpc; FlagManager.Flag ftimer; @@ -52,8 +52,8 @@ public void run() { List removeme = new ArrayList<>(); removeme.addAll(inrange); for (Entity ent : nearby) { - if (ent instanceof LivingEntity && (!(ent instanceof Player) || dEntity.isCitizensNPC(ent)) - && (acceptnpc || (!dEntity.isCitizensNPC(ent)))) { + if (ent instanceof LivingEntity && (!(ent instanceof Player) || EntityTag.isCitizensNPC(ent)) + && (acceptnpc || (!EntityTag.isCitizensNPC(ent)))) { if (removeme.contains(ent)) { removeme.remove(ent); } @@ -111,7 +111,7 @@ public void run() { // --> private void callAction(String act, Entity ent) { Map context = new HashMap<>(); - context.put("entity", new dEntity(ent)); + context.put("entity", new EntityTag(ent)); dnpc.action("mob " + act + " proximity", null, context); dnpc.action(ent.getType().name() + " " + act + " proximity", null, context); } @@ -134,7 +134,7 @@ public void onTraitAttachEvent(NPCTraitCommandAttachEvent event) { @Override public void onSpawn() { liveEnt = (LivingEntity) getNPC().getEntity(); - dnpc = dNPC.mirrorCitizensNPC(getNPC()); + dnpc = NPCTag.mirrorCitizensNPC(getNPC()); frange = DenizenAPI.getCurrentInstance().flagManager().getNPCFlag(dnpc.getId(), "mobprox_range"); if (frange.isEmpty()) { frange.set("10"); diff --git a/plugin/src/main/java/com/denizenscript/denizen/npc/traits/PushableTrait.java b/plugin/src/main/java/com/denizenscript/denizen/npc/traits/PushableTrait.java index dc0aee0209..254b1973e9 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/npc/traits/PushableTrait.java +++ b/plugin/src/main/java/com/denizenscript/denizen/npc/traits/PushableTrait.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.npc.traits; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.utilities.DenizenAPI; import net.citizensnpcs.api.ai.event.NavigationCompleteEvent; import net.citizensnpcs.api.event.NPCPushEvent; @@ -159,7 +159,7 @@ public void NPCPush(NPCPushEvent event) { } } if (pusher != null) { - DenizenAPI.getDenizenNPC(npc).action("push", dPlayer.mirrorBukkitPlayer(pusher)); + DenizenAPI.getDenizenNPC(npc).action("push", PlayerTag.mirrorBukkitPlayer(pusher)); pushedTimer = System.currentTimeMillis() + (delay * 1000); } } // End push action diff --git a/plugin/src/main/java/com/denizenscript/denizen/npc/traits/TriggerTrait.java b/plugin/src/main/java/com/denizenscript/denizen/npc/traits/TriggerTrait.java index 0131a619f6..2a2ea10ce9 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/npc/traits/TriggerTrait.java +++ b/plugin/src/main/java/com/denizenscript/denizen/npc/traits/TriggerTrait.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.npc.traits; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.scripts.commands.npc.EngageCommand; import com.denizenscript.denizen.scripts.triggers.AbstractTrigger; import com.denizenscript.denizen.scripts.triggers.TriggerRegistry; @@ -180,7 +180,7 @@ public void describe(CommandSender sender, int page) throws CommandException { } - public boolean triggerCooldownOnly(AbstractTrigger triggerClass, dPlayer player) { + public boolean triggerCooldownOnly(AbstractTrigger triggerClass, PlayerTag player) { // Check cool down, return false if not yet met if (!DenizenAPI.getCurrentInstance().getTriggerRegistry().checkCooldown(npc, player, triggerClass, getCooldownType(triggerClass.getName()))) { return false; @@ -205,12 +205,12 @@ public boolean triggerCooldownOnly(AbstractTrigger triggerClass, dPlayer player) // return the type of trigger fired // // --> - public TriggerContext trigger(AbstractTrigger triggerClass, dPlayer player) { + public TriggerContext trigger(AbstractTrigger triggerClass, PlayerTag player) { return trigger(triggerClass, player, null); } - public TriggerContext trigger(AbstractTrigger triggerClass, dPlayer player, Map context) { + public TriggerContext trigger(AbstractTrigger triggerClass, PlayerTag player, Map context) { String trigger_type = triggerClass.getName(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/dBiome.java b/plugin/src/main/java/com/denizenscript/denizen/objects/BiomeTag.java similarity index 81% rename from plugin/src/main/java/com/denizenscript/denizen/objects/dBiome.java rename to plugin/src/main/java/com/denizenscript/denizen/objects/BiomeTag.java index 23347e875c..79d1b2ed1b 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/dBiome.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/BiomeTag.java @@ -15,13 +15,13 @@ import java.util.HashMap; import java.util.List; -public class dBiome implements ObjectTag, Adjustable { +public class BiomeTag implements ObjectTag, Adjustable { // <--[language] - // @name dBiome + // @name BiomeTag // @group Object System // @description - // A dBiome represents a world biome type. + // A BiomeTag represents a world biome type. // // A list of all valid Bukkit biomes can found be at // <@link url https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/Biome.html> @@ -34,11 +34,11 @@ public class dBiome implements ObjectTag, Adjustable { // @name b@ // @group Object Fetcher System // @description - // b@ refers to the 'object identifier' of a dBiome. The 'b@' is notation for Denizen's Object - // Fetcher. The constructor for a dBiome is the name of a valid biome (in Bukkit). + // b@ refers to the 'object identifier' of a BiomeTag. The 'b@' is notation for Denizen's Object + // Fetcher. The constructor for a BiomeTag is the name of a valid biome (in Bukkit). // For example, 'b@desert'. // - // For general info, see <@link language dBiome> + // For general info, see <@link language BiomeTag> // // --> @@ -46,7 +46,7 @@ public class dBiome implements ObjectTag, Adjustable { // OBJECT FETCHER //////////////// - public static dBiome valueOf(String string) { + public static BiomeTag valueOf(String string) { return valueOf(string, null); } @@ -56,7 +56,7 @@ public static dBiome valueOf(String string) { * @param string the string */ @Fetchable("b") - public static dBiome valueOf(String string, TagContext context) { + public static BiomeTag valueOf(String string, TagContext context) { if (string.startsWith("b@")) { string = string.substring(2); @@ -64,7 +64,7 @@ public static dBiome valueOf(String string, TagContext context) { for (Biome biome : Biome.values()) { if (biome.name().equalsIgnoreCase(string)) { - return new dBiome(biome); + return new BiomeTag(biome); } } @@ -97,7 +97,7 @@ public static boolean matches(String arg) { // Constructors ///////////// - public dBiome(Biome biome) { + public BiomeTag(Biome biome) { this.biome = NMSHandler.getInstance().getBiomeNMS(biome); } @@ -156,7 +156,7 @@ public ObjectTag setPrefix(String prefix) { public static void registerTags() { // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns this biome's downfall type for when a world has weather. @@ -165,13 +165,13 @@ public static void registerTags() { registerTag("downfall_type", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(CoreUtilities.toLowerCase(((dBiome) object).biome.getDownfallType().name())) + return new ElementTag(CoreUtilities.toLowerCase(((BiomeTag) object).biome.getDownfallType().name())) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @description // Returns the humidity of this biome. @@ -179,12 +179,12 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("humidity", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dBiome) object).biome.getHumidity()) + return new ElementTag(((BiomeTag) object).biome.getHumidity()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @description // Returns the temperature of this biome. @@ -192,13 +192,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("temperature", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dBiome) object).biome.getTemperature()) + return new ElementTag(((BiomeTag) object).biome.getTemperature()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute - // @returns ListTag(dEntity) + // @attribute + // @returns ListTag(EntityTag) // @description // Returns all entities that spawn naturally in this biome. // --> @@ -206,14 +206,14 @@ public String run(Attribute attribute, ObjectTag object) { @Override public String run(Attribute attribute, ObjectTag object) { attribute = attribute.fulfill(1); - BiomeNMS biome = ((dBiome) object).biome; + BiomeNMS biome = ((BiomeTag) object).biome; List entityTypes; boolean hasAttribute = true; // <--[tag] - // @attribute - // @returns ListTag(dEntity) + // @attribute + // @returns ListTag(EntityTag) // @description // Returns the entities that spawn naturally in ambient locations. // Default examples: BAT @@ -223,8 +223,8 @@ public String run(Attribute attribute, ObjectTag object) { } // <--[tag] - // @attribute - // @returns ListTag(dEntity) + // @attribute + // @returns ListTag(EntityTag) // @description // Returns the entities that spawn naturally in creature locations. // Default examples: PIG, COW, CHICKEN... @@ -234,8 +234,8 @@ else if (attribute.startsWith("creatures")) { } // <--[tag] - // @attribute - // @returns ListTag(dEntity) + // @attribute + // @returns ListTag(EntityTag) // @description // Returns the entities that spawn naturally in monster locations. // Default examples: CREEPER, ZOMBIE, SKELETON... @@ -245,8 +245,8 @@ else if (attribute.startsWith("monsters")) { } // <--[tag] - // @attribute - // @returns ListTag(dEntity) + // @attribute + // @returns ListTag(EntityTag) // @description // Returns the entities that spawn naturally in underwater locations. // Default examples: SQUID @@ -268,10 +268,10 @@ else if (attribute.startsWith("water")) { }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description - // Always returns 'Biome' for dBiome objects. All objects fetchable by the Object Fetcher will return the + // Always returns 'Biome' for BiomeTag objects. All objects fetchable by the Object Fetcher will return the // type of object that is fulfilling this attribute. // --> registerTag("type", new TagRunnable() { @@ -320,7 +320,7 @@ public void applyProperty(Mechanism mechanism) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dBiome + // @object BiomeTag // @name humidity // @input Element(Decimal) // @description @@ -328,14 +328,14 @@ public void adjust(Mechanism mechanism) { // If this is greater than 0.85, fire has less chance // to spread in this biome. // @tags - // + // // --> if (mechanism.matches("humidity") && mechanism.requireFloat()) { biome.setHumidity(mechanism.getValue().asFloat()); } // <--[mechanism] - // @object dBiome + // @object BiomeTag // @name temperature // @input Element(Decimal) // @description @@ -344,7 +344,7 @@ public void adjust(Mechanism mechanism) { // when weather occurs in the world and a layer of ice // will form over water. // @tags - // + // // --> if (mechanism.matches("temperature") && mechanism.requireFloat()) { biome.setTemperature(mechanism.getValue().asFloat()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/dChunk.java b/plugin/src/main/java/com/denizenscript/denizen/objects/ChunkTag.java similarity index 78% rename from plugin/src/main/java/com/denizenscript/denizen/objects/dChunk.java rename to plugin/src/main/java/com/denizenscript/denizen/objects/ChunkTag.java index 3a5d236da6..accdc78035 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/dChunk.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/ChunkTag.java @@ -21,13 +21,13 @@ import java.util.*; -public class dChunk implements ObjectTag, Adjustable { +public class ChunkTag implements ObjectTag, Adjustable { // <--[language] - // @name dChunk + // @name ChunkTag // @group Object System // @description - // A dChunk represents a chunk in the world. + // A ChunkTag represents a chunk in the world. // // For format info, see <@link language ch@> // @@ -37,8 +37,8 @@ public class dChunk implements ObjectTag, Adjustable { // @name ch@ // @group Object Fetcher System // @description - // ch@ refers to the 'object identifier' of a dChunk. The 'ch@' is notation for Denizen's Object - // Fetcher. The constructor for a dChunk is ,,. + // ch@ refers to the 'object identifier' of a ChunkTag. The 'ch@' is notation for Denizen's Object + // Fetcher. The constructor for a ChunkTag is ,,. // For example, 'ch@5,3,world'. // // Note that the X/Z pair are chunk coordinates, not block coordinates. @@ -54,7 +54,7 @@ public class dChunk implements ObjectTag, Adjustable { // For example, block at X,Z 32,67 is in the chunk at X,Z 2,4 // And the block at X,Z -32,-67 is in the chunk at X,Z -2,-5 // - // For general info, see <@link language dChunk> + // For general info, see <@link language ChunkTag> // // --> @@ -62,20 +62,20 @@ public class dChunk implements ObjectTag, Adjustable { // OBJECT FETCHER //////////////// - public static dChunk valueOf(String string) { + public static ChunkTag valueOf(String string) { return valueOf(string, null); } /** * Gets a Chunk Object from a string form of x,z,world. * This is not to be confused with the 'x,y,z,world' of a - * location, which is a finer grain of unit in a dWorlds. + * location, which is a finer grain of unit in a WorldTags. * * @param string the string or dScript argument String - * @return a dChunk, or null if incorrectly formatted + * @return a ChunkTag, or null if incorrectly formatted */ @Fetchable("ch") - public static dChunk valueOf(String string, TagContext context) { + public static ChunkTag valueOf(String string, TagContext context) { if (string == null) { return null; } @@ -89,11 +89,11 @@ public static dChunk valueOf(String string, TagContext context) { String[] parts = string.split(","); if (parts.length == 3) { try { - return new dChunk(dWorld.valueOf(parts[2], context), Integer.valueOf(parts[0]), Integer.valueOf(parts[1])); + return new ChunkTag(WorldTag.valueOf(parts[2], context), Integer.valueOf(parts[0]), Integer.valueOf(parts[1])); } catch (Exception e) { if (context == null || context.debug) { - Debug.log("Minor: valueOf dChunk returning null: " + "ch@" + string); + Debug.log("Minor: valueOf ChunkTag returning null: " + "ch@" + string); } return null; } @@ -101,7 +101,7 @@ public static dChunk valueOf(String string, TagContext context) { } else { if (context == null || context.debug) { - Debug.log("Minor: valueOf dChunk unable to handle malformed format: " + "ch@" + string); + Debug.log("Minor: valueOf ChunkTag unable to handle malformed format: " + "ch@" + string); } } @@ -120,7 +120,7 @@ public static boolean matches(String string) { int chunkX, chunkZ; - dWorld world; + WorldTag world; Chunk cachedChunk; @@ -132,36 +132,36 @@ public Chunk getChunk() { } /** - * dChunk can be constructed with a Chunk + * ChunkTag can be constructed with a Chunk * * @param chunk The chunk to use. */ - public dChunk(Chunk chunk) { + public ChunkTag(Chunk chunk) { this.cachedChunk = chunk; - world = new dWorld(chunk.getWorld()); + world = new WorldTag(chunk.getWorld()); chunkX = chunk.getX(); chunkZ = chunk.getZ(); } - public dChunk(dWorld world, int x, int z) { + public ChunkTag(WorldTag world, int x, int z) { this.world = world; chunkX = x; chunkZ = z; } /** - * dChunk can be constructed with a Location (or dLocation) + * ChunkTag can be constructed with a Location (or LocationTag) * * @param location The location of the chunk. */ - public dChunk(Location location) { - world = new dWorld(location.getWorld()); + public ChunkTag(Location location) { + world = new WorldTag(location.getWorld()); chunkX = location.getBlockX() >> 4; chunkZ = location.getBlockZ() >> 4; } - public dLocation getCenter() { - return new dLocation(getWorld(), getX() * 16 + 8, 128, getZ() * 16 + 8); + public LocationTag getCenter() { + return new LocationTag(getWorld(), getX() * 16 + 8, 128, getZ() * 16 + 8); } public int getX() { @@ -197,7 +197,7 @@ public String getPrefix() { } @Override - public dChunk setPrefix(String prefix) { + public ChunkTag setPrefix(String prefix) { this.prefix = prefix; return this; } @@ -229,8 +229,8 @@ public boolean isLoaded() { public static void registerTags() { // <--[tag] - // @attribute ,<#>]> - // @returns dChunk + // @attribute ,<#>]> + // @returns ChunkTag // @description // Returns the chunk with the specified coordinates added to it. // --> @@ -238,27 +238,27 @@ public static void registerTags() { @Override public String run(Attribute attribute, ObjectTag object) { if (!attribute.hasContext(1)) { - Debug.echoError("The tag ch@chunk.add[<#>,<#>] must have a value."); + Debug.echoError("The tag ChunkTag.add[<#>,<#>] must have a value."); return null; } List coords = CoreUtilities.split(attribute.getContext(1), ','); if (coords.size() < 2) { - Debug.echoError("The tag ch@chunk.add[<#>,<#>] requires two values!"); + Debug.echoError("The tag ChunkTag.add[<#>,<#>] requires two values!"); return null; } int x = ArgumentHelper.getIntegerFrom(coords.get(0)); int z = ArgumentHelper.getIntegerFrom(coords.get(1)); - dChunk chunk = (dChunk) object; + ChunkTag chunk = (ChunkTag) object; - return new dChunk(chunk.world, chunk.chunkX + x, chunk.chunkZ + z) + return new ChunkTag(chunk.world, chunk.chunkX + x, chunk.chunkZ + z) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute ,<#>]> - // @returns dChunk + // @attribute ,<#>]> + // @returns ChunkTag // @description // Returns the chunk with the specified coordinates subtracted from it. // --> @@ -266,26 +266,26 @@ public String run(Attribute attribute, ObjectTag object) { @Override public String run(Attribute attribute, ObjectTag object) { if (!attribute.hasContext(1)) { - Debug.echoError("The tag ch@chunk.add[<#>,<#>] must have a value."); + Debug.echoError("The tag ChunkTag.add[<#>,<#>] must have a value."); return null; } List coords = CoreUtilities.split(attribute.getContext(1), ','); if (coords.size() < 2) { - Debug.echoError("The tag ch@chunk.sub[<#>,<#>] requires two values!"); + Debug.echoError("The tag ChunkTag.sub[<#>,<#>] requires two values!"); return null; } int x = ArgumentHelper.getIntegerFrom(coords.get(0)); int z = ArgumentHelper.getIntegerFrom(coords.get(1)); - dChunk chunk = (dChunk) object; + ChunkTag chunk = (ChunkTag) object; - return new dChunk(chunk.world, chunk.chunkX - x, chunk.chunkZ - z) + return new ChunkTag(chunk.world, chunk.chunkX - x, chunk.chunkZ - z) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns true if the chunk is currently loaded into memory. @@ -293,13 +293,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("is_loaded", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dChunk) object).isLoaded()) + return new ElementTag(((ChunkTag) object).isLoaded()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the x coordinate of the chunk. @@ -307,12 +307,12 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("x", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dChunk) object).chunkX).getAttribute(attribute.fulfill(1)); + return new ElementTag(((ChunkTag) object).chunkX).getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the z coordinate of the chunk. @@ -320,42 +320,42 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("z", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dChunk) object).chunkZ).getAttribute(attribute.fulfill(1)); + return new ElementTag(((ChunkTag) object).chunkZ).getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute - // @returns dWorld + // @attribute + // @returns WorldTag // @description // Returns the world associated with the chunk. // --> registerTag("world", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return ((dChunk) object).world.getAttribute(attribute.fulfill(1)); + return ((ChunkTag) object).world.getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute - // @returns dCuboid + // @attribute + // @returns CuboidTag // @description // Returns a cuboid of this chunk. // --> registerTag("cuboid", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - dChunk chunk = (dChunk) object; - return new dCuboid(new Location(chunk.getWorld(), chunk.getX() * 16, 0, chunk.getZ() * 16), + ChunkTag chunk = (ChunkTag) object; + return new CuboidTag(new Location(chunk.getWorld(), chunk.getX() * 16, 0, chunk.getZ() * 16), new Location(chunk.getWorld(), chunk.getX() * 16 + 15, 255, chunk.getZ() * 16 + 15)) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute - // @returns ListTag(dEntity) + // @attribute + // @returns ListTag(EntityTag) // @description // Returns a list of entities in the chunk. // --> @@ -363,9 +363,9 @@ public String run(Attribute attribute, ObjectTag object) { @Override public String run(Attribute attribute, ObjectTag object) { ListTag entities = new ListTag(); - if (((dChunk) object).isLoaded()) { - for (Entity ent : ((dChunk) object).getChunk().getEntities()) { - entities.addObject(new dEntity(ent).getDenizenObject()); + if (((ChunkTag) object).isLoaded()) { + for (Entity ent : ((ChunkTag) object).getChunk().getEntities()) { + entities.addObject(new EntityTag(ent).getDenizenObject()); } } @@ -374,8 +374,8 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute - // @returns ListTag(dEntity) + // @attribute + // @returns ListTag(EntityTag) // @description // Returns a list of living entities in the chunk. This includes Players, mobs, NPCs, etc., but excludes // dropped items, experience orbs, etc. @@ -384,10 +384,10 @@ public String run(Attribute attribute, ObjectTag object) { @Override public String run(Attribute attribute, ObjectTag object) { ListTag entities = new ListTag(); - if (((dChunk) object).isLoaded()) { - for (Entity ent : ((dChunk) object).getChunk().getEntities()) { + if (((ChunkTag) object).isLoaded()) { + for (Entity ent : ((ChunkTag) object).getChunk().getEntities()) { if (ent instanceof LivingEntity) { - entities.addObject(new dEntity(ent).getDenizenObject()); + entities.addObject(new EntityTag(ent).getDenizenObject()); } } } @@ -397,8 +397,8 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute - // @returns ListTag(dPlayer) + // @attribute + // @returns ListTag(PlayerTag) // @description // Returns a list of players in the chunk. // --> @@ -406,10 +406,10 @@ public String run(Attribute attribute, ObjectTag object) { @Override public String run(Attribute attribute, ObjectTag object) { ListTag entities = new ListTag(); - if (((dChunk) object).isLoaded()) { - for (Entity ent : ((dChunk) object).getChunk().getEntities()) { - if (dEntity.isPlayer(ent)) { - entities.addObject(new dPlayer((Player) ent)); + if (((ChunkTag) object).isLoaded()) { + for (Entity ent : ((ChunkTag) object).getChunk().getEntities()) { + if (EntityTag.isPlayer(ent)) { + entities.addObject(new PlayerTag((Player) ent)); } } } @@ -419,7 +419,7 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute + // @attribute // @returns ListTag // @description // Returns a list of the height of each block in the chunk. @@ -427,7 +427,7 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("height_map", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - int[] heightMap = ((dChunk) object).getHeightMap(); + int[] heightMap = ((ChunkTag) object).getHeightMap(); List height_map = new ArrayList<>(heightMap.length); for (int i : heightMap) { height_map.add(String.valueOf(i)); @@ -437,7 +437,7 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @description // Returns the average height of the blocks in the chunk. @@ -446,7 +446,7 @@ public String run(Attribute attribute, ObjectTag object) { @Override public String run(Attribute attribute, ObjectTag object) { int sum = 0; - int[] heightMap = ((dChunk) object).getHeightMap(); + int[] heightMap = ((ChunkTag) object).getHeightMap(); for (int i : heightMap) { sum += i; } @@ -455,7 +455,7 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // scans the heights of the blocks to check variance between them. If no number is supplied, is_flat will return @@ -467,7 +467,7 @@ public String run(Attribute attribute, ObjectTag object) { public String run(Attribute attribute, ObjectTag object) { int tolerance = attribute.hasContext(1) && ArgumentHelper.matchesInteger(attribute.getContext(1)) ? Integer.valueOf(attribute.getContext(1)) : 2; - int[] heightMap = ((dChunk) object).getHeightMap(); + int[] heightMap = ((ChunkTag) object).getHeightMap(); int x = heightMap[0]; for (int i : heightMap) { if (Math.abs(x - i) > tolerance) { @@ -480,8 +480,8 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute - // @returns ListTag(dLocation) + // @attribute + // @returns ListTag(LocationTag) // @description // Returns a list of the highest non-air surface blocks in the chunk. // --> @@ -491,7 +491,7 @@ public String run(Attribute attribute, ObjectTag object) { ListTag surface_blocks = new ListTag(); for (int x = 0; x < 16; x++) { for (int z = 0; z < 16; z++) { - surface_blocks.add(new dLocation(((dChunk) object).getChunk().getBlock(x, ((dChunk) object) + surface_blocks.add(new LocationTag(((ChunkTag) object).getChunk().getBlock(x, ((ChunkTag) object) .getSnapshot().getHighestBlockYAt(x, z) - 1, z).getLocation()).identify()); } } @@ -501,15 +501,15 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute - // @returns ListTag(dLocation) + // @attribute + // @returns ListTag(LocationTag) // @description // Returns whether the chunk is a specially located 'slime spawner' chunk. // --> registerTag("spawn_slimes", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - dChunk chunk = (dChunk) object; + ChunkTag chunk = (ChunkTag) object; Random random = new Random(chunk.getWorld().getSeed() + chunk.getX() * chunk.getX() * 4987142 + chunk.getX() * 5947611 + @@ -520,10 +520,10 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description - // Always returns 'Chunk' for dChunk objects. All objects fetchable by the Object Fetcher will return the + // Always returns 'Chunk' for ChunkTag objects. All objects fetchable by the Object Fetcher will return the // type of object that is fulfilling this attribute. // --> registerTag("type", new TagRunnable() { @@ -577,7 +577,7 @@ public void applyProperty(Mechanism mechanism) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dChunk + // @object ChunkTag // @name unload // @input None // @description @@ -595,7 +595,7 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dChunk + // @object ChunkTag // @name unload_without_saving // @input None // @description @@ -608,7 +608,7 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dChunk + // @object ChunkTag // @name load // @input None // @description @@ -621,7 +621,7 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dChunk + // @object ChunkTag // @name regenerate // @input None // @description @@ -634,7 +634,7 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dChunk + // @object ChunkTag // @name refresh_chunk // @input None // @description @@ -649,9 +649,9 @@ public void adjust(Mechanism mechanism) { new BukkitRunnable() { @Override public void run() { - for (Map blocks : FakeBlock.getBlocks().values()) { - for (Map.Entry locBlock : blocks.entrySet()) { - dLocation location = locBlock.getKey(); + for (Map blocks : FakeBlock.getBlocks().values()) { + for (Map.Entry locBlock : blocks.entrySet()) { + LocationTag location = locBlock.getKey(); if (Math.floor(location.getX() / 16) == chunkX && Math.floor(location.getZ() / 16) == chunkZ) { locBlock.getValue().updateBlock(); @@ -663,7 +663,7 @@ public void run() { } // <--[mechanism] - // @object dChunk + // @object ChunkTag // @name refresh_chunk_sections // @input None // @description diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/dColor.java b/plugin/src/main/java/com/denizenscript/denizen/objects/ColorTag.java similarity index 77% rename from plugin/src/main/java/com/denizenscript/denizen/objects/dColor.java rename to plugin/src/main/java/com/denizenscript/denizen/objects/ColorTag.java index 8ff3887db7..d75536a348 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/dColor.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/ColorTag.java @@ -14,15 +14,15 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -public class dColor implements ObjectTag { +public class ColorTag implements ObjectTag { // <--[language] - // @name dColor + // @name ColorTag // @group Object System // @description - // A dColor represents an RGB color code. + // A ColorTag represents an RGB color code. // - // Note that a dColor is NOT a base dye color (used by wool, etc). That is handled by a separate naming system. + // Note that a ColorTag is NOT a base dye color (used by wool, etc). That is handled by a separate naming system. // // For format info, see <@link language co@> // @@ -32,8 +32,8 @@ public class dColor implements ObjectTag { // @name co@ // @group Object Fetcher System // @description - // co@ refers to the 'object identifier' of a dColor. The 'co@' is notation for Denizen's Object - // Fetcher. The constructor for a dColor is ,,, or the name of a color. + // co@ refers to the 'object identifier' of a ColorTag. The 'co@' is notation for Denizen's Object + // Fetcher. The constructor for a ColorTag is ,,, or the name of a color. // For example, 'co@50,64,128' or 'co@red'. // // A list of accepted color names can be found at @@ -41,7 +41,7 @@ public class dColor implements ObjectTag { // // Red/green/blue values are each from 0 to 256. // - // For general info, see <@link language dColor> + // For general info, see <@link language ColorTag> // // --> @@ -51,7 +51,7 @@ public class dColor implements ObjectTag { // OBJECT FETCHER //////////////// - public static dColor valueOf(String string) { + public static ColorTag valueOf(String string) { return valueOf(string, null); } @@ -62,14 +62,14 @@ public static dColor valueOf(String string) { * @return a Color, or null if incorrectly formatted */ @Fetchable("co") - public static dColor valueOf(String string, TagContext context) { + public static ColorTag valueOf(String string, TagContext context) { string = string.toUpperCase().replace("CO@", ""); if (string.matches("RANDOM")) { // Get a color using random RGB values - return new dColor(CoreUtilities.getRandom().nextInt(256), + return new ColorTag(CoreUtilities.getRandom().nextInt(256), CoreUtilities.getRandom().nextInt(256), CoreUtilities.getRandom().nextInt(256)); } @@ -77,7 +77,7 @@ public static dColor valueOf(String string, TagContext context) { Matcher m = rgbPattern.matcher(string); if (m.matches()) { - return new dColor(ArgumentHelper.getIntegerFrom(m.group(1)), + return new ColorTag(ArgumentHelper.getIntegerFrom(m.group(1)), ArgumentHelper.getIntegerFrom(m.group(2)), ArgumentHelper.getIntegerFrom(m.group(3))); } @@ -95,7 +95,7 @@ public static dColor valueOf(String string, TagContext context) { } if (colorField != null) { - return new dColor(colorField); + return new ColorTag(colorField); } // No match @@ -136,11 +136,11 @@ public static boolean matches(String arg) { // Constructors ///////////// - public dColor(int red, int green, int blue) { + public ColorTag(int red, int green, int blue) { color = Color.fromRGB(red, green, blue); } - public dColor(Field field) { + public ColorTag(Field field) { try { color = (Color) field.get(null); } @@ -149,11 +149,11 @@ public dColor(Field field) { } } - public dColor(Color color) { + public ColorTag(Color color) { this.color = color; } - public dColor(DyeColor dyeColor) { + public ColorTag(DyeColor dyeColor) { this.color = dyeColor.getColor(); } @@ -223,7 +223,7 @@ public ObjectTag setPrefix(String prefix) { public static void registerTags() { // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the red value of this color. @@ -231,12 +231,12 @@ public static void registerTags() { registerTag("red", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dColor) object).color.getRed()).getAttribute(attribute.fulfill(1)); + return new ElementTag(((ColorTag) object).color.getRed()).getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the green value of this color. @@ -244,12 +244,12 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("green", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dColor) object).color.getGreen()).getAttribute(attribute.fulfill(1)); + return new ElementTag(((ColorTag) object).color.getGreen()).getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the blue value of this color. @@ -257,12 +257,12 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("blue", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dColor) object).color.getBlue()).getAttribute(attribute.fulfill(1)); + return new ElementTag(((ColorTag) object).color.getBlue()).getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the RGB value of this color. @@ -271,13 +271,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("rgb", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - Color color = ((dColor) object).color; + Color color = ((ColorTag) object).color; return new ElementTag(color.getRed() + "," + color.getGreen() + "," + color.getBlue()).getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the hue value of this color. @@ -285,12 +285,12 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("hue", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dColor) object).ToHSB()[0]).getAttribute(attribute.fulfill(1)); + return new ElementTag(((ColorTag) object).ToHSB()[0]).getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the saturation value of this color. @@ -298,12 +298,12 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("saturation", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dColor) object).ToHSB()[1]).getAttribute(attribute.fulfill(1)); + return new ElementTag(((ColorTag) object).ToHSB()[1]).getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the brightness value of this color. @@ -311,12 +311,12 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("brightness", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dColor) object).ToHSB()[2]).getAttribute(attribute.fulfill(1)); + return new ElementTag(((ColorTag) object).ToHSB()[2]).getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the HSV value of this color. @@ -325,13 +325,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("hsv", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - int[] HSV = ((dColor) object).ToHSB(); + int[] HSV = ((ColorTag) object).ToHSB(); return new ElementTag(HSV[1] + "," + HSV[1] + "," + HSV[2]).getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the name of this color (or red,green,blue if none). @@ -344,8 +344,8 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute ]> - // @returns dColor + // @attribute ]> + // @returns ColorTag // @description // Returns the color that results if you mix this color with another. // --> @@ -356,9 +356,9 @@ public String run(Attribute attribute, ObjectTag object) { Debug.echoError("The tag ListTag.insert[...] must have a value."); return null; } - dColor mixed_with = dColor.valueOf(attribute.getContext(1)); + ColorTag mixed_with = ColorTag.valueOf(attribute.getContext(1)); if (mixed_with != null) { - return new dColor(((dColor) object).color.mixColors(mixed_with.getColor())).getAttribute(attribute.fulfill(1)); + return new ColorTag(((ColorTag) object).color.mixColors(mixed_with.getColor())).getAttribute(attribute.fulfill(1)); } else { Debug.echoError("'" + attribute.getContext(1) + "' is not a valid color!"); @@ -368,28 +368,28 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @description // Returns the color as a particle offset, for use with PlayEffect. // --> registerTag("to_particle_offset", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - Color valid = ((dColor) object).color; + Color valid = ((ColorTag) object).color; if (valid.asRGB() == 0) { valid = Color.fromRGB(1, 0, 0); } - return new dLocation(null, valid.getRed() / 255F, valid.getGreen() / 255F, valid.getBlue() / 255F) + return new LocationTag(null, valid.getRed() / 255F, valid.getGreen() / 255F, valid.getBlue() / 255F) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description - // Always returns 'Color' for dColor objects. All objects fetchable by the Object Fetcher will return the + // Always returns 'Color' for ColorTag objects. All objects fetchable by the Object Fetcher will return the // type of object that is fulfilling this attribute. // --> registerTag("type", new TagRunnable() { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/dCuboid.java b/plugin/src/main/java/com/denizenscript/denizen/objects/CuboidTag.java similarity index 71% rename from plugin/src/main/java/com/denizenscript/denizen/objects/dCuboid.java rename to plugin/src/main/java/com/denizenscript/denizen/objects/CuboidTag.java index 5b17cfc019..2cb2dc93a7 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/dCuboid.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/CuboidTag.java @@ -30,19 +30,19 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -public class dCuboid implements ObjectTag, Cloneable, Notable, Adjustable { +public class CuboidTag implements ObjectTag, Cloneable, Notable, Adjustable { // <--[language] - // @name dCuboid + // @name CuboidTag // @group Object System // @description - // A dCuboid represents a cuboidal region in the world. + // A CuboidTag represents a cuboidal region in the world. // // The word 'cuboid' means a less strict cube. // Basically: a "cuboid" is to a 3D "cube" what a "rectangle" is to a 2D "square". // // One 'cuboid' consists of two points: the low point and a high point. - // a dCuboid can contain as many cuboids within itself as needed (this allows forming more complex shapes from a single dCuboid). + // a CuboidTag can contain as many cuboids within itself as needed (this allows forming more complex shapes from a single CuboidTag). // // For format info, see <@link language cu@> // @@ -52,18 +52,18 @@ public class dCuboid implements ObjectTag, Cloneable, Notable, Adjustable { // @name cu@ // @group Object Fetcher System // @description - // cu@ refers to the 'object identifier' of a dCuboid. The 'cu@' is notation for Denizen's Object - // Fetcher. The constructor for a dCuboid is ,,,|... + // cu@ refers to the 'object identifier' of a CuboidTag. The 'cu@' is notation for Denizen's Object + // Fetcher. The constructor for a CuboidTag is ,,,|... // For example, 'cu@1,2,3,space|4,5,6,space'. // - // For general info, see <@link language dCuboid> + // For general info, see <@link language CuboidTag> // // --> // Cloning @Override - public dCuboid clone() throws CloneNotSupportedException { - dCuboid cuboid = (dCuboid) super.clone(); + public CuboidTag clone() throws CloneNotSupportedException { + CuboidTag cuboid = (CuboidTag) super.clone(); cuboid.pairs = new ArrayList<>(pairs.size()); for (LocationPair pair : pairs) { cuboid.pairs.add(new LocationPair(pair.point_1.clone(), pair.point_2.clone())); @@ -76,9 +76,9 @@ public dCuboid clone() throws CloneNotSupportedException { // STATIC METHODS ///////////////// - public static List getNotableCuboidsContaining(Location location) { - List cuboids = new ArrayList<>(); - for (dCuboid cuboid : NotableManager.getAllType(dCuboid.class)) { + public static List getNotableCuboidsContaining(Location location) { + List cuboids = new ArrayList<>(); + for (CuboidTag cuboid : NotableManager.getAllType(CuboidTag.class)) { if (cuboid.isInsideCuboid(location)) { cuboids.add(cuboid); } @@ -92,22 +92,14 @@ public static List getNotableCuboidsContaining(Location location) { // OBJECT FETCHER //////////////// - public static dCuboid valueOf(String string) { + public static CuboidTag valueOf(String string) { return valueOf(string, null); } final static Pattern cuboid_by_saved = Pattern.compile("(cu@)?(.+)"); - /** - * Gets a Location Object from a string form of id,x,y,z,world - * or a dScript argument (location:)x,y,z,world. If including an Id, - * this location will persist and can be recalled at any time. - * - * @param string the string or dScript argument String - * @return a Location, or null if incorrectly formatted - */ @Fetchable("cu") - public static dCuboid valueOf(String string, TagContext context) { + public static CuboidTag valueOf(String string, TagContext context) { if (string == null) { return null; } @@ -120,34 +112,34 @@ public static dCuboid valueOf(String string, TagContext context) { // If there's a | and the first two points look like locations, assume it's a valid location-list constructor. if (positions.size() > 1 - && dLocation.matches(positions.get(0)) - && dLocation.matches(positions.get(1))) { + && LocationTag.matches(positions.get(0)) + && LocationTag.matches(positions.get(1))) { if (positions.size() % 2 != 0) { if (context == null || context.debug) { - Debug.echoError("valueOf dCuboid returning null (Uneven number of locations): '" + string + "'."); + Debug.echoError("valueOf CuboidTag returning null (Uneven number of locations): '" + string + "'."); } return null; } // Form a cuboid to add to - dCuboid toReturn = new dCuboid(); + CuboidTag toReturn = new CuboidTag(); // Add to the cuboid for (int i = 0; i < positions.size(); i += 2) { - dLocation pos_1 = dLocation.valueOf(positions.get(i)); - dLocation pos_2 = dLocation.valueOf(positions.get(i + 1)); + LocationTag pos_1 = LocationTag.valueOf(positions.get(i)); + LocationTag pos_2 = LocationTag.valueOf(positions.get(i + 1)); // Must be valid locations if (pos_1 == null || pos_2 == null) { if (context == null || context.debug) { - Debug.echoError("valueOf in dCuboid returning null (null locations): '" + string + "'."); + Debug.echoError("valueOf in CuboidTag returning null (null locations): '" + string + "'."); } return null; } // Must have worlds if (pos_1.getWorldName() == null || pos_2.getWorldName() == null) { if (context == null || context.debug) { - Debug.echoError("valueOf in dCuboid returning null (null worlds): '" + string + "'."); + Debug.echoError("valueOf in CuboidTag returning null (null worlds): '" + string + "'."); } return null; } @@ -161,17 +153,17 @@ public static dCuboid valueOf(String string, TagContext context) { } //////// - // Match @object format for Notable dCuboids + // Match @object format for Notable CuboidTags Matcher m; m = cuboid_by_saved.matcher(string); - if (m.matches() && NotableManager.isType(m.group(2), dCuboid.class)) { - return (dCuboid) NotableManager.getSavedObject(m.group(2)); + if (m.matches() && NotableManager.isType(m.group(2), CuboidTag.class)) { + return (CuboidTag) NotableManager.getSavedObject(m.group(2)); } if (context == null || context.debug) { - Debug.echoError("valueOf dCuboid returning null: " + string); + Debug.echoError("valueOf CuboidTag returning null: " + string); } return null; @@ -193,7 +185,7 @@ public static boolean matches(String string) { // Check for named cuboid: cu@notable_cuboid m = cuboid_by_saved.matcher(string); - if (m.matches() && NotableManager.isType(m.group(2), dCuboid.class)) { + if (m.matches() && NotableManager.isType(m.group(2), CuboidTag.class)) { return true; } @@ -209,21 +201,21 @@ public static boolean matches(String string) { public static class LocationPair { - public dLocation low; - public dLocation high; - dLocation point_1; - dLocation point_2; + public LocationTag low; + public LocationTag high; + LocationTag point_1; + LocationTag point_2; int x_distance; int y_distance; int z_distance; - public LocationPair(dLocation point_1, dLocation point_2) { + public LocationPair(LocationTag point_1, LocationTag point_2) { this.point_1 = point_1; this.point_2 = point_2; regenerate(); } - public void changePoint(int number, dLocation point) { + public void changePoint(int number, LocationTag point) { if (number == 1) { this.point_1 = point; } @@ -254,8 +246,8 @@ public void regenerate() { ? point_1.getBlockZ() : point_2.getBlockZ()); // Specify defining locations to the pair - low = new dLocation(world, x_low, y_low, z_low); - high = new dLocation(world, x_high, y_high, z_high); + low = new LocationTag(world, x_low, y_low, z_low); + high = new LocationTag(world, x_high, y_high, z_high); generateDistances(); } @@ -271,20 +263,20 @@ public void generateDistances() { // Constructors/Instance Methods ////////////////// - // Location Pairs (low, high) that make up the dCuboid + // Location Pairs (low, high) that make up the CuboidTag public List pairs = new ArrayList<>(); - // Only put dMaterials in filter. + // Only put MaterialTags in filter. ArrayList filter = new ArrayList<>(); /** * Construct the cuboid without adding pairs * ONLY use this if addPair will be called immediately after! */ - public dCuboid() { + public CuboidTag() { } - public dCuboid(Location point_1, Location point_2) { + public CuboidTag(Location point_1, Location point_2) { addPair(point_1, point_2); } @@ -299,7 +291,7 @@ public void addPair(Location point_1, Location point_2) { return; } // Make a new pair - LocationPair pair = new LocationPair(new dLocation(point_1), new dLocation(point_2)); + LocationPair pair = new LocationPair(new LocationTag(point_1), new LocationTag(point_2)); // Add it to the Cuboid pairs list pairs.add(pair); } @@ -326,25 +318,25 @@ public boolean isInsideCuboid(Location location) { } - public dCuboid addBlocksToFilter(List addl) { + public CuboidTag addBlocksToFilter(List addl) { filter.addAll(addl); return this; } - public dCuboid removeBlocksFromFilter(List addl) { + public CuboidTag removeBlocksFromFilter(List addl) { filter.removeAll(addl); return this; } - public dCuboid removeFilter() { + public CuboidTag removeFilter() { filter.clear(); return this; } - public dCuboid setAsFilter(List list) { + public CuboidTag setAsFilter(List list) { filter.clear(); filter.addAll(list); return this; @@ -357,24 +349,24 @@ public ListTag getShell() { ListTag list = new ListTag(); for (LocationPair pair : pairs) { - dLocation low = pair.low; - dLocation high = pair.high; + LocationTag low = pair.low; + LocationTag high = pair.high; int y_distance = pair.y_distance; int z_distance = pair.z_distance; int x_distance = pair.x_distance; for (int x = 0; x < x_distance; x++) { for (int y = 0; y < y_distance; y++) { - list.addObject(new dLocation(low.getWorld(), low.getBlockX() + x, low.getBlockY() + y, low.getBlockZ())); - list.addObject(new dLocation(low.getWorld(), low.getBlockX() + x, low.getBlockY() + y, high.getBlockZ())); + list.addObject(new LocationTag(low.getWorld(), low.getBlockX() + x, low.getBlockY() + y, low.getBlockZ())); + list.addObject(new LocationTag(low.getWorld(), low.getBlockX() + x, low.getBlockY() + y, high.getBlockZ())); index++; if (index > max) { return list; } } for (int z = 0; z < z_distance; z++) { - list.addObject(new dLocation(low.getWorld(), low.getBlockX() + x, low.getBlockY(), low.getBlockZ() + z)); - list.addObject(new dLocation(low.getWorld(), low.getBlockX() + x, high.getBlockY(), low.getBlockZ() + z)); + list.addObject(new LocationTag(low.getWorld(), low.getBlockX() + x, low.getBlockY(), low.getBlockZ() + z)); + list.addObject(new LocationTag(low.getWorld(), low.getBlockX() + x, high.getBlockY(), low.getBlockZ() + z)); index++; if (index > max) { return list; @@ -383,8 +375,8 @@ public ListTag getShell() { } for (int y = 0; y < y_distance; y++) { for (int z = 0; z < z_distance; z++) { - list.addObject(new dLocation(low.getWorld(), low.getBlockX(), low.getBlockY() + y, low.getBlockZ() + z)); - list.addObject(new dLocation(low.getWorld(), high.getBlockX(), low.getBlockY() + y, low.getBlockZ() + z)); + list.addObject(new LocationTag(low.getWorld(), low.getBlockX(), low.getBlockY() + y, low.getBlockZ() + z)); + list.addObject(new LocationTag(low.getWorld(), high.getBlockX(), low.getBlockY() + y, low.getBlockZ() + z)); index++; if (index > max) { return list; @@ -411,29 +403,29 @@ public ListTag getOutline() { for (LocationPair pair : pairs) { - dLocation loc_1 = pair.low; - dLocation loc_2 = pair.high; + LocationTag loc_1 = pair.low; + LocationTag loc_2 = pair.high; int y_distance = pair.y_distance; int z_distance = pair.z_distance; int x_distance = pair.x_distance; for (int y = loc_1.getBlockY(); y < loc_1.getBlockY() + y_distance; y++) { - list.addObject(new dLocation(loc_1.getWorld(), + list.addObject(new LocationTag(loc_1.getWorld(), loc_1.getBlockX(), y, loc_1.getBlockZ())); - list.addObject(new dLocation(loc_1.getWorld(), + list.addObject(new LocationTag(loc_1.getWorld(), loc_2.getBlockX(), y, loc_2.getBlockZ())); - list.addObject(new dLocation(loc_1.getWorld(), + list.addObject(new LocationTag(loc_1.getWorld(), loc_1.getBlockX(), y, loc_2.getBlockZ())); - list.addObject(new dLocation(loc_1.getWorld(), + list.addObject(new LocationTag(loc_1.getWorld(), loc_2.getBlockX(), y, loc_1.getBlockZ())); @@ -444,22 +436,22 @@ public ListTag getOutline() { } for (int x = loc_1.getBlockX(); x < loc_1.getBlockX() + x_distance; x++) { - list.addObject(new dLocation(loc_1.getWorld(), + list.addObject(new LocationTag(loc_1.getWorld(), x, loc_1.getBlockY(), loc_1.getBlockZ())); - list.addObject(new dLocation(loc_1.getWorld(), + list.addObject(new LocationTag(loc_1.getWorld(), x, loc_1.getBlockY(), loc_2.getBlockZ())); - list.addObject(new dLocation(loc_1.getWorld(), + list.addObject(new LocationTag(loc_1.getWorld(), x, loc_2.getBlockY(), loc_2.getBlockZ())); - list.addObject(new dLocation(loc_1.getWorld(), + list.addObject(new LocationTag(loc_1.getWorld(), x, loc_2.getBlockY(), loc_1.getBlockZ())); @@ -470,22 +462,22 @@ public ListTag getOutline() { } for (int z = loc_1.getBlockZ(); z < loc_1.getBlockZ() + z_distance; z++) { - list.addObject(new dLocation(loc_1.getWorld(), + list.addObject(new LocationTag(loc_1.getWorld(), loc_1.getBlockX(), loc_1.getBlockY(), z)); - list.addObject(new dLocation(loc_1.getWorld(), + list.addObject(new LocationTag(loc_1.getWorld(), loc_2.getBlockX(), loc_2.getBlockY(), z)); - list.addObject(new dLocation(loc_1.getWorld(), + list.addObject(new LocationTag(loc_1.getWorld(), loc_1.getBlockX(), loc_2.getBlockY(), z)); - list.addObject(new dLocation(loc_1.getWorld(), + list.addObject(new LocationTag(loc_1.getWorld(), loc_2.getBlockX(), loc_1.getBlockY(), z)); @@ -504,12 +496,12 @@ public ListTag getBlocks() { return getBlocks(null); } - private boolean matchesMaterialList(Location loc, List materials) { + private boolean matchesMaterialList(Location loc, List materials) { if (materials == null) { return true; } - dMaterial mat = new dMaterial(loc.getBlock()); - for (dMaterial material : materials) { + MaterialTag mat = new MaterialTag(loc.getBlock()); + for (MaterialTag material : materials) { if (mat.equals(material) || mat.getMaterial() == material.getMaterial()) { return true; } @@ -517,24 +509,24 @@ private boolean matchesMaterialList(Location loc, List materials) { return false; } - public ListTag getBlocks(List materials) { - List locs = getBlocks_internal(materials); + public ListTag getBlocks(List materials) { + List locs = getBlocks_internal(materials); ListTag list = new ListTag(); - for (dLocation loc : locs) { + for (LocationTag loc : locs) { list.add(loc.identify()); } return list; } - public List getBlocks_internal(List materials) { + public List getBlocks_internal(List materials) { int max = Settings.blockTagsMaxBlocks(); - dLocation loc; - List list = new ArrayList<>(); + LocationTag loc; + List list = new ArrayList<>(); int index = 0; for (LocationPair pair : pairs) { - dLocation loc_1 = pair.low; + LocationTag loc_1 = pair.low; int y_distance = pair.y_distance; int z_distance = pair.z_distance; int x_distance = pair.x_distance; @@ -542,14 +534,14 @@ public List getBlocks_internal(List materials) { for (int x = 0; x != x_distance + 1; x++) { for (int y = 0; y != y_distance + 1; y++) { for (int z = 0; z != z_distance + 1; z++) { - loc = new dLocation(loc_1.clone().add(x, y, z)); + loc = new LocationTag(loc_1.clone().add(x, y, z)); if (loc.getY() < 0 || loc.getY() > 255) { continue; } if (!filter.isEmpty()) { // TODO: Should 'filter' exist? // Check filter for (ObjectTag material : filter) { - if (((dMaterial) material).matchesBlock(loc.getBlock())) { + if (((MaterialTag) material).matchesBlock(loc.getBlock())) { if (matchesMaterialList(loc, materials)) { list.add(loc); } @@ -575,10 +567,10 @@ public List getBlocks_internal(List materials) { } public void setBlocks_internal(List materials) { - dLocation loc; + LocationTag loc; int index = 0; for (LocationPair pair : pairs) { - dLocation loc_1 = pair.low; + LocationTag loc_1 = pair.low; int y_distance = pair.y_distance; int z_distance = pair.z_distance; int x_distance = pair.x_distance; @@ -597,11 +589,11 @@ public void setBlocks_internal(List materials) { } public BlockData getBlockAt(double nX, double nY, double nZ, List materials) { - dLocation loc; + LocationTag loc; int index = 0; // TODO: calculate rather than cheat for (LocationPair pair : pairs) { - dLocation loc_1 = pair.low; + LocationTag loc_1 = pair.low; int y_distance = pair.y_distance; int z_distance = pair.z_distance; int x_distance = pair.x_distance; @@ -620,15 +612,15 @@ public BlockData getBlockAt(double nX, double nY, double nZ, List mat return null; } - public List getBlockLocations() { + public List getBlockLocations() { int max = Settings.blockTagsMaxBlocks(); - dLocation loc; - List list = new ArrayList<>(); + LocationTag loc; + List list = new ArrayList<>(); int index = 0; for (LocationPair pair : pairs) { - dLocation loc_1 = pair.low; + LocationTag loc_1 = pair.low; int y_distance = pair.y_distance; int z_distance = pair.z_distance; int x_distance = pair.x_distance; @@ -636,12 +628,12 @@ public List getBlockLocations() { for (int x = 0; x != x_distance + 1; x++) { for (int z = 0; z != z_distance + 1; z++) { for (int y = 0; y != y_distance + 1; y++) { - loc = new dLocation(loc_1.clone() + loc = new LocationTag(loc_1.clone() .add(x, y, z)); if (!filter.isEmpty()) { // Check filter for (ObjectTag material : filter) { - if (loc.getBlock().getType().name().equalsIgnoreCase(((dMaterial) material) + if (loc.getBlock().getType().name().equalsIgnoreCase(((MaterialTag) material) .getMaterial().name())) { list.add(loc); } @@ -669,23 +661,23 @@ public ListTag getSpawnableBlocks() { } /** - * Returns a ListTag of dLocations with 2 vertical blocks of air + * Returns a ListTag of LocationTags with 2 vertical blocks of air * that are safe for players and similar entities to spawn in, * but ignoring blocks in midair * * @return The ListTag */ - public ListTag getSpawnableBlocks(List mats) { + public ListTag getSpawnableBlocks(List mats) { int max = Settings.blockTagsMaxBlocks(); - dLocation loc; + LocationTag loc; ListTag list = new ListTag(); int index = 0; BlockHelper blockHelper = NMSHandler.getInstance().getBlockHelper(); for (LocationPair pair : pairs) { - dLocation loc_1 = pair.low; + LocationTag loc_1 = pair.low; int y_distance = pair.y_distance; int z_distance = pair.z_distance; int x_distance = pair.x_distance; @@ -693,7 +685,7 @@ public ListTag getSpawnableBlocks(List mats) { for (int x = 0; x != x_distance + 1; x++) { for (int y = 0; y != y_distance + 1; y++) { for (int z = 0; z != z_distance + 1; z++) { - loc = new dLocation(loc_1.clone() + loc = new LocationTag(loc_1.clone() .add(x, y, z)); if (blockHelper.isSafeBlock(loc.getBlock().getType()) @@ -724,7 +716,7 @@ public World getWorld() { return pairs.get(0).high.getWorld(); } - public dLocation getHigh(int index) { + public LocationTag getHigh(int index) { if (index < 0) { return null; } @@ -734,7 +726,7 @@ public dLocation getHigh(int index) { return pairs.get(index).high; } - public dLocation getLow(int index) { + public LocationTag getLow(int index) { if (index < 0) { return null; } @@ -792,7 +784,7 @@ public String getPrefix() { @Override - public dCuboid setPrefix(String prefix) { + public CuboidTag setPrefix(String prefix) { this.prefix = prefix; return this; } @@ -856,10 +848,10 @@ public String toString() { public static void registerTags() { // <--[tag] - // @attribute |...]> - // @returns ListTag(dLocation) + // @attribute |...]> + // @returns ListTag(LocationTag) // @description - // Returns each block location within the dCuboid. + // Returns each block location within the CuboidTag. // Optionally, specify a list of materials to only return locations // with that block type. // --> @@ -867,11 +859,11 @@ public static void registerTags() { @Override public String run(Attribute attribute, ObjectTag object) { if (attribute.hasContext(1)) { - return new ListTag(((dCuboid) object).getBlocks(ListTag.valueOf(attribute.getContext(1)).filter(dMaterial.class, attribute.context))) + return new ListTag(((CuboidTag) object).getBlocks(ListTag.valueOf(attribute.getContext(1)).filter(MaterialTag.class, attribute.context))) .getAttribute(attribute.fulfill(1)); } else { - return new ListTag(((dCuboid) object).getBlocks()) + return new ListTag(((CuboidTag) object).getBlocks()) .getAttribute(attribute.fulfill(1)); } } @@ -879,24 +871,24 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("get_blocks", registeredTags.get("blocks")); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description - // Returns the number of cuboids defined in the dCuboid. + // Returns the number of cuboids defined in the CuboidTag. // --> registerTag("members_size", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dCuboid) object).pairs.size()) + return new ElementTag(((CuboidTag) object).pairs.size()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute |...]> - // @returns ListTag(dLocation) + // @attribute |...]> + // @returns ListTag(LocationTag) // @description - // Returns each dLocation within the dCuboid that is + // Returns each LocationTag within the CuboidTag that is // safe for players or similar entities to spawn in. // Optionally, specify a list of materials to only return locations // with that block type. @@ -905,11 +897,11 @@ public String run(Attribute attribute, ObjectTag object) { @Override public String run(Attribute attribute, ObjectTag object) { if (attribute.hasContext(1)) { - return new ListTag(((dCuboid) object).getSpawnableBlocks(ListTag.valueOf(attribute.getContext(1)).filter(dMaterial.class, attribute.context))) + return new ListTag(((CuboidTag) object).getSpawnableBlocks(ListTag.valueOf(attribute.getContext(1)).filter(MaterialTag.class, attribute.context))) .getAttribute(attribute.fulfill(1)); } else { - return new ListTag(((dCuboid) object).getSpawnableBlocks()) + return new ListTag(((CuboidTag) object).getSpawnableBlocks()) .getAttribute(attribute.fulfill(1)); } } @@ -917,50 +909,50 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("get_spawnable_blocks", registeredTags.get("spawnable_blocks")); // <--[tag] - // @attribute - // @returns ListTag(dLocation) + // @attribute + // @returns ListTag(LocationTag) // @description - // Returns each block location on the shell of the dCuboid. + // Returns each block location on the shell of the CuboidTag. // --> registerTag("shell", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return ((dCuboid) object).getShell() + return ((CuboidTag) object).getShell() .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute - // @returns ListTag(dLocation) + // @attribute + // @returns ListTag(LocationTag) // @description - // Returns each block location on the outline of the dCuboid. + // Returns each block location on the outline of the CuboidTag. // --> registerTag("outline", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return ((dCuboid) object).getOutline() + return ((CuboidTag) object).getOutline() .getAttribute(attribute.fulfill(1)); } }); registerTag("get_outline", registeredTags.get("outline")); // <--[tag] - // @attribute - // @returns ListTag(dLocation) + // @attribute + // @returns ListTag(LocationTag) // @description - // Returns the block locations from the dCuboid's filter. + // Returns the block locations from the CuboidTag's filter. // --> registerTag("filter", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ListTag(((dCuboid) object).filter) + return new ListTag(((CuboidTag) object).filter) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Boolean) // @description // Returns whether this cuboid and another intersect. @@ -969,14 +961,14 @@ public String run(Attribute attribute, ObjectTag object) { @Override public String run(Attribute attribute, ObjectTag object) { if (!attribute.hasContext(1)) { - Debug.echoError("The tag cu@cuboid.intersects[...] must have a value."); + Debug.echoError("The tag CuboidTag.intersects[...] must have a value."); return null; } - dCuboid cub2 = dCuboid.valueOf(attribute.getContext(1)); + CuboidTag cub2 = CuboidTag.valueOf(attribute.getContext(1)); if (cub2 != null) { boolean intersects = false; whole_loop: - for (LocationPair pair : ((dCuboid) object).pairs) { + for (LocationPair pair : ((CuboidTag) object).pairs) { for (LocationPair pair2 : cub2.pairs) { if (!pair.low.getWorld().getName().equalsIgnoreCase(pair2.low.getWorld().getName())) { return new ElementTag("false").getAttribute(attribute.fulfill(1)); @@ -999,7 +991,7 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Boolean) // @description // Returns whether this cuboid contains a location. @@ -1008,16 +1000,16 @@ public String run(Attribute attribute, ObjectTag object) { @Override public String run(Attribute attribute, ObjectTag object) { if (!attribute.hasContext(1)) { - Debug.echoError("The tag cu@cuboid.contains_location[...] must have a value."); + Debug.echoError("The tag CuboidTag.contains_location[...] must have a value."); return null; } - dLocation loc = dLocation.valueOf(attribute.getContext(1)); - return new ElementTag(((dCuboid) object).isInsideCuboid(loc)).getAttribute(attribute.fulfill(1)); + LocationTag loc = LocationTag.valueOf(attribute.getContext(1)); + return new ElementTag(((CuboidTag) object).isInsideCuboid(loc)).getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Boolean) // @description // Returns whether this cuboid is fully inside another cuboid. @@ -1026,13 +1018,13 @@ public String run(Attribute attribute, ObjectTag object) { @Override public String run(Attribute attribute, ObjectTag object) { if (!attribute.hasContext(1)) { - Debug.echoError("The tag cu@cuboid.is_within[...] must have a value."); + Debug.echoError("The tag CuboidTag.is_within[...] must have a value."); return null; } - dCuboid cub2 = dCuboid.valueOf(attribute.getContext(1)); + CuboidTag cub2 = CuboidTag.valueOf(attribute.getContext(1)); if (cub2 != null) { boolean contains = true; - for (LocationPair pair2 : ((dCuboid) object).pairs) { + for (LocationPair pair2 : ((CuboidTag) object).pairs) { boolean contained = false; for (LocationPair pair : cub2.pairs) { if (!pair.low.getWorld().getName().equalsIgnoreCase(pair2.low.getWorld().getName())) { @@ -1063,26 +1055,26 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute - // @returns ListTag(dCuboid) + // @attribute + // @returns ListTag(CuboidTag) // @description - // Returns a list of all sub-cuboids in this dCuboid (for cuboids that contain multiple sub-cuboids). + // Returns a list of all sub-cuboids in this CuboidTag (for cuboids that contain multiple sub-cuboids). // --> registerTag("list_members", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - List pairs = ((dCuboid) object).pairs; + List pairs = ((CuboidTag) object).pairs; ListTag list = new ListTag(); for (LocationPair pair : pairs) { - list.addObject(new dCuboid(pair.low, pair.high)); + list.addObject(new CuboidTag(pair.low, pair.high)); } return list.getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute ]> - // @returns dCuboid + // @attribute ]> + // @returns CuboidTag // @description // Returns a cuboid representing the one component of this cuboid (for cuboids that contain multiple sub-cuboids). // --> @@ -1090,7 +1082,7 @@ public String run(Attribute attribute, ObjectTag object) { @Override public String run(Attribute attribute, ObjectTag object) { if (!attribute.hasContext(1)) { - Debug.echoError("The tag cu@cuboid.get[...] must have a value."); + Debug.echoError("The tag CuboidTag.get[...] must have a value."); return null; } else { @@ -1098,11 +1090,11 @@ public String run(Attribute attribute, ObjectTag object) { if (member < 1) { member = 1; } - if (member > ((dCuboid) object).pairs.size()) { - member = ((dCuboid) object).pairs.size(); + if (member > ((CuboidTag) object).pairs.size()) { + member = ((CuboidTag) object).pairs.size(); } - LocationPair pair = ((dCuboid) object).pairs.get(member - 1); - return new dCuboid(pair.point_1, pair.point_2).getAttribute(attribute.fulfill(1)); + LocationPair pair = ((CuboidTag) object).pairs.get(member - 1); + return new CuboidTag(pair.point_1, pair.point_2).getAttribute(attribute.fulfill(1)); } } }); @@ -1110,8 +1102,8 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("get_member", registeredTags.get("get")); // <--[tag] - // @attribute ].at[]> - // @returns dCuboid + // @attribute ].at[]> + // @returns CuboidTag // @description // Returns a modified copy of this cuboid, with the specific sub-cuboid index changed to hold the input cuboid. // --> @@ -1119,32 +1111,32 @@ public String run(Attribute attribute, ObjectTag object) { @Override public String run(Attribute attribute, ObjectTag object) { if (!attribute.hasContext(1)) { - Debug.echoError("The tag cu@cuboid.set[...] must have a value."); + Debug.echoError("The tag CuboidTag.set[...] must have a value."); return null; } else { - dCuboid subCuboid = dCuboid.valueOf(attribute.getContext(1)); + CuboidTag subCuboid = CuboidTag.valueOf(attribute.getContext(1)); attribute = attribute.fulfill(1); if (!attribute.matches("at")) { attribute.fulfill(1); - Debug.echoError("The tag cu@cuboid.set[...] must be followed by an 'at'."); + Debug.echoError("The tag CuboidTag.set[...] must be followed by an 'at'."); return null; } if (!attribute.hasContext(1)) { attribute.fulfill(1); - Debug.echoError("The tag cu@cuboid.set[...].at[...] must have an 'at' value."); + Debug.echoError("The tag CuboidTag.set[...].at[...] must have an 'at' value."); return null; } int member = attribute.getIntContext(1); if (member < 1) { member = 1; } - if (member > ((dCuboid) object).pairs.size()) { - member = ((dCuboid) object).pairs.size(); + if (member > ((CuboidTag) object).pairs.size()) { + member = ((CuboidTag) object).pairs.size(); } LocationPair pair = subCuboid.pairs.get(0); try { - dCuboid cloned = ((dCuboid) object).clone(); + CuboidTag cloned = ((CuboidTag) object).clone(); cloned.pairs.set(member - 1, new LocationPair(pair.point_1, pair.point_2)); return cloned.getAttribute(attribute.fulfill(1)); } @@ -1157,8 +1149,8 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @description // Returns the location of the exact center of the cuboid. // --> @@ -1167,28 +1159,28 @@ public String run(Attribute attribute, ObjectTag object) { public String run(Attribute attribute, ObjectTag object) { LocationPair pair; if (!attribute.hasContext(1)) { - pair = ((dCuboid) object).pairs.get(0); + pair = ((CuboidTag) object).pairs.get(0); } else { int member = attribute.getIntContext(1); if (member < 1) { member = 1; } - if (member > ((dCuboid) object).pairs.size()) { - member = ((dCuboid) object).pairs.size(); + if (member > ((CuboidTag) object).pairs.size()) { + member = ((CuboidTag) object).pairs.size(); } - pair = ((dCuboid) object).pairs.get(member - 1); + pair = ((CuboidTag) object).pairs.get(member - 1); } Location base = pair.high.clone().add(pair.low.clone()).add(1.0, 1.0, 1.0); base.setX(base.getX() / 2.0); base.setY(base.getY() / 2.0); base.setZ(base.getZ() / 2.0); - return new dLocation(base).getAttribute(attribute.fulfill(1)); + return new LocationTag(base).getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the volume of the cuboid. @@ -1197,15 +1189,15 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("volume", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - LocationPair pair = ((dCuboid) object).pairs.get(0); + LocationPair pair = ((CuboidTag) object).pairs.get(0); Location base = pair.high.clone().subtract(pair.low.clone()).add(1, 1, 1); return new ElementTag(base.getX() * base.getY() * base.getZ()).getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @description // Returns the size of the cuboid. // Effectively equivalent to: (max - min) + (1,1,1) @@ -1215,26 +1207,26 @@ public String run(Attribute attribute, ObjectTag object) { public String run(Attribute attribute, ObjectTag object) { LocationPair pair; if (!attribute.hasContext(1)) { - pair = ((dCuboid) object).pairs.get(0); + pair = ((CuboidTag) object).pairs.get(0); } else { int member = attribute.getIntContext(1); if (member < 1) { member = 1; } - if (member > ((dCuboid) object).pairs.size()) { - member = ((dCuboid) object).pairs.size(); + if (member > ((CuboidTag) object).pairs.size()) { + member = ((CuboidTag) object).pairs.size(); } - pair = ((dCuboid) object).pairs.get(member - 1); + pair = ((CuboidTag) object).pairs.get(member - 1); } Location base = pair.high.clone().subtract(pair.low.clone()).add(1, 1, 1); - return new dLocation(base).getAttribute(attribute.fulfill(1)); + return new LocationTag(base).getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @description // Returns the highest-numbered (maximum) corner location. // --> @@ -1242,24 +1234,24 @@ public String run(Attribute attribute, ObjectTag object) { @Override public String run(Attribute attribute, ObjectTag object) { if (!attribute.hasContext(1)) { - return ((dCuboid) object).pairs.get(0).high.getAttribute(attribute.fulfill(1)); + return ((CuboidTag) object).pairs.get(0).high.getAttribute(attribute.fulfill(1)); } else { int member = attribute.getIntContext(1); if (member < 1) { member = 1; } - if (member > ((dCuboid) object).pairs.size()) { - member = ((dCuboid) object).pairs.size(); + if (member > ((CuboidTag) object).pairs.size()) { + member = ((CuboidTag) object).pairs.size(); } - return ((dCuboid) object).pairs.get(member - 1).high.getAttribute(attribute.fulfill(1)); + return ((CuboidTag) object).pairs.get(member - 1).high.getAttribute(attribute.fulfill(1)); } } }); // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @description // Returns the lowest-numbered (minimum) corner location. // --> @@ -1267,55 +1259,55 @@ public String run(Attribute attribute, ObjectTag object) { @Override public String run(Attribute attribute, ObjectTag object) { if (!attribute.hasContext(1)) { - return ((dCuboid) object).pairs.get(0).low.getAttribute(attribute.fulfill(1)); + return ((CuboidTag) object).pairs.get(0).low.getAttribute(attribute.fulfill(1)); } else { int member = attribute.getIntContext(1); if (member < 1) { member = 1; } - if (member > ((dCuboid) object).pairs.size()) { - member = ((dCuboid) object).pairs.size(); + if (member > ((CuboidTag) object).pairs.size()) { + member = ((CuboidTag) object).pairs.size(); } - return ((dCuboid) object).pairs.get(member - 1).low.getAttribute(attribute.fulfill(1)); + return ((CuboidTag) object).pairs.get(member - 1).low.getAttribute(attribute.fulfill(1)); } } }); // <--[tag] - // @attribute ]> - // @returns dCuboid + // @attribute ]> + // @returns CuboidTag // @description - // Expands the first member of the dCuboid to contain the given location, and returns the expanded cuboid. + // Expands the first member of the CuboidTag to contain the given location, and returns the expanded cuboid. // --> registerTag("include", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { if (!attribute.hasContext(1)) { - Debug.echoError("The tag cu@cuboid.include[...] must have a value."); + Debug.echoError("The tag CuboidTag.include[...] must have a value."); return null; } try { - dLocation loc = dLocation.valueOf(attribute.getContext(1)); - dCuboid cuboid = ((dCuboid) object).clone(); + LocationTag loc = LocationTag.valueOf(attribute.getContext(1)); + CuboidTag cuboid = ((CuboidTag) object).clone(); if (loc != null) { if (loc.getX() < cuboid.pairs.get(0).low.getX()) { - cuboid.pairs.get(0).low = new dLocation(cuboid.pairs.get(0).low.getWorld(), loc.getX(), cuboid.pairs.get(0).low.getY(), cuboid.pairs.get(0).low.getZ()); + cuboid.pairs.get(0).low = new LocationTag(cuboid.pairs.get(0).low.getWorld(), loc.getX(), cuboid.pairs.get(0).low.getY(), cuboid.pairs.get(0).low.getZ()); } if (loc.getY() < cuboid.pairs.get(0).low.getY()) { - cuboid.pairs.get(0).low = new dLocation(cuboid.pairs.get(0).low.getWorld(), cuboid.pairs.get(0).low.getX(), loc.getY(), cuboid.pairs.get(0).low.getZ()); + cuboid.pairs.get(0).low = new LocationTag(cuboid.pairs.get(0).low.getWorld(), cuboid.pairs.get(0).low.getX(), loc.getY(), cuboid.pairs.get(0).low.getZ()); } if (loc.getZ() < cuboid.pairs.get(0).low.getZ()) { - cuboid.pairs.get(0).low = new dLocation(cuboid.pairs.get(0).low.getWorld(), cuboid.pairs.get(0).low.getX(), cuboid.pairs.get(0).low.getY(), loc.getZ()); + cuboid.pairs.get(0).low = new LocationTag(cuboid.pairs.get(0).low.getWorld(), cuboid.pairs.get(0).low.getX(), cuboid.pairs.get(0).low.getY(), loc.getZ()); } if (loc.getX() > cuboid.pairs.get(0).high.getX()) { - cuboid.pairs.get(0).high = new dLocation(cuboid.pairs.get(0).high.getWorld(), loc.getX(), cuboid.pairs.get(0).high.getY(), cuboid.pairs.get(0).high.getZ()); + cuboid.pairs.get(0).high = new LocationTag(cuboid.pairs.get(0).high.getWorld(), loc.getX(), cuboid.pairs.get(0).high.getY(), cuboid.pairs.get(0).high.getZ()); } if (loc.getY() > cuboid.pairs.get(0).high.getY()) { - cuboid.pairs.get(0).high = new dLocation(cuboid.pairs.get(0).high.getWorld(), cuboid.pairs.get(0).high.getX(), loc.getY(), cuboid.pairs.get(0).high.getZ()); + cuboid.pairs.get(0).high = new LocationTag(cuboid.pairs.get(0).high.getWorld(), cuboid.pairs.get(0).high.getX(), loc.getY(), cuboid.pairs.get(0).high.getZ()); } if (loc.getZ() > cuboid.pairs.get(0).high.getZ()) { - cuboid.pairs.get(0).high = new dLocation(cuboid.pairs.get(0).high.getWorld(), cuboid.pairs.get(0).high.getX(), cuboid.pairs.get(0).high.getY(), loc.getZ()); + cuboid.pairs.get(0).high = new LocationTag(cuboid.pairs.get(0).high.getWorld(), cuboid.pairs.get(0).high.getX(), cuboid.pairs.get(0).high.getY(), loc.getZ()); } return cuboid.getAttribute(attribute.fulfill(1)); } @@ -1328,26 +1320,26 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute ]> - // @returns dCuboid + // @attribute ]> + // @returns CuboidTag // @description - // Expands the first member of the dCuboid to contain the given X value, and returns the expanded cuboid. + // Expands the first member of the CuboidTag to contain the given X value, and returns the expanded cuboid. // --> registerTag("include_x", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { if (!attribute.hasContext(1)) { - Debug.echoError("The tag cu@cuboid.include_x[...] must have a value."); + Debug.echoError("The tag CuboidTag.include_x[...] must have a value."); return null; } try { double x = attribute.getDoubleContext(1); - dCuboid cuboid = ((dCuboid) object).clone(); + CuboidTag cuboid = ((CuboidTag) object).clone(); if (x < cuboid.pairs.get(0).low.getX()) { - cuboid.pairs.get(0).low = new dLocation(cuboid.pairs.get(0).low.getWorld(), x, cuboid.pairs.get(0).low.getY(), cuboid.pairs.get(0).low.getZ()); + cuboid.pairs.get(0).low = new LocationTag(cuboid.pairs.get(0).low.getWorld(), x, cuboid.pairs.get(0).low.getY(), cuboid.pairs.get(0).low.getZ()); } if (x > cuboid.pairs.get(0).high.getX()) { - cuboid.pairs.get(0).high = new dLocation(cuboid.pairs.get(0).high.getWorld(), x, cuboid.pairs.get(0).high.getY(), cuboid.pairs.get(0).high.getZ()); + cuboid.pairs.get(0).high = new LocationTag(cuboid.pairs.get(0).high.getWorld(), x, cuboid.pairs.get(0).high.getY(), cuboid.pairs.get(0).high.getZ()); } return cuboid.getAttribute(attribute.fulfill(1)); } @@ -1359,26 +1351,26 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute ]> - // @returns dCuboid + // @attribute ]> + // @returns CuboidTag // @description - // Expands the first member of the dCuboid to contain the given Y value, and returns the expanded cuboid. + // Expands the first member of the CuboidTag to contain the given Y value, and returns the expanded cuboid. // --> registerTag("include_y", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { if (!attribute.hasContext(1)) { - Debug.echoError("The tag cu@cuboid.include_y[...] must have a value."); + Debug.echoError("The tag CuboidTag.include_y[...] must have a value."); return null; } try { double y = attribute.getDoubleContext(1); - dCuboid cuboid = ((dCuboid) object).clone(); + CuboidTag cuboid = ((CuboidTag) object).clone(); if (y < cuboid.pairs.get(0).low.getY()) { - cuboid.pairs.get(0).low = new dLocation(cuboid.pairs.get(0).low.getWorld(), cuboid.pairs.get(0).low.getX(), y, cuboid.pairs.get(0).low.getZ()); + cuboid.pairs.get(0).low = new LocationTag(cuboid.pairs.get(0).low.getWorld(), cuboid.pairs.get(0).low.getX(), y, cuboid.pairs.get(0).low.getZ()); } if (y > cuboid.pairs.get(0).high.getY()) { - cuboid.pairs.get(0).high = new dLocation(cuboid.pairs.get(0).high.getWorld(), cuboid.pairs.get(0).high.getX(), y, cuboid.pairs.get(0).high.getZ()); + cuboid.pairs.get(0).high = new LocationTag(cuboid.pairs.get(0).high.getWorld(), cuboid.pairs.get(0).high.getX(), y, cuboid.pairs.get(0).high.getZ()); } return cuboid.getAttribute(attribute.fulfill(1)); } @@ -1390,26 +1382,26 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute ]> - // @returns dCuboid + // @attribute ]> + // @returns CuboidTag // @description - // Expands the first member of the dCuboid to contain the given Z value, and returns the expanded cuboid. + // Expands the first member of the CuboidTag to contain the given Z value, and returns the expanded cuboid. // --> registerTag("include_z", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { if (!attribute.hasContext(1)) { - Debug.echoError("The tag cu@cuboid.include_z[...] must have a value."); + Debug.echoError("The tag CuboidTag.include_z[...] must have a value."); return null; } try { double z = attribute.getDoubleContext(1); - dCuboid cuboid = ((dCuboid) object).clone(); + CuboidTag cuboid = ((CuboidTag) object).clone(); if (z < cuboid.pairs.get(0).low.getZ()) { - cuboid.pairs.get(0).low = new dLocation(cuboid.pairs.get(0).low.getWorld(), cuboid.pairs.get(0).low.getX(), cuboid.pairs.get(0).low.getY(), z); + cuboid.pairs.get(0).low = new LocationTag(cuboid.pairs.get(0).low.getWorld(), cuboid.pairs.get(0).low.getX(), cuboid.pairs.get(0).low.getY(), z); } if (z > cuboid.pairs.get(0).high.getZ()) { - cuboid.pairs.get(0).high = new dLocation(cuboid.pairs.get(0).high.getWorld(), cuboid.pairs.get(0).high.getX(), cuboid.pairs.get(0).high.getY(), z); + cuboid.pairs.get(0).high = new LocationTag(cuboid.pairs.get(0).high.getWorld(), cuboid.pairs.get(0).high.getX(), cuboid.pairs.get(0).high.getY(), z); } return cuboid.getAttribute(attribute.fulfill(1)); } @@ -1421,10 +1413,10 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute ]> - // @returns dCuboid + // @attribute ]> + // @returns CuboidTag // @description - // Changes the first member of the dCuboid to have the given minimum location, and returns the changed cuboid. + // Changes the first member of the CuboidTag to have the given minimum location, and returns the changed cuboid. // If values in the new min are higher than the existing max, the output max will contain the new min values, // and the output min will contain the old max values. // Note that this is equivalent to constructing a cuboid with the input value and the original cuboids max value. @@ -1433,20 +1425,20 @@ public String run(Attribute attribute, ObjectTag object) { @Override public String run(Attribute attribute, ObjectTag object) { if (!attribute.hasContext(1)) { - Debug.echoError("The tag cu@cuboid.with_min[...] must have a value."); + Debug.echoError("The tag CuboidTag.with_min[...] must have a value."); return null; } - dCuboid cuboid = (dCuboid) object; - dLocation location = dLocation.valueOf(attribute.getContext(1)); - return new dCuboid(location, cuboid.pairs.get(0).high).getAttribute(attribute.fulfill(1)); + CuboidTag cuboid = (CuboidTag) object; + LocationTag location = LocationTag.valueOf(attribute.getContext(1)); + return new CuboidTag(location, cuboid.pairs.get(0).high).getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute ]> - // @returns dCuboid + // @attribute ]> + // @returns CuboidTag // @description - // Changes the first member of the dCuboid to have the given maximum location, and returns the changed cuboid. + // Changes the first member of the CuboidTag to have the given maximum location, and returns the changed cuboid. // If values in the new max are lower than the existing min, the output min will contain the new max values, // and the output max will contain the old min values. // Note that this is equivalent to constructing a cuboid with the input value and the original cuboids min value. @@ -1455,28 +1447,28 @@ public String run(Attribute attribute, ObjectTag object) { @Override public String run(Attribute attribute, ObjectTag object) { if (!attribute.hasContext(1)) { - Debug.echoError("The tag cu@cuboid.with_max[...] must have a value."); + Debug.echoError("The tag CuboidTag.with_max[...] must have a value."); return null; } - dCuboid cuboid = (dCuboid) object; - dLocation location = dLocation.valueOf(attribute.getContext(1)); - return new dCuboid(location, cuboid.pairs.get(0).low).getAttribute(attribute.fulfill(1)); + CuboidTag cuboid = (CuboidTag) object; + LocationTag location = LocationTag.valueOf(attribute.getContext(1)); + return new CuboidTag(location, cuboid.pairs.get(0).low).getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute - // @returns ListTag(dPlayer) + // @attribute + // @returns ListTag(PlayerTag) // @description - // Gets a list of all players currently within the dCuboid. + // Gets a list of all players currently within the CuboidTag. // --> registerTag("list_players", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - ArrayList players = new ArrayList<>(); + ArrayList players = new ArrayList<>(); for (Player player : Bukkit.getOnlinePlayers()) { - if (((dCuboid) object).isInsideCuboid(player.getLocation())) { - players.add(dPlayer.mirrorBukkitPlayer(player)); + if (((CuboidTag) object).isInsideCuboid(player.getLocation())) { + players.add(PlayerTag.mirrorBukkitPlayer(player)); } } return new ListTag(players).getAttribute(attribute.fulfill(1)); @@ -1484,19 +1476,19 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute - // @returns ListTag(dNPC) + // @attribute + // @returns ListTag(NPCTag) // @description - // Gets a list of all NPCs currently within the dCuboid. + // Gets a list of all NPCs currently within the CuboidTag. // --> if (Depends.citizens != null) { registerTag("list_npcs", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - ArrayList npcs = new ArrayList<>(); + ArrayList npcs = new ArrayList<>(); for (NPC npc : CitizensAPI.getNPCRegistry()) { - dNPC dnpc = dNPC.mirrorCitizensNPC(npc); - if (((dCuboid) object).isInsideCuboid(dnpc.getLocation())) { + NPCTag dnpc = NPCTag.mirrorCitizensNPC(npc); + if (((CuboidTag) object).isInsideCuboid(dnpc.getLocation())) { npcs.add(dnpc); } } @@ -1506,23 +1498,23 @@ public String run(Attribute attribute, ObjectTag object) { } // <--[tag] - // @attribute |...]> - // @returns ListTag(dEntity) + // @attribute |...]> + // @returns ListTag(EntityTag) // @description - // Gets a list of all entities currently within the dCuboid, with + // Gets a list of all entities currently within the CuboidTag, with // an optional search parameter for the entity type. // --> registerTag("list_entities", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - ArrayList entities = new ArrayList<>(); + ArrayList entities = new ArrayList<>(); ListTag types = new ListTag(); if (attribute.hasContext(1)) { types = ListTag.valueOf(attribute.getContext(1)); } - for (Entity ent : ((dCuboid) object).getWorld().getEntities()) { - dEntity current = new dEntity(ent); - if (ent.isValid() && ((dCuboid) object).isInsideCuboid(ent.getLocation())) { + for (Entity ent : ((CuboidTag) object).getWorld().getEntities()) { + EntityTag current = new EntityTag(ent); + if (ent.isValid() && ((CuboidTag) object).isInsideCuboid(ent.getLocation())) { if (!types.isEmpty()) { for (String type : types) { if (current.identifySimpleType().equalsIgnoreCase(type)) { @@ -1532,7 +1524,7 @@ public String run(Attribute attribute, ObjectTag object) { } } else { - entities.add(new dEntity(ent)); + entities.add(new EntityTag(ent)); } } } @@ -1541,18 +1533,18 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute - // @returns ListTag(dEntity) + // @attribute + // @returns ListTag(EntityTag) // @description - // Gets a list of all living entities currently within the dCuboid. + // Gets a list of all living entities currently within the CuboidTag. // --> registerTag("list_living_entities", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - ArrayList entities = new ArrayList<>(); - for (Entity ent : ((dCuboid) object).getWorld().getLivingEntities()) { - if (ent.isValid() && ((dCuboid) object).isInsideCuboid(ent.getLocation()) && !dEntity.isCitizensNPC(ent)) { - entities.add(new dEntity(ent)); + ArrayList entities = new ArrayList<>(); + for (Entity ent : ((CuboidTag) object).getWorld().getLivingEntities()) { + if (ent.isValid() && ((CuboidTag) object).isInsideCuboid(ent.getLocation()) && !EntityTag.isCitizensNPC(ent)) { + entities.add(new EntityTag(ent)); } } return new ListTag(entities).getAttribute(attribute.fulfill(1)); @@ -1560,29 +1552,29 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute - // @returns ListTag(dChunk) + // @attribute + // @returns ListTag(ChunkTag) // @description - // Gets a list of all chunks entirely within the dCuboid. + // Gets a list of all chunks entirely within the CuboidTag. // --> registerTag("list_chunks", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { ListTag chunks = new ListTag(); - dCuboid obj = (dCuboid) object; + CuboidTag obj = (CuboidTag) object; for (LocationPair pair : obj.pairs) { int minY = pair.low.getBlockY(); - dChunk minChunk = new dChunk(pair.low); + ChunkTag minChunk = new ChunkTag(pair.low); if (obj.isInsideCuboid(new Location(obj.getWorld(), minChunk.getX() * 16, minY, minChunk.getZ() * 16))) { chunks.addObject(minChunk); } - dChunk maxChunk = new dChunk(pair.high); + ChunkTag maxChunk = new ChunkTag(pair.high); if (obj.isInsideCuboid(new Location(obj.getWorld(), maxChunk.getX() * 16 + 15, minY, maxChunk.getZ() * 16 + 15))) { chunks.addObject(maxChunk); } for (int x = minChunk.getX() + 1; x < maxChunk.getX(); x++) { for (int z = minChunk.getZ() + 1; z < maxChunk.getZ(); z++) { - chunks.addObject(new dChunk(new dWorld(((dCuboid) object).getWorld()), x, z)); + chunks.addObject(new ChunkTag(new WorldTag(((CuboidTag) object).getWorld()), x, z)); } } } @@ -1591,21 +1583,21 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute - // @returns ListTag(dChunk) + // @attribute + // @returns ListTag(ChunkTag) // @description - // Gets a list of all chunks partially or entirely within the dCuboid. + // Gets a list of all chunks partially or entirely within the CuboidTag. // --> registerTag("list_partial_chunks", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { ListTag chunks = new ListTag(); - for (LocationPair pair : ((dCuboid) object).pairs) { - dChunk minChunk = new dChunk(pair.low); - dChunk maxChunk = new dChunk(pair.high); + for (LocationPair pair : ((CuboidTag) object).pairs) { + ChunkTag minChunk = new ChunkTag(pair.low); + ChunkTag maxChunk = new ChunkTag(pair.high); for (int x = minChunk.getX(); x <= maxChunk.getX(); x++) { for (int z = minChunk.getZ(); z <= maxChunk.getZ(); z++) { - chunks.addObject(new dChunk(new dWorld(((dCuboid) object).getWorld()), x, z)); + chunks.addObject(new ChunkTag(new WorldTag(((CuboidTag) object).getWorld()), x, z)); } } } @@ -1614,16 +1606,16 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description - // Gets the name of a Notable dCuboid. If the cuboid isn't noted, + // Gets the name of a Notable CuboidTag. If the cuboid isn't noted, // this is null. // --> registerTag("notable_name", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - String notname = NotableManager.getSavedId((dCuboid) object); + String notname = NotableManager.getSavedId((CuboidTag) object); if (notname == null) { return null; } @@ -1632,7 +1624,7 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @group conversion // @description @@ -1641,15 +1633,15 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("full", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dCuboid) object).identifyFull()).getAttribute(attribute.fulfill(1)); + return new ElementTag(((CuboidTag) object).identifyFull()).getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description - // Always returns 'Cuboid' for dCuboid objects. All objects fetchable by the Object Fetcher will return the + // Always returns 'Cuboid' for CuboidTag objects. All objects fetchable by the Object Fetcher will return the // type of object that is fulfilling this attribute. // --> registerTag("type", new TagRunnable() { @@ -1710,15 +1702,15 @@ public void applyProperty(Mechanism mechanism) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dCuboid + // @object CuboidTag // @name set_member // @input (#,)dCuboid // @description // Sets a given sub-cuboid of the cuboid. - // Input is of the form like "2,cu@..." where 2 is the sub-cuboid index or just a direct dCuboid input. + // Input is of the form like "2,cu@..." where 2 is the sub-cuboid index or just a direct CuboidTag input. // @tags - // - // ].at[<#>]> + // + // ].at[<#>]> // --> if (mechanism.matches("set_member")) { String value = mechanism.getValue().asString(); @@ -1727,7 +1719,7 @@ public void adjust(Mechanism mechanism) { if (comma > 0) { member = new ElementTag(value.substring(0, comma)).asInt(); } - dCuboid subCuboid = dCuboid.valueOf(comma == -1 ? value : value.substring(comma + 1)); + CuboidTag subCuboid = CuboidTag.valueOf(comma == -1 ? value : value.substring(comma + 1)); if (member < 1) { member = 1; } diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/dEllipsoid.java b/plugin/src/main/java/com/denizenscript/denizen/objects/EllipsoidTag.java similarity index 73% rename from plugin/src/main/java/com/denizenscript/denizen/objects/dEllipsoid.java rename to plugin/src/main/java/com/denizenscript/denizen/objects/EllipsoidTag.java index eb74002a5e..c3472d5731 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/dEllipsoid.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/EllipsoidTag.java @@ -17,13 +17,13 @@ import java.util.List; -public class dEllipsoid implements ObjectTag, Notable { +public class EllipsoidTag implements ObjectTag, Notable { // <--[language] - // @name dEllipsoid + // @name EllipsoidTag // @group Object System // @description - // A dEllipsoid represents an ellipsoidal region in the world. + // A EllipsoidTag represents an ellipsoidal region in the world. // // The word 'ellipsoid' means a less strict sphere. // Basically: an "ellipsoid" is to a 3D "sphere" what an "ellipse" (or "oval") is to a 2D "circle". @@ -36,17 +36,17 @@ public class dEllipsoid implements ObjectTag, Notable { // @name ellipsoid@ // @group Object Fetcher System // @description - // ellipsoid@ refers to the 'object identifier' of a dEllipsoid. The 'ellipsoid@' is notation for Denizen's Object - // Fetcher. The constructor for a dEllipsoid is ,,,,,, + // ellipsoid@ refers to the 'object identifier' of a EllipsoidTag. The 'ellipsoid@' is notation for Denizen's Object + // Fetcher. The constructor for a EllipsoidTag is ,,,,,, // For example, 'ellipsoid@1,2,3,space,7,7,7'. // - // For general info, see <@link language dEllipsoid> + // For general info, see <@link language EllipsoidTag> // // --> - public static List getNotableEllipsoidsContaining(Location location) { - List cuboids = new ArrayList<>(); - for (dEllipsoid ellipsoid : NotableManager.getAllType(dEllipsoid.class)) { + public static List getNotableEllipsoidsContaining(Location location) { + List cuboids = new ArrayList<>(); + for (EllipsoidTag ellipsoid : NotableManager.getAllType(EllipsoidTag.class)) { if (ellipsoid.contains(location)) { cuboids.add(ellipsoid); } @@ -59,7 +59,7 @@ public static List getNotableEllipsoidsContaining(Location location) // OBJECT FETCHER //////////////// - public static dEllipsoid valueOf(String string) { + public static EllipsoidTag valueOf(String string) { return valueOf(string, null); } @@ -69,14 +69,14 @@ public static dEllipsoid valueOf(String string) { * @param string the string */ @Fetchable("ellipsoid") - public static dEllipsoid valueOf(String string, TagContext context) { + public static EllipsoidTag valueOf(String string, TagContext context) { if (string.startsWith("ellipsoid@")) { string = string.substring(10); } - if (NotableManager.isType(string, dEllipsoid.class)) { - return (dEllipsoid) NotableManager.getSavedObject(string); + if (NotableManager.isType(string, EllipsoidTag.class)) { + return (EllipsoidTag) NotableManager.getSavedObject(string); } List split = CoreUtilities.split(string, ','); @@ -85,16 +85,16 @@ public static dEllipsoid valueOf(String string, TagContext context) { return null; } - dWorld world = dWorld.valueOf(split.get(3), false); + WorldTag world = WorldTag.valueOf(split.get(3), false); if (world == null) { return null; } - dLocation location = new dLocation(world.getWorld(), + LocationTag location = new LocationTag(world.getWorld(), ArgumentHelper.getDoubleFrom(split.get(0)), ArgumentHelper.getDoubleFrom(split.get(1)), ArgumentHelper.getDoubleFrom(split.get(2))); - dLocation size = new dLocation(null, ArgumentHelper.getDoubleFrom(split.get(4)), + LocationTag size = new LocationTag(null, ArgumentHelper.getDoubleFrom(split.get(4)), ArgumentHelper.getDoubleFrom(split.get(5)), ArgumentHelper.getDoubleFrom(split.get(6))); - return new dEllipsoid(location, size); + return new EllipsoidTag(location, size); } /** @@ -106,7 +106,7 @@ public static dEllipsoid valueOf(String string, TagContext context) { public static boolean matches(String arg) { try { - return dEllipsoid.valueOf(arg) != null; + return EllipsoidTag.valueOf(arg) != null; } catch (Exception e) { return false; @@ -118,7 +118,7 @@ public static boolean matches(String arg) { // Constructors ///////////// - public dEllipsoid(dLocation loc, dLocation size) { + public EllipsoidTag(LocationTag loc, LocationTag size) { this.loc = loc; this.size = size; } @@ -127,22 +127,22 @@ public dEllipsoid(dLocation loc, dLocation size) { // INSTANCE FIELDS/METHODS ///////////////// - private dLocation loc; + private LocationTag loc; - private dLocation size; + private LocationTag size; public ListTag getBlocks() { return getBlocks(null); } - public ListTag getBlocks(List materials) { - List initial = new dCuboid(new Location(loc.getWorld(), + public ListTag getBlocks(List materials) { + List initial = new CuboidTag(new Location(loc.getWorld(), loc.getX() - size.getX(), loc.getY() - size.getY(), loc.getZ() - size.getZ()), new Location(loc.getWorld(), loc.getX() + size.getX(), loc.getY() + size.getY(), loc.getZ() + size.getZ())) .getBlocks_internal(materials); ListTag list = new ListTag(); - for (dLocation loc : initial) { + for (LocationTag loc : initial) { if (contains(loc)) { list.add(loc.identify()); } @@ -150,14 +150,14 @@ public ListTag getBlocks(List materials) { return list; } - public List getBlockLocations() { - List initial = new dCuboid(new Location(loc.getWorld(), + public List getBlockLocations() { + List initial = new CuboidTag(new Location(loc.getWorld(), loc.getX() - size.getX(), loc.getY() - size.getY(), loc.getZ() - size.getZ()), new Location(loc.getWorld(), loc.getX() + size.getX(), loc.getY() + size.getY(), loc.getZ() + size.getZ())) .getBlocks_internal(null); - List locations = new ArrayList<>(); - for (dLocation loc : initial) { + List locations = new ArrayList<>(); + for (LocationTag loc : initial) { if (contains(loc)) { locations.add(loc); } @@ -253,10 +253,10 @@ public ObjectTag setPrefix(String prefix) { public static void registerTags() { // <--[tag] - // @attribute |...]> - // @returns ListTag(dLocation) + // @attribute |...]> + // @returns ListTag(LocationTag) // @description - // Returns each block location within the dEllipsoid. + // Returns each block location within the EllipsoidTag. // Optionally, specify a list of materials to only return locations // with that block type. // --> @@ -264,11 +264,11 @@ public static void registerTags() { @Override public String run(Attribute attribute, ObjectTag object) { if (attribute.hasContext(1)) { - return new ListTag(((dEllipsoid) object).getBlocks(ListTag.valueOf(attribute.getContext(1)).filter(dMaterial.class, attribute.context))) + return new ListTag(((EllipsoidTag) object).getBlocks(ListTag.valueOf(attribute.getContext(1)).filter(MaterialTag.class, attribute.context))) .getAttribute(attribute.fulfill(1)); } else { - return new ListTag(((dEllipsoid) object).getBlocks()) + return new ListTag(((EllipsoidTag) object).getBlocks()) .getAttribute(attribute.fulfill(1)); } } @@ -276,36 +276,36 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("get_blocks", registeredTags.get("blocks")); // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @description // Returns the location of the ellipsoid. // --> registerTag("location", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return ((dEllipsoid) object).loc.getAttribute(attribute.fulfill(1)); + return ((EllipsoidTag) object).loc.getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @description // Returns the size of the ellipsoid. // --> registerTag("size", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return ((dEllipsoid) object).size.getAttribute(attribute.fulfill(1)); + return ((EllipsoidTag) object).size.getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description - // Always returns 'Ellipsoid' for dEllipsoid objects. All objects fetchable by the Object Fetcher will return the + // Always returns 'Ellipsoid' for EllipsoidTag objects. All objects fetchable by the Object Fetcher will return the // type of object that is fulfilling this attribute. // --> registerTag("type", new TagRunnable() { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/EntityFormObject.java b/plugin/src/main/java/com/denizenscript/denizen/objects/EntityFormObject.java index 4d5ab61c6c..fc15013ac5 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/EntityFormObject.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/EntityFormObject.java @@ -4,5 +4,5 @@ public interface EntityFormObject extends ObjectTag { - dEntity getDenizenEntity(); + EntityTag getDenizenEntity(); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/dEntity.java b/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java similarity index 81% rename from plugin/src/main/java/com/denizenscript/denizen/objects/dEntity.java rename to plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java index 3a4c6c4ae0..d52cf35d8a 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/dEntity.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java @@ -43,16 +43,16 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -public class dEntity implements ObjectTag, Adjustable, EntityFormObject { +public class EntityTag implements ObjectTag, Adjustable, EntityFormObject { // <--[language] - // @name dEntity + // @name EntityTag // @group Object System // @description - // A dEntity represents a spawned entity, or a generic entity type. + // A EntityTag represents a spawned entity, or a generic entity type. // // Note that players and NPCs are valid dEntities, but are generally represented by the more specific - // dPlayer and dNPC objects. + // PlayerTag and NPCTag objects. // // For format info, see <@link language e@> // @@ -62,11 +62,11 @@ public class dEntity implements ObjectTag, Adjustable, EntityFormObject { // @name e@ // @group Object Fetcher System // @description - // e@ refers to the 'object identifier' of a dEntity. The 'e@' is notation for Denizen's Object - // Fetcher. The constructor for a dEntity is a spawned entity's UUID, or an entity type. + // e@ refers to the 'object identifier' of a EntityTag. The 'e@' is notation for Denizen's Object + // Fetcher. The constructor for a EntityTag is a spawned entity's UUID, or an entity type. // For example, 'e@zombie'. // - // For general info, see <@link language dEntity> + // For general info, see <@link language EntityTag> // // --> @@ -103,9 +103,9 @@ public static boolean isCitizensNPC(Entity entity) { return entity != null && Depends.citizens != null && CitizensAPI.hasImplementation() && CitizensAPI.getNPCRegistry().isNPC(entity); } - public static dNPC getNPCFrom(Entity entity) { + public static NPCTag getNPCFrom(Entity entity) { if (isCitizensNPC(entity)) { - return dNPC.fromEntity(entity); + return NPCTag.fromEntity(entity); } else { return null; @@ -116,22 +116,22 @@ public static boolean isPlayer(Entity entity) { return entity != null && entity instanceof Player && !isNPC(entity); } - public static dPlayer getPlayerFrom(Entity entity) { + public static PlayerTag getPlayerFrom(Entity entity) { if (isPlayer(entity)) { - return dPlayer.mirrorBukkitPlayer((Player) entity); + return PlayerTag.mirrorBukkitPlayer((Player) entity); } else { return null; } } - public dItem getItemInHand() { + public ItemTag getItemInHand() { if (isLivingEntity() && getLivingEntity().getEquipment() != null) { ItemStack its = getLivingEntity().getEquipment().getItemInHand(); if (its == null) { return null; } - return new dItem(its.clone()); + return new ItemTag(its.clone()); } return null; } @@ -141,27 +141,27 @@ public dItem getItemInHand() { // OBJECT FETCHER //////////////// - public static dEntity getEntityFor(ObjectTag object, TagContext context) { - if (object instanceof dEntity) { - return (dEntity) object; + public static EntityTag getEntityFor(ObjectTag object, TagContext context) { + if (object instanceof EntityTag) { + return (EntityTag) object; } - else if (object instanceof dPlayer && ((dPlayer) object).isOnline()) { - return new dEntity(((dPlayer) object).getPlayerEntity()); + else if (object instanceof PlayerTag && ((PlayerTag) object).isOnline()) { + return new EntityTag(((PlayerTag) object).getPlayerEntity()); } - else if (object instanceof dNPC) { - return new dEntity((dNPC) object); + else if (object instanceof NPCTag) { + return new EntityTag((NPCTag) object); } else { return valueOf(object.toString(), context); } } - public static dEntity valueOf(String string) { + public static EntityTag valueOf(String string) { return valueOf(string, null); } @Fetchable("e") - public static dEntity valueOf(String string, TagContext context) { + public static EntityTag valueOf(String string, TagContext context) { if (string == null) { return null; } @@ -172,7 +172,7 @@ public static dEntity valueOf(String string, TagContext context) { // Handle objects with properties through the object fetcher m = ObjectFetcher.DESCRIBED_PATTERN.matcher(string); if (m.matches()) { - return ObjectFetcher.getObjectFrom(dEntity.class, string, context); + return ObjectFetcher.getObjectFrom(EntityTag.class, string, context); } @@ -190,7 +190,7 @@ public static dEntity valueOf(String string, TagContext context) { randomType = EntityType.values()[CoreUtilities.getRandom().nextInt(EntityType.values().length)]; } - return new dEntity(DenizenEntityType.getByName(randomType.name()), "RANDOM"); + return new EntityTag(DenizenEntityType.getByName(randomType.name()), "RANDOM"); } /////// @@ -207,17 +207,17 @@ public static dEntity valueOf(String string, TagContext context) { // NPC entity if (entityGroup.matches("N@")) { - dNPC npc = dNPC.valueOf(string); + NPCTag npc = NPCTag.valueOf(string); if (npc != null) { if (npc.isSpawned()) { - return new dEntity(npc); + return new EntityTag(npc); } else { if (context != null && context.debug) { Debug.echoDebug(context.entry, "NPC '" + string + "' is not spawned, errors may follow!"); } - return new dEntity(npc); + return new EntityTag(npc); } } else { @@ -228,10 +228,10 @@ public static dEntity valueOf(String string, TagContext context) { // Player entity else if (entityGroup.matches("P@")) { - LivingEntity returnable = dPlayer.valueOf(m.group(2)).getPlayerEntity(); + LivingEntity returnable = PlayerTag.valueOf(m.group(2)).getPlayerEntity(); if (returnable != null) { - return new dEntity(returnable); + return new EntityTag(returnable); } else if (context == null || context.debug) { Debug.echoError("Invalid Player! '" + m.group(2) @@ -245,7 +245,7 @@ else if (context == null || context.debug) { UUID entityID = UUID.fromString(m.group(2)); Entity entity = getEntityForID(entityID); if (entity != null) { - return new dEntity(entity); + return new EntityTag(entity); } return null; } @@ -290,7 +290,7 @@ else if (context == null || context.debug) { // Handle custom DenizenEntityTypes if (DenizenEntityType.isRegistered(m.group(1))) { - return new dEntity(DenizenEntityType.getByName(m.group(1)), data1, data2); + return new EntityTag(DenizenEntityType.getByName(m.group(1)), data1, data2); } } @@ -298,7 +298,7 @@ else if (context == null || context.debug) { UUID entityID = UUID.fromString(string); Entity entity = getEntityForID(entityID); if (entity != null) { - return new dEntity(entity); + return new EntityTag(entity); } return null; } @@ -307,7 +307,7 @@ else if (context == null || context.debug) { } if (context == null || context.debug) { - Debug.log("valueOf dEntity returning null: " + string); + Debug.log("valueOf EntityTag returning null: " + string); } return null; @@ -372,7 +372,7 @@ public static boolean matches(String arg) { // CONSTRUCTORS ////////////////// - public dEntity(Entity entity) { + public EntityTag(Entity entity) { if (entity != null) { this.entity = entity; entityScript = EntityScriptHelper.getEntityScript(entity); @@ -388,7 +388,7 @@ public dEntity(Entity entity) { } @Deprecated - public dEntity(EntityType entityType) { + public EntityTag(EntityType entityType) { if (entityType != null) { this.entity = null; this.entity_type = DenizenEntityType.getByName(entityType.name()); @@ -399,13 +399,13 @@ public dEntity(EntityType entityType) { } @Deprecated - public dEntity(EntityType entityType, ArrayList mechanisms) { + public EntityTag(EntityType entityType, ArrayList mechanisms) { this(entityType); this.mechanisms = mechanisms; } @Deprecated - public dEntity(EntityType entityType, String data1) { + public EntityTag(EntityType entityType, String data1) { if (entityType != null) { this.entity = null; this.entity_type = DenizenEntityType.getByName(entityType.name()); @@ -417,7 +417,7 @@ public dEntity(EntityType entityType, String data1) { } @Deprecated - public dEntity(EntityType entityType, String data1, String data2) { + public EntityTag(EntityType entityType, String data1, String data2) { if (entityType != null) { this.entity = null; this.entity_type = DenizenEntityType.getByName(entityType.name()); @@ -429,7 +429,7 @@ public dEntity(EntityType entityType, String data1, String data2) { } } - public dEntity(DenizenEntityType entityType) { + public EntityTag(DenizenEntityType entityType) { if (entityType != null) { this.entity = null; this.entity_type = entityType; @@ -439,12 +439,12 @@ public dEntity(DenizenEntityType entityType) { } } - public dEntity(DenizenEntityType entityType, ArrayList mechanisms) { + public EntityTag(DenizenEntityType entityType, ArrayList mechanisms) { this(entityType); this.mechanisms = mechanisms; } - public dEntity(DenizenEntityType entityType, String data1) { + public EntityTag(DenizenEntityType entityType, String data1) { if (entityType != null) { this.entity = null; this.entity_type = entityType; @@ -455,7 +455,7 @@ public dEntity(DenizenEntityType entityType, String data1) { } } - public dEntity(DenizenEntityType entityType, String data1, String data2) { + public EntityTag(DenizenEntityType entityType, String data1, String data2) { if (entityType != null) { this.entity = null; this.entity_type = entityType; @@ -467,7 +467,7 @@ public dEntity(DenizenEntityType entityType, String data1, String data2) { } } - public dEntity(dNPC npc) { + public EntityTag(NPCTag npc) { if (Depends.citizens == null) { return; } @@ -496,7 +496,7 @@ public dEntity(dNPC npc) { private String data1 = null; private String data2 = null; private DespawnedEntity despawned_entity = null; - private dNPC npc = null; + private NPCTag npc = null; private UUID uuid = null; private String entityScript = null; @@ -532,14 +532,14 @@ public String getSaveName() { } @Override - public dEntity getDenizenEntity() { + public EntityTag getDenizenEntity() { return this; } /** * Get the ObjectTag that most accurately describes this entity, * useful for automatically saving dEntities to contexts as - * dNPCs and dPlayers + * NPCTags and PlayerTags * * @return The ObjectTag */ @@ -554,7 +554,7 @@ public EntityFormObject getDenizenObject() { return getDenizenNPC(); } else if (isPlayer()) { - return new dPlayer(getPlayer()); + return new PlayerTag(getPlayer()); } else { return this; @@ -562,7 +562,7 @@ else if (isPlayer()) { } /** - * Get the Bukkit entity corresponding to this dEntity + * Get the Bukkit entity corresponding to this EntityTag * * @return the underlying Bukkit entity */ @@ -572,7 +572,7 @@ public Entity getBukkitEntity() { } /** - * Get the living entity corresponding to this dEntity + * Get the living entity corresponding to this EntityTag * * @return The living entity */ @@ -587,7 +587,7 @@ public LivingEntity getLivingEntity() { } /** - * Check whether this dEntity is a living entity + * Check whether this EntityTag is a living entity * * @return true or false */ @@ -601,12 +601,12 @@ public boolean hasInventory() { } /** - * Get the dNPC corresponding to this dEntity + * Get the NPCTag corresponding to this EntityTag * - * @return The dNPC + * @return The NPCTag */ - public dNPC getDenizenNPC() { + public NPCTag getDenizenNPC() { if (npc != null) { return npc; } @@ -616,7 +616,7 @@ public dNPC getDenizenNPC() { } /** - * Check whether this dEntity is an NPC + * Check whether this EntityTag is an NPC * * @return true or false */ @@ -630,7 +630,7 @@ public boolean isCitizensNPC() { } /** - * Get the Player corresponding to this dEntity + * Get the Player corresponding to this EntityTag * * @return The Player */ @@ -645,14 +645,14 @@ public Player getPlayer() { } /** - * Get the dPlayer corresponding to this dEntity + * Get the PlayerTag corresponding to this EntityTag * - * @return The dPlayer + * @return The PlayerTag */ - public dPlayer getDenizenPlayer() { + public PlayerTag getDenizenPlayer() { if (isPlayer()) { - return new dPlayer(getPlayer()); + return new PlayerTag(getPlayer()); } else { return null; @@ -660,7 +660,7 @@ public dPlayer getDenizenPlayer() { } /** - * Check whether this dEntity is a Player + * Check whether this EntityTag is a Player * * @return true or false */ @@ -670,7 +670,7 @@ public boolean isPlayer() { } /** - * Get this dEntity as a Projectile + * Get this EntityTag as a Projectile * * @return The Projectile */ @@ -681,7 +681,7 @@ public Projectile getProjectile() { } /** - * Check whether this dEntity is a Projectile + * Check whether this EntityTag is a Projectile * * @return true or false */ @@ -693,12 +693,12 @@ public boolean isProjectile() { /** * Get this Projectile entity's shooter * - * @return A dEntity of the shooter + * @return A EntityTag of the shooter */ - public dEntity getShooter() { + public EntityTag getShooter() { if (hasShooter()) { - return new dEntity((LivingEntity) getProjectile().getShooter()); + return new EntityTag((LivingEntity) getProjectile().getShooter()); } else { return null; @@ -709,7 +709,7 @@ public dEntity getShooter() { * Set this Projectile entity's shooter */ - public void setShooter(dEntity shooter) { + public void setShooter(EntityTag shooter) { if (isProjectile() && shooter.isLivingEntity()) { getProjectile().setShooter(shooter.getLivingEntity()); } @@ -736,14 +736,14 @@ public Inventory getBukkitInventory() { } /** - * Returns this entity's dInventory. + * Returns this entity's InventoryTag. * - * @return the entity's dInventory + * @return the entity's InventoryTag */ - public dInventory getInventory() { + public InventoryTag getInventory() { return hasInventory() ? isCitizensNPC() ? getDenizenNPC().getDenizenInventory() - : dInventory.mirrorBukkitInventory(getBukkitInventory()) : null; + : InventoryTag.mirrorBukkitInventory(getBukkitInventory()) : null; } public String getName() { @@ -773,7 +773,7 @@ public ListTag getEquipment() { ItemStack[] equipment = getLivingEntity().getEquipment().getArmorContents(); ListTag equipmentList = new ListTag(); for (ItemStack item : equipment) { - equipmentList.add(new dItem(item).identify()); + equipmentList.add(new ItemTag(item).identify()); } return equipmentList; } @@ -796,10 +796,10 @@ public boolean isGeneric() { * @return The Location */ - public dLocation getLocation() { + public LocationTag getLocation() { if (entity != null) { - return new dLocation(entity.getLocation()); + return new LocationTag(entity.getLocation()); } return null; @@ -811,16 +811,16 @@ public dLocation getLocation() { * @return The location */ - public dLocation getEyeLocation() { + public LocationTag getEyeLocation() { if (isPlayer()) { - return new dLocation(getPlayer().getEyeLocation()); + return new LocationTag(getPlayer().getEyeLocation()); } else if (!isGeneric() && isLivingEntity()) { - return new dLocation(getLivingEntity().getEyeLocation()); + return new LocationTag(getLivingEntity().getEyeLocation()); } else if (!isGeneric()) { - return new dLocation(getBukkitEntity().getLocation()); + return new LocationTag(getBukkitEntity().getLocation()); } return null; @@ -916,7 +916,7 @@ else if (entity != null && isUnique()) { return; } else { - dNPC npc = new dNPC(net.citizensnpcs.api.CitizensAPI.getNPCRegistry().createNPC(EntityType.PLAYER, data1)); + NPCTag npc = new NPCTag(net.citizensnpcs.api.CitizensAPI.getNPCRegistry().createNPC(EntityType.PLAYER, data1)); npc.getCitizen().spawn(location); entity = npc.getEntity(); uuid = entity.getUniqueId(); @@ -926,9 +926,9 @@ else if (entity_type.getName().equals("FALLING_BLOCK")) { Material material = null; - if (data1 != null && dMaterial.matches(data1)) { + if (data1 != null && MaterialTag.matches(data1)) { - material = dMaterial.valueOf(data1).getMaterial(); + material = MaterialTag.valueOf(data1).getMaterial(); // If we did not get a block with "RANDOM", or we got // air or portals, keep trying @@ -938,7 +938,7 @@ else if (entity_type.getName().equals("FALLING_BLOCK")) { material == MaterialCompat.NETHER_PORTAL || material == MaterialCompat.END_PORTAL)) { - material = dMaterial.valueOf(data1).getMaterial(); + material = MaterialTag.valueOf(data1).getMaterial(); } } @@ -978,7 +978,7 @@ else if (entity_type.getName().equals("FALLING_BLOCK")) { } } else { - Debug.echoError("Cannot spawn a null dEntity!"); + Debug.echoError("Cannot spawn a null EntityTag!"); } if (!isUnique()) { @@ -1003,7 +1003,7 @@ public void respawn() { spawnAt(despawned_entity.location); } else if (entity == null) { - Debug.echoError("Cannot respawn a null dEntity!"); + Debug.echoError("Cannot respawn a null EntityTag!"); } } @@ -1059,7 +1059,7 @@ private class DespawnedEntity { ItemStack[] equipment = null; String custom_script = null; - public DespawnedEntity(dEntity entity) { + public DespawnedEntity(EntityTag entity) { if (entity != null) { // Save some important info to rebuild the entity health = entity.getLivingEntity().getHealth(); @@ -1073,7 +1073,7 @@ public DespawnedEntity(dEntity entity) { } } - public int comparesTo(dEntity entity) { + public int comparesTo(EntityTag entity) { // Never matches a null if (entity == null) { return 0; @@ -1138,7 +1138,7 @@ public String getPrefix() { } @Override - public dEntity setPrefix(String prefix) { + public EntityTag setPrefix(String prefix) { this.prefix = prefix; return this; } @@ -1323,10 +1323,10 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description - // Always returns 'Entity' for dEntity objects. All objects fetchable by the Object Fetcher will return the + // Always returns 'Entity' for EntityTag objects. All objects fetchable by the Object Fetcher will return the // type of object that is fulfilling this attribute. // --> if (attribute.startsWith("type")) { @@ -1338,7 +1338,7 @@ public String getAttribute(Attribute attribute) { ///////////////// // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @group data // @description @@ -1349,7 +1349,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group data // @description @@ -1361,7 +1361,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @group data // @description @@ -1373,7 +1373,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @group data // @description @@ -1386,7 +1386,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @group data // @description @@ -1401,7 +1401,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Boolean) // @description // Returns true if the entity has the specified flag, otherwise returns false. @@ -1422,7 +1422,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns Flag ListTag // @description // Returns the specified flag from the entity. @@ -1455,7 +1455,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ListTag // @description // Returns a list of an entity's flag names, with an optional search for @@ -1508,11 +1508,11 @@ public String getAttribute(Attribute attribute) { ///////////////// // <--[tag] - // @attribute + // @attribute // @returns ScriptTag/Element // @group data // @description - // If the entity has a script ID, returns the dScript of that ID. + // If the entity has a script ID, returns the ScriptTag of that ID. // Otherwise, returns the name of the entity type. // --> if (attribute.startsWith("custom_id")) { @@ -1527,7 +1527,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @group data // @description @@ -1546,39 +1546,39 @@ public String getAttribute(Attribute attribute) { // <--[tag] - // @attribute - // @returns dItem + // @attribute + // @returns ItemTag // @group inventory // @description - // If the entity is a horse or pig, returns the saddle as a dItem, or i@air if none. + // If the entity is a horse or pig, returns the saddle as a ItemTag, or i@air if none. // --> if (attribute.startsWith("saddle")) { if (getLivingEntity().getType() == EntityType.HORSE) { - return new dItem(((Horse) getLivingEntity()).getInventory().getSaddle()) + return new ItemTag(((Horse) getLivingEntity()).getInventory().getSaddle()) .getAttribute(attribute.fulfill(1)); } else if (getLivingEntity().getType() == EntityType.PIG) { - return new dItem(((Pig) getLivingEntity()).hasSaddle() ? Material.SADDLE : Material.AIR) + return new ItemTag(((Pig) getLivingEntity()).hasSaddle() ? Material.SADDLE : Material.AIR) .getAttribute(attribute.fulfill(1)); } } // <--[tag] - // @attribute - // @returns dItem + // @attribute + // @returns ItemTag // @group inventory // @description // If the entity is a horse, returns the item equipped as the horses armor, or i@air if none. // --> if (attribute.startsWith("horse_armor") || attribute.startsWith("horse_armour")) { if (getLivingEntity().getType() == EntityType.HORSE) { - return new dItem(((Horse) getLivingEntity()).getInventory().getArmor()) + return new ItemTag(((Horse) getLivingEntity()).getInventory().getArmor()) .getAttribute(attribute.fulfill(1)); } } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group inventory // @description @@ -1596,33 +1596,33 @@ else if (getLivingEntity().getType() == EntityType.PIG) { } // <--[tag] - // @attribute - // @returns dItem + // @attribute + // @returns ItemTag // @group inventory // @description // Returns the item the entity is holding, or i@air if none. // --> if (attribute.startsWith("item_in_hand") || attribute.startsWith("iteminhand")) { - return new dItem(NMSHandler.getInstance().getEntityHelper().getItemInHand(getLivingEntity())) + return new ItemTag(NMSHandler.getInstance().getEntityHelper().getItemInHand(getLivingEntity())) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute - // @returns dItem + // @attribute + // @returns ItemTag // @group inventory // @description // Returns the item the entity is holding in their off hand, or i@air if none. // --> if (attribute.startsWith("item_in_offhand") || attribute.startsWith("iteminoffhand")) { - return new dItem(NMSHandler.getInstance().getEntityHelper().getItemInOffHand(getLivingEntity())) + return new ItemTag(NMSHandler.getInstance().getEntityHelper().getItemInOffHand(getLivingEntity())) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the villager entity is trading. @@ -1634,15 +1634,15 @@ else if (getLivingEntity().getType() == EntityType.PIG) { } // <--[tag] - // @attribute - // @returns dPlayer + // @attribute + // @returns PlayerTag // @description // Returns the player who is trading with the villager entity, or null if it is not trading. // --> if (attribute.startsWith("trading_with")) { if (entity instanceof Merchant && ((Merchant) entity).getTrader() != null) { - return new dEntity(((Merchant) entity).getTrader()).getAttribute(attribute.fulfill(1)); + return new EntityTag(((Merchant) entity).getTrader()).getAttribute(attribute.fulfill(1)); } } @@ -1652,8 +1652,8 @@ else if (getLivingEntity().getType() == EntityType.PIG) { ///////////////// // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @group location // @description // Returns a 2D location indicating where on the map the entity's looking at. @@ -1680,20 +1680,20 @@ else if (mtr.angle == BlockFace.EAST) { x = 128f - (basez * 128f); } y = 128f - (basey * 128f); - return new dLocation(null, Math.round(x), Math.round(y)).getAttribute(attribute.fulfill(1)); + return new LocationTag(null, Math.round(x), Math.round(y)).getAttribute(attribute.fulfill(1)); } } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Boolean) // @group location // @description // Returns whether the entity can see the specified other entity (has an uninterrupted line-of-sight). // --> if (attribute.startsWith("can_see")) { - if (isLivingEntity() && attribute.hasContext(1) && dEntity.matches(attribute.getContext(1))) { - dEntity toEntity = dEntity.valueOf(attribute.getContext(1)); + if (isLivingEntity() && attribute.hasContext(1) && EntityTag.matches(attribute.getContext(1))) { + EntityTag toEntity = EntityTag.valueOf(attribute.getContext(1)); if (toEntity != null && toEntity.isSpawned()) { return new ElementTag(getLivingEntity().hasLineOfSight(toEntity.getBukkitEntity())).getAttribute(attribute.fulfill(1)); } @@ -1701,19 +1701,19 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @group location // @description // Returns the location of the entity's eyes. // --> if (attribute.startsWith("eye_location")) { - return new dLocation(getEyeLocation()) + return new LocationTag(getEyeLocation()) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group location // @description @@ -1727,16 +1727,16 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute ]> - // @returns dLocation + // @attribute ]> + // @returns LocationTag // @group location // @description // Returns the location of the block the entity is looking at. // Optionally, specify a maximum range to find the location from. // --> // <--[tag] - // @attribute ].ignore[|...]> - // @returns dLocation + // @attribute ].ignore[|...]> + // @returns LocationTag // @group location // @description // Returns the location of the block the entity is looking at, ignoring @@ -1753,43 +1753,43 @@ else if (mtr.angle == BlockFace.EAST) { set.add(Material.AIR); attribute = attribute.fulfill(2); if (attribute.startsWith("ignore") && attribute.hasContext(1)) { - List ignoreList = ListTag.valueOf(attribute.getContext(1)).filter(dMaterial.class, attribute.context); - for (dMaterial material : ignoreList) { + List ignoreList = ListTag.valueOf(attribute.getContext(1)).filter(MaterialTag.class, attribute.context); + for (MaterialTag material : ignoreList) { set.add(material.getMaterial()); } attribute = attribute.fulfill(1); } - return new dLocation(getLivingEntity().getTargetBlock(set, range).getLocation()).getAttribute(attribute); + return new LocationTag(getLivingEntity().getTargetBlock(set, range).getLocation()).getAttribute(attribute); } // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @group location // @description // Returns the location of what the entity is standing on. // Works with offline players. // --> if (attribute.startsWith("location.standing_on")) { - return new dLocation(entity.getLocation().clone().add(0, -0.5f, 0)) + return new LocationTag(entity.getLocation().clone().add(0, -0.5f, 0)) .getAttribute(attribute.fulfill(2)); } // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @group location // @description // Returns the location of the entity. // Works with offline players. // --> if (attribute.startsWith("location")) { - return new dLocation(entity.getLocation()) + return new LocationTag(entity.getLocation()) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @group location // @description @@ -1801,27 +1801,27 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @group location // @description // Returns the movement velocity of the entity. // Note: Does not accurately calculate player clientside movement velocity. // --> if (attribute.startsWith("velocity")) { - return new dLocation(entity.getVelocity().toLocation(entity.getWorld())) + return new LocationTag(entity.getVelocity().toLocation(entity.getWorld())) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute - // @returns dWorld + // @attribute + // @returns WorldTag // @group location // @description // Returns the world the entity is in. Works with offline players. // --> if (attribute.startsWith("world")) { - return new dWorld(entity.getWorld()) + return new WorldTag(entity.getWorld()) .getAttribute(attribute.fulfill(1)); } @@ -1831,7 +1831,7 @@ else if (mtr.angle == BlockFace.EAST) { ///////////////// // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group attributes // @description @@ -1845,19 +1845,19 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute - // @returns dMaterial + // @attribute + // @returns MaterialTag // @group attributes // @description // Returns the material of a fallingblock-type entity. // --> if (attribute.startsWith("fallingblock_material") && entity instanceof FallingBlock) { - return new dMaterial(NMSHandler.getInstance().getEntityHelper().getBlockDataFor((FallingBlock) entity)) + return new MaterialTag(NMSHandler.getInstance().getEntityHelper().getBlockDataFor((FallingBlock) entity)) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @group attributes // @description @@ -1869,7 +1869,7 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute + // @attribute // @returns DurationTag // @group attributes // @description @@ -1881,7 +1881,7 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group attributes // @description @@ -1892,53 +1892,53 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute - // @returns dEntity + // @attribute + // @returns EntityTag // @group attributes // @description // Returns the leash holder of entity. // --> if (attribute.startsWith("leash_holder") || attribute.startsWith("get_leash_holder")) { if (isLivingEntity() && getLivingEntity().isLeashed()) { - return new dEntity(getLivingEntity().getLeashHolder()) + return new EntityTag(getLivingEntity().getLeashHolder()) .getAttribute(attribute.fulfill(1)); } } // <--[tag] - // @attribute - // @returns ListTag(dEntity) + // @attribute + // @returns ListTag(EntityTag) // @group attributes // @description // Returns a list of the entity's passengers, if any. // --> if (attribute.startsWith("passengers") || attribute.startsWith("get_passengers")) { - ArrayList passengers = new ArrayList<>(); + ArrayList passengers = new ArrayList<>(); for (Entity ent : entity.getPassengers()) { - passengers.add(new dEntity(ent)); + passengers.add(new EntityTag(ent)); } return new ListTag(passengers).getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute - // @returns dEntity + // @attribute + // @returns EntityTag // @group attributes // @description // Returns the entity's passenger, if any. // --> if (attribute.startsWith("passenger") || attribute.startsWith("get_passenger")) { if (!entity.isEmpty()) { - return new dEntity(entity.getPassenger()) + return new EntityTag(entity.getPassenger()) .getAttribute(attribute.fulfill(1)); } } // <--[tag] - // @attribute - // @returns dEntity + // @attribute + // @returns EntityTag // @group attributes - // @Mechanism dEntity.shooter + // @Mechanism EntityTag.shooter // @description // Returns the entity's shooter, if any. // --> @@ -1950,8 +1950,8 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute - // @returns dEntity + // @attribute + // @returns EntityTag // @description // Returns the entity on the entity's left shoulder. // Only applies to player-typed entities. @@ -1960,13 +1960,13 @@ else if (mtr.angle == BlockFace.EAST) { // --> if (getLivingEntity() instanceof HumanEntity && attribute.startsWith("left_shoulder")) { - return new dEntity(((HumanEntity) getLivingEntity()).getShoulderEntityLeft()) + return new EntityTag(((HumanEntity) getLivingEntity()).getShoulderEntityLeft()) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute - // @returns dEntity + // @attribute + // @returns EntityTag // @description // Returns the entity on the entity's right shoulder. // Only applies to player-typed entities. @@ -1975,26 +1975,26 @@ else if (mtr.angle == BlockFace.EAST) { // --> if (getLivingEntity() instanceof HumanEntity && attribute.startsWith("right_shoulder")) { - return new dEntity(((HumanEntity) getLivingEntity()).getShoulderEntityRight()) + return new EntityTag(((HumanEntity) getLivingEntity()).getShoulderEntityRight()) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute - // @returns dEntity + // @attribute + // @returns EntityTag // @group attributes // @description - // If the entity is in a vehicle, returns the vehicle as a dEntity. + // If the entity is in a vehicle, returns the vehicle as a EntityTag. // --> if (attribute.startsWith("vehicle") || attribute.startsWith("get_vehicle")) { if (entity.isInsideVehicle()) { - return new dEntity(entity.getVehicle()) + return new EntityTag(entity.getVehicle()) .getAttribute(attribute.fulfill(1)); } } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group attributes // @description @@ -2006,7 +2006,7 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group attributes // @description @@ -2018,7 +2018,7 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group attributes // @description @@ -2030,7 +2030,7 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group attributes // @description @@ -2042,7 +2042,7 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group attributes // @description @@ -2054,7 +2054,7 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group attributes // @description @@ -2066,7 +2066,7 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group attributes // @description @@ -2078,7 +2078,7 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group attributes // @description @@ -2090,7 +2090,7 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group attributes // @description @@ -2102,7 +2102,7 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @mechanism collidable // @group attributes @@ -2115,8 +2115,8 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute - // @returns dPlayer + // @attribute + // @returns PlayerTag // @group attributes // @description // Returns the player that last killed the entity. @@ -2127,7 +2127,7 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @group attributes // @description @@ -2139,7 +2139,7 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @group attributes // @description @@ -2152,9 +2152,9 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute + // @attribute // @returns DurationTag - // @mechanism dEntity.no_damage_duration + // @mechanism EntityTag.no_damage_duration // @group attributes // @description // Returns the duration of the last damage taken by the entity. @@ -2165,9 +2165,9 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute + // @attribute // @returns DurationTag - // @mechanism dEntity.max_no_damage_duration + // @mechanism EntityTag.max_no_damage_duration // @group attributes // @description // Returns the maximum duration of the last damage taken by the entity. @@ -2178,7 +2178,7 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute + // @attribute // @returns DurationTag // @group attributes // @description @@ -2191,7 +2191,7 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute + // @attribute // @returns DurationTag // @group attributes // @description @@ -2204,7 +2204,7 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group attributes // @description @@ -2216,25 +2216,25 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute - // @returns dEntity + // @attribute + // @returns EntityTag // @group attributes // @description // Returns the target entity of the creature, if any. - // Note: use for NPC's. + // Note: use for NPC's. // --> if (attribute.startsWith("target")) { if (getBukkitEntity() instanceof Creature) { Entity target = ((Creature) getLivingEntity()).getTarget(); if (target != null) { - return new dEntity(target).getAttribute(attribute.fulfill(1)); + return new EntityTag(target).getAttribute(attribute.fulfill(1)); } } return null; } // <--[tag] - // @attribute + // @attribute // @returns DurationTag // @group attributes // @description @@ -2246,7 +2246,7 @@ else if (mtr.angle == BlockFace.EAST) { } // <--[tag] - // @attribute + // @attribute // @returns DurationTag // @group attributes // @description @@ -2258,7 +2258,7 @@ && getBukkitEntity() instanceof Item) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group attributes // @description @@ -2272,8 +2272,8 @@ && getBukkitEntity() instanceof Item) { } // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @group attributes // @description // Returns the location of the block that the arrow/trident entity is attached to. @@ -2282,16 +2282,16 @@ && getBukkitEntity() instanceof Item) { if (getBukkitEntity() instanceof Arrow) { Block attachedBlock = ((Arrow) getBukkitEntity()).getAttachedBlock(); if (attachedBlock != null) { - return new dLocation(attachedBlock.getLocation()).getAttribute(attribute.fulfill(1)); + return new LocationTag(attachedBlock.getLocation()).getAttribute(attribute.fulfill(1)); } } return null; } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dEntity.gliding + // @mechanism EntityTag.gliding // @group attributes // @description // Returns whether this entity is gliding. @@ -2302,9 +2302,9 @@ && getBukkitEntity() instanceof Item) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dEntity.swimming + // @mechanism EntityTag.swimming // @group attributes // @description // Returns whether this entity is swimming. @@ -2315,9 +2315,9 @@ && getBukkitEntity() instanceof Item) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dEntity.glowing + // @mechanism EntityTag.glowing // @group attributes // @description // Returns whether this entity is glowing. @@ -2332,7 +2332,7 @@ && getBukkitEntity() instanceof Item) { ///////////////// // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group data // @description @@ -2344,7 +2344,7 @@ && getBukkitEntity() instanceof Item) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group data // @description @@ -2356,7 +2356,7 @@ && getBukkitEntity() instanceof Item) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group data // @description @@ -2368,7 +2368,7 @@ && getBukkitEntity() instanceof Item) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group data // @description @@ -2380,7 +2380,7 @@ && getBukkitEntity() instanceof Item) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group data // @description @@ -2393,7 +2393,7 @@ && getBukkitEntity() instanceof Item) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group data // @description @@ -2409,14 +2409,14 @@ && getBukkitEntity() instanceof Item) { ///////////////// // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group properties // @description // Returns whether the entity is tameable. // If this returns true, it will enable access to: - // <@link mechanism dEntity.tame>, <@link mechanism dEntity.owner>, - // <@link tag e@entity.is_tamed>, and <@link tag e@entity.owner> + // <@link mechanism EntityTag.tame>, <@link mechanism EntityTag.owner>, + // <@link tag EntityTag.is_tamed>, and <@link tag EntityTag.owner> // --> if (attribute.startsWith("tameable") || attribute.startsWith("is_tameable")) { return new ElementTag(EntityTame.describes(this)) @@ -2424,15 +2424,15 @@ && getBukkitEntity() instanceof Item) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group properties // @description // Returns whether the entity is ageable. // If this returns true, it will enable access to: - // <@link mechanism dEntity.age>, <@link mechanism dEntity.age_lock>, - // <@link tag e@entity.is_baby>, <@link tag e@entity.age>, - // and <@link tag e@entity.is_age_locked> + // <@link mechanism EntityTag.age>, <@link mechanism EntityTag.age_lock>, + // <@link tag EntityTag.is_baby>, <@link tag EntityTag.age>, + // and <@link tag EntityTag.is_age_locked> // --> if (attribute.startsWith("ageable") || attribute.startsWith("is_ageable")) { return new ElementTag(EntityAge.describes(this)) @@ -2440,13 +2440,13 @@ && getBukkitEntity() instanceof Item) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group properties // @description // Returns whether the entity can be colored. // If this returns true, it will enable access to: - // <@link mechanism dEntity.color> and <@link tag e@entity.color> + // <@link mechanism EntityTag.color> and <@link tag EntityTag.color> // --> if (attribute.startsWith("colorable") || attribute.startsWith("is_colorable")) { return new ElementTag(EntityColor.describes(this)) @@ -2454,7 +2454,7 @@ && getBukkitEntity() instanceof Item) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @group properties // @description @@ -2466,7 +2466,7 @@ && getBukkitEntity() instanceof Item) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @group properties // @description @@ -2478,7 +2478,7 @@ && getBukkitEntity() instanceof Item) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @group properties // @description @@ -2491,7 +2491,7 @@ && getBukkitEntity() instanceof Item) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group properties // @description @@ -2548,37 +2548,37 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name item_in_hand - // @input dItem + // @input ItemTag // @description // Sets the item in the entity's hand. // The entity must be living. // @tags - // + // // --> if (mechanism.matches("item_in_hand")) { - NMSHandler.getInstance().getEntityHelper().setItemInHand(getLivingEntity(), mechanism.valueAsType(dItem.class).getItemStack()); + NMSHandler.getInstance().getEntityHelper().setItemInHand(getLivingEntity(), mechanism.valueAsType(ItemTag.class).getItemStack()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name item_in_offhand - // @input dItem + // @input ItemTag // @description // Sets the item in the entity's offhand. // The entity must be living. // @tags - // + // // --> if (mechanism.matches("item_in_offhand")) { - NMSHandler.getInstance().getEntityHelper().setItemInOffHand(getLivingEntity(), mechanism.valueAsType(dItem.class).getItemStack()); + NMSHandler.getInstance().getEntityHelper().setItemInOffHand(getLivingEntity(), mechanism.valueAsType(ItemTag.class).getItemStack()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name attach_to - // @input dEntity(|dLocation(|Element(Boolean))) + // @input EntityTag(|dLocation(|Element(Boolean))) // @description // Attaches this entity's client-visible motion to another entity. // Optionally, specify an offset vector as well. @@ -2593,12 +2593,12 @@ public void adjust(Mechanism mechanism) { Vector offset = null; boolean rotateWith = true; if (list.size() > 1) { - offset = dLocation.valueOf(list.get(1)).toVector(); + offset = LocationTag.valueOf(list.get(1)).toVector(); if (list.size() > 2) { rotateWith = new ElementTag(list.get(2)).asBoolean(); } } - NMSHandler.getInstance().forceAttachMove(entity, dEntity.valueOf(list.get(0)).getBukkitEntity(), offset, rotateWith); + NMSHandler.getInstance().forceAttachMove(entity, EntityTag.valueOf(list.get(0)).getBukkitEntity(), offset, rotateWith); } else { NMSHandler.getInstance().forceAttachMove(entity, null, null, false); @@ -2606,48 +2606,48 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name shooter - // @input dEntity + // @input EntityTag // @description // Sets the entity's shooter. // The entity must be a projectile. // @tags - // + // // --> if (mechanism.matches("shooter")) { - setShooter(mechanism.valueAsType(dEntity.class)); + setShooter(mechanism.valueAsType(EntityTag.class)); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name can_pickup_items // @input Element(Boolean) // @description // Sets whether the entity can pick up items. // The entity must be living. // @tags - // + // // --> if (mechanism.matches("can_pickup_items") && mechanism.requireBoolean()) { getLivingEntity().setCanPickupItems(mechanism.getValue().asBoolean()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name fall_distance // @input Element(Decimal) // @description // Sets the fall distance. // @tags - // + // // --> if (mechanism.matches("fall_distance") && mechanism.requireFloat()) { entity.setFallDistance(mechanism.getValue().asFloat()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name fallingblock_drop_item // @input Element(Boolean) // @description @@ -2659,7 +2659,7 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name fallingblock_hurt_entities // @input Element(Boolean) // @description @@ -2671,74 +2671,74 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name fire_time // @input Duration // @description // Sets the entity's current fire time (time before the entity stops being on fire). // @tags - // + // // --> if (mechanism.matches("fire_time") && mechanism.requireObject(DurationTag.class)) { entity.setFireTicks(mechanism.valueAsType(DurationTag.class).getTicksAsInt()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name leash_holder - // @input dEntity + // @input EntityTag // @description // Sets the entity holding this entity by leash. // The entity must be living. // @tags - // - // + // + // // --> - if (mechanism.matches("leash_holder") && mechanism.requireObject(dEntity.class)) { - getLivingEntity().setLeashHolder(mechanism.valueAsType(dEntity.class).getBukkitEntity()); + if (mechanism.matches("leash_holder") && mechanism.requireObject(EntityTag.class)) { + getLivingEntity().setLeashHolder(mechanism.valueAsType(EntityTag.class).getBukkitEntity()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name can_breed // @input Element(Boolean) // @description // Sets whether the entity is capable of mating with another of its kind. // The entity must be living and 'ageable'. // @tags - // + // // --> if (mechanism.matches("can_breed") && mechanism.requireBoolean()) { ((Ageable) getLivingEntity()).setBreed(true); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name breed // @input Element(Boolean) // @description // Sets whether the entity is trying to mate with another of its kind. // The entity must be living and an animal. // @tags - // + // // --> if (mechanism.matches("breed") && mechanism.requireBoolean()) { NMSHandler.getInstance().getEntityHelper().setBreeding((Animals) getLivingEntity(), mechanism.getValue().asBoolean()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name passengers - // @input ListTag(dEntity) + // @input ListTag(EntityTag) // @description // Sets the passengers of this entity. // @tags - // - // + // + // // --> if (mechanism.matches("passengers")) { entity.eject(); - for (dEntity ent : mechanism.valueAsType(ListTag.class).filter(dEntity.class, mechanism.context)) { + for (EntityTag ent : mechanism.valueAsType(ListTag.class).filter(EntityTag.class, mechanism.context)) { if (ent.isSpawned() && comparesTo(ent) != 1) { entity.addPassenger(ent.getBukkitEntity()); } @@ -2746,56 +2746,56 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name passenger - // @input dEntity + // @input EntityTag // @description // Sets the passenger of this entity. // @tags - // - // + // + // // --> - if (mechanism.matches("passenger") && mechanism.requireObject(dEntity.class)) { - entity.setPassenger(mechanism.valueAsType(dEntity.class).getBukkitEntity()); + if (mechanism.matches("passenger") && mechanism.requireObject(EntityTag.class)) { + entity.setPassenger(mechanism.valueAsType(EntityTag.class).getBukkitEntity()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name time_lived // @input Duration // @description // Sets the amount of time this entity has lived for. // @tags - // + // // --> if (mechanism.matches("time_lived") && mechanism.requireObject(DurationTag.class)) { entity.setTicksLived(mechanism.valueAsType(DurationTag.class).getTicksAsInt()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name remaining_air // @input Element(Number) // @description // Sets how much air the entity has remaining before it drowns. // The entity must be living. // @tags - // - // + // + // // --> if (mechanism.matches("remaining_air") && mechanism.requireInteger()) { getLivingEntity().setRemainingAir(mechanism.getValue().asInt()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name remove_effects // @input None // @description // Removes all potion effects from the entity. // The entity must be living. // @tags - // ]> + // ]> // --> if (mechanism.matches("remove_effects")) { for (PotionEffect potionEffect : this.getLivingEntity().getActivePotionEffects()) { @@ -2804,7 +2804,7 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name release_left_shoulder // @input None // @description @@ -2815,9 +2815,9 @@ public void adjust(Mechanism mechanism) { && mechanism.matches("release_left_shoulder")) { Entity bukkitEnt = ((HumanEntity) getLivingEntity()).getShoulderEntityLeft(); if (bukkitEnt != null) { - dEntity ent = new dEntity(bukkitEnt); + EntityTag ent = new EntityTag(bukkitEnt); String escript = ent.getEntityScript(); - ent = dEntity.valueOf("e@" + (escript != null && escript.length() > 0 ? escript : ent.getEntityType().getLowercaseName()) + ent = EntityTag.valueOf("e@" + (escript != null && escript.length() > 0 ? escript : ent.getEntityType().getLowercaseName()) + PropertyParser.getPropertiesString(ent)); ent.spawnAt(getEyeLocation()); ((HumanEntity) getLivingEntity()).setShoulderEntityLeft(null); @@ -2825,7 +2825,7 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name release_right_shoulder // @input None // @description @@ -2836,9 +2836,9 @@ public void adjust(Mechanism mechanism) { && mechanism.matches("release_right_shoulder")) { Entity bukkitEnt = ((HumanEntity) getLivingEntity()).getShoulderEntityRight(); if (bukkitEnt != null) { - dEntity ent = new dEntity(bukkitEnt); + EntityTag ent = new EntityTag(bukkitEnt); String escript = ent.getEntityScript(); - ent = dEntity.valueOf("e@" + (escript != null && escript.length() > 0 ? escript : ent.getEntityType().getLowercaseName()) + ent = EntityTag.valueOf("e@" + (escript != null && escript.length() > 0 ? escript : ent.getEntityType().getLowercaseName()) + PropertyParser.getPropertiesString(ent)); ent.spawnAt(getEyeLocation()); ((HumanEntity) getLivingEntity()).setShoulderEntityRight(null); @@ -2846,9 +2846,9 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name left_shoulder - // @input dEntity + // @input EntityTag // @description // Sets the entity's left shoulder entity. // Only applies to player-typed entities. @@ -2856,13 +2856,13 @@ public void adjust(Mechanism mechanism) { // NOTE: This mechanism will remove the current shoulder entity from the world. // Also note the client will currently only render parrot entities. // @tags - // + // // --> if (getLivingEntity() instanceof HumanEntity && mechanism.matches("left_shoulder")) { if (mechanism.hasValue()) { - if (mechanism.requireObject(dEntity.class)) { - ((HumanEntity) getLivingEntity()).setShoulderEntityLeft(mechanism.valueAsType(dEntity.class).getBukkitEntity()); + if (mechanism.requireObject(EntityTag.class)) { + ((HumanEntity) getLivingEntity()).setShoulderEntityLeft(mechanism.valueAsType(EntityTag.class).getBukkitEntity()); } } else { @@ -2871,9 +2871,9 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name right_shoulder - // @input dEntity + // @input EntityTag // @description // Sets the entity's right shoulder entity. // Only applies to player-typed entities. @@ -2881,13 +2881,13 @@ public void adjust(Mechanism mechanism) { // NOTE: This mechanism will remove the current shoulder entity from the world. // Also note the client will currently only render parrot entities. // @tags - // + // // --> if (getLivingEntity() instanceof HumanEntity && mechanism.matches("right_shoulder")) { if (mechanism.hasValue()) { - if (mechanism.requireObject(dEntity.class)) { - ((HumanEntity) getLivingEntity()).setShoulderEntityRight(mechanism.valueAsType(dEntity.class).getBukkitEntity()); + if (mechanism.requireObject(EntityTag.class)) { + ((HumanEntity) getLivingEntity()).setShoulderEntityRight(mechanism.valueAsType(EntityTag.class).getBukkitEntity()); } } else { @@ -2896,27 +2896,27 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name remove_when_far_away // @input Element(Boolean) // @description // Sets whether the entity should be removed entirely when despawned. // The entity must be living. // @tags - // + // // --> if (mechanism.matches("remove_when_far_away") && mechanism.requireBoolean()) { getLivingEntity().setRemoveWhenFarAway(mechanism.getValue().asBoolean()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name sheared // @input Element(Boolean) // @description // Sets whether the sheep is sheared. // @tags - // + // // --> if (mechanism.matches("sheared") && mechanism.requireBoolean() && getBukkitEntity() instanceof Sheep) { @@ -2924,14 +2924,14 @@ && getBukkitEntity() instanceof Sheep) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name collidable // @input Element(Boolean) // @description // Sets whether the entity is collidable. // NOTE: To disable collision between two entities, set this mechanism to false on both entities. // @tags - // + // // --> if (mechanism.matches("collidable") && mechanism.requireBoolean()) { @@ -2939,73 +2939,73 @@ && getBukkitEntity() instanceof Sheep) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name no_damage_duration // @input Duration // @description // Sets the duration in which the entity will take no damage. // @tags - // - // + // + // // --> if (mechanism.matches("no_damage_duration") && mechanism.requireObject(DurationTag.class)) { getLivingEntity().setNoDamageTicks(mechanism.valueAsType(DurationTag.class).getTicksAsInt()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name max_no_damage_duration // @input Duration // @description // Sets the maximum duration in which the entity will take no damage. // @tags - // - // + // + // // --> if (mechanism.matches("max_no_damage_duration") && mechanism.requireObject(DurationTag.class)) { getLivingEntity().setMaximumNoDamageTicks(mechanism.valueAsType(DurationTag.class).getTicksAsInt()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name velocity - // @input dLocation + // @input LocationTag // @description // Sets the entity's movement velocity. // @tags - // + // // --> - if (mechanism.matches("velocity") && mechanism.requireObject(dLocation.class)) { - setVelocity(mechanism.valueAsType(dLocation.class).toVector()); + if (mechanism.matches("velocity") && mechanism.requireObject(LocationTag.class)) { + setVelocity(mechanism.valueAsType(LocationTag.class).toVector()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name move - // @input dLocation + // @input LocationTag // @description // Forces an entity to move in the direction of the velocity specified. // --> - if (mechanism.matches("move") && mechanism.requireObject(dLocation.class)) { - NMSHandler.getInstance().getEntityHelper().move(getBukkitEntity(), mechanism.valueAsType(dLocation.class).toVector()); + if (mechanism.matches("move") && mechanism.requireObject(LocationTag.class)) { + NMSHandler.getInstance().getEntityHelper().move(getBukkitEntity(), mechanism.valueAsType(LocationTag.class).toVector()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name interact_with - // @input dLocation + // @input LocationTag // @description // Makes a player-type entity interact with a block. // @tags // None // --> - if (mechanism.matches("interact_with") && mechanism.requireObject(dLocation.class)) { - dLocation interactLocation = mechanism.valueAsType(dLocation.class); + if (mechanism.matches("interact_with") && mechanism.requireObject(LocationTag.class)) { + LocationTag interactLocation = mechanism.valueAsType(LocationTag.class); NMSHandler.getInstance().getEntityHelper().forceInteraction(getPlayer(), interactLocation); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name play_death // @input None // @description @@ -3018,13 +3018,13 @@ && getBukkitEntity() instanceof Sheep) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name pickup_delay // @input Duration // @description // Sets the pickup delay of this Item Entity. // @tags - // + // // --> if ((mechanism.matches("pickup_delay") || mechanism.matches("pickupdelay")) && getBukkitEntity() instanceof Item && mechanism.requireObject(DurationTag.class)) { @@ -3032,26 +3032,26 @@ && getBukkitEntity() instanceof Sheep) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name gliding // @input Element(Boolean) // @description // Sets whether this entity is gliding. // @tags - // + // // --> if (mechanism.matches("gliding") && mechanism.requireBoolean()) { getLivingEntity().setGliding(mechanism.getValue().asBoolean()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name glowing // @input Element(Boolean) // @description // Sets whether this entity is glowing. // @tags - // + // // --> if (mechanism.matches("glowing") && mechanism.requireBoolean()) { getBukkitEntity().setGlowing(mechanism.getValue().asBoolean()); @@ -3061,13 +3061,13 @@ && getBukkitEntity() instanceof Sheep) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name dragon_phase // @input Element // @description // Sets an EnderDragon's combat phase. // @tags - // + // // --> if (mechanism.matches("dragon_phase")) { EnderDragon ed = (EnderDragon) getLivingEntity(); @@ -3075,33 +3075,33 @@ && getBukkitEntity() instanceof Sheep) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name experience // @input Element(Number) // @description // Sets the experience value of this experience orb entity. // @tags - // + // // --> if (mechanism.matches("experience") && getBukkitEntity() instanceof ExperienceOrb && mechanism.requireInteger()) { ((ExperienceOrb) getBukkitEntity()).setExperience(mechanism.getValue().asInt()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name fuse_ticks // @input Element(Number) // @description // Sets the number of ticks until the TNT blows up after being primed. // @tags - // + // // --> if (mechanism.matches("fuse_ticks") && getBukkitEntity() instanceof TNTPrimed && mechanism.requireInteger()) { ((TNTPrimed) getBukkitEntity()).setFuseTicks(mechanism.getValue().asInt()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name show_to_players // @input None // @description @@ -3112,7 +3112,7 @@ && getBukkitEntity() instanceof Sheep) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name hide_from_players // @input None // @description @@ -3123,7 +3123,7 @@ && getBukkitEntity() instanceof Sheep) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name mirror_player // @input Element(Boolean) // @description @@ -3155,13 +3155,13 @@ && getBukkitEntity() instanceof Sheep) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name swimming // @input Element(Boolean) // @description // Sets whether the entity is swimming. // @tags - // + // // --> if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13_R2) && mechanism.matches("swimming") && mechanism.requireBoolean()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/dInventory.java b/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java similarity index 82% rename from plugin/src/main/java/com/denizenscript/denizen/objects/dInventory.java rename to plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java index 7f39f551f8..2ff47b6872 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/dInventory.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java @@ -38,13 +38,13 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -public class dInventory implements ObjectTag, Notable, Adjustable { +public class InventoryTag implements ObjectTag, Notable, Adjustable { // <--[language] - // @name dInventory + // @name InventoryTag // @group Object System // @description - // A dInventory represents an inventory, generically or attached to some in-the-world object. + // A InventoryTag represents an inventory, generically or attached to some in-the-world object. // // Inventories can be generically designed using inventory script containers, // and can be modified using the inventory command. @@ -57,20 +57,20 @@ public class dInventory implements ObjectTag, Notable, Adjustable { // @name in@ // @group Object Fetcher System // @description - // in@ refers to the 'object identifier' of a dInventory. The 'in@' is notation for Denizen's Object - // Fetcher. The constructor for a dInventory is a the classification type of inventory to use. All other data is specified through properties. + // in@ refers to the 'object identifier' of a InventoryTag. The 'in@' is notation for Denizen's Object + // Fetcher. The constructor for a InventoryTag is a the classification type of inventory to use. All other data is specified through properties. // // Valid inventory type classifications: // "npc", "player", "crafting", "enderchest", "workbench", "entity", "location", "generic" // - // For general info, see <@link language dInventory> + // For general info, see <@link language InventoryTag> // // --> - public static dInventory mirrorBukkitInventory(Inventory inventory) { + public static InventoryTag mirrorBukkitInventory(Inventory inventory) { // Scripts have priority over notables if (InventoryScriptHelper.tempInventoryScripts.containsKey(inventory)) { - return new dInventory(inventory).setIdentifiers("script", + return new InventoryTag(inventory).setIdentifiers("script", InventoryScriptHelper.tempInventoryScripts.get(inventory)); } // Use the map to get notable inventories @@ -81,17 +81,17 @@ public static dInventory mirrorBukkitInventory(Inventory inventory) { // Iterate through offline player inventories for (Map.Entry inv : ImprovedOfflinePlayer.offlineInventories.entrySet()) { if (inv.getValue().equals(inventory)) { - return new dInventory(NMSHandler.getInstance().getPlayerHelper().getOfflineData(inv.getKey())); + return new InventoryTag(NMSHandler.getInstance().getPlayerHelper().getOfflineData(inv.getKey())); } } // Iterate through offline player enderchests for (Map.Entry inv : ImprovedOfflinePlayer.offlineEnderChests.entrySet()) { if (inv.getValue().equals(inventory)) { - return new dInventory(NMSHandler.getInstance().getPlayerHelper().getOfflineData(inv.getKey()), true); + return new InventoryTag(NMSHandler.getInstance().getPlayerHelper().getOfflineData(inv.getKey()), true); } } - return new dInventory(inventory); + return new InventoryTag(inventory); } ///////////////////// @@ -186,7 +186,7 @@ public void forget() { //////////////// @Fetchable("in") - public static dInventory valueOf(String string, TagContext context) { + public static InventoryTag valueOf(String string, TagContext context) { if (context == null) { return valueOf(string, null, null); } @@ -195,18 +195,18 @@ public static dInventory valueOf(String string, TagContext context) { } } - public static dInventory valueOf(String string, dPlayer player, dNPC npc) { + public static InventoryTag valueOf(String string, PlayerTag player, NPCTag npc) { return valueOf(string, player, npc, false); } /** - * Gets a dInventory from a string format. + * Gets a InventoryTag from a string format. * * @param string The inventory in string form. (in@player[playerName], in@scriptName, etc.) - * @return The dInventory value. If the string is incorrectly formatted or + * @return The InventoryTag value. If the string is incorrectly formatted or * the specified inventory is invalid, this is null. */ - public static dInventory valueOf(String string, dPlayer player, dNPC npc, boolean silent) { + public static InventoryTag valueOf(String string, PlayerTag player, NPCTag npc, boolean silent) { if (string == null) { return null; @@ -216,7 +216,7 @@ public static dInventory valueOf(String string, dPlayer player, dNPC npc, boolea // Handle objects with properties through the object fetcher Matcher m = ObjectFetcher.DESCRIBED_PATTERN.matcher(string); if (m.matches()) { - return ObjectFetcher.getObjectFrom(dInventory.class, string, + return ObjectFetcher.getObjectFrom(InventoryTag.class, string, new BukkitTagContext(player, npc, false, null, false, null)); } @@ -229,13 +229,13 @@ public static dInventory valueOf(String string, dPlayer player, dNPC npc, boolea .getInventoryFrom(player, npc); } - if (NotableManager.isSaved(m.group(2)) && NotableManager.isType(m.group(2), dInventory.class)) { - return (dInventory) NotableManager.getSavedObject(m.group(2)); + if (NotableManager.isSaved(m.group(2)) && NotableManager.isType(m.group(2), InventoryTag.class)) { + return (InventoryTag) NotableManager.getSavedObject(m.group(2)); } for (String idType : idTypes) { if (m.group(2).equalsIgnoreCase(idType)) { - return new dInventory(m.group(2)); + return new InventoryTag(m.group(2)); } } } @@ -252,10 +252,10 @@ public static dInventory valueOf(String string, dPlayer player, dNPC npc, boolea if (type.equals("generic")) { Argument arg = Argument.valueOf(holder); if (arg.matchesEnum(InventoryType.values())) { - return new dInventory(InventoryType.valueOf(holder.toUpperCase())); + return new InventoryTag(InventoryType.valueOf(holder.toUpperCase())); } else if (arg.matchesPrimitive(PrimitiveType.Integer)) { - return new dInventory(arg.asElement().asInt()); + return new InventoryTag(arg.asElement().asInt()); } else { if (!silent) { @@ -264,31 +264,31 @@ else if (arg.matchesPrimitive(PrimitiveType.Integer)) { } } else if (type.equals("npc")) { - if (dNPC.matches(holder)) { - return dNPC.valueOf(holder).getDenizenInventory(); + if (NPCTag.matches(holder)) { + return NPCTag.valueOf(holder).getDenizenInventory(); } } else if (type.equals("crafting")) { - if (dPlayer.matches(holder)) { - dPlayer holderPlayer = dPlayer.valueOf(holder); + if (PlayerTag.matches(holder)) { + PlayerTag holderPlayer = PlayerTag.valueOf(holder); Inventory opened = holderPlayer.getPlayerEntity().getOpenInventory().getTopInventory(); if (opened instanceof CraftingInventory) { - return new dInventory(opened); + return new InventoryTag(opened); } - return dPlayer.valueOf(holder).getInventory(); + return PlayerTag.valueOf(holder).getInventory(); } } else if (type.equals("player")) { - if (dPlayer.matches(holder)) { - return dPlayer.valueOf(holder).getInventory(); + if (PlayerTag.matches(holder)) { + return PlayerTag.valueOf(holder).getInventory(); } } else if (type.equals("workbench")) { - if (dPlayer.matches(holder)) { - dInventory workbench = dPlayer.valueOf(holder).getWorkbench(); + if (PlayerTag.matches(holder)) { + InventoryTag workbench = PlayerTag.valueOf(holder).getWorkbench(); if (workbench == null) { if (!silent) { - Debug.echoError("Value of dInventory returning null (" + string + ")." + + Debug.echoError("Value of InventoryTag returning null (" + string + ")." + " Specified player does not have an open workbench."); } } @@ -298,31 +298,31 @@ else if (type.equals("workbench")) { } } else if (type.equals("enderchest")) { - if (dPlayer.matches(holder)) { - return dPlayer.valueOf(holder).getEnderChest(); + if (PlayerTag.matches(holder)) { + return PlayerTag.valueOf(holder).getEnderChest(); } } else if (type.equals("entity")) { - if (dEntity.matches(holder)) { - return dEntity.valueOf(holder).getInventory(); + if (EntityTag.matches(holder)) { + return EntityTag.valueOf(holder).getInventory(); } } else if (type.equals("location")) { - if (dLocation.matches(holder)) { - return dLocation.valueOf(holder).getInventory(); + if (LocationTag.matches(holder)) { + return LocationTag.valueOf(holder).getInventory(); } } - // If the dInventory is invalid, alert the user and return null + // If the InventoryTag is invalid, alert the user and return null if (!silent) { - Debug.echoError("Value of dInventory returning null. Invalid " + + Debug.echoError("Value of InventoryTag returning null. Invalid " + type + " specified: " + holder); } return null; } if (!silent) { - Debug.echoError("Value of dInventory returning null. Invalid dInventory specified: " + string); + Debug.echoError("Value of InventoryTag returning null. Invalid InventoryTag specified: " + string); } return null; } @@ -351,7 +351,7 @@ public static boolean matches(String arg) { return true; } - if (NotableManager.isSaved(tid) && NotableManager.isType(tid, dInventory.class)) { + if (NotableManager.isSaved(tid) && NotableManager.isType(tid, InventoryTag.class)) { return true; } @@ -372,37 +372,37 @@ public static boolean matches(String arg) { String idType = null; String idHolder = null; - public dInventory(Inventory inventory) { + public InventoryTag(Inventory inventory) { this.inventory = inventory; loadIdentifiers(); } - public dInventory(Inventory inventory, InventoryHolder holder) { + public InventoryTag(Inventory inventory, InventoryHolder holder) { this.inventory = inventory; loadIdentifiers(holder); } - public dInventory(InventoryHolder holder) { + public InventoryTag(InventoryHolder holder) { inventory = holder.getInventory(); loadIdentifiers(); } - public dInventory(ItemStack[] items) { + public InventoryTag(ItemStack[] items) { inventory = Bukkit.getServer().createInventory(null, (int) Math.ceil(items.length / 9.0) * 9); setContents(items); loadIdentifiers(); } - public dInventory(ImprovedOfflinePlayer offlinePlayer) { + public InventoryTag(ImprovedOfflinePlayer offlinePlayer) { this(offlinePlayer, false); } - public dInventory(ImprovedOfflinePlayer offlinePlayer, boolean isEnderChest) { + public InventoryTag(ImprovedOfflinePlayer offlinePlayer, boolean isEnderChest) { inventory = isEnderChest ? offlinePlayer.getEnderChest() : offlinePlayer.getInventory(); setIdentifiers(isEnderChest ? "enderchest" : "player", "p@" + offlinePlayer.getUniqueId()); } - public dInventory(int size, String title) { + public InventoryTag(int size, String title) { if (size <= 0 || size % 9 != 0) { Debug.echoError("InventorySize must be multiple of 9, and greater than 0."); return; @@ -411,16 +411,16 @@ public dInventory(int size, String title) { loadIdentifiers(); } - public dInventory(InventoryType type) { + public InventoryTag(InventoryType type) { inventory = Bukkit.getServer().createInventory(null, type); loadIdentifiers(); } - public dInventory(int size) { + public InventoryTag(int size) { this(size, "Chest"); } - public dInventory(String idType) { + public InventoryTag(String idType) { this.idType = CoreUtilities.toLowerCase(idType); } @@ -449,7 +449,7 @@ public void setInventory(Inventory inventory) { loadIdentifiers(); } - public void setInventory(Inventory inventory, dPlayer player) { + public void setInventory(Inventory inventory, PlayerTag player) { this.inventory = inventory; this.idHolder = player.identify(); } @@ -482,11 +482,11 @@ else if (notableColors != null) { loadIdentifiers(); } - public boolean containsItem(dItem item, int amount) { + public boolean containsItem(ItemTag item, int amount) { if (item == null) { return false; } - item = new dItem(item.getItemStack().clone()); + item = new ItemTag(item.getItemStack().clone()); item.setAmount(1); String myItem = CoreUtilities.toLowerCase(item.getFullString()); for (int i = 0; i < inventory.getSize(); i++) { @@ -497,7 +497,7 @@ public boolean containsItem(dItem item, int amount) { is = is.clone(); int count = is.getAmount(); is.setAmount(1); - String newItem = CoreUtilities.toLowerCase(new dItem(is).getFullString()); + String newItem = CoreUtilities.toLowerCase(new ItemTag(is).getFullString()); if (myItem.equals(newItem)) { if (count <= amount) { amount -= count; @@ -513,7 +513,7 @@ else if (count > amount) { return false; } - public boolean removeItem(dItem item, int amount) { + public boolean removeItem(ItemTag item, int amount) { if (item == null) { return false; } @@ -528,7 +528,7 @@ public boolean removeItem(dItem item, int amount) { int count = is.getAmount(); is.setAmount(1); // Note: this double-parsing is intentional, as part of a hotfix for a larger issue - String newItem = CoreUtilities.toLowerCase(dItem.valueOf(new dItem(is).getFullString(), false).getFullString()); + String newItem = CoreUtilities.toLowerCase(ItemTag.valueOf(new ItemTag(is).getFullString(), false).getFullString()); if (myItem.equals(newItem)) { if (count <= amount) { inventory.setItem(i, null); @@ -587,15 +587,15 @@ private void loadIdentifiers(final InventoryHolder holder) { } if (holder != null) { - if (holder instanceof dNPC) { + if (holder instanceof NPCTag) { idType = "npc"; - idHolder = ((dNPC) holder).identify(); + idHolder = ((NPCTag) holder).identify(); return; } else if (holder instanceof Player) { if (Depends.citizens != null && CitizensAPI.getNPCRegistry().isNPC((Player) holder)) { idType = "npc"; - idHolder = (dNPC.fromEntity((Player) holder)).identify(); + idHolder = (NPCTag.fromEntity((Player) holder)).identify(); return; } if (inventory.getType() == InventoryType.CRAFTING) { @@ -610,12 +610,12 @@ else if (inventory.getType() == InventoryType.WORKBENCH) { else { idType = "player"; } - idHolder = new dPlayer((Player) holder).identify(); + idHolder = new PlayerTag((Player) holder).identify(); return; } else if (holder instanceof Entity) { idType = "entity"; - idHolder = new dEntity((Entity) holder).identify(); + idHolder = new EntityTag((Entity) holder).identify(); return; } else { @@ -633,7 +633,7 @@ else if (getIdType().equals("player")) { // Iterate through offline player inventories for (Map.Entry inv : ImprovedOfflinePlayer.offlineInventories.entrySet()) { // TODO: Less weird lookup? if (inv.getValue().equals(inventory)) { - idHolder = new dPlayer(inv.getKey()).identify(); + idHolder = new PlayerTag(inv.getKey()).identify(); return; } } @@ -642,7 +642,7 @@ else if (getIdType().equals("enderchest")) { // Iterate through offline player enderchests for (Map.Entry inv : ImprovedOfflinePlayer.offlineEnderChests.entrySet()) { // TODO: Less weird lookup? if (inv.getValue().equals(inventory)) { - idHolder = new dPlayer(inv.getKey()).identify(); + idHolder = new PlayerTag(inv.getKey()).identify(); return; } } @@ -657,7 +657,7 @@ else if (getIdType().equals("script")) { idHolder = getInventory().getType().name(); } - public dInventory setIdentifiers(String type, String holder) { + public InventoryTag setIdentifiers(String type, String holder) { idType = type; idHolder = holder; return this; @@ -679,31 +679,31 @@ public String getIdHolder() { } /** - * Return the dLocation of this inventory's + * Return the LocationTag of this inventory's * holder * - * @return The holder's dLocation + * @return The holder's LocationTag */ - public dLocation getLocation() { + public LocationTag getLocation() { return getLocation(inventory.getHolder()); } - public dLocation getLocation(InventoryHolder holder) { + public LocationTag getLocation(InventoryHolder holder) { if (inventory != null && holder != null) { if (holder instanceof BlockState) { - return new dLocation(((BlockState) holder).getLocation()); + return new LocationTag(((BlockState) holder).getLocation()); } else if (holder instanceof DoubleChest) { - return new dLocation(((DoubleChest) holder).getLocation()); + return new LocationTag(((DoubleChest) holder).getLocation()); } else if (holder instanceof Entity) { - return new dLocation(((Entity) holder).getLocation()); + return new LocationTag(((Entity) holder).getLocation()); } - else if (holder instanceof dNPC) { - dNPC npc = (dNPC) holder; + else if (holder instanceof NPCTag) { + NPCTag npc = (NPCTag) holder; if (npc.getLocation() == null) { - return new dLocation(((dNPC) holder).getCitizen().getStoredLocation()); + return new LocationTag(((NPCTag) holder).getCitizen().getStoredLocation()); } return npc.getLocation(); } @@ -743,7 +743,7 @@ else if (inventory instanceof HorseInventory) { } ListTag equipmentList = new ListTag(); for (ItemStack item : equipment) { - equipmentList.add(new dItem(item).identify()); + equipmentList.add(new ItemTag(item).identify()); } return equipmentList; } @@ -779,7 +779,7 @@ public void setContents(ListTag list, TagContext context) { } ItemStack[] contents = new ItemStack[size]; int filled = 0; - for (dItem item : list.filter(dItem.class, context)) { + for (ItemTag item : list.filter(ItemTag.class, context)) { contents[filled] = item.getItemStack(); filled++; } @@ -789,14 +789,14 @@ public void setContents(ListTag list, TagContext context) { filled++; } inventory.setContents(contents); - if (Depends.citizens != null && dNPC.matches(idHolder)) { // TODO: Directly store holder - dNPC.valueOf(idHolder).getInventoryTrait().setContents(contents); + if (Depends.citizens != null && NPCTag.matches(idHolder)) { // TODO: Directly store holder + NPCTag.valueOf(idHolder).getInventoryTrait().setContents(contents); } } public boolean update() { if (getIdType().equals("player")) { - dPlayer.valueOf(idHolder).getPlayerEntity().updateInventory(); + PlayerTag.valueOf(idHolder).getPlayerEntity().updateInventory(); return true; } return false; @@ -831,7 +831,7 @@ public int firstEmpty(int startSlot) { ///////////////// // Somewhat simplified version of CraftBukkit's current code - public dInventory add(int slot, ItemStack... items) { + public InventoryTag add(int slot, ItemStack... items) { if (inventory == null || items == null) { return this; } @@ -1008,7 +1008,7 @@ public int countByScriptName(String scriptName) { int qty = 0; for (ItemStack invStack : inventory) { if (invStack != null) { - dItem item = new dItem(invStack); + ItemTag item = new ItemTag(invStack); if (item.isItemscript() && item.getScriptName().equalsIgnoreCase(scriptName)) { qty += invStack.getAmount(); } @@ -1053,10 +1053,10 @@ public int count(ItemStack item, boolean stacks) { * in this inventory, removing all others * * @param items The array of items - * @return The resulting dInventory + * @return The resulting InventoryTag */ - public dInventory keep(ItemStack[] items) { + public InventoryTag keep(ItemStack[] items) { if (inventory == null || items == null) { return this; @@ -1098,10 +1098,10 @@ public dInventory keep(ItemStack[] items) { * until they are completely gone * * @param items The array of items - * @return The resulting dInventory + * @return The resulting InventoryTag */ - public dInventory exclude(ItemStack[] items) { + public InventoryTag exclude(ItemStack[] items) { if (inventory == null || items == null) { return this; @@ -1125,10 +1125,10 @@ public dInventory exclude(ItemStack[] items) { * over until there is no more room * * @param items The array of items - * @return The resulting dInventory + * @return The resulting InventoryTag */ - public dInventory fill(ItemStack[] items) { + public InventoryTag fill(ItemStack[] items) { if (inventory == null || items == null) { return this; @@ -1151,10 +1151,10 @@ public dInventory fill(ItemStack[] items) { * and return the result * * @param items The array of items - * @return The resulting dInventory + * @return The resulting InventoryTag */ - public dInventory remove(ItemStack[] items) { + public InventoryTag remove(ItemStack[] items) { if (inventory == null || items == null) { return this; @@ -1179,10 +1179,10 @@ public dInventory remove(ItemStack[] items) { * @param title The title of the book * @param author The author of the book * @param quantity The number of books to remove - * @return The resulting dInventory + * @return The resulting InventoryTag */ - public dInventory removeBook(String title, String author, int quantity) { + public InventoryTag removeBook(String title, String author, int quantity) { if (inventory == null || (title == null && author == null)) { return this; @@ -1237,7 +1237,7 @@ private static boolean equalOrNull(String a, String b) { * @param destination The destination inventory */ - public void replace(dInventory destination) { + public void replace(InventoryTag destination) { if (inventory == null || destination == null) { return; @@ -1257,7 +1257,7 @@ public void replace(dInventory destination) { } } - public dInventory setSlots(int slot, ItemStack... items) { + public InventoryTag setSlots(int slot, ItemStack... items) { return setSlots(slot, items, items.length); } @@ -1266,9 +1266,9 @@ public dInventory setSlots(int slot, ItemStack... items) { * * @param slot The slot to start from * @param items The items to add - * @return The resulting dInventory + * @return The resulting InventoryTag */ - public dInventory setSlots(int slot, ItemStack[] items, int c) { + public InventoryTag setSlots(int slot, ItemStack[] items, int c) { if (inventory == null || items == null) { return this; @@ -1284,8 +1284,8 @@ public dInventory setSlots(int slot, ItemStack[] items, int c) { } inventory.setItem(slot + i, item); } - if (Depends.citizens != null && dNPC.matches(idHolder)) { // TODO: Directly store holder - dNPC.valueOf(idHolder).getInventoryTrait().setContents(inventory.getContents()); + if (Depends.citizens != null && NPCTag.matches(idHolder)) { // TODO: Directly store holder + NPCTag.valueOf(idHolder).getInventoryTrait().setContents(inventory.getContents()); } return this; @@ -1316,7 +1316,7 @@ public String getPrefix() { @Override - public dInventory setPrefix(String prefix) { + public InventoryTag setPrefix(String prefix) { this.prefix = prefix; return this; } @@ -1373,15 +1373,15 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the number of empty slots in an inventory. // --> if (attribute.startsWith("empty_slots")) { - dInventory dummyInv; + InventoryTag dummyInv; if (inventory.getType() == InventoryType.PLAYER) { - dummyInv = new dInventory(Bukkit.createInventory(null, InventoryType.CHEST)); + dummyInv = new InventoryTag(Bukkit.createInventory(null, InventoryType.CHEST)); ItemStack[] contents = getStorageContents(); dummyInv.setSize(contents.length); if (contents.length != dummyInv.getSize()) { @@ -1390,27 +1390,27 @@ public String getAttribute(Attribute attribute) { dummyInv.setContents(contents); } else { - dummyInv = new dInventory(inventory); + dummyInv = new InventoryTag(inventory); } int full = dummyInv.count(null, true); return new ElementTag(dummyInv.getSize() - full).getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute |...]> + // @attribute |...]> // @returns ElementTag(Boolean) // @description // Returns whether the inventory can fit an item. // --> if (attribute.startsWith("can_fit") && attribute.hasContext(1)) { - List items = ListTag.valueOf(attribute.getContext(1)).filter(dItem.class, attribute.getScriptEntry()); + List items = ListTag.valueOf(attribute.getContext(1)).filter(ItemTag.class, attribute.getScriptEntry()); if (items == null || items.isEmpty()) { return null; } int attribs = 1; InventoryType type = inventory.getType(); - dInventory dummyInv = new dInventory(Bukkit.createInventory(null, type == InventoryType.PLAYER ? InventoryType.CHEST : type, NMSHandler.getInstance().getTitle(inventory))); + InventoryTag dummyInv = new InventoryTag(Bukkit.createInventory(null, type == InventoryType.PLAYER ? InventoryType.CHEST : type, NMSHandler.getInstance().getTitle(inventory))); ItemStack[] contents = getStorageContents(); if (dummyInv.getInventoryType() == InventoryType.CHEST) { dummyInv.setSize(contents.length); @@ -1421,7 +1421,7 @@ public String getAttribute(Attribute attribute) { dummyInv.setContents(contents); // <--[tag] - // @attribute ].count> + // @attribute ].count> // @returns ElementTag(Number) // @description // Returns the total count of how many times an item can fit into an inventory. @@ -1440,7 +1440,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ].quantity[<#>]> + // @attribute ].quantity[<#>]> // @returns ElementTag(Boolean) // @description // Returns whether the inventory can fit a certain quantity of an item. @@ -1454,7 +1454,7 @@ public String getAttribute(Attribute attribute) { } // NOTE: Could just also convert items to an array and pass it all in at once... - for (dItem itm : items) { + for (ItemTag itm : items) { List leftovers = dummyInv.addWithLeftovers(0, true, itm.getItemStack()); if (!leftovers.isEmpty()) { return new ElementTag(false).getAttribute(attribute.fulfill(attribs)); @@ -1464,31 +1464,31 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ]> - // @returns dInventory + // @attribute ]> + // @returns InventoryTag // @description - // Returns the dInventory with an item added. + // Returns the InventoryTag with an item added. // --> if (attribute.startsWith("include") && attribute.hasContext(1) - && dItem.matches(attribute.getContext(1))) { - dItem item = dItem.valueOf(attribute.getContext(1), attribute.context); + && ItemTag.matches(attribute.getContext(1))) { + ItemTag item = ItemTag.valueOf(attribute.getContext(1), attribute.context); if (item == null) { return null; } int attribs = 1; int qty = 1; - dInventory dummyInv = new dInventory(Bukkit.createInventory(null, inventory.getType(), NMSHandler.getInstance().getTitle(inventory))); + InventoryTag dummyInv = new InventoryTag(Bukkit.createInventory(null, inventory.getType(), NMSHandler.getInstance().getTitle(inventory))); if (inventory.getType() == InventoryType.CHEST) { dummyInv.setSize(inventory.getSize()); } dummyInv.setContents(getContents()); // <--[tag] - // @attribute ].quantity[<#>]> - // @returns dInventory + // @attribute ].quantity[<#>]> + // @returns InventoryTag // @description - // Returns the dInventory with a certain quantity of an item added. + // Returns the InventoryTag with a certain quantity of an item added. // --> if ((attribute.getAttribute(2).startsWith("quantity") || attribute.getAttribute(2).startsWith("qty")) && attribute.hasContext(2) && ArgumentHelper.matchesInteger(attribute.getContext(2))) { @@ -1501,7 +1501,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the inventory is empty. @@ -1518,7 +1518,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the inventory is completely full. @@ -1538,7 +1538,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Boolean) // @description // Returns whether the inventory contains an item with the specified display @@ -1560,7 +1560,7 @@ public String getAttribute(Attribute attribute) { int attribs = 2; // <--[tag] - // @attribute ].quantity[<#>]> + // @attribute ].quantity[<#>]> // @returns ElementTag(Boolean) // @description // Returns whether the inventory contains a certain quantity of an item with the @@ -1620,7 +1620,7 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName } // <--[tag] - // @attribute |...]> + // @attribute |...]> // @returns ElementTag(Boolean) // @description // Returns whether the inventory contains an item with the specified lore. @@ -1643,7 +1643,7 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName int attribs = 2; // <--[tag] - // @attribute |...].quantity[<#>]> + // @attribute |...].quantity[<#>]> // @returns ElementTag(Boolean) // @description // Returns whether the inventory contains a certain quantity of an item @@ -1712,7 +1712,7 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Boolean) // @description // Returns whether the inventory contains an item with the specified scriptname. @@ -1723,7 +1723,7 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName int attribs = 2; // <--[tag] - // @attribute ].quantity[<#>]> + // @attribute ].quantity[<#>]> // @returns ElementTag(Boolean) // @description // Returns whether the inventory contains a certain quantity of an item with the specified scriptname. @@ -1738,7 +1738,7 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName int found_items = 0; for (ItemStack item : getContents()) { - if (item != null && scrName.equalsIgnoreCase(new dItem(item).getScriptName())) { + if (item != null && scrName.equalsIgnoreCase(new ItemTag(item).getScriptName())) { found_items += item.getAmount(); if (found_items >= qty) { break; @@ -1750,7 +1750,7 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Boolean) // @description // Returns whether the inventory contains an item with the specified key. @@ -1761,7 +1761,7 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName int attribs = 2; // <--[tag] - // @attribute ].quantity[<#>]> + // @attribute ].quantity[<#>]> // @returns ElementTag(Boolean) // @description // Returns whether the inventory contains a certain quantity of an item with the specified key. @@ -1788,19 +1788,19 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Boolean) // @description // Returns whether the inventory contains an item with the specified material. // --> if (attribute.startsWith("contains.material") && attribute.hasContext(2) && - dMaterial.matches(attribute.getContext(2))) { - dMaterial material = dMaterial.valueOf(attribute.getContext(2)); + MaterialTag.matches(attribute.getContext(2))) { + MaterialTag material = MaterialTag.valueOf(attribute.getContext(2)); int qty = 1; int attribs = 2; // <--[tag] - // @attribute ].quantity[<#>]> + // @attribute ].quantity[<#>]> // @returns ElementTag(Boolean) // @description // Returns whether the inventory contains a certain quantity of an item with the @@ -1828,7 +1828,7 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName } // <--[tag] - // @attribute |...]> + // @attribute |...]> // @returns ElementTag(Boolean) // @description // Returns whether the inventory contains any of the specified items. @@ -1842,7 +1842,7 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName int attribs = 1; // <--[tag] - // @attribute |...].quantity[<#>]> + // @attribute |...].quantity[<#>]> // @returns ElementTag(Boolean) // @description // Returns whether the inventory contains a certain quantity of any of the specified items. @@ -1852,9 +1852,9 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName qty = attribute.getIntContext(2); attribs = 2; } - List contains = list.filter(dItem.class, attribute.getScriptEntry()); + List contains = list.filter(ItemTag.class, attribute.getScriptEntry()); if (!contains.isEmpty()) { - for (dItem item : contains) { + for (ItemTag item : contains) { if (containsItem(item, qty)) { return new ElementTag(true).getAttribute(attribute.fulfill(attribs)); } @@ -1864,7 +1864,7 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName } // <--[tag] - // @attribute |...]> + // @attribute |...]> // @returns ElementTag(Boolean) // @description // Returns whether the inventory contains all of the specified items. @@ -1878,7 +1878,7 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName int attribs = 1; // <--[tag] - // @attribute |...].quantity[<#>]> + // @attribute |...].quantity[<#>]> // @returns ElementTag(Boolean) // @description // Returns whether the inventory contains a certain quantity of all of the specified items. @@ -1888,9 +1888,9 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName qty = attribute.getIntContext(2); attribs = 2; } - List contains = list.filter(dItem.class, attribute.getScriptEntry()); + List contains = list.filter(ItemTag.class, attribute.getScriptEntry()); if (contains.size() == list.size()) { - for (dItem item : contains) { + for (ItemTag item : contains) { if (!containsItem(item, qty)) { return new ElementTag(false).getAttribute(attribute.fulfill(attribs)); } @@ -1901,7 +1901,7 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the location of the first empty slot. @@ -1913,7 +1913,7 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Number) // @description // Returns the location of the first slot that contains the material. @@ -1921,8 +1921,8 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName // --> if (attribute.startsWith("find.material") && attribute.hasContext(2) - && dMaterial.matches(attribute.getContext(2))) { - dMaterial material = dMaterial.valueOf(attribute.getContext(2)); + && MaterialTag.matches(attribute.getContext(2))) { + MaterialTag material = MaterialTag.valueOf(attribute.getContext(2)); if (material == null) { return null; } @@ -1937,7 +1937,7 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Number) // @description // Returns the location of the first slot that contains the item @@ -1946,15 +1946,15 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName // --> if (attribute.startsWith("find.scriptname") && attribute.hasContext(2) - && dItem.matches(attribute.getContext(2))) { - String scrname = dItem.valueOf(attribute.getContext(2), attribute.context).getScriptName(); + && ItemTag.matches(attribute.getContext(2))) { + String scrname = ItemTag.valueOf(attribute.getContext(2), attribute.context).getScriptName(); if (scrname == null) { return null; } int slot = -1; for (int i = 0; i < inventory.getSize(); i++) { if (inventory.getItem(i) != null - && scrname.equalsIgnoreCase(new dItem(inventory.getItem(i)).getScriptName())) { + && scrname.equalsIgnoreCase(new ItemTag(inventory.getItem(i)).getScriptName())) { slot = i + 1; break; } @@ -1963,7 +1963,7 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Number) // @description // Returns the location of the first slot that contains the item. @@ -1972,13 +1972,13 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName // --> if (attribute.startsWith("find_imperfect") && attribute.hasContext(1) - && dItem.matches(attribute.getContext(1))) { - dItem item = dItem.valueOf(attribute.getContext(1), attribute.context); + && ItemTag.matches(attribute.getContext(1))) { + ItemTag item = ItemTag.valueOf(attribute.getContext(1), attribute.context); item.setAmount(1); int slot = -1; for (int i = 0; i < inventory.getSize(); i++) { if (inventory.getItem(i) != null) { - dItem compare_to = new dItem(inventory.getItem(i).clone()); + ItemTag compare_to = new ItemTag(inventory.getItem(i).clone()); compare_to.setAmount(1); if (item.identify().equalsIgnoreCase(compare_to.identify()) || item.getScriptName().equalsIgnoreCase(compare_to.getScriptName())) { @@ -1991,7 +1991,7 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Number) // @description // Returns the location of the first slot that contains the item. @@ -1999,13 +1999,13 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName // --> if (attribute.startsWith("find") && attribute.hasContext(1) - && dItem.matches(attribute.getContext(1))) { - dItem item = dItem.valueOf(attribute.getContext(1), attribute.context); + && ItemTag.matches(attribute.getContext(1))) { + ItemTag item = ItemTag.valueOf(attribute.getContext(1), attribute.context); item.setAmount(1); int slot = -1; for (int i = 0; i < inventory.getSize(); i++) { if (inventory.getItem(i) != null) { - dItem compare_to = new dItem(inventory.getItem(i).clone()); + ItemTag compare_to = new ItemTag(inventory.getItem(i).clone()); compare_to.setAmount(1); if (item.getFullString().equalsIgnoreCase(compare_to.getFullString())) { slot = i + 1; @@ -2017,7 +2017,7 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns Denizen's type ID for this inventory. (player, location, etc.) @@ -2027,10 +2027,10 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description - // Gets the name of a Notable dInventory. If the inventory isn't noted, + // Gets the name of a Notable InventoryTag. If the inventory isn't noted, // this is null. // --> if (attribute.startsWith("notable_name")) { @@ -2042,13 +2042,13 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName } // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @description // Returns the location of this inventory's holder. // --> if (attribute.startsWith("location")) { - dLocation location = getLocation(); + LocationTag location = getLocation(); if (location == null) { return null; } @@ -2056,7 +2056,7 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Number) // @description // Returns the combined quantity of itemstacks that have the specified script name. @@ -2067,19 +2067,19 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Number) // @description // Returns the combined quantity of itemstacks that have the specified material. // --> if (attribute.startsWith("quantity.material") - && attribute.hasContext(2) && dMaterial.matches(attribute.getContext(2))) { - return new ElementTag(countByMaterial(dMaterial.valueOf(attribute.getContext(2)).getMaterial())) + && attribute.hasContext(2) && MaterialTag.matches(attribute.getContext(2))) { + return new ElementTag(countByMaterial(MaterialTag.valueOf(attribute.getContext(2)).getMaterial())) .getAttribute(attribute.fulfill(2)); } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Number) // @description // Returns the combined quantity of itemstacks that match an item if @@ -2087,9 +2087,9 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName // if one is not. // --> if (attribute.startsWith("quantity") || attribute.startsWith("qty")) { - if (attribute.hasContext(1) && dItem.matches(attribute.getContext(1))) { + if (attribute.hasContext(1) && ItemTag.matches(attribute.getContext(1))) { return new ElementTag(count // TODO: Handle no-script-entry cases - (dItem.valueOf(attribute.getContext(1), attribute.context).getItemStack(), false)) + (ItemTag.valueOf(attribute.getContext(1), attribute.context).getItemStack(), false)) .getAttribute(attribute.fulfill(1)); } else { @@ -2099,16 +2099,16 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Number) // @description // Returns the number of itemstacks that match an item if one is // specified, or the number of all itemstacks if one is not. // --> if (attribute.startsWith("stacks")) { - if (attribute.hasContext(1) && dItem.matches(attribute.getContext(1))) { + if (attribute.hasContext(1) && ItemTag.matches(attribute.getContext(1))) { return new ElementTag(count // TODO: Handle no-script-entry cases - (dItem.valueOf(attribute.getContext(1), attribute.context).getItemStack(), true)) + (ItemTag.valueOf(attribute.getContext(1), attribute.context).getItemStack(), true)) .getAttribute(attribute.fulfill(1)); } else { @@ -2118,8 +2118,8 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName } // <--[tag] - // @attribute ]> - // @returns dItem + // @attribute ]> + // @returns ItemTag // @description // Returns the item in the specified slot. // --> @@ -2133,12 +2133,12 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName else if (slot > getInventory().getSize() - 1) { slot = getInventory().getSize() - 1; } - return new dItem(getInventory().getItem(slot)) + return new ItemTag(getInventory().getItem(slot)) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the type of the inventory (e.g. "PLAYER", "CRAFTING", "HORSE"). @@ -2149,8 +2149,8 @@ else if (slot > getInventory().getSize() - 1) { } // <--[tag] - // @attribute - // @returns ListTag(dItem) + // @attribute + // @returns ListTag(ItemTag) // @description // Returns the equipment of an inventory. // --> @@ -2166,44 +2166,44 @@ else if (slot > getInventory().getSize() - 1) { CraftingInventory craftingInventory = (CraftingInventory) inventory; // <--[tag] - // @attribute - // @returns ListTag(dItem) + // @attribute + // @returns ListTag(ItemTag) // @description - // Returns the dItems currently in a crafting inventory's matrix. + // Returns the ItemTags currently in a crafting inventory's matrix. // --> if (attribute.startsWith("matrix")) { ListTag recipeList = new ListTag(); for (ItemStack item : craftingInventory.getMatrix()) { if (item != null) { - recipeList.add(new dItem(item).identify()); + recipeList.add(new ItemTag(item).identify()); } else { - recipeList.add(new dItem(Material.AIR).identify()); + recipeList.add(new ItemTag(Material.AIR).identify()); } } return recipeList.getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute - // @returns dItem + // @attribute + // @returns ItemTag // @description - // Returns the dItem currently in the result section of a crafting inventory. + // Returns the ItemTag currently in the result section of a crafting inventory. // --> if (attribute.startsWith("result")) { ItemStack result = craftingInventory.getResult(); if (result == null) { return null; } - return new dItem(result).getAttribute(attribute.fulfill(1)); + return new ItemTag(result).getAttribute(attribute.fulfill(1)); } } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description - // Always returns 'Inventory' for dInventory objects. All objects fetchable by the Object Fetcher will return the + // Always returns 'Inventory' for InventoryTag objects. All objects fetchable by the Object Fetcher will return the // type of object that is fulfilling this attribute. // --> if (attribute.startsWith("type")) { @@ -2242,18 +2242,18 @@ public void adjust(Mechanism mechanism) { CoreUtilities.autoPropertyMechanism(this, mechanism); // <--[mechanism] - // @object dInventory + // @object InventoryTag // @name matrix - // @input ListTag(dItem) + // @input ListTag(ItemTag) // @description // Sets the items in the matrix slots of this crafting inventory. // @tags - // + // // --> if (mechanism.matches("matrix") && mechanism.requireObject(ListTag.class)) { if (inventory instanceof CraftingInventory) { CraftingInventory craftingInventory = (CraftingInventory) inventory; - List items = mechanism.valueAsType(ListTag.class).filter(dItem.class, mechanism.context); + List items = mechanism.valueAsType(ListTag.class).filter(ItemTag.class, mechanism.context); ItemStack[] itemStacks = new ItemStack[9]; for (int i = 0; i < 9 && i < items.size(); i++) { itemStacks[i] = items.get(i).getItemStack(); @@ -2267,18 +2267,18 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dInventory + // @object InventoryTag // @name result - // @input dItem + // @input ItemTag // @description // Sets the item in the result slot of this crafting inventory. // @tags - // + // // --> - if (mechanism.matches("result") && mechanism.requireObject(dItem.class)) { + if (mechanism.matches("result") && mechanism.requireObject(ItemTag.class)) { if (inventory instanceof CraftingInventory) { CraftingInventory craftingInventory = (CraftingInventory) inventory; - craftingInventory.setResult(mechanism.valueAsType(dItem.class).getItemStack()); + craftingInventory.setResult(mechanism.valueAsType(ItemTag.class).getItemStack()); ((Player) inventory.getHolder()).updateInventory(); } else { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/dItem.java b/plugin/src/main/java/com/denizenscript/denizen/objects/ItemTag.java similarity index 86% rename from plugin/src/main/java/com/denizenscript/denizen/objects/dItem.java rename to plugin/src/main/java/com/denizenscript/denizen/objects/ItemTag.java index 4b6d562e8c..cb5cbb7445 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/dItem.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/ItemTag.java @@ -41,17 +41,17 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -public class dItem implements ObjectTag, Notable, Adjustable { +public class ItemTag implements ObjectTag, Notable, Adjustable { // <--[language] - // @name dItem + // @name ItemTag // @group Object System // @description - // A dItem represents a holdable item generically. + // A ItemTag represents a holdable item generically. // - // dItems are temporary objects, to actually modify an item in an inventory you must add the item into that inventory. + // ItemTags are temporary objects, to actually modify an item in an inventory you must add the item into that inventory. // - // dItems do NOT remember where they came from. If you read an item from an inventory, changing it + // ItemTags do NOT remember where they came from. If you read an item from an inventory, changing it // does not change the original item in the original inventory. You must set it back in. // // For format info, see <@link language i@> @@ -62,15 +62,15 @@ public class dItem implements ObjectTag, Notable, Adjustable { // @name i@ // @group Object Fetcher System // @description - // i@ refers to the 'object identifier' of a dItem. The 'i@' is notation for Denizen's Object - // Fetcher. The constructor for a dItem is the basic material type name, or an item script name. Other data is specified in properties. + // i@ refers to the 'object identifier' of a ItemTag. The 'i@' is notation for Denizen's Object + // Fetcher. The constructor for a ItemTag is the basic material type name, or an item script name. Other data is specified in properties. // For example, 'i@stick'. // // Find a list of valid materials at: // <@link url https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html> // Note that some materials on that list are exclusively for use with blocks, and cannot be held as items. // - // For general info, see <@link language dItem> + // For general info, see <@link language ItemTag> // // --> @@ -87,33 +87,33 @@ public class dItem implements ObjectTag, Notable, Adjustable { //////////////// - public static dItem valueOf(String string) { + public static ItemTag valueOf(String string) { return valueOf(string, null, null); } @Fetchable("i") - public static dItem valueOf(String string, TagContext context) { + public static ItemTag valueOf(String string, TagContext context) { if (context == null) { return valueOf(string, null, null); } else { nope = !context.debug; - dItem tmp = valueOf(string, ((BukkitTagContext) context).player, ((BukkitTagContext) context).npc); + ItemTag tmp = valueOf(string, ((BukkitTagContext) context).player, ((BukkitTagContext) context).npc); nope = false; return tmp; } } - public static dItem valueOf(String string, Debuggable debugMe) { + public static ItemTag valueOf(String string, Debuggable debugMe) { nope = debugMe != null && !debugMe.shouldDebug(); - dItem tmp = valueOf(string, null, null); + ItemTag tmp = valueOf(string, null, null); nope = false; return tmp; } - public static dItem valueOf(String string, boolean debugMe) { + public static ItemTag valueOf(String string, boolean debugMe) { nope = !debugMe; - dItem tmp = valueOf(string, null, null); + ItemTag tmp = valueOf(string, null, null); nope = false; return tmp; } @@ -122,34 +122,34 @@ public static dItem valueOf(String string, boolean debugMe) { * Gets a Item Object from a string form. * * @param string The string or dScript argument String - * @param player The dPlayer to be used for player contexts + * @param player The PlayerTag to be used for player contexts * where applicable. - * @param npc The dNPC to be used for NPC contexts + * @param npc The NPCTag to be used for NPC contexts * where applicable. * @return an Item, or null if incorrectly formatted */ - public static dItem valueOf(String string, dPlayer player, dNPC npc) { + public static ItemTag valueOf(String string, PlayerTag player, NPCTag npc) { if (string == null || string.equals("")) { return null; } Matcher m; - dItem stack = null; + ItemTag stack = null; /////// // Handle objects with properties through the object fetcher m = ObjectFetcher.DESCRIBED_PATTERN.matcher(string); if (m.matches()) { - return ObjectFetcher.getObjectFrom(dItem.class, string, new BukkitTagContext(player, npc, false, null, !nope, null)); + return ObjectFetcher.getObjectFrom(ItemTag.class, string, new BukkitTagContext(player, npc, false, null, !nope, null)); } //////// - // Match @object format for saved dItems + // Match @object format for saved ItemTags m = item_by_saved.matcher(string); - if (m.matches() && NotableManager.isSaved(m.group(2)) && NotableManager.isType(m.group(2), dItem.class)) { - stack = (dItem) NotableManager.getSavedObject(m.group(2)); + if (m.matches() && NotableManager.isSaved(m.group(2)) && NotableManager.isType(m.group(2), ItemTag.class)) { + stack = (ItemTag) NotableManager.getSavedObject(m.group(2)); if (m.group(3) != null) { stack.setAmount(Integer.valueOf(m.group(3))); @@ -203,11 +203,11 @@ else if (ScriptRegistry.containsScript(m.group(1), BookScriptContainer.class)) { if (!nope) { Debug.echoError("Material ID and data magic number support is deprecated and WILL be removed in a future release. For item input of '" + string + "'."); } - stack = new dItem(Integer.valueOf(material)); + stack = new ItemTag(Integer.valueOf(material)); } else { - dMaterial mat = dMaterial.valueOf(material); - stack = new dItem(mat.getMaterial()); + MaterialTag mat = MaterialTag.valueOf(material); + stack = new ItemTag(mat.getMaterial()); if (mat.hasData() && NMSHandler.getVersion().isAtMost(NMSVersion.v1_12_R1)) { stack.setDurability(mat.getData()); } @@ -230,7 +230,7 @@ else if (ScriptRegistry.containsScript(m.group(1), BookScriptContainer.class)) { } if (!nope) { - Debug.log("valueOf dItem returning null: " + string); + Debug.log("valueOf ItemTag returning null: " + string); } // No match! Return null. @@ -277,12 +277,12 @@ else if (ScriptRegistry.containsScript(arg, BookScriptContainer.class)) { // Constructors ///////////// - public dItem(Material material) { + public ItemTag(Material material) { this(new ItemStack(material)); } @Deprecated - public dItem(int itemId) { + public ItemTag(int itemId) { this(MaterialCompat.updateItem(itemId)); } @@ -292,15 +292,15 @@ private static ItemStack fixQty(ItemStack item, int qty) { } @Deprecated - public dItem(int itemId, int qty) { + public ItemTag(int itemId, int qty) { this(fixQty(MaterialCompat.updateItem(itemId), qty)); } - public dItem(Material material, int qty) { + public ItemTag(Material material, int qty) { this(new ItemStack(material, qty)); } - public dItem(dMaterial material, int qty) { + public ItemTag(MaterialTag material, int qty) { if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13_R2)) { this.item = new ItemStack(material.getMaterial(), qty); } @@ -309,7 +309,7 @@ public dItem(dMaterial material, int qty) { } } - public dItem(MaterialData data) { + public ItemTag(MaterialData data) { if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13_R2) && item.getType().isLegacy()) { this.item = new ItemStack(Bukkit.getUnsafe().fromLegacy(data)); } @@ -318,7 +318,7 @@ public dItem(MaterialData data) { } } - public dItem(ItemStack item) { + public ItemTag(ItemStack item) { if (item == null || item.getType() == Material.AIR) { this.item = new ItemStack(Material.AIR, 0); } @@ -327,7 +327,7 @@ public dItem(ItemStack item) { } } - public dItem(Item item) { + public ItemTag(Item item) { this(item.getItemStack()); } @@ -354,7 +354,7 @@ public void setItemStack(ItemStack item) { // was probably originally alike, but may have been // modified or enhanced. - public int comparesTo(dItem item) { + public int comparesTo(ItemTag item) { return comparesTo(item.getItemStack()); } @@ -533,9 +533,9 @@ public void setItemScript(ItemScriptContainer script) { } } - public dMaterial getMaterial() { + public MaterialTag getMaterial() { if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13_R2)) { - return new dMaterial(getItemStack().getType()); + return new MaterialTag(getItemStack().getType()); } return OldMaterialsHelper.getMaterialFrom(getItemStack().getType(), getItemStack().getData().getData()); } @@ -592,7 +592,7 @@ public String getPrefix() { } @Override - public dItem setPrefix(String prefix) { + public ItemTag setPrefix(String prefix) { this.prefix = prefix; return this; } @@ -694,7 +694,7 @@ public static void registerTags() { @Override public String run(Attribute attribute, ObjectTag object) { Debug.echoError("Material ID and data magic number support is deprecated and WILL be removed in a future release."); - return new ElementTag(((dItem) object).getItemStack().getType().getId()) + return new ElementTag(((ItemTag) object).getItemStack().getType().getId()) .getAttribute(attribute.fulfill(1)); } }); @@ -703,14 +703,14 @@ public String run(Attribute attribute, ObjectTag object) { @Override public String run(Attribute attribute, ObjectTag object) { Debug.echoError("Material ID and data magic number support is deprecated and WILL be removed in a future release."); - return new ElementTag(((dItem) object).getItemStack().getData().getData()) + return new ElementTag(((ItemTag) object).getItemStack().getData().getData()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute =;...]> - // @returns dItem + // @attribute =;...]> + // @returns ItemTag // @group properties // @description // Returns a copy of the item with mechanism adjustments applied. @@ -719,9 +719,9 @@ public String run(Attribute attribute, ObjectTag object) { @Override public String run(Attribute attribute, ObjectTag object) { if (!attribute.hasContext(1)) { - Debug.echoError("i@item.with[...] tag must have an input mechanism list."); + Debug.echoError("ItemTag.with[...] tag must have an input mechanism list."); } - dItem item = new dItem(((dItem) object).getItemStack().clone()); + ItemTag item = new ItemTag(((ItemTag) object).getItemStack().clone()); List properties = ObjectFetcher.separateProperties("[" + attribute.getContext(1) + "]"); for (int i = 1; i < properties.size(); i++) { List data = CoreUtilities.split(properties.get(i), '=', 2); @@ -737,14 +737,14 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group properties // @description // Returns whether the item can be repaired. // If this returns true, it will enable access to: - // <@link mechanism dItem.durability>, <@link tag i@item.max_durability>, - // and <@link tag i@item.durability> + // <@link mechanism ItemTag.durability>, <@link tag ItemTag.max_durability>, + // and <@link tag ItemTag.durability> // --> registerTag("repairable", new TagRunnable() { @Override @@ -755,13 +755,13 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group properties // @description // Returns whether the item is a growable crop. // If this returns true, it will enable access to: - // <@link mechanism dItem.plant_growth> and <@link tag i@item.plant_growth> + // <@link mechanism ItemTag.plant_growth> and <@link tag ItemTag.plant_growth> // --> registerTag("is_crop", new TagRunnable() { @Override @@ -772,16 +772,16 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group properties // @description // Returns whether the item is considered an editable book. // If this returns true, it will enable access to: - // <@link mechanism dItem.book>, <@link tag i@item.book>, - // <@link tag i@item.book.author>, <@link tag i@item.book.title>, - // <@link tag i@item.book.page_count>, <@link tag i@item.book.page[<#>]>, - // and <@link tag i@item.book.pages> + // <@link mechanism ItemTag.book>, <@link tag ItemTag.book>, + // <@link tag ItemTag.book.author>, <@link tag ItemTag.book.title>, + // <@link tag ItemTag.book.page_count>, <@link tag ItemTag.book.page[<#>]>, + // and <@link tag ItemTag.book.pages> // --> registerTag("is_book", new TagRunnable() { @Override @@ -792,12 +792,12 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group properties // Returns whether the item can have a custom color. // If this returns true, it will enable access to: - // <@link mechanism dItem.color>, and <@link tag i@item.color> + // <@link mechanism ItemTag.color>, and <@link tag ItemTag.color> // --> registerTag("is_colorable", new TagRunnable() { @Override @@ -816,12 +816,12 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group properties // Returns whether the item is a firework. // If this returns true, it will enable access to: - // <@link mechanism dItem.firework>, and <@link tag i@item.firework> + // <@link mechanism ItemTag.firework>, and <@link tag ItemTag.firework> // --> registerTag("is_firework", new TagRunnable() { @Override @@ -832,12 +832,12 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group properties // Returns whether the item has an inventory. // If this returns true, it will enable access to: - // <@link mechanism dItem.inventory>, and <@link tag i@item.inventory> + // <@link mechanism ItemTag.inventory>, and <@link tag ItemTag.inventory> // --> registerTag("has_inventory", new TagRunnable() { @Override @@ -848,12 +848,12 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group properties // Returns whether the item is lockable. // If this returns true, it will enable access to: - // <@link mechanism dItem.lock>, and <@link tag i@item.lock> + // <@link mechanism ItemTag.lock>, and <@link tag ItemTag.lock> // --> registerTag("is_lockable", new TagRunnable() { @Override @@ -864,20 +864,20 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute - // @returns dMaterial + // @attribute + // @returns MaterialTag // @group conversion // @description - // Returns the dMaterial that is the basis of the item. + // Returns the MaterialTag that is the basis of the item. // EG, a stone with lore and a display name, etc. will return only "m@stone". // --> registerTag("material", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - dItem item = (dItem) object; + ItemTag item = (ItemTag) object; if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13_R2) && item.getItemStack().hasItemMeta() && item.getItemStack().getItemMeta() instanceof BlockStateMeta) { - return new dMaterial(new ModernBlockData(((BlockStateMeta) item.getItemStack().getItemMeta()).getBlockState())) + return new MaterialTag(new ModernBlockData(((BlockStateMeta) item.getItemStack().getItemMeta()).getBlockState())) .getAttribute(attribute.fulfill(1)); } return item.getMaterial().getAttribute(attribute.fulfill(1)); @@ -885,7 +885,7 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @group conversion // @description @@ -898,13 +898,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("json", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(NMSHandler.getInstance().getItemHelper().getJsonString(((dItem) object).item)) + return new ElementTag(NMSHandler.getInstance().getItemHelper().getJsonString(((ItemTag) object).item)) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @group conversion // @description @@ -914,13 +914,13 @@ public String run(Attribute attribute, ObjectTag object) { @Override public String run(Attribute attribute, ObjectTag object) { YamlConfiguration config = new YamlConfiguration(); - config.set("item", ((dItem) object).getItemStack()); + config.set("item", ((ItemTag) object).getItemStack()); return new ElementTag(config.saveToString()).getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @group conversion // @description @@ -930,12 +930,12 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("full", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dItem) object).getFullString()).getAttribute(attribute.fulfill(1)); + return new ElementTag(((ItemTag) object).getFullString()).getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @group conversion // @description @@ -944,21 +944,21 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("simple", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dItem) object).identifySimple()).getAttribute(attribute.fulfill(1)); + return new ElementTag(((ItemTag) object).identifySimple()).getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description - // Gets the name of a Notable dItem. If the item isn't noted, + // Gets the name of a Notable ItemTag. If the item isn't noted, // this is null. // --> registerTag("notable_name", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - String notname = NotableManager.getSavedId((dItem) object); + String notname = NotableManager.getSavedId((ItemTag) object); if (notname == null) { return null; } @@ -967,10 +967,10 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description - // Always returns 'Item' for dItem objects. All objects fetchable by the Object Fetcher will return the + // Always returns 'Item' for ItemTag objects. All objects fetchable by the Object Fetcher will return the // type of object that is fulfilling this attribute. // --> registerTag("type", new TagRunnable() { @@ -1018,7 +1018,7 @@ public String getAttribute(Attribute attribute) { // // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @group formatting // @description diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/dLocation.java b/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java similarity index 80% rename from plugin/src/main/java/com/denizenscript/denizen/objects/dLocation.java rename to plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java index 2f2acd6426..86427b00a0 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/dLocation.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java @@ -47,13 +47,13 @@ import java.util.Comparator; import java.util.regex.Pattern; -public class dLocation extends org.bukkit.Location implements ObjectTag, Notable, Adjustable { +public class LocationTag extends org.bukkit.Location implements ObjectTag, Notable, Adjustable { // <--[language] - // @name dLocation + // @name LocationTag // @group Object System // @description - // A dLocation represents a point in the world. + // A LocationTag represents a point in the world. // // For format info, see <@link language l@> // @@ -63,14 +63,14 @@ public class dLocation extends org.bukkit.Location implements ObjectTag, Notable // @name l@ // @group Object Fetcher System // @description - // l@ refers to the 'object identifier' of a dLocation. The 'l@' is notation for Denizen's Object + // l@ refers to the 'object identifier' of a LocationTag. The 'l@' is notation for Denizen's Object // Fetcher. Note that 'l' is a lowercase 'L', the first letter in 'location'. - // The full constructor for a dLocation is: 'l@,,,,,' + // The full constructor for a LocationTag is: 'l@,,,,,' // Note that you can leave off the world, and/or pitch and yaw, and/or the z value. // You cannot leave off both the z and the pitch+yaw at the same time. // For example, 'l@1,2.15,3,45,90,space' or 'l@7.5,99,3.2' // - // For general info, see <@link language dLocation> + // For general info, see <@link language LocationTag> // // --> @@ -87,8 +87,8 @@ public String getWorldName() { } @Override - public dLocation clone() { - return (dLocation) super.clone(); + public LocationTag clone() { + return (LocationTag) super.clone(); } // This pattern correctly reads both 0.9 and 0.8 notables @@ -114,8 +114,8 @@ public String getSaveObject() { + "," + getWorldName(); } - public static String getSaved(dLocation location) { - for (dLocation saved : NotableManager.getAllType(dLocation.class)) { + public static String getSaved(LocationTag location) { + for (LocationTag saved : NotableManager.getAllType(LocationTag.class)) { if (saved.getX() != location.getX()) { continue; } @@ -149,7 +149,7 @@ public void forget() { //////////////// - public static dLocation valueOf(String string) { + public static LocationTag valueOf(String string) { return valueOf(string, null); } @@ -162,7 +162,7 @@ public static dLocation valueOf(String string) { * @return a Location, or null if incorrectly formatted */ @Fetchable("l") - public static dLocation valueOf(String string, TagContext context) { + public static LocationTag valueOf(String string, TagContext context) { if (string == null) { return null; } @@ -171,8 +171,8 @@ public static dLocation valueOf(String string, TagContext context) { string = string.substring(2); } - if (NotableManager.isSaved(string) && NotableManager.isType(string, dLocation.class)) { - return (dLocation) NotableManager.getSavedObject(string); + if (NotableManager.isSaved(string) && NotableManager.isType(string, LocationTag.class)) { + return (LocationTag) NotableManager.getSavedObject(string); } //////// @@ -186,13 +186,13 @@ public static dLocation valueOf(String string, TagContext context) { // x,y { try { - return new dLocation(null, + return new LocationTag(null, Double.valueOf(split.get(0)), Double.valueOf(split.get(1))); } catch (Exception e) { if (context == null || context.debug) { - Debug.log("Minor: valueOf dLocation returning null: " + string + "(internal exception:" + e.getMessage() + ")"); + Debug.log("Minor: valueOf LocationTag returning null: " + string + "(internal exception:" + e.getMessage() + ")"); } return null; } @@ -204,17 +204,17 @@ else if (split.size() == 3) try { World world = Bukkit.getWorld(split.get(2)); if (world != null) { - return new dLocation(world, + return new LocationTag(world, Double.valueOf(split.get(0)), Double.valueOf(split.get(1))); } if (ArgumentHelper.matchesDouble(split.get(2))) { - return new dLocation(null, + return new LocationTag(null, Double.valueOf(split.get(0)), Double.valueOf(split.get(1)), Double.valueOf(split.get(2))); } - dLocation output = new dLocation(null, + LocationTag output = new LocationTag(null, Double.valueOf(split.get(0)), Double.valueOf(split.get(1))); output.backupWorld = split.get(2); @@ -222,7 +222,7 @@ else if (split.size() == 3) } catch (Exception e) { if (context == null || context.debug) { - Debug.log("Minor: valueOf dLocation returning null: " + string + "(internal exception:" + e.getMessage() + ")"); + Debug.log("Minor: valueOf LocationTag returning null: " + string + "(internal exception:" + e.getMessage() + ")"); } return null; } @@ -234,12 +234,12 @@ else if (split.size() == 4) try { World world = Bukkit.getWorld(split.get(3)); if (world != null) { - return new dLocation(world, + return new LocationTag(world, Double.valueOf(split.get(0)), Double.valueOf(split.get(1)), Double.valueOf(split.get(2))); } - dLocation output = new dLocation(null, + LocationTag output = new LocationTag(null, Double.valueOf(split.get(0)), Double.valueOf(split.get(1)), Double.valueOf(split.get(2))); @@ -248,7 +248,7 @@ else if (split.size() == 4) } catch (Exception e) { if (context == null || context.debug) { - Debug.log("Minor: valueOf dLocation returning null: " + string + "(internal exception:" + e.getMessage() + ")"); + Debug.log("Minor: valueOf LocationTag returning null: " + string + "(internal exception:" + e.getMessage() + ")"); } return null; } @@ -259,7 +259,7 @@ else if (split.size() == 5) // x,y,z,pitch,yaw { try { - dLocation output = new dLocation(null, + LocationTag output = new LocationTag(null, Double.valueOf(split.get(0)), Double.valueOf(split.get(1)), Double.valueOf(split.get(2)), @@ -269,7 +269,7 @@ else if (split.size() == 5) } catch (Exception e) { if (context == null || context.debug) { - Debug.log("Minor: valueOf dLocation returning null: " + string + "(internal exception:" + e.getMessage() + ")"); + Debug.log("Minor: valueOf LocationTag returning null: " + string + "(internal exception:" + e.getMessage() + ")"); } return null; } @@ -282,14 +282,14 @@ else if (split.size() == 6) try { World world = Bukkit.getWorld(split.get(5)); if (world != null) { - return new dLocation(world, + return new LocationTag(world, Double.valueOf(split.get(0)), Double.valueOf(split.get(1)), Double.valueOf(split.get(2)), Float.valueOf(split.get(3)), Float.valueOf(split.get(4))); } - dLocation output = new dLocation(null, + LocationTag output = new LocationTag(null, Double.valueOf(split.get(0)), Double.valueOf(split.get(1)), Double.valueOf(split.get(2)), @@ -300,14 +300,14 @@ else if (split.size() == 6) } catch (Exception e) { if (context == null || context.debug) { - Debug.log("Minor: valueOf dLocation returning null: " + string + "(internal exception:" + e.getMessage() + ")"); + Debug.log("Minor: valueOf LocationTag returning null: " + string + "(internal exception:" + e.getMessage() + ")"); } return null; } } if (context == null || context.debug) { - Debug.log("Minor: valueOf dLocation returning null: " + string); + Debug.log("Minor: valueOf LocationTag returning null: " + string); } return null; @@ -322,7 +322,7 @@ public static boolean matches(String string) { return true; } - return dLocation.valueOf(string, new BukkitTagContext(null, null, false, null, false, null)) != null; + return LocationTag.valueOf(string, new BukkitTagContext(null, null, false, null, false, null)) != null; } @@ -333,12 +333,12 @@ public static boolean matches(String string) { private boolean is2D = false; /** - * Turns a Bukkit Location into a dLocation, which has some helpful methods + * Turns a Bukkit Location into a LocationTag, which has some helpful methods * for working with dScript. * * @param location the Bukkit Location to reference */ - public dLocation(Location location) { + public LocationTag(Location location) { // Just save the yaw and pitch as they are; don't check if they are // higher than 0, because Minecraft yaws are weird and can have // negative values @@ -346,11 +346,11 @@ public dLocation(Location location) { location.getYaw(), location.getPitch()); } - public dLocation(Vector vector) { + public LocationTag(Vector vector) { super(null, vector.getX(), vector.getY(), vector.getZ()); } - public dLocation(World world, double x, double y) { + public LocationTag(World world, double x, double y) { this(world, x, y, 0); this.is2D = true; } @@ -364,11 +364,11 @@ public dLocation(World world, double x, double y) { * @param y y-coordinate of the location * @param z z-coordinate of the location */ - public dLocation(World world, double x, double y, double z) { + public LocationTag(World world, double x, double y, double z) { super(world, x, y, z); } - public dLocation(World world, double x, double y, double z, float pitch, float yaw) { + public LocationTag(World world, double x, double y, double z, float pitch, float yaw) { super(world, x, y, z, yaw, pitch); } @@ -415,8 +415,8 @@ public Inventory getBukkitInventory() { return hasInventory() ? ((InventoryHolder) getBlockState()).getInventory() : null; } - public dInventory getInventory() { - return hasInventory() ? dInventory.mirrorBukkitInventory(getBukkitInventory()) : null; + public InventoryTag getInventory() { + return hasInventory() ? InventoryTag.mirrorBukkitInventory(getBukkitInventory()) : null; } public BlockFace getSkullBlockFace(int rotation) { @@ -516,10 +516,10 @@ public boolean equals(Object o) { if (o == null) { return false; } - if (!(o instanceof dLocation)) { + if (!(o instanceof LocationTag)) { return false; } - dLocation other = (dLocation) o; + LocationTag other = (LocationTag) o; if ((other.getWorldName() == null && getWorldName() != null) || (getWorldName() == null && other.getWorldName() != null) || (getWorldName() != null && other.getWorldName() != null @@ -544,7 +544,7 @@ public String getPrefix() { } @Override - public dLocation setPrefix(String prefix) { + public LocationTag setPrefix(String prefix) { this.prefix = prefix; return this; } @@ -619,8 +619,8 @@ public String getAttribute(Attribute attribute) { ///////////////// // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @description // Returns the relative location vector of where this block is facing. // Only works for block types that have directionality (such as signs, chests, stairs, etc.). @@ -630,129 +630,129 @@ public String getAttribute(Attribute attribute) { if (attribute.matches("block_facing")) { Vector facing = DirectionalBlocksHelper.getFacing(getBlock()); if (facing != null) { - return new dLocation(getWorld(), facing.getX(), facing.getY(), facing.getZ()) + return new LocationTag(getWorld(), facing.getX(), facing.getY(), facing.getZ()) .getAttribute(attribute.fulfill(1)); } } // <--[tag] - // @attribute )]> - // @returns dLocation + // @attribute )]> + // @returns LocationTag // @description // Returns the location above this location. Optionally specify a number of blocks to go up. - // This just moves straight along the Y axis, equivalent to <@link tag l@location.add> with input 0,1,0 (or the input value instead of '1'). + // This just moves straight along the Y axis, equivalent to <@link tag LocationTag.add> with input 0,1,0 (or the input value instead of '1'). // --> if (attribute.startsWith("above")) { - return new dLocation(this.clone().add(0, attribute.hasContext(1) ? attribute.getDoubleContext(1) : 1, 0)) + return new LocationTag(this.clone().add(0, attribute.hasContext(1) ? attribute.getDoubleContext(1) : 1, 0)) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute )]> - // @returns dLocation + // @attribute )]> + // @returns LocationTag // @description // Returns the location below this location. Optionally specify a number of blocks to go down. - // This just moves straight along the Y axis, equivalent to <@link tag l@location.sub> with input 0,1,0 (or the input value instead of '1'). + // This just moves straight along the Y axis, equivalent to <@link tag LocationTag.sub> with input 0,1,0 (or the input value instead of '1'). // --> if (attribute.startsWith("below")) { - return new dLocation(this.clone().subtract(0, attribute.hasContext(1) ? attribute.getDoubleContext(1) : 1, 0)) + return new LocationTag(this.clone().subtract(0, attribute.hasContext(1) ? attribute.getDoubleContext(1) : 1, 0)) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute )]> - // @returns dLocation + // @attribute )]> + // @returns LocationTag // @description // Returns the location in front of this location based on pitch and yaw. Optionally specify a number of blocks to go forward. // --> if (attribute.startsWith("forward")) { Vector vector = this.getDirection().multiply(attribute.hasContext(1) ? attribute.getDoubleContext(1) : 1); - return new dLocation(this.clone().add(vector)) + return new LocationTag(this.clone().add(vector)) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute )]> - // @returns dLocation + // @attribute )]> + // @returns LocationTag // @description // Returns the location behind this location based on pitch and yaw. Optionally specify a number of blocks to go backward. - // This is equivalent to <@link tag l@location.forward> in the opposite direction. + // This is equivalent to <@link tag LocationTag.forward> in the opposite direction. // --> if (attribute.startsWith("backward")) { Vector vector = this.getDirection().multiply(attribute.hasContext(1) ? attribute.getDoubleContext(1) : 1); - return new dLocation(this.clone().subtract(vector)) + return new LocationTag(this.clone().subtract(vector)) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute )]> - // @returns dLocation + // @attribute )]> + // @returns LocationTag // @description // Returns the location to the left of this location based on pitch and yaw. Optionally specify a number of blocks to go left. - // This is equivalent to <@link tag l@location.forward> with a +90 degree rotation to the yaw and the pitch set to 0. + // This is equivalent to <@link tag LocationTag.forward> with a +90 degree rotation to the yaw and the pitch set to 0. // --> if (attribute.startsWith("left")) { Location loc = this.clone(); loc.setPitch(0); Vector vector = loc.getDirection().rotateAroundY(Math.PI / 2).multiply(attribute.hasContext(1) ? attribute.getDoubleContext(1) : 1); - return new dLocation(this.clone().add(vector)) + return new LocationTag(this.clone().add(vector)) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute )]> - // @returns dLocation + // @attribute )]> + // @returns LocationTag // @description // Returns the location to the right of this location based on pitch and yaw. Optionally specify a number of blocks to go right. - // This is equivalent to <@link tag l@location.forward> with a -90 degree rotation to the yaw and the pitch set to 0. + // This is equivalent to <@link tag LocationTag.forward> with a -90 degree rotation to the yaw and the pitch set to 0. // --> if (attribute.startsWith("right")) { Location loc = this.clone(); loc.setPitch(0); Vector vector = loc.getDirection().rotateAroundY(Math.PI / 2).multiply(attribute.hasContext(1) ? attribute.getDoubleContext(1) : 1); - return new dLocation(this.clone().subtract(vector)) + return new LocationTag(this.clone().subtract(vector)) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute )]> - // @returns dLocation + // @attribute )]> + // @returns LocationTag // @description // Returns the location above this location based on pitch and yaw. Optionally specify a number of blocks to go up. - // This is equivalent to <@link tag l@location.forward> with a +90 degree rotation to the pitch. + // This is equivalent to <@link tag LocationTag.forward> with a +90 degree rotation to the pitch. // --> if (attribute.startsWith("up")) { Location loc = this.clone(); loc.setPitch(loc.getPitch() - 90); Vector vector = loc.getDirection().multiply(attribute.hasContext(1) ? attribute.getDoubleContext(1) : 1); - return new dLocation(this.clone().add(vector)) + return new LocationTag(this.clone().add(vector)) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute )]> - // @returns dLocation + // @attribute )]> + // @returns LocationTag // @description // Returns the location below this location based on pitch and yaw. Optionally specify a number of blocks to go down. - // This is equivalent to <@link tag l@location.forward> with a -90 degree rotation to the pitch. + // This is equivalent to <@link tag LocationTag.forward> with a -90 degree rotation to the pitch. // --> if (attribute.startsWith("down")) { Location loc = this.clone(); loc.setPitch(loc.getPitch() - 90); Vector vector = loc.getDirection().multiply(attribute.hasContext(1) ? attribute.getDoubleContext(1) : 1); - return new dLocation(this.clone().subtract(vector)) + return new LocationTag(this.clone().subtract(vector)) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute ]> - // @returns dLocation + // @attribute ]> + // @returns LocationTag // @description // Returns the location relative to this location. Input is a vector location of the form left,up,forward. // For example, input -1,1,1 will return a location 1 block to the right, 1 block up, and 1 block forward. // --> if (attribute.startsWith("relative") && attribute.hasContext(1)) { - dLocation offsetLoc = dLocation.valueOf(attribute.getContext(1)); + LocationTag offsetLoc = LocationTag.valueOf(attribute.getContext(1)); if (offsetLoc == null) { return null; } @@ -764,46 +764,46 @@ public String getAttribute(Attribute attribute) { loc.setPitch(0); offset = offset.add(loc.getDirection().rotateAroundY(Math.PI / 2).multiply(offsetLoc.getX())); - return new dLocation(this.clone().add(offset)) + return new LocationTag(this.clone().add(offset)) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @description // Returns the location of the block this location is on, // i.e. returns a location without decimals or direction. // --> if (attribute.matches("block")) { - return new dLocation(getWorld(), getBlockX(), getBlockY(), getBlockZ()) + return new LocationTag(getWorld(), getBlockX(), getBlockY(), getBlockZ()) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @description // Returns the location at the center of the block this location is on. // --> if (attribute.startsWith("center")) { - return new dLocation(getWorld(), getBlockX() + 0.5, getBlockY() + 0.5, getBlockZ() + 0.5) + return new LocationTag(getWorld(), getBlockX() + 0.5, getBlockY() + 0.5, getBlockZ() + 0.5) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @description // Returns the location of the highest solid block at the location. // --> if (attribute.startsWith("highest")) { - return new dLocation(getWorld().getHighestBlockAt(this).getLocation().add(0, -1, 0)) + return new LocationTag(getWorld().getHighestBlockAt(this).getLocation().add(0, -1, 0)) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the base color of the banner at this location. @@ -815,7 +815,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the block at the location has an inventory. @@ -825,10 +825,10 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @returns dInventory + // @attribute + // @returns InventoryTag // @description - // Returns the dInventory of the block at the location. If the + // Returns the InventoryTag of the block at the location. If the // block is not a container, returns null. // --> if (attribute.startsWith("inventory")) { @@ -837,20 +837,20 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @returns dMaterial + // @attribute + // @returns MaterialTag // @description // Returns the material of the block at the location. // --> if (attribute.startsWith("material")) { - return new dMaterial(getBlock()).getAttribute(attribute.fulfill(1)); + return new MaterialTag(getBlock()).getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute + // @attribute // @returns ListTag // @group properties - // @mechanism dLocation.patterns + // @mechanism LocationTag.patterns // @description // Lists the patterns of the banner at this location in the form "li@COLOR/PATTERN|COLOR/PATTERN" etc. // For the list of possible colors, see <@link url http://bit.ly/1dydq12>. @@ -865,11 +865,11 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Gets the rotation of the head at this location. Can be 1-16. - // @mechanism dLocation.head_rotation + // @mechanism LocationTag.head_rotation // --> if (attribute.startsWith("head_rotation")) { return new ElementTag(getSkullRotation(((Skull) getBlockState()).getRotation()) + 1) @@ -877,7 +877,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the block at the location is considered to be switched on. @@ -890,9 +890,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ListTag - // @mechanism dLocation.sign_contents + // @mechanism LocationTag.sign_contents // @description // Returns a list of lines on a sign. // --> @@ -907,15 +907,15 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @mechanism dLocation.spawner_type - // @returns dEntity + // @attribute + // @mechanism LocationTag.spawner_type + // @returns EntityTag // @description // Returns the type of entity spawned by a mob spawner. // --> if (attribute.startsWith("spawner_type")) { if (getBlockState() instanceof CreatureSpawner) { - return new dEntity(DenizenEntityType.getByName(((CreatureSpawner) getBlockState()) + return new EntityTag(DenizenEntityType.getByName(((CreatureSpawner) getBlockState()) .getSpawnedType().name())).getAttribute(attribute.fulfill(1)); } else { @@ -924,8 +924,8 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @mechanism dLocation.lock + // @attribute + // @mechanism LocationTag.lock // @returns ElementTag // @description // Returns the password to a locked container. @@ -937,8 +937,8 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @mechanism dLocation.lock + // @attribute + // @mechanism LocationTag.lock // @returns ElementTag(Boolean) // @description // Returns whether the container is locked. @@ -949,8 +949,8 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @mechanism dLocation.lock + // @attribute + // @mechanism LocationTag.lock // @returns ElementTag(Boolean) // @description // Returns whether the container is lockable. @@ -961,8 +961,8 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute )]> - // @returns ListTag(dItem) + // @attribute )]> + // @returns ListTag(ItemTag) // @description // Returns what items the block at the location would drop if broken naturally. // Optionally specifier a breaker item. @@ -970,7 +970,7 @@ public String getAttribute(Attribute attribute) { if (attribute.startsWith("drops")) { Collection its; if (attribute.hasContext(1)) { - dItem item = dItem.valueOf(attribute.getContext(1), attribute.context); + ItemTag item = ItemTag.valueOf(attribute.getContext(1), attribute.context); its = getBlock().getDrops(item.getItemStack()); } else { @@ -978,13 +978,13 @@ public String getAttribute(Attribute attribute) { } ListTag list = new ListTag(); for (ItemStack it : its) { - list.add(new dItem(it).identify()); + list.add(new ItemTag(it).identify()); } return list.getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the flower pot contents at the location. @@ -1004,7 +1004,7 @@ else if (getBlock().getType() == Material.FLOWER_POT) { // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the type of the skull. @@ -1018,9 +1018,9 @@ else if (getBlock().getType() == Material.FLOWER_POT) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dLocation.skull_skin + // @mechanism LocationTag.skull_skin // @description // Returns the name of the skin the skull is displaying. // --> @@ -1040,9 +1040,9 @@ else if (getBlock().getType() == Material.FLOWER_POT) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dLocation.skull_skin + // @mechanism LocationTag.skull_skin // @description // Returns the skin the skull is displaying - just the name or UUID as text, not a player object. // --> @@ -1058,9 +1058,9 @@ else if (getBlock().getType() == Material.FLOWER_POT) { String texture = profile.getTexture(); attribute = attribute.fulfill(1); // <--[tag] - // @attribute + // @attribute // @returns ElementTag|Element - // @mechanism dLocation.skull_skin + // @mechanism LocationTag.skull_skin // @description // Returns the skin the skull item is displaying - just the name or UUID as text, not a player object, // along with the permanently cached texture property. @@ -1078,10 +1078,10 @@ else if (getBlock().getType() == Material.FLOWER_POT) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description - // Returns the formatted simple version of the dLocation's block coordinates. + // Returns the formatted simple version of the LocationTag's block coordinates. // In the format: X 'x', Y 'y', Z 'z', in world 'world' // For example, X '1', Y '2', Z '3', in world 'world_nether' // --> @@ -1093,10 +1093,10 @@ else if (getBlock().getType() == Material.FLOWER_POT) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description - // Returns a simple version of the dLocation's block coordinates. + // Returns a simple version of the LocationTag's block coordinates. // In the format: x,y,z,world // For example: 1,2,3,world_nether // --> @@ -1117,8 +1117,8 @@ else if (getBlock().getType() == Material.FLOWER_POT) { ///////////////// // <--[tag] - // @attribute ]> - // @returns dLocation + // @attribute ]> + // @returns LocationTag // @description // Returns the exact impact normal at the location this location is pointing at. // Optionally, specify a maximum range to find the location from (defaults to 200). @@ -1134,7 +1134,7 @@ else if (getBlock().getType() == Material.FLOWER_POT) { double nz = xzLen * Math.cos(getYaw() * (Math.PI / 180)); Location location = NMSHandler.getInstance().getEntityHelper().getImpactNormal(this, new Vector(nx, -ny, nz), range); if (location != null) { - return new dLocation(location).getAttribute(attribute.fulfill(1)); + return new LocationTag(location).getAttribute(attribute.fulfill(1)); } else { return null; @@ -1142,8 +1142,8 @@ else if (getBlock().getType() == Material.FLOWER_POT) { } // <--[tag] - // @attribute ]> - // @returns dLocation + // @attribute ]> + // @returns LocationTag // @description // Returns the block location this location is pointing at. // Optionally, specify a maximum range to find the location from (defaults to 200). @@ -1159,7 +1159,7 @@ else if (getBlock().getType() == Material.FLOWER_POT) { double nz = xzLen * Math.cos(getYaw() * (Math.PI / 180)); Location location = NMSHandler.getInstance().getEntityHelper().rayTraceBlock(this, new Vector(nx, -ny, nz), range); if (location != null) { - return new dLocation(location.getBlock().getLocation()).getAttribute(attribute.fulfill(1)); + return new LocationTag(location.getBlock().getLocation()).getAttribute(attribute.fulfill(1)); } else { return null; @@ -1167,8 +1167,8 @@ else if (getBlock().getType() == Material.FLOWER_POT) { } // <--[tag] - // @attribute ]> - // @returns dLocation + // @attribute ]> + // @returns LocationTag // @description // Returns the exact location this location is pointing at. // Optionally, specify a maximum range to find the location from (defaults to 200). @@ -1184,7 +1184,7 @@ else if (getBlock().getType() == Material.FLOWER_POT) { double nz = xzLen * Math.cos(getYaw() * (Math.PI / 180)); Location location = NMSHandler.getInstance().getEntityHelper().rayTrace(this, new Vector(nx, -ny, nz), range); if (location != null) { - return new dLocation(location).getAttribute(attribute.fulfill(1)); + return new LocationTag(location).getAttribute(attribute.fulfill(1)); } else { return null; @@ -1192,20 +1192,20 @@ else if (getBlock().getType() == Material.FLOWER_POT) { } // <--[tag] - // @attribute ]> - // @returns ListTag(dLocation) + // @attribute ]> + // @returns ListTag(LocationTag) // @description // Finds all locations between this location and another, separated by 1 block-width each. // --> if (attribute.startsWith("points_between")) { - dLocation target = dLocation.valueOf(attribute.getContext(1)); + LocationTag target = LocationTag.valueOf(attribute.getContext(1)); if (target == null) { return null; } attribute = attribute.fulfill(1); // <--[tag] - // @attribute ].distance[<#.#>]> - // @returns ListTag(dLocation) + // @attribute ].distance[<#.#>]> + // @returns ListTag(LocationTag) // @description // Finds all locations between this location and another, separated by the specified distance each. // --> @@ -1219,14 +1219,14 @@ else if (getBlock().getType() == Material.FLOWER_POT) { double len = rel.length(); rel = rel.multiply(1d / len); for (double i = 0d; i < len; i += rad) { - list.add(new dLocation(this.clone().add(rel.clone().multiply(i))).identify()); + list.add(new LocationTag(this.clone().add(rel.clone().multiply(i))).identify()); } return list.getAttribute(attribute); } // <--[tag] - // @attribute ]> - // @returns ListTag(dLocation) + // @attribute ]> + // @returns ListTag(LocationTag) // @description // Finds all block locations in the direction this location is facing, // optionally with a custom range (default is 100). @@ -1241,20 +1241,20 @@ else if (getBlock().getType() == Material.FLOWER_POT) { ListTag list = new ListTag(); BlockIterator iterator = new BlockIterator(this, 0, range); while (iterator.hasNext()) { - list.add(new dLocation(iterator.next().getLocation()).identify()); + list.add(new LocationTag(iterator.next().getLocation()).identify()); } return list.getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Boolean) // @description // Returns whether the specified location is within this location's // line of sight. // --> if (attribute.startsWith("line_of_sight") && attribute.hasContext(1)) { - dLocation location = dLocation.valueOf(attribute.getContext(1)); + LocationTag location = LocationTag.valueOf(attribute.getContext(1)); if (location != null) { return new ElementTag(NMSHandler.getInstance().getEntityHelper().canTrace(getWorld(), toVector(), location.toVector())) .getAttribute(attribute.fulfill(1)); @@ -1262,8 +1262,8 @@ else if (getBlock().getType() == Material.FLOWER_POT) { } // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @description // Returns the location's direction as a one-length vector. // --> @@ -1272,11 +1272,11 @@ else if (getBlock().getType() == Material.FLOWER_POT) { double nx = xzLen * Math.sin(-getYaw() * (Math.PI / 180)); double ny = Math.sin(getPitch() * (Math.PI / 180)); double nz = xzLen * Math.cos(getYaw() * (Math.PI / 180)); - return new dLocation(getWorld(), nx, -ny, nz).getAttribute(attribute.fulfill(2)); + return new LocationTag(getWorld(), nx, -ny, nz).getAttribute(attribute.fulfill(2)); } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag // @description // Returns the compass direction between two locations. @@ -1285,14 +1285,14 @@ else if (getBlock().getType() == Material.FLOWER_POT) { // --> if (attribute.startsWith("direction")) { // Get the cardinal direction from this location to another - if (attribute.hasContext(1) && dLocation.matches(attribute.getContext(1))) { + if (attribute.hasContext(1) && LocationTag.matches(attribute.getContext(1))) { // Subtract this location's vector from the other location's vector, // not the other way around - dLocation target = dLocation.valueOf(attribute.getContext(1)); + LocationTag target = LocationTag.valueOf(attribute.getContext(1)); attribute = attribute.fulfill(1); EntityHelper entityHelper = NMSHandler.getInstance().getEntityHelper(); // <--[tag] - // @attribute ].yaw> + // @attribute ].yaw> // @returns ElementTag(Decimal) // @description // Returns the yaw direction between two locations. @@ -1318,21 +1318,21 @@ else if (getBlock().getType() == Material.FLOWER_POT) { } // <--[tag] - // @attribute ]> - // @returns dLocation + // @attribute ]> + // @returns LocationTag // @description // Returns a location containing a yaw/pitch that point from the current location // to the target location. // --> if (attribute.startsWith("face") && attribute.hasContext(1)) { - Location two = dLocation.valueOf(attribute.getContext(1)); - return new dLocation(NMSHandler.getInstance().getEntityHelper().faceLocation(this, two)) + Location two = LocationTag.valueOf(attribute.getContext(1)); + return new LocationTag(NMSHandler.getInstance().getEntityHelper().faceLocation(this, two)) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute /]> + // @attribute /]> // @returns ElementTag(Boolean) // @description // Returns whether the location's yaw is facing another @@ -1348,7 +1348,7 @@ else if (getBlock().getType() == Material.FLOWER_POT) { int attributePos = 1; // <--[tag] - // @attribute /].degrees[<#>(,<#>)]> + // @attribute /].degrees[<#>(,<#>)]> // @returns ElementTag(Boolean) // @description // Returns whether the location's yaw is facing another @@ -1363,14 +1363,14 @@ else if (getBlock().getType() == Material.FLOWER_POT) { String pitch = context.substring(context.indexOf(',') + 1); degrees = ArgumentHelper.getIntegerFrom(yaw); int pitchDegrees = ArgumentHelper.getIntegerFrom(pitch); - if (dLocation.matches(attribute.getContext(1))) { + if (LocationTag.matches(attribute.getContext(1))) { return new ElementTag(NMSHandler.getInstance().getEntityHelper().isFacingLocation - (this, dLocation.valueOf(attribute.getContext(1)), degrees, pitchDegrees)) + (this, LocationTag.valueOf(attribute.getContext(1)), degrees, pitchDegrees)) .getAttribute(attribute.fulfill(attributePos)); } - else if (dEntity.matches(attribute.getContext(1))) { + else if (EntityTag.matches(attribute.getContext(1))) { return new ElementTag(NMSHandler.getInstance().getEntityHelper().isFacingLocation - (this, dEntity.valueOf(attribute.getContext(1)) + (this, EntityTag.valueOf(attribute.getContext(1)) .getBukkitEntity().getLocation(), degrees, pitchDegrees)) .getAttribute(attribute.fulfill(attributePos)); } @@ -1381,14 +1381,14 @@ else if (dEntity.matches(attribute.getContext(1))) { } } - if (dLocation.matches(attribute.getContext(1))) { + if (LocationTag.matches(attribute.getContext(1))) { return new ElementTag(NMSHandler.getInstance().getEntityHelper().isFacingLocation - (this, dLocation.valueOf(attribute.getContext(1)), degrees)) + (this, LocationTag.valueOf(attribute.getContext(1)), degrees)) .getAttribute(attribute.fulfill(attributePos)); } - else if (dEntity.matches(attribute.getContext(1))) { + else if (EntityTag.matches(attribute.getContext(1))) { return new ElementTag(NMSHandler.getInstance().getEntityHelper().isFacingLocation - (this, dEntity.valueOf(attribute.getContext(1)) + (this, EntityTag.valueOf(attribute.getContext(1)) .getBukkitEntity().getLocation(), degrees)) .getAttribute(attribute.fulfill(attributePos)); } @@ -1396,7 +1396,7 @@ else if (dEntity.matches(attribute.getContext(1))) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @description // Returns the pitch of the object at the location. @@ -1406,8 +1406,8 @@ else if (dEntity.matches(attribute.getContext(1))) { } // <--[tag] - // @attribute /,]> - // @returns dLocation + // @attribute /,]> + // @returns LocationTag // @description // Returns the location with pitch and yaw. // --> @@ -1415,8 +1415,8 @@ else if (dEntity.matches(attribute.getContext(1))) { String context = attribute.getContext(1); float pitch = 0f; float yaw = 0f; - if (dEntity.matches(context)) { - dEntity ent = dEntity.valueOf(context); + if (EntityTag.matches(context)) { + EntityTag ent = EntityTag.valueOf(context); if (ent.isSpawned()) { pitch = ent.getBukkitEntity().getLocation().getPitch(); yaw = ent.getBukkitEntity().getLocation().getYaw(); @@ -1427,14 +1427,14 @@ else if (context.split(",").length == 2) { pitch = Float.parseFloat(split[0]); yaw = Float.parseFloat(split[1]); } - dLocation loc = dLocation.valueOf(identify()); + LocationTag loc = LocationTag.valueOf(identify()); loc.setPitch(pitch); loc.setYaw(yaw); return loc.getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the yaw as 'North', 'South', 'East', or 'West'. @@ -1464,7 +1464,7 @@ else if (yaw < 315) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @description // Returns the raw yaw of the object at the location. @@ -1475,7 +1475,7 @@ else if (yaw < 315) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @description // Returns the normalized yaw of the object at the location. @@ -1486,8 +1486,8 @@ else if (yaw < 315) { } // <--[tag] - // @attribute ]> - // @returns dLocation + // @attribute ]> + // @returns LocationTag // @description // Returns the location rotated around the x axis by a specified angle in radians. // --> @@ -1500,12 +1500,12 @@ else if (yaw < 315) { Location location = clone(); location.setY(y); location.setZ(z); - return new dLocation(location).getAttribute(attribute.fulfill(1)); + return new LocationTag(location).getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute ]> - // @returns dLocation + // @attribute ]> + // @returns LocationTag // @description // Returns the location rotated around the y axis by a specified angle in radians. // --> @@ -1518,12 +1518,12 @@ else if (yaw < 315) { Location location = clone(); location.setX(x); location.setZ(z); - return new dLocation(location).getAttribute(attribute.fulfill(1)); + return new LocationTag(location).getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute ]> - // @returns dLocation + // @attribute ]> + // @returns LocationTag // @description // Returns the location rotated around the z axis by a specified angle in radians. // --> @@ -1536,7 +1536,7 @@ else if (yaw < 315) { Location location = clone(); location.setX(x); location.setY(y); - return new dLocation(location).getAttribute(attribute.fulfill(1)); + return new LocationTag(location).getAttribute(attribute.fulfill(1)); } @@ -1548,7 +1548,7 @@ else if (yaw < 315) { attribute.fulfill(1); // <--[tag] - // @attribute |...].within[<#>]> + // @attribute |...].within[<#>]> // @returns ListTag // @description // Returns a list of matching blocks within a radius. @@ -1557,11 +1557,11 @@ else if (yaw < 315) { if (attribute.startsWith("blocks") && attribute.getAttribute(2).startsWith("within") && attribute.hasContext(2)) { - ArrayList found = new ArrayList<>(); + ArrayList found = new ArrayList<>(); int radius = ArgumentHelper.matchesInteger(attribute.getContext(2)) ? attribute.getIntContext(2) : 10; - List materials = new ArrayList<>(); + List materials = new ArrayList<>(); if (attribute.hasContext(1)) { - materials = ListTag.valueOf(attribute.getContext(1)).filter(dMaterial.class, attribute.context); + materials = ListTag.valueOf(attribute.getContext(1)).filter(MaterialTag.class, attribute.context); } // Avoid NPE from invalid materials if (materials == null) { @@ -1588,29 +1588,29 @@ else if (yaw < 315) { } if (Utilities.checkLocation(this, tstart.clone().add(x + 0.5, y + 0.5, z + 0.5), radius)) { if (!materials.isEmpty()) { - for (dMaterial material : materials) { + for (MaterialTag material : materials) { if (material.hasData() && material.getData() != 0) { // TODO: less arbitrary matching - if (material.matchesMaterialData(new dLocation(tstart.clone().add(x, y, z)).getBlockState().getData())) { - found.add(new dLocation(tstart.clone().add(x, y, z))); + if (material.matchesMaterialData(new LocationTag(tstart.clone().add(x, y, z)).getBlockState().getData())) { + found.add(new LocationTag(tstart.clone().add(x, y, z))); } } else if (material.getMaterial() == tstart.clone().add(x, y, z).getBlock().getType()) { - found.add(new dLocation(tstart.clone().add(x, y, z))); + found.add(new LocationTag(tstart.clone().add(x, y, z))); } } } else { - found.add(new dLocation(tstart.clone().add(x, y, z))); + found.add(new LocationTag(tstart.clone().add(x, y, z))); } } } } } - Collections.sort(found, new Comparator() { + Collections.sort(found, new Comparator() { @Override - public int compare(dLocation loc1, dLocation loc2) { - return dLocation.this.compare(loc1, loc2); + public int compare(LocationTag loc1, LocationTag loc2) { + return LocationTag.this.compare(loc1, loc2); } }); @@ -1618,7 +1618,7 @@ public int compare(dLocation loc1, dLocation loc2) { } // <--[tag] - // @attribute |...].within[<#.#>]> + // @attribute |...].within[<#.#>]> // @returns ListTag // @description // Returns a list of matching surface blocks within a radius. @@ -1626,11 +1626,11 @@ public int compare(dLocation loc1, dLocation loc2) { else if (attribute.startsWith("surface_blocks") && attribute.getAttribute(2).startsWith("within") && attribute.hasContext(2)) { - ArrayList found = new ArrayList<>(); + ArrayList found = new ArrayList<>(); double radius = ArgumentHelper.matchesDouble(attribute.getContext(2)) ? attribute.getDoubleContext(2) : 10; - List materials = new ArrayList<>(); + List materials = new ArrayList<>(); if (attribute.hasContext(1)) { - materials = ListTag.valueOf(attribute.getContext(1)).filter(dMaterial.class, attribute.context); + materials = ListTag.valueOf(attribute.getContext(1)).filter(MaterialTag.class, attribute.context); } // Avoid NPE from invalid materials if (materials == null) { @@ -1653,12 +1653,12 @@ else if (attribute.startsWith("surface_blocks") if (Utilities.checkLocation(loc, getBlock().getLocation().add(x + 0.5, y + 0.5, z + 0.5), radius)) { Location l = getBlock().getLocation().clone().add(x, y, z); if (!materials.isEmpty()) { - for (dMaterial material : materials) { + for (MaterialTag material : materials) { if (material.matchesBlock(getBlock().getLocation().clone().add(x, y, z).getBlock())) { if (l.clone().add(0, 1, 0).getBlock().getType() == Material.AIR && l.clone().add(0, 2, 0).getBlock().getType() == Material.AIR && l.getBlock().getType() != Material.AIR) { - found.add(new dLocation(getBlock().getLocation().clone().add(x + 0.5, y, z + 0.5))); + found.add(new LocationTag(getBlock().getLocation().clone().add(x + 0.5, y, z + 0.5))); } } } @@ -1667,7 +1667,7 @@ else if (attribute.startsWith("surface_blocks") if (l.clone().add(0, 1, 0).getBlock().getType() == Material.AIR && l.clone().add(0, 2, 0).getBlock().getType() == Material.AIR && l.getBlock().getType() != Material.AIR) { - found.add(new dLocation(getBlock().getLocation().clone().add(x + 0.5, y, z + 0.5))); + found.add(new LocationTag(getBlock().getLocation().clone().add(x + 0.5, y, z + 0.5))); } } } @@ -1675,10 +1675,10 @@ else if (attribute.startsWith("surface_blocks") } } - Collections.sort(found, new Comparator() { + Collections.sort(found, new Comparator() { @Override - public int compare(dLocation loc1, dLocation loc2) { - return dLocation.this.compare(loc1, loc2); + public int compare(LocationTag loc1, LocationTag loc2) { + return LocationTag.this.compare(loc1, loc2); } }); @@ -1686,7 +1686,7 @@ public int compare(dLocation loc1, dLocation loc2) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ListTag // @description // Returns a list of players within a radius. @@ -1694,19 +1694,19 @@ public int compare(dLocation loc1, dLocation loc2) { else if (attribute.startsWith("players") && attribute.getAttribute(2).startsWith("within") && attribute.hasContext(2)) { - ArrayList found = new ArrayList<>(); + ArrayList found = new ArrayList<>(); double radius = ArgumentHelper.matchesDouble(attribute.getContext(2)) ? attribute.getDoubleContext(2) : 10; attribute.fulfill(2); for (Player player : Bukkit.getOnlinePlayers()) { if (!player.isDead() && Utilities.checkLocation(this, player.getLocation(), radius)) { - found.add(new dPlayer(player)); + found.add(new PlayerTag(player)); } } - Collections.sort(found, new Comparator() { + Collections.sort(found, new Comparator() { @Override - public int compare(dPlayer pl1, dPlayer pl2) { - return dLocation.this.compare(pl1.getLocation(), pl2.getLocation()); + public int compare(PlayerTag pl1, PlayerTag pl2) { + return LocationTag.this.compare(pl1.getLocation(), pl2.getLocation()); } }); @@ -1714,7 +1714,7 @@ public int compare(dPlayer pl1, dPlayer pl2) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ListTag // @description // Returns a list of NPCs within a radius. @@ -1722,19 +1722,19 @@ public int compare(dPlayer pl1, dPlayer pl2) { else if (attribute.startsWith("npcs") && attribute.getAttribute(2).startsWith("within") && attribute.hasContext(2)) { - ArrayList found = new ArrayList<>(); + ArrayList found = new ArrayList<>(); double radius = ArgumentHelper.matchesDouble(attribute.getContext(2)) ? attribute.getDoubleContext(2) : 10; attribute.fulfill(2); for (NPC npc : CitizensAPI.getNPCRegistry()) { if (npc.isSpawned() && Utilities.checkLocation(this.getBlock().getLocation(), npc.getStoredLocation(), radius)) { - found.add(new dNPC(npc)); + found.add(new NPCTag(npc)); } } - Collections.sort(found, new Comparator() { + Collections.sort(found, new Comparator() { @Override - public int compare(dNPC npc1, dNPC npc2) { - return dLocation.this.compare(npc1.getLocation(), npc2.getLocation()); + public int compare(NPCTag npc1, NPCTag npc2) { + return LocationTag.this.compare(npc1.getLocation(), npc2.getLocation()); } }); @@ -1742,7 +1742,7 @@ public int compare(dNPC npc1, dNPC npc2) { } // <--[tag] - // @attribute |...].within[<#.#>]> + // @attribute |...].within[<#.#>]> // @returns ListTag // @description // Returns a list of entities within a radius, with an optional search parameter @@ -1755,12 +1755,12 @@ else if (attribute.startsWith("entities") if (attribute.hasContext(1)) { ent_list = ListTag.valueOf(attribute.getContext(1)); } - ArrayList found = new ArrayList<>(); + ArrayList found = new ArrayList<>(); double radius = ArgumentHelper.matchesDouble(attribute.getContext(2)) ? attribute.getDoubleContext(2) : 10; attribute.fulfill(2); for (Entity entity : getWorld().getEntities()) { if (Utilities.checkLocation(this, entity.getLocation(), radius)) { - dEntity current = new dEntity(entity); + EntityTag current = new EntityTag(entity); if (!ent_list.isEmpty()) { for (String ent : ent_list) { if (current.comparedTo(ent)) { @@ -1775,10 +1775,10 @@ else if (attribute.startsWith("entities") } } - Collections.sort(found, new Comparator() { + Collections.sort(found, new Comparator() { @Override - public int compare(dEntity ent1, dEntity ent2) { - return dLocation.this.compare(ent1.getLocation(), ent2.getLocation()); + public int compare(EntityTag ent1, EntityTag ent2) { + return LocationTag.this.compare(ent1.getLocation(), ent2.getLocation()); } }); @@ -1786,7 +1786,7 @@ public int compare(dEntity ent1, dEntity ent2) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ListTag // @description // Returns a list of living entities within a radius. @@ -1794,20 +1794,20 @@ public int compare(dEntity ent1, dEntity ent2) { else if (attribute.startsWith("living_entities") && attribute.getAttribute(2).startsWith("within") && attribute.hasContext(2)) { - ArrayList found = new ArrayList<>(); + ArrayList found = new ArrayList<>(); double radius = ArgumentHelper.matchesDouble(attribute.getContext(2)) ? attribute.getDoubleContext(2) : 10; attribute.fulfill(2); for (Entity entity : getWorld().getEntities()) { if (entity instanceof LivingEntity && Utilities.checkLocation(this, entity.getLocation(), radius)) { - found.add(new dEntity(entity)); + found.add(new EntityTag(entity)); } } - Collections.sort(found, new Comparator() { + Collections.sort(found, new Comparator() { @Override - public int compare(dEntity ent1, dEntity ent2) { - return dLocation.this.compare(ent1.getLocation(), ent2.getLocation()); + public int compare(EntityTag ent1, EntityTag ent2) { + return LocationTag.this.compare(ent1.getLocation(), ent2.getLocation()); } }); @@ -1816,21 +1816,21 @@ public int compare(dEntity ent1, dEntity ent2) { } // <--[tag] - // @attribute ]> - // @returns ListTag(dLocation) + // @attribute ]> + // @returns ListTag(LocationTag) // @description // Returns a full list of points along the path from this location to the given location. // Uses a max range of 100 blocks from the start. // --> if (attribute.startsWith("find_path") && attribute.hasContext(1)) { - dLocation two = dLocation.valueOf(attribute.getContext(1)); + LocationTag two = LocationTag.valueOf(attribute.getContext(1)); if (two == null) { return null; } - List locs = PathFinder.getPath(this, two); + List locs = PathFinder.getPath(this, two); ListTag list = new ListTag(); - for (dLocation loc : locs) { + for (LocationTag loc : locs) { list.add(loc.identify()); } return list.getAttribute(attribute.fulfill(1)); @@ -1842,7 +1842,7 @@ public int compare(dEntity ent1, dEntity ent2) { ///////////////// // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the location formatted for a Citizens command. @@ -1854,10 +1854,10 @@ public int compare(dEntity ent1, dEntity ent2) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description - // Returns the formatted version of the dLocation. + // Returns the formatted version of the LocationTag. // In the format: X 'x.x', Y 'y.y', Z 'z.z', in world 'world' // For example: X '1.0', Y '2.0', Z '3.0', in world 'world_nether' // --> @@ -1869,42 +1869,42 @@ public int compare(dEntity ent1, dEntity ent2) { } // <--[tag] - // @attribute - // @returns dChunk + // @attribute + // @returns ChunkTag // @description // Returns the chunk that this location belongs to. // --> if (attribute.startsWith("chunk") || attribute.startsWith("get_chunk")) { - return new dChunk(this).getAttribute(attribute.fulfill(1)); + return new ChunkTag(this).getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @description // Returns the raw representation of this location, // ignoring any notables it might match. // --> if (attribute.startsWith("raw")) { - dLocation rawLocation = new dLocation(this); + LocationTag rawLocation = new LocationTag(this); rawLocation.setRaw(true); return rawLocation.getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute - // @returns dWorld + // @attribute + // @returns WorldTag // @description // Returns the world that the location is in. // --> if (attribute.startsWith("world")) { - return dWorld.mirrorBukkitWorld(getWorld()) + return WorldTag.mirrorBukkitWorld(getWorld()) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @description // Returns the X coordinate of the location. @@ -1914,7 +1914,7 @@ public int compare(dEntity ent1, dEntity ent2) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @description // Returns the Y coordinate of the location. @@ -1924,7 +1924,7 @@ public int compare(dEntity ent1, dEntity ent2) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @description // Returns the Z coordinate of the location. @@ -1934,83 +1934,83 @@ public int compare(dEntity ent1, dEntity ent2) { } // <--[tag] - // @attribute ]> - // @returns dLocation + // @attribute ]> + // @returns LocationTag // @description // Returns a copy of the location with a changed X value. // --> if (attribute.matches("with_x") && attribute.hasContext(1)) { - dLocation output = clone(); + LocationTag output = clone(); output.setX(attribute.getDoubleContext(1)); return output.getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute ]> - // @returns dLocation + // @attribute ]> + // @returns LocationTag // @description // Returns a copy of the location with a changed Y value. // --> if (attribute.matches("with_y") && attribute.hasContext(1)) { - dLocation output = clone(); + LocationTag output = clone(); output.setY(attribute.getDoubleContext(1)); return output.getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute ]> - // @returns dLocation + // @attribute ]> + // @returns LocationTag // @description // Returns a copy of the location with a changed Z value. // --> if (attribute.matches("with_z") && attribute.hasContext(1)) { - dLocation output = clone(); + LocationTag output = clone(); output.setZ(attribute.getDoubleContext(1)); return output.getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute ]> - // @returns dLocation + // @attribute ]> + // @returns LocationTag // @description // Returns a copy of the location with a changed yaw value. // --> if (attribute.matches("with_yaw") && attribute.hasContext(1)) { - dLocation output = clone(); + LocationTag output = clone(); output.setYaw((float) attribute.getDoubleContext(1)); return output.getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute ]> - // @returns dLocation + // @attribute ]> + // @returns LocationTag // @description // Returns a copy of the location with a changed pitch value. // --> if (attribute.matches("with_pitch") && attribute.hasContext(1)) { - dLocation output = clone(); + LocationTag output = clone(); output.setPitch((float) attribute.getDoubleContext(1)); return output.getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute ]> - // @returns dLocation + // @attribute ]> + // @returns LocationTag // @description // Returns a copy of the location with a changed world value. // --> if (attribute.matches("with_world") && attribute.hasContext(1)) { - dLocation output = clone(); - dWorld world = dWorld.valueOf(attribute.getContext(1)); + LocationTag output = clone(); + WorldTag world = WorldTag.valueOf(attribute.getContext(1)); output.setWorld(world.getWorld()); return output.getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description - // Gets the name of a Notable dLocation. If the location isn't noted, + // Gets the name of a Notable LocationTag. If the location isn't noted, // this is null. // --> if (attribute.startsWith("notable_name")) { @@ -2027,80 +2027,80 @@ public int compare(dEntity ent1, dEntity ent2) { ///////////////// // <--[tag] - // @attribute ]> - // @returns dLocation + // @attribute ]> + // @returns LocationTag // @description // Returns the location with the specified coordinates added to it. // --> if (attribute.startsWith("add") && attribute.hasContext(1)) { - String[] ints = attribute.getContext(1).replace("l@", "").split(",", 4); // TODO: Just dLocation.valueOf? + String[] ints = attribute.getContext(1).replace("l@", "").split(",", 4); // TODO: Just LocationTag.valueOf? if (ints.length >= 3) { if ((ArgumentHelper.matchesDouble(ints[0]) || ArgumentHelper.matchesInteger(ints[0])) && (ArgumentHelper.matchesDouble(ints[1]) || ArgumentHelper.matchesInteger(ints[1])) && (ArgumentHelper.matchesDouble(ints[2]) || ArgumentHelper.matchesInteger(ints[2]))) { - return new dLocation(this.clone().add(Double.valueOf(ints[0]), + return new LocationTag(this.clone().add(Double.valueOf(ints[0]), Double.valueOf(ints[1]), Double.valueOf(ints[2]))).getAttribute(attribute.fulfill(1)); } } - else if (dLocation.matches(attribute.getContext(1))) { - return new dLocation(this.clone().add(dLocation.valueOf(attribute.getContext(1)))) + else if (LocationTag.matches(attribute.getContext(1))) { + return new LocationTag(this.clone().add(LocationTag.valueOf(attribute.getContext(1)))) .getAttribute(attribute.fulfill(1)); } } // <--[tag] - // @attribute ]> - // @returns dLocation + // @attribute ]> + // @returns LocationTag // @description // Returns the location with the specified coordinates subtracted from it. // --> if (attribute.startsWith("sub") && attribute.hasContext(1)) { - String[] ints = attribute.getContext(1).replace("l@", "").split(",", 4); // TODO: Just dLocation.valueOf? + String[] ints = attribute.getContext(1).replace("l@", "").split(",", 4); // TODO: Just LocationTag.valueOf? if (ints.length == 3 || ints.length == 4) { if ((ArgumentHelper.matchesDouble(ints[0]) || ArgumentHelper.matchesInteger(ints[0])) && (ArgumentHelper.matchesDouble(ints[1]) || ArgumentHelper.matchesInteger(ints[1])) && (ArgumentHelper.matchesDouble(ints[2]) || ArgumentHelper.matchesInteger(ints[2]))) { - return new dLocation(this.clone().subtract(Double.valueOf(ints[0]), + return new LocationTag(this.clone().subtract(Double.valueOf(ints[0]), Double.valueOf(ints[1]), Double.valueOf(ints[2]))).getAttribute(attribute.fulfill(1)); } } - else if (dLocation.matches(attribute.getContext(1))) { - return new dLocation(this.clone().subtract(dLocation.valueOf(attribute.getContext(1)))) + else if (LocationTag.matches(attribute.getContext(1))) { + return new LocationTag(this.clone().subtract(LocationTag.valueOf(attribute.getContext(1)))) .getAttribute(attribute.fulfill(1)); } } // <--[tag] - // @attribute ]> - // @returns dLocation + // @attribute ]> + // @returns LocationTag // @description // Returns the location multiplied by the specified length. // --> if (attribute.startsWith("mul") && attribute.hasContext(1)) { - return new dLocation(this.clone().multiply(Double.parseDouble(attribute.getContext(1)))) + return new LocationTag(this.clone().multiply(Double.parseDouble(attribute.getContext(1)))) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute ]> - // @returns dLocation + // @attribute ]> + // @returns LocationTag // @description // Returns the location divided by the specified length. // --> if (attribute.startsWith("div") && attribute.hasContext(1)) { - return new dLocation(this.clone().multiply(1D / Double.parseDouble(attribute.getContext(1)))) + return new LocationTag(this.clone().multiply(1D / Double.parseDouble(attribute.getContext(1)))) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @description // Returns a 1-length vector in the same direction as this vector location. // --> @@ -2110,13 +2110,13 @@ else if (dLocation.matches(attribute.getContext(1))) { return this.getAttribute(attribute.fulfill(1)); } else { - return new dLocation(this.clone().multiply(1D / len)) + return new LocationTag(this.clone().multiply(1D / len)) .getAttribute(attribute.fulfill(1)); } } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @description // Returns the 3D length of the vector/location. @@ -2127,7 +2127,7 @@ else if (dLocation.matches(attribute.getContext(1))) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the name of the BlockFace represented by a vector. @@ -2145,15 +2145,15 @@ else if (dLocation.matches(attribute.getContext(1))) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Decimal) // @description // Returns the distance between 2 locations, squared. // --> if (attribute.startsWith("distance_squared") && attribute.hasContext(1)) { - if (dLocation.matches(attribute.getContext(1))) { - dLocation toLocation = dLocation.valueOf(attribute.getContext(1)); + if (LocationTag.matches(attribute.getContext(1))) { + LocationTag toLocation = LocationTag.valueOf(attribute.getContext(1)); if (!getWorldName().equalsIgnoreCase(toLocation.getWorldName())) { if (!attribute.hasAlternative()) { Debug.echoError("Can't measure distance between two different worlds!"); @@ -2166,18 +2166,18 @@ else if (dLocation.matches(attribute.getContext(1))) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Decimal) // @description // Returns the distance between 2 locations. // --> if (attribute.startsWith("distance") && attribute.hasContext(1)) { - if (dLocation.matches(attribute.getContext(1))) { - dLocation toLocation = dLocation.valueOf(attribute.getContext(1)); + if (LocationTag.matches(attribute.getContext(1))) { + LocationTag toLocation = LocationTag.valueOf(attribute.getContext(1)); // <--[tag] - // @attribute ].horizontal> + // @attribute ].horizontal> // @returns ElementTag(Decimal) // @description // Returns the horizontal distance between 2 locations. @@ -2185,7 +2185,7 @@ else if (dLocation.matches(attribute.getContext(1))) { if (attribute.getAttribute(2).startsWith("horizontal")) { // <--[tag] - // @attribute ].horizontal.multiworld> + // @attribute ].horizontal.multiworld> // @returns ElementTag(Decimal) // @description // Returns the horizontal distance between 2 multiworld locations. @@ -2205,7 +2205,7 @@ else if (this.getWorldName().equalsIgnoreCase(toLocation.getWorldName())) { } // <--[tag] - // @attribute ].vertical> + // @attribute ].vertical> // @returns ElementTag(Decimal) // @description // Returns the vertical distance between 2 locations. @@ -2213,7 +2213,7 @@ else if (this.getWorldName().equalsIgnoreCase(toLocation.getWorldName())) { else if (attribute.getAttribute(2).startsWith("vertical")) { // <--[tag] - // @attribute ].vertical.multiworld> + // @attribute ].vertical.multiworld> // @returns ElementTag(Decimal) // @description // Returns the vertical distance between 2 multiworld locations. @@ -2242,7 +2242,7 @@ else if (this.getWorldName().equalsIgnoreCase(toLocation.getWorldName())) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the location is within the world border. @@ -2253,22 +2253,22 @@ else if (this.getWorldName().equalsIgnoreCase(toLocation.getWorldName())) { } // <--[tag] - // @attribute /]> + // @attribute /]> // @returns ElementTag(Boolean) // @description // Returns whether the location is within the cuboid or ellipsoid. // --> if (attribute.startsWith("is_within") && attribute.hasContext(1)) { - if (dEllipsoid.matches(attribute.getContext(1))) { - dEllipsoid ellipsoid = dEllipsoid.valueOf(attribute.getContext(1)); + if (EllipsoidTag.matches(attribute.getContext(1))) { + EllipsoidTag ellipsoid = EllipsoidTag.valueOf(attribute.getContext(1)); if (ellipsoid != null) { return new ElementTag(ellipsoid.contains(this)) .getAttribute(attribute.fulfill(1)); } } else { - dCuboid cuboid = dCuboid.valueOf(attribute.getContext(1)); + CuboidTag cuboid = CuboidTag.valueOf(attribute.getContext(1)); if (cuboid != null) { return new ElementTag(cuboid.isInsideCuboid(this)) .getAttribute(attribute.fulfill(1)); @@ -2282,7 +2282,7 @@ else if (this.getWorldName().equalsIgnoreCase(toLocation.getWorldName())) { ///////////////// // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the formatted biome name at the location. @@ -2293,49 +2293,49 @@ else if (this.getWorldName().equalsIgnoreCase(toLocation.getWorldName())) { } // <--[tag] - // @attribute - // @mechanism dLocation.biome - // @returns dBiome + // @attribute + // @mechanism LocationTag.biome + // @returns BiomeTag // @description // Returns the biome at the location. // --> if (attribute.startsWith("biome")) { - return new dBiome(getBlock().getBiome()) + return new BiomeTag(getBlock().getBiome()) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute - // @returns ListTag(dCuboid) + // @attribute + // @returns ListTag(CuboidTag) // @description - // Returns a ListTag of all notable dCuboids that include this location. + // Returns a ListTag of all notable CuboidTags that include this location. // --> if (attribute.startsWith("cuboids")) { - List cuboids = dCuboid.getNotableCuboidsContaining(this); + List cuboids = CuboidTag.getNotableCuboidsContaining(this); ListTag cuboid_list = new ListTag(); - for (dCuboid cuboid : cuboids) { + for (CuboidTag cuboid : cuboids) { cuboid_list.add(cuboid.identify()); } return cuboid_list.getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute - // @returns ListTag(dCuboid) + // @attribute + // @returns ListTag(CuboidTag) // @description - // Returns a ListTag of all notable dEllipsoids that include this location. + // Returns a ListTag of all notable EllipsoidTags that include this location. // --> if (attribute.startsWith("ellipsoids")) { - List ellipsoids = dEllipsoid.getNotableEllipsoidsContaining(this); + List ellipsoids = EllipsoidTag.getNotableEllipsoidsContaining(this); ListTag ellipsoid_list = new ListTag(); - for (dEllipsoid ellipsoid : ellipsoids) { + for (EllipsoidTag ellipsoid : ellipsoids) { ellipsoid_list.add(ellipsoid.identify()); } return ellipsoid_list.getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the block at the location is a liquid. @@ -2346,7 +2346,7 @@ else if (this.getWorldName().equalsIgnoreCase(toLocation.getWorldName())) { // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the amount of light from light blocks that is @@ -2359,7 +2359,7 @@ else if (this.getWorldName().equalsIgnoreCase(toLocation.getWorldName())) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the amount of light from the sky that is @@ -2372,7 +2372,7 @@ else if (this.getWorldName().equalsIgnoreCase(toLocation.getWorldName())) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the total amount of light on the location. @@ -2383,7 +2383,7 @@ else if (this.getWorldName().equalsIgnoreCase(toLocation.getWorldName())) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the current redstone power level of a block. @@ -2394,10 +2394,10 @@ else if (this.getWorldName().equalsIgnoreCase(toLocation.getWorldName())) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description - // Always returns 'Location' for dLocation objects. All objects fetchable by the Object Fetcher will return the + // Always returns 'Location' for LocationTag objects. All objects fetchable by the Object Fetcher will return the // type of object that is fulfilling this attribute. // --> if (attribute.startsWith("type")) { @@ -2405,9 +2405,9 @@ else if (this.getWorldName().equalsIgnoreCase(toLocation.getWorldName())) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dLocation.command_block_name + // @mechanism LocationTag.command_block_name // @description // Returns the name a command block is set to. // --> @@ -2417,9 +2417,9 @@ else if (this.getWorldName().equalsIgnoreCase(toLocation.getWorldName())) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dLocation.command_block + // @mechanism LocationTag.command_block // @description // Returns the command a command block is set to. // --> @@ -2429,9 +2429,9 @@ else if (this.getWorldName().equalsIgnoreCase(toLocation.getWorldName())) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) - // @mechanism dLocation.furnace_burn_time + // @mechanism LocationTag.furnace_burn_time // @description // Returns the burn time a furnace has left. // --> @@ -2441,9 +2441,9 @@ else if (this.getWorldName().equalsIgnoreCase(toLocation.getWorldName())) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) - // @mechanism dLocation.furnace_cook_time + // @mechanism LocationTag.furnace_cook_time // @description // Returns the cook time a furnace has left. // --> @@ -2453,15 +2453,15 @@ else if (this.getWorldName().equalsIgnoreCase(toLocation.getWorldName())) { } // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @description // Returns the block this block is attached to. // (Only if it is a lever or button!) // --> if (attribute.startsWith("attached_to")) { BlockFace face = BlockFace.SELF; - dMaterial material = new dMaterial(getBlock()); + MaterialTag material = new MaterialTag(getBlock()); if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13_R2) && MaterialSwitchFace.describes(material)) { face = MaterialSwitchFace.getFrom(material).getAttachedTo(); @@ -2473,14 +2473,14 @@ else if (this.getWorldName().equalsIgnoreCase(toLocation.getWorldName())) { } } if (face != BlockFace.SELF) { - return new dLocation(getBlock().getRelative(face).getLocation()) + return new LocationTag(getBlock().getRelative(face).getLocation()) .getAttribute(attribute.fulfill(1)); } } // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @description // If the location is part of a double-block structure // (double chests, doors, beds, etc), returns the location of the other block in the double-block structure. @@ -2502,7 +2502,7 @@ else if (DirectionalBlocksHelper.isRightHalf(getBlock())) { } return null; } - return new dLocation(this.clone().add(direction)).getAttribute(attribute.fulfill(1)); + return new LocationTag(this.clone().add(direction)).getAttribute(attribute.fulfill(1)); } else if (state instanceof Chest) { // There is no remotely sane API for this. @@ -2511,10 +2511,10 @@ else if (state instanceof Chest) { Location left = ((DoubleChest) holder).getLeftSide().getInventory().getLocation(); Location right = ((DoubleChest) holder).getRightSide().getInventory().getLocation(); if (left.getBlockX() == getBlockX() && left.getBlockY() == getBlockY() && left.getBlockZ() == getBlockZ()) { - return new dLocation(right).getAttribute(attribute.fulfill(1)); + return new LocationTag(right).getAttribute(attribute.fulfill(1)); } else { - return new dLocation(left).getAttribute(attribute.fulfill(1)); + return new LocationTag(left).getAttribute(attribute.fulfill(1)); } } } @@ -2526,14 +2526,14 @@ else if (state instanceof Bed if (!isTop) { direction = direction.getOppositeFace(); } - return new dLocation(this.clone().add(direction.getDirection())).getAttribute(attribute.fulfill(1)); + return new LocationTag(this.clone().add(direction.getDirection())).getAttribute(attribute.fulfill(1)); } else if (state.getData() instanceof Door) { if (((Door) state.getData()).isTopHalf()) { - return new dLocation(this.clone().subtract(0, 1, 0)).getAttribute(attribute.fulfill(1)); + return new LocationTag(this.clone().subtract(0, 1, 0)).getAttribute(attribute.fulfill(1)); } else { - return new dLocation(this.clone().add(0, 1, 0)).getAttribute(attribute.fulfill(1)); + return new LocationTag(this.clone().add(0, 1, 0)).getAttribute(attribute.fulfill(1)); } } else { @@ -2549,9 +2549,9 @@ else if (state.getData() instanceof Door) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dLocation.custom_name + // @mechanism LocationTag.custom_name // @description // Returns the custom name of this block. // Only works for nameable blocks, such as chests and dispensers. @@ -2585,64 +2585,64 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dLocation + // @object LocationTag // @name block_facing - // @input dLocation + // @input LocationTag // @description // Sets the facing direction of the block, as a vector. // @tags - // + // // --> - if (mechanism.matches("block_facing") && mechanism.requireObject(dLocation.class)) { - dLocation faceVec = mechanism.valueAsType(dLocation.class); + if (mechanism.matches("block_facing") && mechanism.requireObject(LocationTag.class)) { + LocationTag faceVec = mechanism.valueAsType(LocationTag.class); DirectionalBlocksHelper.setFacing(getBlock(), faceVec.toVector()); } // <--[mechanism] - // @object dLocation + // @object LocationTag // @name block_type - // @input dMaterial + // @input MaterialTag // @description // Sets the type of the block. // @tags - // + // // --> - if (mechanism.matches("block_type") && mechanism.requireObject(dMaterial.class)) { - dMaterial mat = mechanism.valueAsType(dMaterial.class); + if (mechanism.matches("block_type") && mechanism.requireObject(MaterialTag.class)) { + MaterialTag mat = mechanism.valueAsType(MaterialTag.class); mat.getNmsBlockData().setBlock(getBlock(), false); } // <--[mechanism] - // @object dLocation + // @object LocationTag // @name biome - // @input dBiome + // @input BiomeTag // @description // Sets the biome of the block. // @tags - // + // // --> - if (mechanism.matches("biome") && mechanism.requireObject(dBiome.class)) { - mechanism.valueAsType(dBiome.class).getBiome().changeBlockBiome(this); + if (mechanism.matches("biome") && mechanism.requireObject(BiomeTag.class)) { + mechanism.valueAsType(BiomeTag.class).getBiome().changeBlockBiome(this); } // <--[mechanism] - // @object dLocation + // @object LocationTag // @name spawner_type - // @input dEntity + // @input EntityTag // @description // Sets the entity that a mob spawner will spawn. // @tags - // + // // --> - if (mechanism.matches("spawner_type") && mechanism.requireObject(dEntity.class) + if (mechanism.matches("spawner_type") && mechanism.requireObject(EntityTag.class) && getBlockState() instanceof CreatureSpawner) { CreatureSpawner spawner = ((CreatureSpawner) getBlockState()); - spawner.setSpawnedType(mechanism.valueAsType(dEntity.class).getBukkitEntityType()); + spawner.setSpawnedType(mechanism.valueAsType(EntityTag.class).getBukkitEntityType()); spawner.update(); } // <--[mechanism] - // @object dLocation + // @object LocationTag // @name lock // @input Element // @description @@ -2650,9 +2650,9 @@ && getBlockState() instanceof CreatureSpawner) { // Locked containers can only be opened while holding an item with the name of the lock. // Leave blank to remove a container's lock. // @tags - // - // - // + // + // + // // --> if (mechanism.matches("lock") && getBlockState() instanceof Lockable) { BlockState state = getBlockState(); @@ -2661,7 +2661,7 @@ && getBlockState() instanceof CreatureSpawner) { } // <--[mechanism] - // @object dLocation + // @object LocationTag // @name sign_contents // @input ListTag // @description @@ -2669,7 +2669,7 @@ && getBlockState() instanceof CreatureSpawner) { // Note that this takes an escaped list. // See <@link language property escaping>. // @tags - // + // // --> if (mechanism.matches("sign_contents") && getBlockState() instanceof Sign) { Sign state = (Sign) getBlockState(); @@ -2689,7 +2689,7 @@ && getBlockState() instanceof CreatureSpawner) { } // <--[mechanism] - // @object dLocation + // @object LocationTag // @name skull_skin // @input Element(|Element(|Element)) // @description @@ -2698,7 +2698,7 @@ && getBlockState() instanceof CreatureSpawner) { // Optionally, use the second ElementTag for the skin texture cache. // Optionally, use the third ElementTag for a player name. // @tags - // + // // --> if (mechanism.matches("skull_skin")) { final BlockState blockState = getBlockState(); @@ -2735,35 +2735,35 @@ else if (blockState instanceof Skull) { } // <--[mechanism] - // @object dLocation + // @object LocationTag // @name flowerpot_contents - // @input dMaterial + // @input MaterialTag // @description // Sets the contents of a flower pot. // NOTE: Replaced by materials (such as POTTED_CACTUS) in 1.13 and above. // NOTE: Flowerpot contents will not update client-side until players refresh the chunk. - // Refresh a chunk manually with mechanism: refresh_chunk_sections for dChunk objects + // Refresh a chunk manually with mechanism: refresh_chunk_sections for ChunkTag objects // @tags - // + // // --> - if (mechanism.matches("flowerpot_contents") && mechanism.requireObject(dMaterial.class)) { + if (mechanism.matches("flowerpot_contents") && mechanism.requireObject(MaterialTag.class)) { if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13_R2)) { Debug.echoError("As of Minecraft version 1.13 potted flowers each have their own material, such as POTTED_CACTUS."); } else if (getBlock().getType() == Material.FLOWER_POT) { - MaterialData data = mechanism.valueAsType(dMaterial.class).getMaterialData(); + MaterialData data = mechanism.valueAsType(MaterialTag.class).getMaterialData(); NMSHandler.getInstance().getBlockHelper().setFlowerpotContents(getBlock(), data); } } // <--[mechanism] - // @object dLocation + // @object LocationTag // @name command_block_name // @input Element // @description // Sets the name of a command block. // @tags - // + // // --> if (mechanism.matches("command_block_name")) { if (getBlock().getType() == MaterialCompat.COMMAND_BLOCK) { @@ -2774,13 +2774,13 @@ else if (getBlock().getType() == Material.FLOWER_POT) { } // <--[mechanism] - // @object dLocation + // @object LocationTag // @name command_block // @input Element // @description // Sets the command of a command block. // @tags - // + // // --> if (mechanism.matches("command_block")) { if (getBlock().getType() == MaterialCompat.COMMAND_BLOCK) { @@ -2791,14 +2791,14 @@ else if (getBlock().getType() == Material.FLOWER_POT) { } // <--[mechanism] - // @object dLocation + // @object LocationTag // @name custom_name // @input Element // @description // Sets the custom name of the block. // Use no value to reset the block's name. // @tags - // + // // --> if (mechanism.matches("custom_name")) { if (getBlockState() instanceof Nameable) { @@ -2813,13 +2813,13 @@ else if (getBlock().getType() == Material.FLOWER_POT) { } // <--[mechanism] - // @object dLocation + // @object LocationTag // @name furnace_burn_time // @input Element(Number) // @description // Sets the burn time for a furnace in ticks. Maximum is 32767. // @tags - // + // // --> if (mechanism.matches("furnace_burn_time")) { if (MaterialCompat.isFurnace(getBlock().getType())) { @@ -2830,13 +2830,13 @@ else if (getBlock().getType() == Material.FLOWER_POT) { } // <--[mechanism] - // @object dLocation + // @object LocationTag // @name furnace_cook_time // @input Element(Number) // @description // Sets the cook time for a furnace in ticks. Maximum is 32767. // @tags - // + // // --> if (mechanism.matches("furnace_cook_time")) { if (MaterialCompat.isFurnace(getBlock().getType())) { @@ -2847,14 +2847,14 @@ else if (getBlock().getType() == Material.FLOWER_POT) { } // <--[mechanism] - // @object dLocation + // @object LocationTag // @name base_color // @input Element // @description // Changes the base color of the banner at this location. // For the list of possible colors, see <@link url http://bit.ly/1dydq12>. // @tags - // + // // --> if (mechanism.matches("base_color")) { Banner banner = (Banner) getBlockState(); @@ -2863,7 +2863,7 @@ else if (getBlock().getType() == Material.FLOWER_POT) { } // <--[mechanism] - // @object dLocation + // @object LocationTag // @name patterns // @input ListTag // @description @@ -2872,7 +2872,7 @@ else if (getBlock().getType() == Material.FLOWER_POT) { // For the list of possible colors, see <@link url http://bit.ly/1dydq12>. // For the list of possible patterns, see <@link url http://bit.ly/1MqRn7T>. // @tags - // + // // // --> if (mechanism.matches("patterns")) { @@ -2895,13 +2895,13 @@ else if (getBlock().getType() == Material.FLOWER_POT) { } // <--[mechanism] - // @object dLocation + // @object LocationTag // @name head_rotation // @input Element(Number) // @description // Sets the rotation of the head at this location. Must be an integer 1 to 16. // @tags - // + // // --> if (mechanism.matches("head_rotation") && mechanism.requireInteger()) { Skull sk = (Skull) getBlockState(); @@ -2910,7 +2910,7 @@ else if (getBlock().getType() == Material.FLOWER_POT) { } // <--[mechanism] - // @object dLocation + // @object LocationTag // @name generate_tree // @input Element // @description @@ -2927,7 +2927,7 @@ else if (getBlock().getType() == Material.FLOWER_POT) { } // <--[mechanism] - // @object dLocation + // @object LocationTag // @name activate // @input None // @description diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/dMaterial.java b/plugin/src/main/java/com/denizenscript/denizen/objects/MaterialTag.java similarity index 80% rename from plugin/src/main/java/com/denizenscript/denizen/objects/dMaterial.java rename to plugin/src/main/java/com/denizenscript/denizen/objects/MaterialTag.java index 9c6ae89de1..a27894e3c1 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/dMaterial.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/MaterialTag.java @@ -25,13 +25,13 @@ import java.util.HashMap; -public class dMaterial implements ObjectTag, Adjustable { +public class MaterialTag implements ObjectTag, Adjustable { // <--[language] - // @name dMaterial + // @name MaterialTag // @group Object System // @description - // A dMaterial represents a material (a type of block or item). + // A MaterialTag represents a material (a type of block or item). // // For format info, see <@link language m@> // @@ -41,24 +41,24 @@ public class dMaterial implements ObjectTag, Adjustable { // @name m@ // @group Object Fetcher System // @description - // m@ refers to the 'object identifier' of a dMaterial. The 'm@' is notation for Denizen's Object - // Fetcher. The constructor for a dMaterial is the material type name. + // m@ refers to the 'object identifier' of a MaterialTag. The 'm@' is notation for Denizen's Object + // Fetcher. The constructor for a MaterialTag is the material type name. // For example, 'm@stick'. // - // For general info, see <@link language dMaterial> + // For general info, see <@link language MaterialTag> // // --> /** - * Legacy dMaterial identities. + * Legacy MaterialTag identities. */ private String forcedIdentity = null, forcedIdentityLow = null; /** - * Legacy dMaterial identities. Do not use. + * Legacy MaterialTag identities. Do not use. */ - public dMaterial forceIdentifyAs(String string) { + public MaterialTag forceIdentifyAs(String string) { forcedIdentity = string; forcedIdentityLow = CoreUtilities.toLowerCase(string); return this; @@ -70,7 +70,7 @@ public dMaterial forceIdentifyAs(String string) { //////////////// - public static dMaterial valueOf(String string) { + public static MaterialTag valueOf(String string) { return valueOf(string, null); } @@ -81,12 +81,12 @@ public static dMaterial valueOf(String string) { * @return a Material, or null if incorrectly formatted */ @Fetchable("m") - public static dMaterial valueOf(String string, TagContext context) { + public static MaterialTag valueOf(String string, TagContext context) { /////// // Handle objects with properties through the object fetcher if (ObjectFetcher.DESCRIBED_PATTERN.matcher(string).matches()) { - return ObjectFetcher.getObjectFrom(dMaterial.class, string, context); + return ObjectFetcher.getObjectFrom(MaterialTag.class, string, context); } string = string.toUpperCase(); @@ -122,19 +122,19 @@ public static dMaterial valueOf(String string, TagContext context) { } } else if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13_R2)) { - return new dMaterial(m); + return new MaterialTag(m); } return OldMaterialsHelper.getMaterialFrom(m, data); } if (OldMaterialsHelper.all_dMaterials != null) { - dMaterial mat = OldMaterialsHelper.all_dMaterials.get(string); + MaterialTag mat = OldMaterialsHelper.all_dMaterials.get(string); if (mat != null) { if ((context == null || context.debug) && index >= 0) { Debug.log("Material ID and data magic number support is deprecated and WILL be removed in a future release. Use relevant properties instead."); } if (data == 0) { if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13_R2)) { - return new dMaterial(mat.material); + return new MaterialTag(mat.material); } return mat; } @@ -155,7 +155,7 @@ else if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13_R2)) { return null; } - public static dMaterial quickOfNamed(String string) { + public static MaterialTag quickOfNamed(String string) { string = string.toUpperCase(); int index = string.indexOf(','); if (index < 0) { @@ -170,7 +170,7 @@ public static dMaterial quickOfNamed(String string) { if (m != null) { return OldMaterialsHelper.getMaterialFrom(m, data); } - dMaterial mat = OldMaterialsHelper.all_dMaterials.get(string); + MaterialTag mat = OldMaterialsHelper.all_dMaterials.get(string); if (mat != null) { if (data == 0) { return mat; @@ -196,17 +196,17 @@ public static boolean matches(String arg) { } /** - * @param object object-fetchable String of a valid dMaterial, or a dMaterial object - * @return true if the dMaterials are the same. + * @param object object-fetchable String of a valid MaterialTag, or a MaterialTag object + * @return true if the MaterialTags are the same. */ @Override public boolean equals(Object object) { - if (object instanceof dMaterial) { - return getMaterial() == ((dMaterial) object).getMaterial() - && getData((byte) 0) == ((dMaterial) object).getData((byte) 0); + if (object instanceof MaterialTag) { + return getMaterial() == ((MaterialTag) object).getMaterial() + && getData((byte) 0) == ((MaterialTag) object).getData((byte) 0); } else { - dMaterial parsed = valueOf(object.toString()); + MaterialTag parsed = valueOf(object.toString()); return equals(parsed); } } @@ -226,7 +226,7 @@ public boolean matchesBlock(Block b) { /** * Legacy material format. Do not use. */ - public dMaterial(Material material, int data) { + public MaterialTag(Material material, int data) { this.material = material; if (data < 0) { this.data = null; @@ -240,11 +240,11 @@ public dMaterial(Material material, int data) { } } - public dMaterial(Material material) { + public MaterialTag(Material material) { this(material, 0); } - public dMaterial(BlockState state) { + public MaterialTag(BlockState state) { this.material = state.getType(); if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13_R2)) { this.modernData = new ModernBlockData(state); @@ -254,7 +254,7 @@ public dMaterial(BlockState state) { } } - public dMaterial(BlockData block) { + public MaterialTag(BlockData block) { if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13_R2)) { this.modernData = block.modern(); this.material = modernData.getMaterial(); @@ -265,7 +265,7 @@ public dMaterial(BlockData block) { } } - public dMaterial(Block block) { + public MaterialTag(Block block) { if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13_R2)) { this.modernData = new ModernBlockData(block); this.material = modernData.getMaterial(); @@ -276,7 +276,7 @@ public dMaterial(Block block) { } } - public dMaterial(ModernBlockData data) { + public MaterialTag(ModernBlockData data) { this.modernData = data; this.material = data.getMaterial(); } @@ -465,7 +465,7 @@ public static void registerTags() { @Override public String run(Attribute attribute, ObjectTag object) { Debug.echoError("Material ID and data magic number support is deprecated and WILL be removed in a future release. Use material names instead."); - return new ElementTag(((dMaterial) object).material.getId()) + return new ElementTag(((MaterialTag) object).material.getId()) .getAttribute(attribute.fulfill(1)); } }); @@ -476,19 +476,19 @@ public String run(Attribute attribute, ObjectTag object) { if (attribute.context == null || attribute.context.debug) { Debug.log("Material ID and data magic number support is deprecated and WILL be removed in a future release. Use relevant properties instead."); } - return new ElementTag(((dMaterial) object).getData()) + return new ElementTag(((MaterialTag) object).getData()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group properties // @description // Returns whether the material is an ageable material. - // When this returns true, <@link tag m@material.age>, <@link tag m@material.maximum_age>, - // and <@link mechanism dMaterial.age> are accessible. + // When this returns true, <@link tag MaterialTag.age>, <@link tag MaterialTag.maximum_age>, + // and <@link mechanism MaterialTag.age> are accessible. // --> registerTag("is_ageable", new TagRunnable() { @Override @@ -507,13 +507,13 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group properties // @description // Returns whether the material is a is_directional material. - // When this returns true, <@link tag m@material.direction>, <@link tag m@material.valid_directions>, - // and <@link mechanism dMaterial.direction> are accessible. + // When this returns true, <@link tag MaterialTag.direction>, <@link tag MaterialTag.valid_directions>, + // and <@link mechanism MaterialTag.direction> are accessible. // --> registerTag("is_bisected", new TagRunnable() { @Override @@ -524,13 +524,13 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group properties // @description // Returns whether the material is a bisected material. - // When this returns true, <@link tag m@material.half>, - // and <@link mechanism dMaterial.half> are accessible. + // When this returns true, <@link tag MaterialTag.half>, + // and <@link mechanism MaterialTag.half> are accessible. // --> registerTag("is_bisected", new TagRunnable() { @Override @@ -541,13 +541,13 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group properties // @description // Returns whether the material is a levelable material. - // When this returns true, <@link tag m@material.level>, <@link tag m@material.maximum_level>, - // and <@link mechanism dMaterial.level> are accessible. + // When this returns true, <@link tag MaterialTag.level>, <@link tag MaterialTag.maximum_level>, + // and <@link mechanism MaterialTag.level> are accessible. // --> registerTag("is_levelable", new TagRunnable() { @Override @@ -558,7 +558,7 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the material is affected by gravity. @@ -566,13 +566,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("has_gravity", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dMaterial) object).material.hasGravity()) + return new ElementTag(((MaterialTag) object).material.hasGravity()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the material is a placeable block. @@ -580,13 +580,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("is_block", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dMaterial) object).material.isBlock()) + return new ElementTag(((MaterialTag) object).material.isBlock()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the material is a block that can burn away. @@ -594,13 +594,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("is_burnable", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dMaterial) object).material.isBurnable()) + return new ElementTag(((MaterialTag) object).material.isBurnable()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the material is edible. @@ -608,13 +608,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("is_edible", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dMaterial) object).material.isEdible()) + return new ElementTag(((MaterialTag) object).material.isEdible()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the material is a block that can catch fire. @@ -622,13 +622,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("is_flammable", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dMaterial) object).material.isFlammable()) + return new ElementTag(((MaterialTag) object).material.isFlammable()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the material is a block that completely blocks vision. @@ -636,13 +636,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("is_occluding", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dMaterial) object).material.isOccluding()) + return new ElementTag(((MaterialTag) object).material.isOccluding()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the material is a playable music disc. @@ -650,13 +650,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("is_record", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dMaterial) object).material.isRecord()) + return new ElementTag(((MaterialTag) object).material.isRecord()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the material is a block that is solid (cannot be walked through). @@ -664,13 +664,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("is_solid", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dMaterial) object).material.isSolid()) + return new ElementTag(((MaterialTag) object).material.isSolid()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the material is a block that does not block any light. @@ -678,13 +678,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("is_transparent", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dMaterial) object).material.isTransparent()) + return new ElementTag(((MaterialTag) object).material.isTransparent()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the maximum durability of this material. @@ -692,22 +692,22 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("max_durability", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dMaterial) object).material.getMaxDurability()) + return new ElementTag(((MaterialTag) object).material.getMaxDurability()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) - // @mechanism dMaterial.block_resistance + // @mechanism MaterialTag.block_resistance // @description // Returns the explosion resistance for all blocks of this material type. // --> registerTag("block_resistance", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - dMaterial material = (dMaterial) object; + MaterialTag material = (MaterialTag) object; if (!NMSHandler.getInstance().getBlockHelper().hasBlock(material.getMaterial())) { Debug.echoError("Provided material does not have a placeable block."); return null; @@ -718,7 +718,7 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @description // Returns the value representing how hard a material, used as a basis for calculating the time it takes to break. @@ -726,7 +726,7 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("hardness", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - dMaterial material = (dMaterial) object; + MaterialTag material = (MaterialTag) object; if (!material.getMaterial().isBlock()) { Debug.echoError("Provided material does not have a placeable block."); return null; @@ -737,7 +737,7 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the maximum amount of this material that can be held in a stack. @@ -745,13 +745,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("max_stack_size", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dMaterial) object).material.getMaxStackSize()) + return new ElementTag(((MaterialTag) object).material.getMaxStackSize()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Boolean) // @description // Returns true if the material is a variety of the specified material. @@ -761,14 +761,14 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("is_made_of", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - dMaterial compared = dMaterial.valueOf(attribute.getContext(1)); - return new ElementTag(compared != null && ((dMaterial) object).material == compared.getMaterial()) + MaterialTag compared = MaterialTag.valueOf(attribute.getContext(1)); + return new ElementTag(compared != null && ((MaterialTag) object).material == compared.getMaterial()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the bukkit Material enum value. For example: @@ -778,13 +778,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("bukkit_enum", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dMaterial) object).material.name()) + return new ElementTag(((MaterialTag) object).material.name()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the name of the material. @@ -792,14 +792,14 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("name", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dMaterial) object).forcedIdentity != null ? ((dMaterial) object).forcedIdentityLow : - CoreUtilities.toLowerCase(((dMaterial) object).material.name())) + return new ElementTag(((MaterialTag) object).forcedIdentity != null ? ((MaterialTag) object).forcedIdentityLow : + CoreUtilities.toLowerCase(((MaterialTag) object).material.name())) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the material's full identification. @@ -808,28 +808,28 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("full", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - if (((dMaterial) object).hasData()) { - return new ElementTag(((dMaterial) object).identifyFull()) + if (((MaterialTag) object).hasData()) { + return new ElementTag(((MaterialTag) object).identifyFull()) .getAttribute(attribute.fulfill(1)); } else { - return new ElementTag(((dMaterial) object).identify()) + return new ElementTag(((MaterialTag) object).identify()) .getAttribute(attribute.fulfill(1)); } } }); // <--[tag] - // @attribute - // @returns dItem + // @attribute + // @returns ItemTag // @description // Returns an item of the material. // --> registerTag("item", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - dMaterial material = (dMaterial) object; - dItem item = new dItem(material, 1); + MaterialTag material = (MaterialTag) object; + ItemTag item = new ItemTag(material, 1); attribute = attribute.fulfill(1); if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13_R2)) { // Special patch for older material-item tags. @@ -850,10 +850,10 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description - // Always returns 'Material' for dMaterial objects. All objects fetchable by the Object Fetcher will return the + // Always returns 'Material' for MaterialTag objects. All objects fetchable by the Object Fetcher will return the // type of object that is fulfilling this attribute. // --> registerTag("type", new TagRunnable() { @@ -908,13 +908,13 @@ public void applyProperty(Mechanism mechanism) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dMaterial + // @object MaterialTag // @name block_resistance // @input Element(Decimal) // @description // Sets the explosion resistance for all blocks of this material type. // @tags - // + // // --> if (!mechanism.isProperty && mechanism.matches("block_resistance") && mechanism.requireFloat()) { if (!NMSHandler.getInstance().getBlockHelper().setBlockResistance(material, mechanism.getValue().asFloat())) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/dNPC.java b/plugin/src/main/java/com/denizenscript/denizen/objects/NPCTag.java similarity index 86% rename from plugin/src/main/java/com/denizenscript/denizen/objects/dNPC.java rename to plugin/src/main/java/com/denizenscript/denizen/objects/NPCTag.java index 409d4958b2..1f7951a001 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/dNPC.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/NPCTag.java @@ -44,13 +44,13 @@ import java.util.Map; import java.util.regex.Pattern; -public class dNPC implements ObjectTag, Adjustable, InventoryHolder, EntityFormObject { +public class NPCTag implements ObjectTag, Adjustable, InventoryHolder, EntityFormObject { // <--[language] - // @name dNPC + // @name NPCTag // @group Object System // @description - // A dNPC represents an NPC configured through Citizens. + // A NPCTag represents an NPC configured through Citizens. // // For format info, see <@link language n@> // @@ -60,29 +60,29 @@ public class dNPC implements ObjectTag, Adjustable, InventoryHolder, EntityFormO // @name n@ // @group Object Fetcher System // @description - // n@ refers to the 'object identifier' of a dNPC. The 'n@' is notation for Denizen's Object - // Fetcher. The constructor for a dNPC is the NPC's id number. + // n@ refers to the 'object identifier' of a NPCTag. The 'n@' is notation for Denizen's Object + // Fetcher. The constructor for a NPCTag is the NPC's id number. // For example, 'n@5'. // - // For general info, see <@link language dNPC> + // For general info, see <@link language NPCTag> // // --> - public static dNPC mirrorCitizensNPC(NPC npc) { - return new dNPC(npc); + public static NPCTag mirrorCitizensNPC(NPC npc) { + return new NPCTag(npc); } - public static dNPC fromEntity(Entity entity) { + public static NPCTag fromEntity(Entity entity) { return mirrorCitizensNPC(CitizensAPI.getNPCRegistry().getNPC(entity)); } - public static dNPC valueOf(String string) { + public static NPCTag valueOf(String string) { return valueOf(string, null); } @Fetchable("n") - public static dNPC valueOf(String string, TagContext context) { + public static NPCTag valueOf(String string, TagContext context) { if (string == null) { return null; } @@ -97,7 +97,7 @@ public static dNPC valueOf(String string, TagContext context) { npc = CitizensAPI.getNPCRegistry().getById(id); if (npc != null) { - return new dNPC(npc); + return new NPCTag(npc); } } @@ -109,7 +109,7 @@ public static dNPC valueOf(String string, TagContext context) { if (context == null || context.debug) { Debug.echoError("Warning: loading NPC by name - use the ID instead! NPC named '" + test.getName() + "' has ID: " + test.getId()); } - return new dNPC(test); + return new NPCTag(test); } } } @@ -151,7 +151,7 @@ public boolean isValid() { private int npcid = -1; private final org.bukkit.Location locationCache = new org.bukkit.Location(null, 0, 0, 0); - public dNPC(NPC citizensNPC) { + public NPCTag(NPC citizensNPC) { if (citizensNPC != null) { this.npcid = citizensNPC.getId(); } @@ -200,12 +200,12 @@ public LivingEntity getLivingEntity() { @Override - public dEntity getDenizenEntity() { + public EntityTag getDenizenEntity() { try { - return new dEntity(getCitizen().getEntity()); + return new EntityTag(getCitizen().getEntity()); } catch (NullPointerException e) { - Debug.log("Uh oh! Denizen has encountered a NPE while trying to fetch an NPC dEntity. " + + Debug.log("Uh oh! Denizen has encountered a NPE while trying to fetch an NPC EntityTag. " + "Has this NPC been removed?"); return null; } @@ -216,8 +216,8 @@ public Inventory getInventory() { return DenizenNPCHelper.getInventory(getCitizen()); } - public dInventory getDenizenInventory() { - return new dInventory(this); + public InventoryTag getDenizenInventory() { + return new InventoryTag(this); } public EntityType getEntityType() { @@ -236,11 +236,11 @@ public String getName() { return getCitizen().getName(); } - public InteractScriptContainer getInteractScript(dPlayer player, Class triggerType) { + public InteractScriptContainer getInteractScript(PlayerTag player, Class triggerType) { return InteractScriptHelper.getInteractScript(this, player, triggerType); } - public InteractScriptContainer getInteractScriptQuietly(dPlayer player, Class triggerType) { + public InteractScriptContainer getInteractScriptQuietly(PlayerTag player, Class triggerType) { boolean db = Debug.showDebug; Debug.showDebug = false; InteractScriptContainer script = InteractScriptHelper.getInteractScript(this, player, triggerType); @@ -252,24 +252,24 @@ public void destroy() { getCitizen().destroy(); } - public dLocation getLocation() { + public LocationTag getLocation() { if (isSpawned()) { - return new dLocation(getEntity().getLocation()); + return new LocationTag(getEntity().getLocation()); } else { - return new dLocation(getCitizen().getStoredLocation()); + return new LocationTag(getCitizen().getStoredLocation()); } } - public dLocation getEyeLocation() { + public LocationTag getEyeLocation() { if (isSpawned() && getCitizen().getEntity() instanceof LivingEntity) { - return new dLocation(((LivingEntity) getCitizen().getEntity()).getEyeLocation()); + return new LocationTag(((LivingEntity) getCitizen().getEntity()).getEyeLocation()); } else if (isSpawned()) { - return new dLocation(getEntity().getLocation()); + return new LocationTag(getEntity().getLocation()); } else { - return new dLocation(getCitizen().getStoredLocation()); + return new LocationTag(getCitizen().getStoredLocation()); } } @@ -375,12 +375,12 @@ public TriggerTrait getTriggerTrait() { return npc.getTrait(TriggerTrait.class); } - public String action(String actionName, dPlayer player, Map context) { + public String action(String actionName, PlayerTag player, Map context) { if (getCitizen() != null) { if (getCitizen().hasTrait(AssignmentTrait.class)) // Return the result from the ActionHandler { - return DenizenAPI.getCurrentInstance().getNPCRegistry() + return DenizenAPI.getCurrentInstance().getNPCHelper() .getActionHandler().doAction( actionName, this, @@ -393,7 +393,7 @@ public String action(String actionName, dPlayer player, Map c return "none"; } - public String action(String actionName, dPlayer player) { + public String action(String actionName, PlayerTag player) { return action(actionName, player, null); } @@ -430,7 +430,7 @@ public String identifySimple() { } @Override - public dNPC setPrefix(String prefix) { + public NPCTag setPrefix(String prefix) { return this; } @@ -439,10 +439,10 @@ public boolean equals(Object o) { if (o == null) { return false; } - if (!(o instanceof dNPC)) { + if (!(o instanceof NPCTag)) { return false; } - return getId() == ((dNPC) o).getId(); + return getId() == ((NPCTag) o).getId(); } @Override @@ -457,24 +457,24 @@ public String getAttribute(Attribute attribute) { return null; } - // Defined in dEntity + // Defined in EntityTag if (attribute.startsWith("is_npc")) { return new ElementTag(true).getAttribute(attribute.fulfill(1)); } - // Defined in dEntity + // Defined in EntityTag if (attribute.startsWith("location") && !isSpawned()) { return getLocation().getAttribute(attribute.fulfill(1)); } - // Defined in dEntity + // Defined in EntityTag if (attribute.startsWith("eye_location")) { return getEyeLocation().getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns true if the NPC has a nickname. @@ -486,7 +486,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the NPC's display name. @@ -497,7 +497,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the name of the NPC. @@ -508,7 +508,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ListTag // @description // Returns a list of all of the NPC's traits. @@ -522,7 +522,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Boolean) // @description // Returns whether the NPC has a specified trait. @@ -538,7 +538,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the NPC is pushable. @@ -548,7 +548,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Boolean) // @description // Returns whether the NPC has a specified trigger. @@ -564,7 +564,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ListTag // @description // Returns a list of anchor names currently assigned to the NPC. @@ -579,7 +579,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the NPC has anchors assigned. @@ -590,22 +590,22 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ]> - // @returns dLocation + // @attribute ]> + // @returns LocationTag // @description // Returns the location associated with the specified anchor, or null if it doesn't exist. // --> if (attribute.startsWith("anchor")) { if (attribute.hasContext(1) && getCitizen().getTrait(Anchors.class).getAnchor(attribute.getContext(1)) != null) { - return new dLocation(getCitizen().getTrait(Anchors.class) + return new LocationTag(getCitizen().getTrait(Anchors.class) .getAnchor(attribute.getContext(1)).getLocation()) .getAttribute(attribute.fulfill(1)); } } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Boolean) // @description // Returns true if the NPC has the specified flag, otherwise returns false. @@ -622,7 +622,7 @@ && getCitizen().getTrait(Anchors.class).getAnchor(attribute.getContext(1)) != nu } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns Flag ListTag // @description // Returns the specified flag from the NPC. @@ -653,7 +653,7 @@ && getCitizen().getTrait(Anchors.class).getAnchor(attribute.getContext(1)) != nu } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ListTag // @description // Returns a list of an NPC's flag names, with an optional search for @@ -692,7 +692,7 @@ && getCitizen().getTrait(Anchors.class).getAnchor(attribute.getContext(1)) != nu } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag // @description // Returns the specified constant from the NPC. @@ -711,7 +711,7 @@ && getCitizen().getTrait(ConstantsTrait.class).getConstant(attribute.getContext( } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Boolean) // @description // Returns true if the NPC has the specified pose, otherwise returns false. @@ -727,16 +727,16 @@ && getCitizen().getTrait(ConstantsTrait.class).getConstant(attribute.getContext( } // <--[tag] - // @attribute ]> - // @returns dLocation + // @attribute ]> + // @returns LocationTag // @description - // Returns the pose as a dLocation with x, y, and z set to 0, and the world set to the first + // Returns the pose as a LocationTag with x, y, and z set to 0, and the world set to the first // possible available world Bukkit knows about. // --> if (attribute.startsWith("pose") || attribute.startsWith("get_pose")) { if (attribute.hasContext(1)) { Pose pose = getCitizen().getTrait(Poses.class).getPose(attribute.getContext(1)); - return new dLocation(org.bukkit.Bukkit.getWorlds().get(0), 0, 0, 0, pose.getYaw(), pose.getPitch()) + return new LocationTag(org.bukkit.Bukkit.getWorlds().get(0), 0, 0, 0, pose.getYaw(), pose.getPitch()) .getAttribute(attribute.fulfill(1)); } else { @@ -745,7 +745,7 @@ && getCitizen().getTrait(ConstantsTrait.class).getConstant(attribute.getContext( } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the NPC is currently sneaking. Only works for player-type NPCs. @@ -757,7 +757,7 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the NPC is currently engaged. @@ -768,7 +768,7 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the NPC is currently invulnerable. @@ -779,7 +779,7 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the NPC's ID number. @@ -789,16 +789,16 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute - // @returns dPlayer/Element + // @attribute + // @returns PlayerTag/Element // @description - // Returns the owner of the NPC as a dPlayer if it's a player, otherwise as just the name. + // Returns the owner of the NPC as a PlayerTag if it's a player, otherwise as just the name. // --> if (attribute.startsWith("owner")) { String owner = getOwner(); - dPlayer player = null; + PlayerTag player = null; if (!owner.equalsIgnoreCase("server")) { - player = dPlayer.valueOfInternal(owner, false); + player = PlayerTag.valueOfInternal(owner, false); } if (player != null) { return player.getAttribute(attribute.fulfill(1)); @@ -809,7 +809,7 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns whether the NPC has a custom skinskin. @@ -819,7 +819,7 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the NPC's custom skin blob, if any. @@ -836,7 +836,7 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the NPC's custom skin, if any. @@ -848,17 +848,17 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute - // @returns dInventory + // @attribute + // @returns InventoryTag // @description - // Returns the dInventory of the NPC. + // Returns the InventoryTag of the NPC. // --> if (attribute.startsWith("inventory")) { return getDenizenInventory().getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the NPC is spawned. @@ -868,7 +868,7 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the NPC is protected. @@ -878,7 +878,7 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns the NPC's "lookclose" mechanism.getValue(). @@ -896,8 +896,8 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @description // Returns the NPC's previous navigated location. // --> @@ -908,9 +908,9 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute - // @returns dLocation - // @mechanism dNPC.teleport_on_stuck + // @attribute + // @returns LocationTag + // @mechanism NPCTag.teleport_on_stuck // @description // Returns whether the NPC teleports when it is stuck. // --> @@ -920,7 +920,7 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns true if the NPC has an assignment script. @@ -932,7 +932,7 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute + // @attribute // @returns ScriptTag // @description // Returns the NPC's assigned script. @@ -949,7 +949,7 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the NPC is currently navigating. @@ -959,7 +959,7 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the current speed of the NPC. @@ -970,7 +970,7 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the maximum pathfinding range. @@ -981,7 +981,7 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the maximum attack range. @@ -992,7 +992,7 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the NPC's attack strategy. @@ -1003,7 +1003,7 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the NPC movement speed modifier. @@ -1014,7 +1014,7 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the base navigation speed. @@ -1025,7 +1025,7 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the NPC will avoid water. @@ -1036,19 +1036,19 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @description // Returns the location the NPC is curently navigating towards. // --> if (attribute.startsWith("navigator.target_location")) { return (getNavigator().getTargetAsLocation() != null - ? new dLocation(getNavigator().getTargetAsLocation()).getAttribute(attribute.fulfill(2)) + ? new LocationTag(getNavigator().getTargetAsLocation()).getAttribute(attribute.fulfill(2)) : null); } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the NPC is in combat. @@ -1059,7 +1059,7 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the entity type of the target. @@ -1073,22 +1073,22 @@ && isSpawned() && getEntity() instanceof Player) { } // <--[tag] - // @attribute - // @returns dEntity + // @attribute + // @returns EntityTag // @description // Returns the entity being targeted. // --> if (attribute.startsWith("navigator.target_entity")) { return (getNavigator().getEntityTarget() != null && getNavigator().getEntityTarget().getTarget() != null - ? new dEntity(getNavigator().getEntityTarget().getTarget()).getAttribute(attribute.fulfill(2)) + ? new EntityTag(getNavigator().getEntityTarget().getTarget()).getAttribute(attribute.fulfill(2)) : null); } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description - // Always returns 'NPC' for dNPC objects. All objects fetchable by the Object Fetcher will return the + // Always returns 'NPC' for NPCTag objects. All objects fetchable by the Object Fetcher will return the // type of object that is fulfilling this attribute. // --> if (attribute.startsWith("type")) { @@ -1101,7 +1101,7 @@ && isSpawned() && getEntity() instanceof Player) { } return (getEntity() != null - ? new dEntity(this).getAttribute(attribute) + ? new EntityTag(this).getAttribute(attribute) : new ElementTag(identify()).getAttribute(attribute)); } @@ -1116,105 +1116,105 @@ public void adjust(Mechanism mechanism) { // TODO: For all the mechanism tags, add the @Mechanism link! // <--[mechanism] - // @object dNPC + // @object NPCTag // @name set_assignment - // @input dScript + // @input ScriptTag // @description // Sets the NPC's assignment script. // @tags - // + // // --> if (mechanism.matches("set_assignment") && mechanism.requireObject(ScriptTag.class)) { getAssignmentTrait().setAssignment(mechanism.valueAsType(ScriptTag.class).getName(), null); } // <--[mechanism] - // @object dNPC + // @object NPCTag // @name remove_assignment // @input none // @description // Removes the NPC's assigment script. // @tags - // + // // --> if (mechanism.matches("remove_assignment")) { getAssignmentTrait().removeAssignment(null); } // <--[mechanism] - // @object dNPC + // @object NPCTag // @name set_nickname // @input Element // @description // Sets the NPC's nickname. // @tags - // + // // --> if (mechanism.matches("set_nickname")) { getNicknameTrait().setNickname(mechanism.getValue().asString()); } // <--[mechanism] - // @object dNPC + // @object NPCTag // @name remove_nickname // @input none // @description // Removes the NPC's nickname. // @tags - // + // // --> if (mechanism.matches("remove_nickname")) { getNicknameTrait().removeNickname(); } // <--[mechanism] - // @object dNPC + // @object NPCTag // @name set_entity_type - // @input dEntity + // @input EntityTag // @description // Sets the NPC's entity type. // @tags - // + // // --> - if (mechanism.matches("set_entity_type") && mechanism.requireObject(dEntity.class)) { - getCitizen().setBukkitEntityType(mechanism.valueAsType(dEntity.class).getBukkitEntityType()); + if (mechanism.matches("set_entity_type") && mechanism.requireObject(EntityTag.class)) { + getCitizen().setBukkitEntityType(mechanism.valueAsType(EntityTag.class).getBukkitEntityType()); } // <--[mechanism] - // @object dNPC + // @object NPCTag // @name name // @input Element // @description // Sets the name of the NPC. // @tags - // + // // --> if (mechanism.matches("name") || mechanism.matches("set_name")) { getCitizen().setName(mechanism.getValue().asString().length() > 64 ? mechanism.getValue().asString().substring(0, 64) : mechanism.getValue().asString()); } // <--[mechanism] - // @object dNPC + // @object NPCTag // @name owner // @input Element // @description // Sets the owner of the NPC. // @tags - // + // // --> if (mechanism.matches("owner")) { getCitizen().getTrait(Owner.class).setOwner(mechanism.getValue().asString()); } // <--[mechanism] - // @object dNPC + // @object NPCTag // @name skin_blob // @input Element // @description // Sets the skin blob of an NPC, in the form of "texture;signature;name". // Call with no value to clear the mechanism.getValue(). // @tags - // + // // --> if (mechanism.matches("skin_blob")) { if (!mechanism.hasValue()) { @@ -1242,14 +1242,14 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dNPC + // @object NPCTag // @name skin // @input Element // @description // Sets the skin of an NPC by name. // Call with no value to clear the mechanism.getValue(). // @tags - // + // // --> if (mechanism.matches("skin")) { if (!mechanism.hasValue()) { @@ -1265,16 +1265,16 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dNPC + // @object NPCTag // @name item_type - // @input dItem + // @input ItemTag // @description // Sets the item type of the item. // @tags // None // --> - if (mechanism.matches("item_type") && mechanism.requireObject(dItem.class)) { - dItem item = mechanism.valueAsType(dItem.class); + if (mechanism.matches("item_type") && mechanism.requireObject(ItemTag.class)) { + ItemTag item = mechanism.valueAsType(ItemTag.class); Material mat = item.getMaterial().getMaterial(); int data = item.getMaterial().getData((byte) 0); switch (getEntity().getType()) { @@ -1300,18 +1300,18 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dNPC + // @object NPCTag // @name spawn - // @input dLocation + // @input LocationTag // @description // Spawns the NPC at a location. If no location is specified, the NPC will spawn // at its last known location. // @tags - // + // // --> if (mechanism.matches("spawn")) { - if (mechanism.requireObject("Invalid dLocation specified. Assuming last known NPC location.", dLocation.class)) { - getCitizen().spawn(mechanism.valueAsType(dLocation.class)); + if (mechanism.requireObject("Invalid LocationTag specified. Assuming last known NPC location.", LocationTag.class)) { + getCitizen().spawn(mechanism.valueAsType(LocationTag.class)); } else { getCitizen().spawn(getCitizen().getStoredLocation()); @@ -1319,65 +1319,65 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dNPC + // @object NPCTag // @name range // @input Element(Decimal) // @description // Sets the maximum movement distance of the NPC. // @tags - // + // // --> if (mechanism.matches("range") && mechanism.requireFloat()) { getCitizen().getNavigator().getDefaultParameters().range(mechanism.getValue().asFloat()); } // <--[mechanism] - // @object dNPC + // @object NPCTag // @name attack_range // @input Element(Decimal) // @description // Sets the maximum attack distance of the NPC. // @tags - // + // // --> if (mechanism.matches("attack_range") && mechanism.requireFloat()) { getCitizen().getNavigator().getDefaultParameters().attackRange(mechanism.getValue().asFloat()); } // <--[mechanism] - // @object dNPC + // @object NPCTag // @name speed // @input Element(Decimal) // @description // Sets the movement speed of the NPC. // @tags - // + // // --> if (mechanism.matches("speed") && mechanism.requireFloat()) { getCitizen().getNavigator().getDefaultParameters().speedModifier(mechanism.getValue().asFloat()); } // <--[mechanism] - // @object dNPC + // @object NPCTag // @name despawn // @input none // @description // Despawns the NPC. // @tags - // + // // --> if (mechanism.matches("despawn")) { getCitizen().despawn(DespawnReason.PLUGIN); } // <--[mechanism] - // @object dNPC + // @object NPCTag // @name set_sneaking // @input Element(Boolean) // @description // Sets whether the NPC is sneaking or not. Only works for player-type NPCs. // @tags - // + // // --> if (mechanism.matches("set_sneaking") && mechanism.requireBoolean()) { if (!getCitizen().hasTrait(SneakingTrait.class)) { @@ -1393,39 +1393,39 @@ else if (!trait.isSneaking() && mechanism.getValue().asBoolean()) { } // <--[mechanism] - // @object dNPC + // @object NPCTag // @name set_protected // @input Element(Boolean) // @description // Sets whether or not the NPC is protected. // @tags - // + // // --> if (mechanism.matches("set_protected") && mechanism.requireBoolean()) { getCitizen().setProtected(mechanism.getValue().asBoolean()); } // <--[mechanism] - // @object dNPC + // @object NPCTag // @name lookclose // @input Element(Boolean) // @description // Sets the NPC's lookclose mechanism.getValue(). // @tags - // + // // --> if (mechanism.matches("lookclose") && mechanism.requireBoolean()) { getLookCloseTrait().lookClose(mechanism.getValue().asBoolean()); } // <--[mechanism] - // @object dNPC + // @object NPCTag // @name teleport_on_stuck // @input Element(Boolean) // @description // Sets whether the NPC teleports when it is stuck. // @tags - // + // // --> if (mechanism.matches("teleport_on_stuck") && mechanism.requireBoolean()) { if (mechanism.getValue().asBoolean()) { @@ -1437,7 +1437,7 @@ else if (!trait.isSneaking() && mechanism.getValue().asBoolean()) { } // <--[mechanism] - // @object dNPC + // @object NPCTag // @name set_distance // @input Element(Decimal) // @description @@ -1450,7 +1450,7 @@ else if (!trait.isSneaking() && mechanism.getValue().asBoolean()) { } // <--[mechanism] - // @object dNPC + // @object NPCTag // @name name_visible // @input Element // @description @@ -1463,7 +1463,7 @@ else if (!trait.isSneaking() && mechanism.getValue().asBoolean()) { } // <--[mechanism] - // @object dNPC + // @object NPCTag // @name clear_waypoints // @input None // @description @@ -1489,35 +1489,35 @@ else if ((wp.getCurrentProvider() instanceof WanderWaypointProvider)) { } // <--[mechanism] - // @object dNPC + // @object NPCTag // @name add_waypoint - // @input dLocation + // @input LocationTag // @description // Add a waypoint location to the NPC's path. // @tags // TODO // --> - if (mechanism.matches("add_waypoint") && mechanism.requireObject(dLocation.class)) { + if (mechanism.matches("add_waypoint") && mechanism.requireObject(LocationTag.class)) { if (!getCitizen().hasTrait(Waypoints.class)) { getCitizen().addTrait(Waypoints.class); } Waypoints wp = getCitizen().getTrait(Waypoints.class); if ((wp.getCurrentProvider() instanceof WaypointProvider.EnumerableWaypointProvider)) { ((List) ((WaypointProvider.EnumerableWaypointProvider) wp.getCurrentProvider()).waypoints()) - .add(new Waypoint(mechanism.valueAsType(dLocation.class))); + .add(new Waypoint(mechanism.valueAsType(LocationTag.class))); } else if ((wp.getCurrentProvider() instanceof WanderWaypointProvider)) { ((WanderWaypointProvider) wp.getCurrentProvider()).getRegionCentres() - .add(mechanism.valueAsType(dLocation.class)); + .add(mechanism.valueAsType(LocationTag.class)); } } CoreUtilities.autoPropertyMechanism(this, mechanism); - // Pass along to dEntity mechanism handler if not already handled. + // Pass along to EntityTag mechanism handler if not already handled. if (!mechanism.fulfilled()) { if (isSpawned()) { - new dEntity(getEntity()).adjust(mechanism); + new EntityTag(getEntity()).adjust(mechanism); } } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/dPlayer.java b/plugin/src/main/java/com/denizenscript/denizen/objects/PlayerTag.java similarity index 85% rename from plugin/src/main/java/com/denizenscript/denizen/objects/dPlayer.java rename to plugin/src/main/java/com/denizenscript/denizen/objects/PlayerTag.java index 78e9892a95..2ae6071978 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/dPlayer.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/PlayerTag.java @@ -46,14 +46,14 @@ import java.util.UUID; import java.util.regex.Pattern; -public class dPlayer implements ObjectTag, Adjustable, EntityFormObject { +public class PlayerTag implements ObjectTag, Adjustable, EntityFormObject { // <--[language] - // @name dPlayer + // @name PlayerTag // @group Object System // @description - // A dPlayer represents a player in the game. + // A PlayerTag represents a player in the game. // // For format info, see <@link language p@> // @@ -64,19 +64,19 @@ public class dPlayer implements ObjectTag, Adjustable, EntityFormObject { ///////////////// - public static dPlayer mirrorBukkitPlayer(OfflinePlayer player) { + public static PlayerTag mirrorBukkitPlayer(OfflinePlayer player) { if (player == null) { return null; } else { - return new dPlayer(player); + return new PlayerTag(player); } } static Map playerNames = new HashMap<>(); /** - * Notes that the player exists, for easy dPlayer valueOf handling. + * Notes that the player exists, for easy PlayerTag valueOf handling. */ public static void notePlayer(OfflinePlayer player) { if (player.getName() == null) { @@ -105,31 +105,31 @@ public static Map getAllPlayers() { // @name p@ // @group Object Fetcher System // @description - // p@ refers to the 'object identifier' of a dPlayer. The 'p@' is notation for Denizen's Object - // Fetcher. The only valid constructor for a dPlayer is the UUID of the player the object should be + // p@ refers to the 'object identifier' of a PlayerTag. The 'p@' is notation for Denizen's Object + // Fetcher. The only valid constructor for a PlayerTag is the UUID of the player the object should be // associated with. // - // For general info, see <@link language dPlayer> + // For general info, see <@link language PlayerTag> // // --> - public static dPlayer valueOf(String string) { + public static PlayerTag valueOf(String string) { return valueOf(string, null); } @Fetchable("p") - public static dPlayer valueOf(String string, TagContext context) { + public static PlayerTag valueOf(String string, TagContext context) { return valueOfInternal(string, context, true); } public static SlowWarning playerByNameWarning = new SlowWarning(""); - public static dPlayer valueOfInternal(String string, boolean announce) { + public static PlayerTag valueOfInternal(String string, boolean announce) { return valueOfInternal(string, null, announce); } - public static dPlayer valueOfInternal(String string, TagContext context, boolean defaultAnnounce) { + public static PlayerTag valueOfInternal(String string, TagContext context, boolean defaultAnnounce) { if (string == null) { return null; } @@ -145,7 +145,7 @@ public static dPlayer valueOfInternal(String string, TagContext context, boolean if (uuid != null) { OfflinePlayer player = Bukkit.getOfflinePlayer(uuid); if (player != null) { - return new dPlayer(player); + return new PlayerTag(player); } } } @@ -162,7 +162,7 @@ public static dPlayer valueOfInternal(String string, TagContext context, boolean " (or use tag server.match_player)! Player named '" + player.getName() + "' has UUID: " + player.getUniqueId(); playerByNameWarning.warn(context == null ? null : context.entry); } - return new dPlayer(player); + return new PlayerTag(player); } if (announce) { @@ -212,18 +212,18 @@ public static boolean playerNameIsValid(String name) { // CONSTRUCTORS ///////////////// - public dPlayer(OfflinePlayer player) { + public PlayerTag(OfflinePlayer player) { offlinePlayer = player; } - public dPlayer(UUID uuid) { + public PlayerTag(UUID uuid) { offlinePlayer = Bukkit.getOfflinePlayer(uuid); } - public dPlayer(Player player) { + public PlayerTag(Player player) { this((OfflinePlayer) player); - if (dEntity.isNPC(player)) { - throw new IllegalStateException("NPCs are not allowed as dPlayer objects!"); + if (EntityTag.isNPC(player)) { + throw new IllegalStateException("NPCs are not allowed as PlayerTag objects!"); } } @@ -254,15 +254,15 @@ public ImprovedOfflinePlayer getNBTEditor() { } @Override - public dEntity getDenizenEntity() { - return new dEntity(getPlayerEntity()); + public EntityTag getDenizenEntity() { + return new EntityTag(getPlayerEntity()); } - public dNPC getSelectedNPC() { + public NPCTag getSelectedNPC() { if (Depends.citizens != null && CitizensAPI.hasImplementation()) { NPC npc = CitizensAPI.getDefaultNPCSelector().getSelected(getPlayerEntity()); if (npc != null) { - return dNPC.mirrorCitizensNPC(npc); + return NPCTag.mirrorCitizensNPC(npc); } } return null; @@ -283,12 +283,12 @@ public String getSaveName() { return baseID.substring(0, 2) + "." + baseID; } - public dLocation getLocation() { + public LocationTag getLocation() { if (isOnline()) { - return new dLocation(getPlayerEntity().getLocation()); + return new LocationTag(getPlayerEntity().getLocation()); } else { - return new dLocation(getNBTEditor().getLocation()); + return new LocationTag(getNBTEditor().getLocation()); } } @@ -337,9 +337,9 @@ public int getFoodLevel() { } } - public dLocation getEyeLocation() { + public LocationTag getEyeLocation() { if (isOnline()) { - return new dLocation(getPlayerEntity().getEyeLocation()); + return new LocationTag(getPlayerEntity().getEyeLocation()); } else { return null; @@ -355,12 +355,12 @@ public PlayerInventory getBukkitInventory() { } } - public dInventory getInventory() { + public InventoryTag getInventory() { if (isOnline()) { - return dInventory.mirrorBukkitInventory(getPlayerEntity().getInventory()); + return InventoryTag.mirrorBukkitInventory(getPlayerEntity().getInventory()); } else { - return new dInventory(getNBTEditor()); + return new InventoryTag(getNBTEditor()); } } @@ -374,11 +374,11 @@ public CraftingInventory getBukkitWorkbench() { return null; } - public dInventory getWorkbench() { + public InventoryTag getWorkbench() { if (isOnline()) { CraftingInventory workbench = getBukkitWorkbench(); if (workbench != null) { - return new dInventory(workbench, getPlayerEntity()); + return new InventoryTag(workbench, getPlayerEntity()); } } return null; @@ -393,12 +393,12 @@ public Inventory getBukkitEnderChest() { } } - public dInventory getEnderChest() { + public InventoryTag getEnderChest() { if (isOnline()) { - return new dInventory(getPlayerEntity().getEnderChest(), getPlayerEntity()); + return new InventoryTag(getPlayerEntity().getEnderChest(), getPlayerEntity()); } else { - return new dInventory(getNBTEditor(), true); + return new InventoryTag(getNBTEditor(), true); } } @@ -597,7 +597,7 @@ public String getPrefix() { } @Override - public dPlayer setPrefix(String prefix) { + public PlayerTag setPrefix(String prefix) { this.prefix = prefix; return this; } @@ -648,7 +648,7 @@ public String getAttribute(Attribute attribute) { // OFFLINE ATTRIBUTES ///////////////// - // Defined in dEntity + // Defined in EntityTag if (attribute.startsWith("is_player")) { return new ElementTag(true).getAttribute(attribute.fulfill(1)); } @@ -658,7 +658,7 @@ public String getAttribute(Attribute attribute) { ///////////////// // <--[tag] - // @attribute + // @attribute // @returns ListTag // @description // Returns a list of the last 10 things the player has said, less @@ -671,7 +671,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the last thing the player said. @@ -696,7 +696,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns Flag ListTag // @description // Returns the specified flag from the player. @@ -722,7 +722,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Boolean) // @description // Returns true if the Player has the specified flag, otherwise returns false. @@ -734,7 +734,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ListTag // @description // Returns a list of a player's flag names, with an optional search for @@ -798,20 +798,20 @@ public String getAttribute(Attribute attribute) { ///////////////// // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @plugin Vault // @description // Returns the amount of money the player has with the registered Economy system. // May work offline depending on economy provider. - // @mechanism dPlayer.money + // @mechanism PlayerTag.money // --> if (attribute.startsWith("money")) { if (Depends.economy != null) { // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @plugin Vault // @description @@ -823,7 +823,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @plugin Vault // @description @@ -836,7 +836,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @plugin Vault // @description @@ -866,8 +866,8 @@ public String getAttribute(Attribute attribute) { ///////////////// // <--[tag] - // @attribute |...)]> - // @returns dEntity + // @attribute |...)]> + // @returns EntityTag // @description // Returns the entity that the player is looking at, within a maximum range of 50 blocks, // or null if the player is not looking at an entity. @@ -879,8 +879,8 @@ public String getAttribute(Attribute attribute) { int attribs = 1; // <--[tag] - // @attribute |...)].within[(<#>)]> - // @returns dEntity + // @attribute |...)].within[(<#>)]> + // @returns EntityTag // @description // Returns the living entity that the player is looking at within the specified range limit, // or null if the player is not looking at an entity. @@ -908,15 +908,15 @@ public String getAttribute(Attribute attribute) { if (entity instanceof LivingEntity) { for (ObjectTag obj : list.objectForms) { boolean valid = false; - dEntity filterEntity = null; - if (obj instanceof dEntity) { - filterEntity = (dEntity) obj; + EntityTag filterEntity = null; + if (obj instanceof EntityTag) { + filterEntity = (EntityTag) obj; } else if (CoreUtilities.toLowerCase(obj.toString()).equals("npc")) { - valid = dEntity.isCitizensNPC(entity); + valid = EntityTag.isCitizensNPC(entity); } else { - filterEntity = dEntity.getEntityFor(obj, attribute.context); + filterEntity = EntityTag.getEntityFor(obj, attribute.context); if (filterEntity == null) { Debug.echoError("Trying to filter 'player.target[...]' tag with invalid input: " + obj.toString()); continue; @@ -975,7 +975,7 @@ else if (CoreUtilities.toLowerCase(obj.toString()).equals("npc")) { (bz - .50 <= ez && ez <= bz + 1.50) && (by - 1 <= ey && ey <= by + 2.5)) { // Entity is close enough, so return it - return new dEntity(possibleTarget).getDenizenObject().getAttribute(attribute.fulfill(attribs)); + return new EntityTag(possibleTarget).getDenizenObject().getAttribute(attribute.fulfill(attribs)); } } } @@ -983,7 +983,7 @@ else if (CoreUtilities.toLowerCase(obj.toString()).equals("npc")) { return null; } - // workaround for + // workaround for if (attribute.startsWith("list_effects")) { ListTag effects = new ListTag(); for (PotionEffect effect : getPlayerEntity().getActivePotionEffects()) { @@ -1035,10 +1035,10 @@ else if (attribute.startsWith("uuid") && !isOnline()) } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description - // Always returns 'Player' for dPlayer objects. All objects fetchable by the Object Fetcher will return the + // Always returns 'Player' for PlayerTag objects. All objects fetchable by the Object Fetcher will return the // type of object that is fulfilling this attribute. // --> if (attribute.startsWith("type")) { @@ -1046,7 +1046,7 @@ else if (attribute.startsWith("uuid") && !isOnline()) } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the ID used to save the player in Denizen's saves.yml file. @@ -1062,23 +1062,23 @@ else if (attribute.startsWith("uuid") && !isOnline()) ///////////////// // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @description // Returns the location of the player's bed spawn location, null if // it doesn't exist. // Works with offline players. - // @mechanism dPlayer.bed_spawn_location + // @mechanism PlayerTag.bed_spawn_location // --> if (attribute.startsWith("bed_spawn")) { if (getOfflinePlayer().getBedSpawnLocation() == null) { return null; } - return new dLocation(getOfflinePlayer().getBedSpawnLocation()) + return new LocationTag(getOfflinePlayer().getBedSpawnLocation()) .getAttribute(attribute.fulfill(1)); } - // If online, let dEntity handle location tags since there are more options + // If online, let EntityTag handle location tags since there are more options // for online Players if (attribute.startsWith("location") && !isOnline()) { @@ -1086,7 +1086,7 @@ else if (attribute.startsWith("uuid") && !isOnline()) } if (attribute.startsWith("world") && !isOnline()) { - return new dWorld(getWorld()).getAttribute(attribute.fulfill(1)); + return new WorldTag(getWorld()).getAttribute(attribute.fulfill(1)); } @@ -1095,13 +1095,13 @@ else if (attribute.startsWith("uuid") && !isOnline()) ///////////////// // <--[tag] - // @attribute ]> + // @attribute ]> // @returns DurationTag // @description // Returns the cooldown duration remaining on player's material. // --> if (attribute.startsWith("item_cooldown")) { - dMaterial mat = new ElementTag(attribute.getContext(1)).asType(dMaterial.class, attribute.context); + MaterialTag mat = new ElementTag(attribute.getContext(1)).asType(MaterialTag.class, attribute.context); if (mat != null) { return new DurationTag((long) getPlayerEntity().getCooldown(mat.getMaterial())) .getAttribute(attribute.fulfill(1)); @@ -1109,7 +1109,7 @@ else if (attribute.startsWith("uuid") && !isOnline()) } // <--[tag] - // @attribute + // @attribute // @returns DurationTag // @description // Returns the millisecond time of when the player first logged on to this server. @@ -1126,7 +1126,7 @@ else if (attribute.startsWith("uuid") && !isOnline()) } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the player has played before. @@ -1139,11 +1139,11 @@ else if (attribute.startsWith("uuid") && !isOnline()) } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @description // Returns the player's absorption health. - // @mechanism dPlayer.absorption_health + // @mechanism PlayerTag.absorption_health // --> if (attribute.startsWith("absorption_health")) { return new ElementTag(NMSHandler.getInstance().getPlayerHelper().getAbsorption(getPlayerEntity())) @@ -1151,7 +1151,7 @@ else if (attribute.startsWith("uuid") && !isOnline()) } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the player's health bar is currently being scaled. @@ -1162,7 +1162,7 @@ else if (attribute.startsWith("uuid") && !isOnline()) } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @description // Returns the current scale for the player's health bar @@ -1173,7 +1173,7 @@ else if (attribute.startsWith("uuid") && !isOnline()) } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @description // Returns how fast the food level drops (exhaustion). @@ -1183,7 +1183,7 @@ else if (attribute.startsWith("uuid") && !isOnline()) .getAttribute(attribute.fulfill(1)); } - // Handle dEntity oxygen tags here to allow getting them when the player is offline + // Handle EntityTag oxygen tags here to allow getting them when the player is offline if (attribute.startsWith("oxygen.max")) { return new DurationTag((long) getMaximumAir()).getAttribute(attribute.fulfill(2)); } @@ -1194,7 +1194,7 @@ else if (attribute.startsWith("uuid") && !isOnline()) // Same with health tags if (attribute.startsWith("health.formatted")) { - return EntityHealth.getHealthFormatted(new dEntity(getPlayerEntity()), attribute); + return EntityHealth.getHealthFormatted(new EntityTag(getPlayerEntity()), attribute); } if (attribute.startsWith("health.percentage")) { @@ -1215,7 +1215,7 @@ else if (attribute.startsWith("uuid") && !isOnline()) } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the player is banned. @@ -1232,7 +1232,7 @@ else if (ban.getExpiration() == null) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the player is currently online. @@ -1243,12 +1243,12 @@ else if (ban.getExpiration() == null) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the player is a full server operator. // Works with offline players. - // @mechanism dPlayer.is_op + // @mechanism PlayerTag.is_op // --> if (attribute.startsWith("is_op")) { return new ElementTag(getOfflinePlayer().isOp()) @@ -1256,12 +1256,12 @@ else if (ban.getExpiration() == null) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the player is whitelisted. // Works with offline players. - // @mechanism dPlayer.is_whitelisted + // @mechanism PlayerTag.is_whitelisted // --> if (attribute.startsWith("is_whitelisted")) { return new ElementTag(getOfflinePlayer().isWhitelisted()) @@ -1269,7 +1269,7 @@ else if (ban.getExpiration() == null) { } // <--[tag] - // @attribute + // @attribute // @returns DurationTag // @description // Returns the datestamp of when the player was last seen in duration. @@ -1294,7 +1294,7 @@ else if (ban.getExpiration() == null) { } // <--[tag] - // @attribute + // @attribute // @returns ListTag // @description // Returns a list of all groups the player is in. @@ -1325,7 +1325,7 @@ else if (ban.getExpiration() == null) { } // <--[tag] - // @attribute + // @attribute // @returns DurationTag // @description // Returns the expiration of the player's ban, if they are banned. @@ -1337,7 +1337,7 @@ else if (ban.getExpiration() == null) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the reason for the player's ban, if they are banned. @@ -1348,7 +1348,7 @@ else if (attribute.startsWith("reason")) { } // <--[tag] - // @attribute + // @attribute // @returns DurationTag // @description // Returns when the player's ban was created, if they are banned. @@ -1359,7 +1359,7 @@ else if (attribute.startsWith("created")) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the source of the player's ban, if they are banned. @@ -1373,12 +1373,12 @@ else if (attribute.startsWith("source")) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Boolean) // @description // Returns whether the player is in the specified group. // This requires an online player - if the player may be offline, consider using - // <@link tag p@player.in_group[group_name].global>. + // <@link tag PlayerTag.in_group[group_name].global>. // --> if (attribute.startsWith("in_group")) { if (Depends.permissions == null) { @@ -1391,7 +1391,7 @@ else if (attribute.startsWith("source")) { String group = attribute.getContext(1); // <--[tag] - // @attribute ].global> + // @attribute ].global> // @returns ElementTag(Boolean) // @description // Returns whether the player has the group with no regard to the @@ -1407,7 +1407,7 @@ else if (attribute.startsWith("source")) { } // <--[tag] - // @attribute ].world[]> + // @attribute ].world[]> // @returns ElementTag(Boolean) // @description // Returns whether the player has the group in regards to a specific world. @@ -1429,7 +1429,7 @@ else if (isOnline()) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the player has the specified node. @@ -1441,7 +1441,7 @@ else if (isOnline()) { String permission = attribute.getContext(1); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the player has the specified node, regardless of world. @@ -1463,7 +1463,7 @@ else if (isOnline()) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Boolean) // @description // Returns whether the player has the specified node in regards to the @@ -1497,10 +1497,10 @@ else if (isOnline()) { ///////////////// // <--[tag] - // @attribute - // @returns dInventory + // @attribute + // @returns InventoryTag // @description - // Returns a dInventory of the player's current inventory. + // Returns a InventoryTag of the player's current inventory. // Works with offline players. // --> if (attribute.startsWith("inventory")) { @@ -1508,8 +1508,8 @@ else if (isOnline()) { } // <--[tag] - // @attribute - // @returns dInventory + // @attribute + // @returns InventoryTag // @description // Gets the player's enderchest inventory. // Works with offline players. @@ -1535,19 +1535,19 @@ else if (isOnline()) { } // <--[tag] - // @attribute - // @returns dInventory + // @attribute + // @returns InventoryTag // @description // Gets the inventory the player currently has open. If the player has no open // inventory, this returns the player's inventory. // --> if (attribute.startsWith("open_inventory")) { - return dInventory.mirrorBukkitInventory(getPlayerEntity().getOpenInventory().getTopInventory()) + return InventoryTag.mirrorBukkitInventory(getPlayerEntity().getOpenInventory().getTopInventory()) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the index of the trade the player is currently viewing, if any. @@ -1561,8 +1561,8 @@ else if (isOnline()) { // This is almost completely broke and only works if the player has placed items in the trade slots. // [tag] - // @attribute - // @returns dTrade + // @attribute + // @returns TradeTag // @description // Returns the trade the player is currently viewing, if any. // @@ -1571,25 +1571,25 @@ else if (isOnline()) { Inventory playerInventory = getPlayerEntity().getOpenInventory().getTopInventory(); if (playerInventory instanceof MerchantInventory && ((MerchantInventory) playerInventory).getSelectedRecipe() != null) { - return new dTrade(((MerchantInventory) playerInventory).getSelectedRecipe()).getAttribute(attribute.fulfill(1)); + return new TradeTag(((MerchantInventory) playerInventory).getSelectedRecipe()).getAttribute(attribute.fulfill(1)); } } */ // <--[tag] - // @attribute - // @returns dItem + // @attribute + // @returns ItemTag // @description // Returns the item on the player's cursor, if any. This includes // chest interfaces, inventories, and hotbars, etc. // --> if (attribute.startsWith("item_on_cursor")) { - return new dItem(getPlayerEntity().getItemOnCursor()) + return new ItemTag(getPlayerEntity().getItemOnCursor()) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the slot location of the player's selected item. @@ -1600,7 +1600,7 @@ else if (isOnline()) { } // <--[tag] - // @attribute + // @attribute // @returns ListTag // @description // Returns the current lines set on the player's Sidebar via the Sidebar command. @@ -1614,7 +1614,7 @@ else if (isOnline()) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the current title set on the player's Sidebar via the Sidebar command. @@ -1628,11 +1628,11 @@ else if (isOnline()) { } // <--[tag] - // @attribute + // @attribute // @returns ListTag // @description // Returns the current scores set on the player's Sidebar via the Sidebar command, - // in the same order as <@link tag p@player.sidebar.lines>. + // in the same order as <@link tag PlayerTag.sidebar.lines>. // --> if (attribute.startsWith("sidebar.scores")) { Sidebar sidebar = SidebarCommand.getSidebar(this); @@ -1647,11 +1647,11 @@ else if (isOnline()) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the player's current skin blob. - // @mechanism dPlayer.skin_blob + // @mechanism PlayerTag.skin_blob // --> if (attribute.startsWith("skin_blob")) { return new ElementTag(NMSHandler.getInstance().getProfileEditor().getPlayerSkinBlob(getPlayerEntity())) @@ -1662,7 +1662,7 @@ else if (isOnline()) { attribute.fulfill(1); // <--[tag] - // @attribute + // @attribute // @returns DurationTag // @description // Returns the amount of time that passed since the start of the attack cooldown. @@ -1674,7 +1674,7 @@ else if (isOnline()) { // <--[tag] - // @attribute + // @attribute // @returns DurationTag // @description // Returns the maximum amount of time that can pass before the player's main hand has returned @@ -1689,7 +1689,7 @@ else if (attribute.startsWith("max_duration")) { // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @description // Returns the progress of the attack cooldown. 0 means that the attack cooldown has just @@ -1712,10 +1712,10 @@ else if (attribute.startsWith("percent")) { ///////////////// // <--[tag] - // @attribute - // @returns dNPC + // @attribute + // @returns NPCTag // @description - // Returns the dNPC that the player currently has selected with + // Returns the NPCTag that the player currently has selected with // '/npc select', null if no player selected. // --> if (attribute.startsWith("selected_npc")) { @@ -1730,14 +1730,14 @@ else if (attribute.startsWith("percent")) { ///////////////// // <--[tag] - // @attribute - // @returns dEntity + // @attribute + // @returns EntityTag // @description - // Returns the dEntity object of the player. - // (Note: This should never actually be needed. is considered a valid dEntity by script commands.) + // Returns the EntityTag object of the player. + // (Note: This should never actually be needed. is considered a valid EntityTag by script commands.) // --> if (attribute.startsWith("entity") && !attribute.startsWith("entity_")) { - return new dEntity(getPlayerEntity()) + return new EntityTag(getPlayerEntity()) .getAttribute(attribute.fulfill(1)); } @@ -1747,7 +1747,7 @@ else if (attribute.startsWith("percent")) { ///////////////// // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the player's IP address host name. @@ -1756,7 +1756,7 @@ else if (attribute.startsWith("percent")) { attribute.startsWith("host_name")) { attribute = attribute.fulfill(1); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the player's IP address. @@ -1767,7 +1767,7 @@ else if (attribute.startsWith("percent")) { } String host = getPlayerEntity().getAddress().getHostName(); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the player's IP address. @@ -1781,7 +1781,7 @@ else if (attribute.startsWith("percent")) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the display name of the player, which may contain @@ -1793,7 +1793,7 @@ else if (attribute.startsWith("percent")) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the name of the player as shown in the player list. @@ -1804,7 +1804,7 @@ else if (attribute.startsWith("percent")) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the displayed text in the nameplate of the player. @@ -1815,7 +1815,7 @@ else if (attribute.startsWith("percent")) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the name of the player. @@ -1829,26 +1829,26 @@ else if (attribute.startsWith("percent")) { ///////////////// // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @description // Returns the location of the player's compass target. // --> if (attribute.startsWith("compass_target")) { Location target = getPlayerEntity().getCompassTarget(); if (target != null) { - return new dLocation(target).getAttribute(attribute.fulfill(1)); + return new LocationTag(target).getAttribute(attribute.fulfill(1)); } } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Boolean) // @description // Returns whether the player has the chunk loaded on their client. // --> if (attribute.startsWith("chunk_loaded") && attribute.hasContext(1)) { - dChunk chunk = dChunk.valueOf(attribute.getContext(1)); + ChunkTag chunk = ChunkTag.valueOf(attribute.getContext(1)); if (chunk == null) { return null; } @@ -1861,11 +1861,11 @@ else if (attribute.startsWith("percent")) { ///////////////// // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the player is allowed to fly. - // @mechanism dPlayer.can_fly + // @mechanism PlayerTag.can_fly // --> if (attribute.startsWith("can_fly") || attribute.startsWith("allowed_flight")) { return new ElementTag(getPlayerEntity().getAllowFlight()) @@ -1873,7 +1873,7 @@ else if (attribute.startsWith("percent")) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @description // Returns the speed the player can fly at. @@ -1884,7 +1884,7 @@ else if (attribute.startsWith("percent")) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns a 'formatted' value of the player's current food level. @@ -1914,7 +1914,7 @@ else if (foodLevel / maxHunger < 1) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @description // Returns the current saturation of the player. @@ -1925,7 +1925,7 @@ else if (foodLevel / maxHunger < 1) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the current food level of the player. @@ -1936,7 +1936,7 @@ else if (foodLevel / maxHunger < 1) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the name of the gamemode the player is currently set to. @@ -1944,7 +1944,7 @@ else if (foodLevel / maxHunger < 1) { if (attribute.startsWith("gamemode")) { attribute = attribute.fulfill(1); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the gamemode ID of the player. 0 = survival, 1 = creative, 2 = adventure, 3 = spectator @@ -1958,7 +1958,7 @@ else if (foodLevel / maxHunger < 1) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the player is currently blocking. @@ -1969,7 +1969,7 @@ else if (foodLevel / maxHunger < 1) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the player's current ping. @@ -1980,7 +1980,7 @@ else if (foodLevel / maxHunger < 1) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the player is currently flying. @@ -1991,7 +1991,7 @@ else if (foodLevel / maxHunger < 1) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the player is currently sleeping. @@ -2002,7 +2002,7 @@ else if (foodLevel / maxHunger < 1) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the player is currently sneaking. @@ -2013,7 +2013,7 @@ else if (foodLevel / maxHunger < 1) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the player is currently sprinting. @@ -2024,7 +2024,7 @@ else if (foodLevel / maxHunger < 1) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Boolean) // @description // Returns whether the player has the specified achievement. @@ -2035,7 +2035,7 @@ else if (foodLevel / maxHunger < 1) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Number) // @description // Returns the player's current value for the specified statistic. @@ -2047,7 +2047,7 @@ else if (foodLevel / maxHunger < 1) { } // <--[tag] - // @attribute ].qualifier[/]> + // @attribute ].qualifier[/]> // @returns ElementTag(Number) // @description // Returns the player's current value for the specified statistic, with the @@ -2056,12 +2056,12 @@ else if (foodLevel / maxHunger < 1) { if (attribute.getAttribute(2).startsWith("qualifier")) { ObjectTag obj = ObjectFetcher.pickObjectFor(attribute.getContext(2), attribute.context); try { - if (obj instanceof dMaterial) { - return new ElementTag(getPlayerEntity().getStatistic(statistic, ((dMaterial) obj).getMaterial())) + if (obj instanceof MaterialTag) { + return new ElementTag(getPlayerEntity().getStatistic(statistic, ((MaterialTag) obj).getMaterial())) .getAttribute(attribute.fulfill(2)); } - else if (obj instanceof dEntity) { - return new ElementTag(getPlayerEntity().getStatistic(statistic, ((dEntity) obj).getBukkitEntityType())) + else if (obj instanceof EntityTag) { + return new ElementTag(getPlayerEntity().getStatistic(statistic, ((EntityTag) obj).getBukkitEntityType())) .getAttribute(attribute.fulfill(2)); } else { @@ -2083,7 +2083,7 @@ else if (obj instanceof dEntity) { } // <--[tag] - // @attribute + // @attribute // @returns DurationTag // @description // Returns the time the player has been asleep. @@ -2094,7 +2094,7 @@ else if (obj instanceof dEntity) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the time the player is currently experiencing. This time could differ from @@ -2107,7 +2107,7 @@ else if (obj instanceof dEntity) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @description // Returns the speed the player can walk at. @@ -2118,9 +2118,9 @@ else if (obj instanceof dEntity) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dPlayer.weather + // @mechanism PlayerTag.weather // @description // Returns the type of weather the player is experiencing. This will be different // from the weather currently in the world that the player is residing in if @@ -2138,7 +2138,7 @@ else if (obj instanceof dEntity) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the number of XP levels the player has. @@ -2149,7 +2149,7 @@ else if (obj instanceof dEntity) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the amount of XP needed to get to the next level. @@ -2160,7 +2160,7 @@ else if (obj instanceof dEntity) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the total amount of experience points. @@ -2171,7 +2171,7 @@ else if (obj instanceof dEntity) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @description // Returns the percentage of experience points to the next level. @@ -2184,14 +2184,14 @@ else if (obj instanceof dEntity) { if (Depends.chat != null) { // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @plugin Vault // @description // Returns the player's chat prefix. // NOTE: May work with offline players. // Requires a Vault-compatible chat plugin. - // @mechanism dPlayer.chat_prefix + // @mechanism PlayerTag.chat_prefix // --> if (attribute.startsWith("chat_prefix")) { String prefix = Depends.chat.getPlayerPrefix(getWorld().getName(), getOfflinePlayer()); @@ -2202,14 +2202,14 @@ else if (obj instanceof dEntity) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @plugin Vault // @description // Returns the player's chat suffix. // NOTE: May work with offline players. // Requires a Vault-compatible chat plugin. - // @mechanism dPlayer.chat_suffix + // @mechanism PlayerTag.chat_suffix // --> else if (attribute.startsWith("chat_suffix")) { String suffix = Depends.chat.getPlayerSuffix(getWorld().getName(), getOfflinePlayer()); @@ -2225,7 +2225,7 @@ else if (attribute.startsWith("chat_suffix")) { return returned; } - return new dEntity(getPlayerEntity()).getAttribute(attribute); + return new EntityTag(getPlayerEntity()).getAttribute(attribute); } @@ -2237,7 +2237,7 @@ public void applyProperty(Mechanism mechanism) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name respawn // @input None // @description @@ -2248,7 +2248,7 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name vision // @input Element // @description @@ -2266,28 +2266,28 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name level // @input Element(Number) // @description // Sets the level on the player. Does not affect the current progression // of experience towards next level. // @tags - // + // // --> if (mechanism.matches("level") && mechanism.requireInteger()) { setLevel(mechanism.getValue().asInt()); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name item_slot // @input Element(Number) // @description // Sets the inventory slot that the player has selected. // Works with offline players. // @tags - // + // // --> if (mechanism.matches("item_slot") && mechanism.requireInteger()) { if (isOnline()) { @@ -2299,7 +2299,7 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name window_property // @input Element // @description @@ -2327,21 +2327,21 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name item_on_cursor - // @input dItem + // @input ItemTag // @description // Sets the item on the player's cursor. This includes // chest interfaces, inventories, and hotbars, etc. // @tags - // + // // --> - if (mechanism.matches("item_on_cursor") && mechanism.requireObject(dItem.class)) { - getPlayerEntity().setItemOnCursor(mechanism.valueAsType(dItem.class).getItemStack()); + if (mechanism.matches("item_on_cursor") && mechanism.requireObject(ItemTag.class)) { + getPlayerEntity().setItemOnCursor(mechanism.valueAsType(ItemTag.class).getItemStack()); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name award_achievement // @input Element // @description @@ -2361,20 +2361,20 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name absorption_health // @input Element(Decimal) // @description // Sets the player's absorption health. // @tags - // + // // --> if (mechanism.matches("absorption_health") && mechanism.requireFloat()) { NMSHandler.getInstance().getPlayerHelper().setAbsorption(getPlayerEntity(), mechanism.getValue().asFloat()); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name fake_absorption_health // @input Element(Decimal) // @description @@ -2385,7 +2385,7 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name health_scale // @input Element(Decimal) // @description @@ -2394,21 +2394,21 @@ public void adjust(Mechanism mechanism) { // standard. // Player relogging will reset this mechanism. // @tags - // + // // --> if (mechanism.matches("health_scale") && mechanism.requireDouble()) { getPlayerEntity().setHealthScale(mechanism.getValue().asDouble()); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name scale_health // @input Element(Boolean) // @description // Enables or disables the health scale mechanism.getValue(). Disabling will result in the standard // amount of hearts being shown. // @tags - // + // // --> if (mechanism.matches("scale_health") && mechanism.requireBoolean()) { getPlayerEntity().setHealthScaled(mechanism.getValue().asBoolean()); @@ -2424,23 +2424,23 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name redo_attack_cooldown // @input None // @description // Forces the player to wait for the full attack cooldown duration for the item in their hand. // NOTE: The clientside attack cooldown indicator will not reflect this change! // @tags - // - // - // + // + // + // // --> if (mechanism.matches("redo_attack_cooldown")) { NMSHandler.getInstance().getPlayerHelper().setAttackCooldown(getPlayerEntity(), 0); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name reset_attack_cooldown // @input None // @description @@ -2448,9 +2448,9 @@ public void adjust(Mechanism mechanism) { // NOTE: This will do nothing if the player's attack speed attribute is set to 0. // NOTE: The clientside attack cooldown indicator will not reflect this change! // @tags - // - // - // + // + // + // // --> if (mechanism.matches("reset_attack_cooldown")) { PlayerHelper playerHelper = NMSHandler.getInstance().getPlayerHelper(); @@ -2458,7 +2458,7 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name attack_cooldown_percent // @input Element(Decimal) // @description @@ -2466,9 +2466,9 @@ public void adjust(Mechanism mechanism) { // 0 means the cooldown has just begun, while 1 means the cooldown has been completed. // NOTE: The clientside attack cooldown indicator will not reflect this change! // @tags - // - // - // + // + // + // // --> if (mechanism.matches("attack_cooldown_percent") && mechanism.requireFloat()) { float percent = mechanism.getValue().asFloat(); @@ -2484,7 +2484,7 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name attack_cooldown // @input Duration // @description @@ -2492,9 +2492,9 @@ public void adjust(Mechanism mechanism) { // attack cooldown, then the cooldown is considered finished. // NOTE: The clientside attack cooldown indicator will not reflect this change! // @tags - // - // - // + // + // + // // --> if (mechanism.matches("attack_cooldown") && mechanism.requireObject(DurationTag.class)) { NMSHandler.getInstance().getPlayerHelper().setAttackCooldown(getPlayerEntity(), @@ -2502,7 +2502,7 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name resource_pack // @input Element // @description @@ -2515,20 +2515,20 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name saturation // @input Element(Decimal) // @description // Sets the current food saturation level of a player. // @tags - // + // // --> if (mechanism.matches("saturation") && mechanism.requireFloat()) { getPlayerEntity().setSaturation(mechanism.getValue().asFloat()); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name send_map // @input Element(Number) // @description @@ -2547,100 +2547,100 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name food_level // @input Element(Number) // @description // Sets the current food level of a player. Typically, '20' is full. // @tags - // + // // --> if (mechanism.matches("food_level") && mechanism.requireInteger()) { setFoodLevel(mechanism.getValue().asInt()); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name bed_spawn_location - // @input dLocation + // @input LocationTag // @description // Sets the bed location that the player respawns at. // @tags - // + // // --> - if (mechanism.matches("bed_spawn_location") && mechanism.requireObject(dLocation.class)) { - setBedSpawnLocation(mechanism.valueAsType(dLocation.class)); + if (mechanism.matches("bed_spawn_location") && mechanism.requireObject(LocationTag.class)) { + setBedSpawnLocation(mechanism.valueAsType(LocationTag.class)); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name can_fly // @input Element(Boolean) // @description // Sets whether the player is allowed to fly. // @tags - // + // // --> if (mechanism.matches("can_fly") && mechanism.requireBoolean()) { getPlayerEntity().setAllowFlight(mechanism.getValue().asBoolean()); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name fly_speed // @input Element(Decimal) // @description // Sets the fly speed of the player. Valid range is 0.0 to 1.0 // @tags - // + // // --> if (mechanism.matches("fly_speed") && mechanism.requireFloat()) { setFlySpeed(mechanism.getValue().asFloat()); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name flying // @input Element(Boolean) // @description // Sets whether the player is flying. // @tags - // + // // --> if (mechanism.matches("flying") && mechanism.requireBoolean()) { getPlayerEntity().setFlying(mechanism.getValue().asBoolean()); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name sprinting // @input Element(Boolean) // @description // Sets whether the player is sprinting. // @tags - // + // // --> if (mechanism.matches("sprinting") && mechanism.requireBoolean()) { getPlayerEntity().setSprinting(mechanism.getValue().asBoolean()); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name gamemode // @input Element // @description // Sets the game mode of the player. // Valid gamemodes are survival, creative, adventure, and spectator. // @tags - // - // + // + // // --> if (mechanism.matches("gamemode") && mechanism.requireEnum(false, GameMode.values())) { setGameMode(GameMode.valueOf(mechanism.getValue().asString().toUpperCase())); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name kick // @input Element // @description @@ -2653,7 +2653,7 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name weather // @input Element // @description @@ -2661,47 +2661,47 @@ public void adjust(Mechanism mechanism) { // in the world, and will block any world weather changes until the 'reset_weather' // mechanism is used. Valid weather: CLEAR, DOWNFALL // @tags - // + // // --> if (mechanism.matches("weather") && mechanism.requireEnum(false, WeatherType.values())) { getPlayerEntity().setPlayerWeather(WeatherType.valueOf(mechanism.getValue().asString().toUpperCase())); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name reset_weather // @input None // @description // Resets the weather on the Player to the conditions currently taking place in the Player's // current world. // @tags - // + // // --> if (mechanism.matches("reset_weather")) { getPlayerEntity().resetPlayerWeather(); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name player_list_name // @input Element // @description // Sets the entry that is shown in the 'player list' that is shown when pressing tab. // @tags - // + // // --> if (mechanism.matches("player_list_name")) { getPlayerEntity().setPlayerListName(mechanism.getValue().asString()); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name display_name // @input Element // @description // Sets the name displayed for the player when chatting. // @tags - // + // // --> if (mechanism.matches("display_name")) { getPlayerEntity().setDisplayName(mechanism.getValue().asString()); @@ -2709,35 +2709,35 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name show_workbench - // @input dLocation + // @input LocationTag // @description // Shows the player a workbench GUI corresponding to a given location. // @tags // None // --> - if (mechanism.matches("show_workbench") && mechanism.requireObject(dLocation.class)) { - getPlayerEntity().openWorkbench(mechanism.valueAsType(dLocation.class), true); + if (mechanism.matches("show_workbench") && mechanism.requireObject(LocationTag.class)) { + getPlayerEntity().openWorkbench(mechanism.valueAsType(LocationTag.class), true); return; } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name location - // @input dLocation + // @input LocationTag // @description // If the player is online, teleports the player to a given location. // Otherwise, sets the player's next spawn location. // @tags - // + // // --> - if (mechanism.matches("location") && mechanism.requireObject(dLocation.class)) { - setLocation(mechanism.valueAsType(dLocation.class)); + if (mechanism.matches("location") && mechanism.requireObject(LocationTag.class)) { + setLocation(mechanism.valueAsType(LocationTag.class)); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name time // @input Element(Number) // @description @@ -2747,14 +2747,14 @@ public void adjust(Mechanism mechanism) { // will reset this mechanism to match the world's current time. Valid range is 0-24000. // The value is relative to the current world time, and will continue moving at the same rate as current world time moves. // @tags - // + // // --> if (mechanism.matches("time") && mechanism.requireInteger()) { getPlayerEntity().setPlayerTime(mechanism.getValue().asInt(), true); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name freeze_time // @input Element(Number) // @description @@ -2764,7 +2764,7 @@ public void adjust(Mechanism mechanism) { // the world are experiencing. Using the 'reset_time' mechanism, or relogging your player // will reset this mechanism to match the world's current time. Valid range is 0-24000. // @tags - // + // // --> if (mechanism.matches("freeze_time")) { if (mechanism.requireInteger("Invalid integer specified. Assuming current world time.")) { @@ -2776,60 +2776,60 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name reset_time // @input None // @description // Resets any altered time that has been applied to this player. Using this will make // the Player's time match the world's current time. // @tags - // + // // --> if (mechanism.matches("reset_time")) { getPlayerEntity().resetPlayerTime(); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name walk_speed // @input Element(Decimal) // @description // Sets the walk speed of the player. The standard value is '0.2'. Valid range is 0.0 to 1.0 // @tags - // + // // --> if (mechanism.matches("walk_speed") && mechanism.requireFloat()) { getPlayerEntity().setWalkSpeed(mechanism.getValue().asFloat()); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name exhaustion // @input Element(Decimal) // @description // Sets the exhaustion level of a player. // @tags - // + // // --> if (mechanism.matches("exhaustion") && mechanism.requireFloat()) { getPlayerEntity().setExhaustion(mechanism.getValue().asFloat()); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name show_entity - // @input dEntity + // @input EntityTag // @description // Shows the player a previously hidden entity. // --> - if (mechanism.matches("show_entity") && mechanism.requireObject(dEntity.class)) { - NMSHandler.getInstance().getEntityHelper().unhideEntity(getPlayerEntity(), mechanism.valueAsType(dEntity.class).getBukkitEntity()); + if (mechanism.matches("show_entity") && mechanism.requireObject(EntityTag.class)) { + NMSHandler.getInstance().getEntityHelper().unhideEntity(getPlayerEntity(), mechanism.valueAsType(EntityTag.class).getBukkitEntity()); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name hide_entity - // @input dEntity(|Element(Boolean)) + // @input EntityTag(|Element(Boolean)) // @description // Hides an entity from the player. You can optionally also specify a boolean to determine // whether the entity should be kept in the tab list (players only). @@ -2837,8 +2837,8 @@ public void adjust(Mechanism mechanism) { if (mechanism.matches("hide_entity")) { if (!mechanism.getValue().asString().isEmpty()) { String[] split = mechanism.getValue().asString().split("[\\|" + ListTag.internal_escape + "]", 2); - if (split.length > 0 && new ElementTag(split[0]).matchesType(dEntity.class)) { - dEntity entity = mechanism.valueAsType(dEntity.class); + if (split.length > 0 && new ElementTag(split[0]).matchesType(EntityTag.class)) { + EntityTag entity = mechanism.valueAsType(EntityTag.class); if (!entity.isSpawned()) { Debug.echoError("Can't hide the unspawned entity '" + split[0] + "'!"); } @@ -2860,7 +2860,7 @@ else if (split.length > 1 && new ElementTag(split[1]).isBoolean()) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name show_boss_bar // @input (Element(Number)|)Element // @description @@ -2890,7 +2890,7 @@ else if (split.length > 1 && new ElementTag(split[1]).isBoolean()) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name fake_experience // @input Element(Decimal)(|Element(Number)) // @description @@ -2925,7 +2925,7 @@ else if (split.length > 1 && new ElementTag(split[1]).isBoolean()) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name fake_health // @input Element(Decimal)(|Element(Number)(|Element(Decimal))) // @description @@ -2969,9 +2969,9 @@ else if (split.length > 1 && new ElementTag(split[1]).isBoolean()) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name fake_equipment - // @input dEntity(|Element|dItem) + // @input EntityTag(|Element|dItem) // @description // Shows the player fake equipment on the specified living entity, which has // no real non-visual effects, in the form Entity|Slot|Item, where the slot @@ -2984,11 +2984,11 @@ else if (split.length > 1 && new ElementTag(split[1]).isBoolean()) { if (mechanism.matches("fake_equipment")) { if (!mechanism.getValue().asString().isEmpty()) { String[] split = mechanism.getValue().asString().split("[\\|" + ListTag.internal_escape + "]", 3); - if (split.length > 0 && new ElementTag(split[0]).matchesType(dEntity.class)) { + if (split.length > 0 && new ElementTag(split[0]).matchesType(EntityTag.class)) { String slot = split.length > 1 ? split[1].toUpperCase() : null; if (split.length > 1 && (new ElementTag(slot).matchesEnum(EquipmentSlot.values()) || slot.equals("MAIN_HAND") || slot.equals("BOOTS"))) { - if (split.length > 2 && new ElementTag(split[2]).matchesType(dItem.class)) { + if (split.length > 2 && new ElementTag(split[2]).matchesType(ItemTag.class)) { if (slot.equals("MAIN_HAND")) { slot = "HAND"; } @@ -2996,12 +2996,12 @@ else if (slot.equals("BOOTS")) { slot = "FEET"; } NMSHandler.getInstance().getPacketHelper().showEquipment(getPlayerEntity(), - new ElementTag(split[0]).asType(dEntity.class, mechanism.context).getLivingEntity(), + new ElementTag(split[0]).asType(EntityTag.class, mechanism.context).getLivingEntity(), EquipmentSlot.valueOf(slot), - new ElementTag(split[2]).asType(dItem.class, mechanism.context).getItemStack()); + new ElementTag(split[2]).asType(ItemTag.class, mechanism.context).getItemStack()); } else if (split.length > 2) { - Debug.echoError("'" + split[2] + "' is not a valid dItem!"); + Debug.echoError("'" + split[2] + "' is not a valid ItemTag!"); } } else if (split.length > 1) { @@ -3009,17 +3009,17 @@ else if (split.length > 1) { } else { NMSHandler.getInstance().getPacketHelper().resetEquipment(getPlayerEntity(), - new ElementTag(split[0]).asType(dEntity.class, mechanism.context).getLivingEntity()); + new ElementTag(split[0]).asType(EntityTag.class, mechanism.context).getLivingEntity()); } } else { - Debug.echoError("'" + split[0] + "' is not a valid dEntity!"); + Debug.echoError("'" + split[0] + "' is not a valid EntityTag!"); } } } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name fov_multiplier // @input Element(Decimal) // @description @@ -3037,7 +3037,7 @@ else if (split.length > 1) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name item_message // @input Element // @description @@ -3049,7 +3049,7 @@ else if (split.length > 1) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name show_endcredits // @input None // @description @@ -3060,7 +3060,7 @@ else if (split.length > 1) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name show_demo // @input None // @description @@ -3071,21 +3071,21 @@ else if (split.length > 1) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name spectate - // @input dEntity + // @input EntityTag // @description // Forces the player to spectate from the entity's point of view. // Note: They cannot cancel the spectating without a re-log -- you // must make them spectate themselves to cancel the effect. // (i.e. - adjust "spectate:") // --> - if (mechanism.matches("spectate") && mechanism.requireObject(dEntity.class)) { - NMSHandler.getInstance().getPacketHelper().forceSpectate(getPlayerEntity(), mechanism.valueAsType(dEntity.class).getBukkitEntity()); + if (mechanism.matches("spectate") && mechanism.requireObject(EntityTag.class)) { + NMSHandler.getInstance().getPacketHelper().forceSpectate(getPlayerEntity(), mechanism.valueAsType(EntityTag.class).getBukkitEntity()); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name open_book // @input None // @description @@ -3098,7 +3098,7 @@ else if (split.length > 1) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name open_offhand_book // @input None // @description @@ -3111,15 +3111,15 @@ else if (split.length > 1) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name show_book - // @input dItem + // @input ItemTag // @description // Displays a book to a player. // --> if (mechanism.matches("show_book") - && mechanism.requireObject(dItem.class)) { - dItem book = mechanism.valueAsType(dItem.class); + && mechanism.requireObject(ItemTag.class)) { + ItemTag book = mechanism.valueAsType(ItemTag.class); if (!book.getItemStack().hasItemMeta() || !(book.getItemStack().getItemMeta() instanceof BookMeta)) { Debug.echoError("show_book mechanism must have a book as input."); return; @@ -3132,21 +3132,21 @@ else if (split.length > 1) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name edit_sign - // @input dLocation + // @input LocationTag // @description // Allows the player to edit an existing sign. To create a // sign, see <@link command Sign>. // --> - if (mechanism.matches("edit_sign") && mechanism.requireObject(dLocation.class)) { - if (!NMSHandler.getInstance().getPacketHelper().showSignEditor(getPlayerEntity(), mechanism.valueAsType(dLocation.class))) { + if (mechanism.matches("edit_sign") && mechanism.requireObject(LocationTag.class)) { + if (!NMSHandler.getInstance().getPacketHelper().showSignEditor(getPlayerEntity(), mechanism.valueAsType(LocationTag.class))) { Debug.echoError("Can't edit non-sign materials!"); } } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name tab_list_info // @input Element(|Element) // @description @@ -3175,18 +3175,18 @@ else if (split.length > 1) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name sign_update - // @input dLocation|dList + // @input LocationTag|dList // @description // Shows the player fake lines on a sign. // --> if (mechanism.matches("sign_update")) { if (!mechanism.getValue().asString().isEmpty()) { String[] split = mechanism.getValue().asString().split("[\\|" + ListTag.internal_escape + "]", 2); - if (dLocation.matches(split[0]) && split.length > 1) { + if (LocationTag.matches(split[0]) && split.length > 1) { ListTag lines = ListTag.valueOf(split[1]); - getPlayerEntity().sendSignChange(dLocation.valueOf(split[0]), lines.toArray(4)); + getPlayerEntity().sendSignChange(LocationTag.valueOf(split[0]), lines.toArray(4)); } else { Debug.echoError("Must specify a valid location and at least one sign line!"); @@ -3198,9 +3198,9 @@ else if (split.length > 1) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name banner_update - // @input dLocation|Element(|dList) + // @input LocationTag|Element(|dList) // @description // Shows the player a fake base color and, optionally, patterns on a banner. Input must be // in the form: "LOCATION|BASE_COLOR(|COLOR/PATTERN|...)" @@ -3225,8 +3225,8 @@ else if (split.length > 1) { } } } - if (dLocation.matches(split[0]) && split.length > 1) { - dLocation location = dLocation.valueOf(split[0]); + if (LocationTag.matches(split[0]) && split.length > 1) { + LocationTag location = LocationTag.valueOf(split[0]); DyeColor base; try { base = DyeColor.valueOf(split[1].toUpperCase()); @@ -3244,7 +3244,7 @@ else if (split.length > 1) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name stop_sound // @input Element // @description @@ -3268,7 +3268,7 @@ else if (split.length > 1) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name action_bar // @input Element // @description @@ -3279,7 +3279,7 @@ else if (split.length > 1) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name update_advancements // @input None // @description @@ -3290,7 +3290,7 @@ else if (split.length > 1) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name name // @input Element // @description @@ -3307,7 +3307,7 @@ else if (split.length > 1) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name skin // @input Element // @description @@ -3325,7 +3325,7 @@ else if (split.length > 1) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name skin_blob // @input Element // @description @@ -3336,33 +3336,33 @@ else if (split.length > 1) { } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name is_whitelisted // @input Element(Boolean) // @description // Changes whether the player is whitelisted or not. // @tags - // + // // --> if (mechanism.matches("is_whitelisted") && mechanism.requireBoolean()) { getPlayerEntity().setWhitelisted(mechanism.getValue().asBoolean()); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name is_op // @input Element(Boolean) // @description // Changes whether the player is a server operator or not. // @tags - // + // // --> if (mechanism.matches("is_op") && mechanism.requireBoolean()) { getOfflinePlayer().setOp(mechanism.getValue().asBoolean()); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name money // @input Element(Number) // @plugin Vault @@ -3370,7 +3370,7 @@ else if (split.length > 1) { // Set the amount of money a player has with the linked economy system (through Vault). // (Only if supported by the registered Economy system.) // @tags - // + // // --> if (mechanism.matches("money") && mechanism.requireDouble() && Depends.economy != null) { double bal = Depends.economy.getBalance(getOfflinePlayer()); @@ -3385,7 +3385,7 @@ else if (bal > goal) { if (Depends.chat != null) { // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name chat_prefix // @input Element // @plugin Vault @@ -3393,14 +3393,14 @@ else if (bal > goal) { // Set the player's chat prefix. // Requires a Vault-compatible chat plugin. // @tags - // + // // --> if (mechanism.matches("chat_prefix")) { Depends.chat.setPlayerPrefix(getPlayerEntity(), mechanism.getValue().asString()); } // <--[mechanism] - // @object dPlayer + // @object PlayerTag // @name chat_suffix // @input Element // @plugin Vault @@ -3408,7 +3408,7 @@ else if (bal > goal) { // Set the player's chat suffix. // Requires a Vault-compatible chat plugin. // @tags - // + // // --> if (mechanism.matches("chat_suffix")) { Depends.chat.setPlayerSuffix(getPlayerEntity(), mechanism.getValue().asString()); @@ -3417,10 +3417,10 @@ else if (bal > goal) { CoreUtilities.autoPropertyMechanism(this, mechanism); - // Pass along to dEntity mechanism handler if not already handled. + // Pass along to EntityTag mechanism handler if not already handled. if (!mechanism.fulfilled()) { if (isOnline()) { - new dEntity(getPlayerEntity()).adjust(mechanism); + new EntityTag(getPlayerEntity()).adjust(mechanism); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/dPlugin.java b/plugin/src/main/java/com/denizenscript/denizen/objects/PluginTag.java similarity index 78% rename from plugin/src/main/java/com/denizenscript/denizen/objects/dPlugin.java rename to plugin/src/main/java/com/denizenscript/denizen/objects/PluginTag.java index 96a1ff08db..07e56e9e3b 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/dPlugin.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/PluginTag.java @@ -12,13 +12,13 @@ import java.util.HashMap; -public class dPlugin implements ObjectTag { +public class PluginTag implements ObjectTag { // <--[language] - // @name dPlugin + // @name PluginTag // @group Object System // @description - // A dPlugin represents a Bukkit plugin on the server. + // A PluginTag represents a Bukkit plugin on the server. // // For format info, see <@link language pl@> // @@ -28,11 +28,11 @@ public class dPlugin implements ObjectTag { // @name pl@ // @group Object Fetcher System // @description - // pl@ refers to the 'object identifier' of a dPlugin. The 'pl@' is notation for Denizen's Object - // Fetcher. The constructor for a dPlugin is the plugin's registered name. + // pl@ refers to the 'object identifier' of a PluginTag. The 'pl@' is notation for Denizen's Object + // Fetcher. The constructor for a PluginTag is the plugin's registered name. // For example, 'pl@Denizen'. // - // For general info, see <@link language dPlugin> + // For general info, see <@link language PluginTag> // // --> @@ -41,19 +41,19 @@ public class dPlugin implements ObjectTag { //////////////// - public static dPlugin valueOf(String string) { + public static PluginTag valueOf(String string) { return valueOf(string, null); } /** - * Gets a dPlugin from a string format. + * Gets a PluginTag from a string format. * * @param string The plugin in string form. (pl@PluginName) - * @return The dPlugin value. If the string is incorrectly formatted or + * @return The PluginTag value. If the string is incorrectly formatted or * the specified plugin is invalid, this is null. */ @Fetchable("pl") - public static dPlugin valueOf(String string, TagContext context) { + public static PluginTag valueOf(String string, TagContext context) { if (string == null) { return null; @@ -65,7 +65,7 @@ public static dPlugin valueOf(String string, TagContext context) { // Attempt to match from plugin list, as PluginManager#getPlugin is case sensitive for (Plugin plugin : Bukkit.getServer().getPluginManager().getPlugins()) { if (string.equalsIgnoreCase(plugin.getName())) { - return new dPlugin(plugin); + return new PluginTag(plugin); } } } @@ -94,7 +94,7 @@ public static boolean matches(String arg) { // Constructors ////////////////// - public dPlugin(Plugin plugin) { + public PluginTag(Plugin plugin) { this.plugin = plugin; } @@ -147,7 +147,7 @@ public String toString() { } @Override - public dPlugin setPrefix(String prefix) { + public PluginTag setPrefix(String prefix) { this.prefix = prefix; return this; } @@ -155,7 +155,7 @@ public dPlugin setPrefix(String prefix) { public static void registerTags() { // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Gets the name of this plugin. @@ -163,13 +163,13 @@ public static void registerTags() { registerTag("name", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dPlugin) object).plugin.getName()) + return new ElementTag(((PluginTag) object).plugin.getName()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Gets the version for the plugin specified. @@ -177,13 +177,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("version", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dPlugin) object).plugin.getDescription().getVersion()) + return new ElementTag(((PluginTag) object).plugin.getDescription().getVersion()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Gets the description for the plugin specified. @@ -191,13 +191,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("description", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dPlugin) object).plugin.getDescription().getDescription()) + return new ElementTag(((PluginTag) object).plugin.getDescription().getDescription()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ListTag // @description // Gets the list of authors for the plugin specified. @@ -205,16 +205,16 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("authors", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ListTag(((dPlugin) object).plugin.getDescription().getAuthors()) + return new ListTag(((PluginTag) object).plugin.getDescription().getAuthors()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description - // Always returns 'Plugin' for dPlugin objects. All objects fetchable by the Object Fetcher will return the + // Always returns 'Plugin' for PluginTag objects. All objects fetchable by the Object Fetcher will return the // type of object that is fulfilling this attribute. // --> registerTag("type", new TagRunnable() { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/dTrade.java b/plugin/src/main/java/com/denizenscript/denizen/objects/TradeTag.java similarity index 80% rename from plugin/src/main/java/com/denizenscript/denizen/objects/dTrade.java rename to plugin/src/main/java/com/denizenscript/denizen/objects/TradeTag.java index 38b97994eb..7ca3f6079a 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/dTrade.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/TradeTag.java @@ -15,7 +15,7 @@ import java.util.Arrays; import java.util.regex.Matcher; -public class dTrade implements ObjectTag, Adjustable { +public class TradeTag implements ObjectTag, Adjustable { // <--[language] // @name Merchant Trades @@ -24,7 +24,7 @@ public class dTrade implements ObjectTag, Adjustable { // Merchant trades are the parts of a special merchant inventory that is typically viewed by right clicking // a villager entity. Any number of trades can fit in a single merchant inventory. // - // Trades are represented by 'trade@trade' ObjectTags. + // Trades are represented by 'TradeTag' ObjectTags. // // The properties that can be used to customize a merchant trade are: // @@ -42,7 +42,7 @@ public class dTrade implements ObjectTag, Adjustable { // open two trades: // type: task // script: - // - opentrades li@trade@trade[max_uses=10;inputs=i@emerald[quantity=2];result=i@sponge|trade@trade[result=i@barrier] + // - opentrades li@TradeTag[max_uses=10;inputs=i@emerald[quantity=2];result=i@sponge|TradeTag[result=i@barrier] // // // For format info, see <@link language trade@> @@ -52,8 +52,8 @@ public class dTrade implements ObjectTag, Adjustable { // @name trade@ // @group Object Fetcher System // @description - // trade@ refers to the 'object identifier' of a dTrade. The 'trade@' is notation for Denizen's Object - // Fetcher. The constructor for a dNPC is just the text 'trade'. All other data is specified through properties. + // trade@ refers to the 'object identifier' of a TradeTag. The 'trade@' is notation for Denizen's Object + // Fetcher. The constructor for a NPCTag is just the text 'trade'. All other data is specified through properties. // // For general info, see <@link language Merchant Trades> // @@ -63,12 +63,12 @@ public class dTrade implements ObjectTag, Adjustable { // OBJECT FETCHER //////////////// - public static dTrade valueOf(String string) { + public static TradeTag valueOf(String string) { return valueOf(string, null); } @Fetchable("trade") - public static dTrade valueOf(String string, TagContext context) { + public static TradeTag valueOf(String string, TagContext context) { if (string == null) { return null; } @@ -77,7 +77,7 @@ public static dTrade valueOf(String string, TagContext context) { // Handle objects with properties through the object fetcher Matcher m = ObjectFetcher.DESCRIBED_PATTERN.matcher(string); if (m.matches()) { - return ObjectFetcher.getObjectFrom(dTrade.class, string, new BukkitTagContext(((BukkitTagContext) context).player, + return ObjectFetcher.getObjectFrom(TradeTag.class, string, new BukkitTagContext(((BukkitTagContext) context).player, ((BukkitTagContext) context).npc, false, null, !context.debug, null)); } @@ -85,20 +85,20 @@ public static dTrade valueOf(String string, TagContext context) { if (string.toLowerCase().matches("trade")) { MerchantRecipe recipe = new MerchantRecipe(new ItemStack(Material.AIR), 0); recipe.setIngredients(new ArrayList<>(Arrays.asList(new ItemStack(Material.AIR)))); - return new dTrade(recipe); + return new TradeTag(recipe); } return null; } public static boolean matches(String arg) { - return arg.matches("trade@trade"); + return arg.matches("TradeTag"); } /////////////// // Constructors ///////////// - public dTrade(MerchantRecipe recipe) { + public TradeTag(MerchantRecipe recipe) { this.recipe = recipe; } @@ -128,7 +128,7 @@ public String getPrefix() { return "trade"; } - public dTrade setPrefix(String prefix) { + public TradeTag setPrefix(String prefix) { return this; } diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/dWorld.java b/plugin/src/main/java/com/denizenscript/denizen/objects/WorldTag.java similarity index 77% rename from plugin/src/main/java/com/denizenscript/denizen/objects/dWorld.java rename to plugin/src/main/java/com/denizenscript/denizen/objects/WorldTag.java index 0559638eeb..02fc91e28e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/dWorld.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/WorldTag.java @@ -21,16 +21,16 @@ import java.util.List; import java.util.Map; -public class dWorld implements ObjectTag, Adjustable { +public class WorldTag implements ObjectTag, Adjustable { ///////////////////// // STATIC METHODS ///////////////// - static Map worlds = new HashMap<>(); + static Map worlds = new HashMap<>(); - public static dWorld mirrorBukkitWorld(World world) { + public static WorldTag mirrorBukkitWorld(World world) { if (world == null) { return null; } @@ -38,7 +38,7 @@ public static dWorld mirrorBukkitWorld(World world) { return worlds.get(world.getName()); } else { - return new dWorld(world); + return new WorldTag(world); } } @@ -48,10 +48,10 @@ public static dWorld mirrorBukkitWorld(World world) { ///////////////// // <--[language] - // @name dWorld + // @name WorldTag // @group Object System // @description - // A dWorld represents a world on the server. + // A WorldTag represents a world on the server. // // For format info, see <@link language w@> // @@ -61,25 +61,25 @@ public static dWorld mirrorBukkitWorld(World world) { // @name w@ // @group Object Fetcher System // @description - // w@ refers to the 'object identifier' of a dWorld. The 'w@' is notation for Denizen's Object - // Fetcher. The only valid constructor for a dWorld is the name of the world it should be - // associated with. For example, to reference the world named 'world1', use w@world1. + // w@ refers to the 'object identifier' of a WorldTag. The 'w@' is notation for Denizen's Object + // Fetcher. The only valid constructor for a WorldTag is the name of the world it should be + // associated with. For example, to reference the world named 'world1', use WorldTag1. // World names are case insensitive. // - // For general info, see <@link language dWorld> + // For general info, see <@link language WorldTag> // --> - public static dWorld valueOf(String string) { + public static WorldTag valueOf(String string) { return valueOf(string, null); } @Fetchable("w") - public static dWorld valueOf(String string, TagContext context) { + public static WorldTag valueOf(String string, TagContext context) { return valueOf(string, context == null || context.debug); } - public static dWorld valueOf(String string, boolean announce) { + public static WorldTag valueOf(String string, boolean announce) { if (string == null) { return null; } @@ -102,7 +102,7 @@ public static dWorld valueOf(String string, boolean announce) { return worlds.get(returnable.getName()); } else { - return new dWorld(returnable); + return new WorldTag(returnable); } } else if (announce) { @@ -145,11 +145,11 @@ public List getEntities() { private String prefix; String world_name; - public dWorld(World world) { + public WorldTag(World world) { this(null, world); } - public dWorld(String prefix, World world) { + public WorldTag(String prefix, World world) { if (prefix == null) { this.prefix = "World"; } @@ -206,18 +206,18 @@ public static void registerTags() { ///////////////// // <--[tag] - // @attribute - // @returns ListTag(dEntity) + // @attribute + // @returns ListTag(EntityTag) // @description // Returns a list of entities in this world. // --> registerTag("entities", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - ArrayList entities = new ArrayList<>(); + ArrayList entities = new ArrayList<>(); - for (Entity entity : ((dWorld) object).getWorld().getEntities()) { - entities.add(new dEntity(entity)); + for (Entity entity : ((WorldTag) object).getWorld().getEntities()) { + entities.add(new EntityTag(entity)); } return new ListTag(entities) @@ -226,18 +226,18 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute - // @returns ListTag(dEntity) + // @attribute + // @returns ListTag(EntityTag) // @description // Returns a list of living entities in this world. // --> registerTag("living_entities", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - ArrayList entities = new ArrayList<>(); + ArrayList entities = new ArrayList<>(); - for (Entity entity : ((dWorld) object).getWorld().getLivingEntities()) { - entities.add(new dEntity(entity)); + for (Entity entity : ((WorldTag) object).getWorld().getLivingEntities()) { + entities.add(new EntityTag(entity)); } return new ListTag(entities) @@ -246,19 +246,19 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute - // @returns ListTag(dPlayer) + // @attribute + // @returns ListTag(PlayerTag) // @description // Returns a list of online players in this world. // --> registerTag("players", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - ArrayList players = new ArrayList<>(); + ArrayList players = new ArrayList<>(); - for (Player player : ((dWorld) object).getWorld().getPlayers()) { - if (!dEntity.isNPC(player)) { - players.add(new dPlayer(player)); + for (Player player : ((WorldTag) object).getWorld().getPlayers()) { + if (!EntityTag.isNPC(player)) { + players.add(new PlayerTag(player)); } } @@ -268,21 +268,21 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute - // @returns ListTag(dNPC) + // @attribute + // @returns ListTag(NPCTag) // @description // Returns a list of spawned NPCs in this world. // --> registerTag("spawned_npcs", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - ArrayList npcs = new ArrayList<>(); + ArrayList npcs = new ArrayList<>(); - World thisWorld = ((dWorld) object).getWorld(); + World thisWorld = ((WorldTag) object).getWorld(); for (NPC npc : CitizensAPI.getNPCRegistry()) { if (npc.isSpawned() && npc.getEntity().getLocation().getWorld().equals(thisWorld)) { - npcs.add(dNPC.mirrorCitizensNPC(npc)); + npcs.add(NPCTag.mirrorCitizensNPC(npc)); } } @@ -292,24 +292,24 @@ public String run(Attribute attribute, ObjectTag object) { }); // <--[tag] - // @attribute - // @returns ListTag(dNPC) + // @attribute + // @returns ListTag(NPCTag) // @description // Returns a list of all NPCs in this world. // --> registerTag("npcs", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - ArrayList npcs = new ArrayList<>(); + ArrayList npcs = new ArrayList<>(); - World thisWorld = ((dWorld) object).getWorld(); + World thisWorld = ((WorldTag) object).getWorld(); for (NPC npc : CitizensAPI.getNPCRegistry()) { Location location = npc.getStoredLocation(); if (location != null) { World world = location.getWorld(); if (world != null && world.equals(thisWorld)) { - npcs.add(dNPC.mirrorCitizensNPC(npc)); + npcs.add(NPCTag.mirrorCitizensNPC(npc)); } } } @@ -325,7 +325,7 @@ public String run(Attribute attribute, ObjectTag object) { ///////////////// // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the world will generate structures. @@ -333,14 +333,14 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("can_generate_structures", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dWorld) object).getWorld().canGenerateStructures()) + return new ElementTag(((WorldTag) object).getWorld().canGenerateStructures()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute - // @returns ListTag(dChunk) + // @attribute + // @returns ListTag(ChunkTag) // @description // Returns a list of all the currently loaded chunks. // --> @@ -348,30 +348,30 @@ public String run(Attribute attribute, ObjectTag object) { @Override public String run(Attribute attribute, ObjectTag object) { ListTag chunks = new ListTag(); - for (Chunk ent : ((dWorld) object).getWorld().getLoadedChunks()) { - chunks.add(new dChunk(ent).identify()); + for (Chunk ent : ((WorldTag) object).getWorld().getLoadedChunks()) { + chunks.add(new ChunkTag(ent).identify()); } return chunks.getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute - // @returns dChunk + // @attribute + // @returns ChunkTag // @description // Returns a random loaded chunk. // --> registerTag("random_loaded_chunk", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - int random = CoreUtilities.getRandom().nextInt(((dWorld) object).getWorld().getLoadedChunks().length); - return new dChunk(((dWorld) object).getWorld().getLoadedChunks()[random]) + int random = CoreUtilities.getRandom().nextInt(((WorldTag) object).getWorld().getLoadedChunks().length); + return new ChunkTag(((WorldTag) object).getWorld().getLoadedChunks()[random]) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the level of the sea. @@ -379,27 +379,27 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("sea_level", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dWorld) object).getWorld().getSeaLevel()) + return new ElementTag(((WorldTag) object).getWorld().getSeaLevel()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @description // Returns the spawn location of the world. // --> registerTag("spawn_location", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new dLocation(((dWorld) object).getWorld().getSpawnLocation()) + return new LocationTag(((WorldTag) object).getWorld().getSpawnLocation()) .getAttribute(attribute.fulfill(1)); } }); // <-- [tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the world type of the world. @@ -408,7 +408,7 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("world_type", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dWorld) object).getWorld().getWorldType().getName()) + return new ElementTag(((WorldTag) object).getWorld().getWorldType().getName()) .getAttribute(attribute.fulfill(1)); } }); @@ -419,7 +419,7 @@ public String run(Attribute attribute, ObjectTag object) { ///////////////// // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the name of the world. @@ -427,13 +427,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("name", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dWorld) object).getWorld().getName()) + return new ElementTag(((WorldTag) object).getWorld().getName()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the world seed. @@ -441,7 +441,7 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("seed", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dWorld) object).getWorld().getSeed()) + return new ElementTag(((WorldTag) object).getWorld().getSeed()) .getAttribute(attribute.fulfill(1)); } }); @@ -452,7 +452,7 @@ public String run(Attribute attribute, ObjectTag object) { ///////////////// // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether animals can spawn in this world. @@ -460,13 +460,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("allows_animals", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dWorld) object).getWorld().getAllowAnimals()) + return new ElementTag(((WorldTag) object).getWorld().getAllowAnimals()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether monsters can spawn in this world. @@ -474,13 +474,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("allows_monsters", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dWorld) object).getWorld().getAllowMonsters()) + return new ElementTag(((WorldTag) object).getWorld().getAllowMonsters()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether player versus player combat is allowed in this world. @@ -488,13 +488,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("allows_pvp", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dWorld) object).getWorld().getPVP()) + return new ElementTag(((WorldTag) object).getWorld().getPVP()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the world automatically saves. @@ -502,13 +502,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("auto_save", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dWorld) object).getWorld().isAutoSave()) + return new ElementTag(((WorldTag) object).getWorld().isAutoSave()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the number of ambient mobs that can spawn in a chunk in this world. @@ -516,13 +516,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("ambient_spawn_limit", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dWorld) object).getWorld().getAmbientSpawnLimit()) + return new ElementTag(((WorldTag) object).getWorld().getAmbientSpawnLimit()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the number of animals that can spawn in a chunk in this world. @@ -530,13 +530,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("animal_spawn_limit", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dWorld) object).getWorld().getAnimalSpawnLimit()) + return new ElementTag(((WorldTag) object).getWorld().getAnimalSpawnLimit()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the number of monsters that can spawn in a chunk in this world. @@ -544,13 +544,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("monster_spawn_limit", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dWorld) object).getWorld().getMonsterSpawnLimit()) + return new ElementTag(((WorldTag) object).getWorld().getMonsterSpawnLimit()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the number of water animals that can spawn in a chunk in this world. @@ -558,13 +558,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("water_animal_spawn_limit", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dWorld) object).getWorld().getWaterAnimalSpawnLimit()) + return new ElementTag(((WorldTag) object).getWorld().getWaterAnimalSpawnLimit()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the name of the difficulty level. @@ -572,13 +572,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("difficulty", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dWorld) object).getWorld().getDifficulty().name()) + return new ElementTag(((WorldTag) object).getWorld().getDifficulty().name()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether the world's spawn area should be kept loaded into memory. @@ -586,13 +586,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("keep_spawn", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dWorld) object).getWorld().getKeepSpawnInMemory()) + return new ElementTag(((WorldTag) object).getWorld().getKeepSpawnInMemory()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the maximum height of this world. @@ -600,13 +600,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("max_height", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dWorld) object).getWorld().getMaxHeight()) + return new ElementTag(((WorldTag) object).getWorld().getMaxHeight()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns DurationTag // @description // Returns the world's ticks per animal spawn mechanism.getValue(). @@ -614,13 +614,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("ticks_per_animal_spawn", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new DurationTag(((dWorld) object).getWorld().getTicksPerAnimalSpawns()) + return new DurationTag(((WorldTag) object).getWorld().getTicksPerAnimalSpawns()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns DurationTag // @description // Returns the world's ticks per monster spawn mechanism.getValue(). @@ -628,7 +628,7 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("ticks_per_monster_spawn", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new DurationTag(((dWorld) object).getWorld().getTicksPerMonsterSpawns()) + return new DurationTag(((WorldTag) object).getWorld().getTicksPerMonsterSpawns()) .getAttribute(attribute.fulfill(1)); } }); @@ -638,7 +638,7 @@ public String run(Attribute attribute, ObjectTag object) { ///////////////// // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the relative in-game time of this world. @@ -649,36 +649,36 @@ public String run(Attribute attribute, ObjectTag object) { attribute = attribute.fulfill(1); // <--[tag] - // @attribute + // @attribute // @returns DurationTags // @description // Returns the relative in-game time of this world as a duration. // --> if (attribute.startsWith("duration")) { - return new DurationTag(((dWorld) object).getWorld().getTime()) + return new DurationTag(((WorldTag) object).getWorld().getTime()) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute + // @attribute // @returns DurationTag // @description // Returns the in-game time of this world. // --> else if (attribute.startsWith("full")) { - return new ElementTag(((dWorld) object).getWorld().getFullTime()) + return new ElementTag(((WorldTag) object).getWorld().getFullTime()) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the time as 'day', 'night', 'dawn', or 'dusk'. // --> else if (attribute.startsWith("period")) { - long time = ((dWorld) object).getWorld().getTime(); + long time = ((WorldTag) object).getWorld().getTime(); String period; if (time >= 23000) { @@ -697,13 +697,13 @@ else if (time >= 12500) { return new ElementTag(period).getAttribute(attribute.fulfill(1)); } else { - return new ElementTag(((dWorld) object).getWorld().getTime()).getAttribute(attribute); + return new ElementTag(((WorldTag) object).getWorld().getTime()).getAttribute(attribute); } } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @description // Returns the current phase of the moon, as an integer from 1 to 8. @@ -711,7 +711,7 @@ else if (time >= 12500) { registerTag("moon_phase", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag((int) ((((dWorld) object).getWorld().getFullTime() / 24000) % 8) + 1) + return new ElementTag((int) ((((WorldTag) object).getWorld().getFullTime() / 24000) % 8) + 1) .getAttribute(attribute.fulfill(1)); } }); @@ -722,22 +722,22 @@ public String run(Attribute attribute, ObjectTag object) { ///////////////// // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether there is currently a storm in this world. - // ie, whether it is raining. To check for thunder, use <@link tag w@world.thundering>. + // ie, whether it is raining. To check for thunder, use <@link tag WorldTag.thundering>. // --> registerTag("has_storm", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dWorld) object).getWorld().hasStorm()) + return new ElementTag(((WorldTag) object).getWorld().hasStorm()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns DurationTag // @description // Returns the duration of thunder. @@ -745,13 +745,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("thunder_duration", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new DurationTag((long) ((dWorld) object).getWorld().getThunderDuration()) + return new DurationTag((long) ((WorldTag) object).getWorld().getThunderDuration()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @description // Returns whether it is currently thundering in this world. @@ -759,13 +759,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("thundering", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dWorld) object).getWorld().isThundering()) + return new ElementTag(((WorldTag) object).getWorld().isThundering()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns DurationTag // @description // Returns the duration of storms. @@ -773,13 +773,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("weather_duration", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new DurationTag((long) ((dWorld) object).getWorld().getWeatherDuration()) + return new DurationTag((long) ((WorldTag) object).getWorld().getWeatherDuration()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // Returns the environment of the world: NORMAL, NETHER, or THE_END. @@ -787,16 +787,16 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("environment", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dWorld) object).getWorld().getEnvironment().name()) + return new ElementTag(((WorldTag) object).getWorld().getEnvironment().name()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description - // Always returns 'World' for dWorld objects. All objects fetchable by the Object Fetcher will return the + // Always returns 'World' for WorldTag objects. All objects fetchable by the Object Fetcher will return the // type of object that is fulfilling this attribute. // --> registerTag("type", new TagRunnable() { @@ -811,7 +811,7 @@ public String run(Attribute attribute, ObjectTag object) { ///////////////// // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // returns the size of the world border in this world. @@ -819,27 +819,27 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("border_size", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dWorld) object).getWorld().getWorldBorder().getSize()) + return new ElementTag(((WorldTag) object).getWorld().getWorldBorder().getSize()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute - // @returns dLocation + // @attribute + // @returns LocationTag // @description // returns the center of the world border in this world. // --> registerTag("border_center", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new dLocation(((dWorld) object).getWorld().getWorldBorder().getCenter()) + return new LocationTag(((WorldTag) object).getWorld().getWorldBorder().getCenter()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // returns the size of the world border in this world. @@ -847,13 +847,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("border_damage", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dWorld) object).getWorld().getWorldBorder().getDamageAmount()) + return new ElementTag(((WorldTag) object).getWorld().getWorldBorder().getDamageAmount()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // returns the damage buffer of the world border in this world. @@ -861,13 +861,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("border_damage_buffer", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dWorld) object).getWorld().getWorldBorder().getDamageBuffer()) + return new ElementTag(((WorldTag) object).getWorld().getWorldBorder().getDamageBuffer()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @description // returns the warning distance of the world border in this world. @@ -875,13 +875,13 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("border_warning_distance", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new ElementTag(((dWorld) object).getWorld().getWorldBorder().getWarningDistance()) + return new ElementTag(((WorldTag) object).getWorld().getWorldBorder().getWarningDistance()) .getAttribute(attribute.fulfill(1)); } }); // <--[tag] - // @attribute + // @attribute // @returns DurationTag // @description // returns warning time of the world border in this world as a duration. @@ -889,7 +889,7 @@ public String run(Attribute attribute, ObjectTag object) { registerTag("border_warning_time", new TagRunnable() { @Override public String run(Attribute attribute, ObjectTag object) { - return new DurationTag(((dWorld) object).getWorld().getWorldBorder().getWarningTime()) + return new DurationTag(((WorldTag) object).getWorld().getWorldBorder().getWarningTime()) .getAttribute(attribute.fulfill(1)); } }); @@ -939,13 +939,13 @@ public void applyProperty(Mechanism mechanism) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dWorld + // @object WorldTag // @name ambient_spawn_limit // @input Element(Number) // @description // Sets the limit for number of ambient mobs that can spawn in a chunk in this world. // @tags - // + // // --> if (mechanism.matches("ambient_spawn_limit") && mechanism.requireInteger()) { @@ -953,13 +953,13 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dWorld + // @object WorldTag // @name animal_spawn_limit // @input Element(Number) // @description // Sets the limit for number of animals that can spawn in a chunk in this world. // @tags - // + // // --> if (mechanism.matches("animal_spawn_limit") && mechanism.requireInteger()) { @@ -967,13 +967,13 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dWorld + // @object WorldTag // @name auto_save // @input Element(Boolean) // @description // Sets whether the world will automatically save edits. // @tags - // + // // --> if (mechanism.matches("auto_save") && mechanism.requireBoolean()) { @@ -981,14 +981,14 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dWorld + // @object WorldTag // @name difficulty // @input Element // @description // Sets the difficulty level of this world. // Possible values: Peaceful, Easy, Normal, Hard. // @tags - // + // // --> if (mechanism.matches("difficulty") && mechanism.requireEnum(true, Difficulty.values())) { String upper = mechanism.getValue().asString().toUpperCase(); @@ -1005,7 +1005,7 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dWorld + // @object WorldTag // @name save // @input None // @description @@ -1018,7 +1018,7 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dWorld + // @object WorldTag // @name destroy // @input None // @description @@ -1044,7 +1044,7 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dWorld + // @object WorldTag // @name force_unload // @input None // @description @@ -1058,151 +1058,151 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dWorld + // @object WorldTag // @name full_time // @input Element(Number) // @description // Sets the in-game time on the server. // @tags - // + // // --> if (mechanism.matches("full_time") && mechanism.requireInteger()) { getWorld().setFullTime(mechanism.getValue().asInt()); } // <--[mechanism] - // @object dWorld + // @object WorldTag // @name keep_spawn // @input Element(Boolean) // @description // Sets whether the world's spawn area should be kept loaded into memory. // @tags - // + // // --> if (mechanism.matches("keep_spawn") && mechanism.requireBoolean()) { getWorld().setKeepSpawnInMemory(mechanism.getValue().asBoolean()); } // <--[mechanism] - // @object dWorld + // @object WorldTag // @name monster_spawn_limit // @input Element(Number) // @description // Sets the limit for number of monsters that can spawn in a chunk in this world. // @tags - // + // // --> if (mechanism.matches("monster_spawn_limit") && mechanism.requireInteger()) { getWorld().setMonsterSpawnLimit(mechanism.getValue().asInt()); } // <--[mechanism] - // @object dWorld + // @object WorldTag // @name allow_pvp // @input Element(Boolean) // @description // Sets whether player versus player combat is allowed in this world. // @tags - // + // // --> if (mechanism.matches("allow_pvp") && mechanism.requireBoolean()) { getWorld().setPVP(mechanism.getValue().asBoolean()); } // <--[mechanism] - // @object dWorld + // @object WorldTag // @name spawn_location - // @input dLocation + // @input LocationTag // @description - // Sets the spawn location of this world. (This ignores the world value of the dLocation.) + // Sets the spawn location of this world. (This ignores the world value of the LocationTag.) // @tags - // + // // --> - if (mechanism.matches("spawn_location") && mechanism.requireObject(dLocation.class)) { - dLocation loc = mechanism.valueAsType(dLocation.class); + if (mechanism.matches("spawn_location") && mechanism.requireObject(LocationTag.class)) { + LocationTag loc = mechanism.valueAsType(LocationTag.class); getWorld().setSpawnLocation(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()); } // <--[mechanism] - // @object dWorld + // @object WorldTag // @name storming // @input Element(Boolean) // @description // Sets whether there is a storm. // @tags - // + // // --> if (mechanism.matches("storming") && mechanism.requireBoolean()) { getWorld().setStorm(mechanism.getValue().asBoolean()); } // <--[mechanism] - // @object dWorld + // @object WorldTag // @name thunder_duration // @input Duration // @description // Sets the duration of thunder. // @tags - // + // // --> if (mechanism.matches("thunder_duration") && mechanism.requireObject(DurationTag.class)) { getWorld().setThunderDuration(mechanism.valueAsType(DurationTag.class).getTicksAsInt()); } // <--[mechanism] - // @object dWorld + // @object WorldTag // @name thundering // @input Element(Boolean) // @description // Sets whether it is thundering. // @tags - // + // // --> if (mechanism.matches("thundering") && mechanism.requireBoolean()) { getWorld().setThundering(mechanism.getValue().asBoolean()); } // <--[mechanism] - // @object dWorld + // @object WorldTag // @name ticks_per_animal_spawns // @input Duration // @description // Sets the time between animal spawns. // @tags - // + // // --> if (mechanism.matches("ticks_per_animal_spawns") && mechanism.requireObject(DurationTag.class)) { getWorld().setTicksPerAnimalSpawns(mechanism.valueAsType(DurationTag.class).getTicksAsInt()); } // <--[mechanism] - // @object dWorld + // @object WorldTag // @name ticks_per_monster_spawns // @input Duration // @description // Sets the time between monster spawns. // @tags - // + // // --> if (mechanism.matches("ticks_per_monster_spawns") && mechanism.requireObject(DurationTag.class)) { getWorld().setTicksPerMonsterSpawns(mechanism.valueAsType(DurationTag.class).getTicksAsInt()); } // <--[mechanism] - // @object dWorld + // @object WorldTag // @name time // @input Element(Number) // @description // Sets the relative in-game time on the server. // @tags - // + // // --> if (mechanism.matches("time") && mechanism.requireInteger()) { getWorld().setTime(mechanism.getValue().asInt()); } // <--[mechanism] - // @object dWorld + // @object WorldTag // @name unload // @input None // @description @@ -1216,26 +1216,26 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dWorld + // @object WorldTag // @name water_animal_spawn_limit // @input Element(Number) // @description // Sets the limit for number of water animals that can spawn in a chunk in this world. // @tags - // + // // --> if (mechanism.matches("water_animal_spawn_limit") && mechanism.requireInteger()) { getWorld().setWaterAnimalSpawnLimit(mechanism.getValue().asInt()); } // <--[mechanism] - // @object dWorld + // @object WorldTag // @name weather_duration // @input Duration // @description // Set the remaining time in ticks of the current conditions. // @tags - // + // // --> if (mechanism.matches("weather_duration") && mechanism.requireObject(DurationTag.class)) { getWorld().setWeatherDuration(mechanism.valueAsType(DurationTag.class).getTicksAsInt()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/notable/NotableManager.java b/plugin/src/main/java/com/denizenscript/denizen/objects/notable/NotableManager.java index 03e1e43fe4..0c8e36f472 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/notable/NotableManager.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/notable/NotableManager.java @@ -30,11 +30,11 @@ public class NotableManager { public NotableManager() { - registerWithNotableManager(dCuboid.class); - registerWithNotableManager(dEllipsoid.class); - registerWithNotableManager(dInventory.class); - registerWithNotableManager(dItem.class); - registerWithNotableManager(dLocation.class); + registerWithNotableManager(CuboidTag.class); + registerWithNotableManager(EllipsoidTag.class); + registerWithNotableManager(InventoryTag.class); + registerWithNotableManager(ItemTag.class); + registerWithNotableManager(LocationTag.class); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/PropertyRegistry.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/PropertyRegistry.java index 40f2cf168b..562e9dbb86 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/PropertyRegistry.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/PropertyRegistry.java @@ -30,117 +30,117 @@ public static void registermainProperties() { PropertyParser.registerProperty(BukkitElementProperties.class, ElementTag.class); PropertyParser.registerProperty(BukkitListProperties.class, ListTag.class); - // register core dEntity properties - PropertyParser.registerProperty(EntityAge.class, dEntity.class); - PropertyParser.registerProperty(EntityAI.class, dEntity.class); - PropertyParser.registerProperty(EntityAnger.class, dEntity.class); - PropertyParser.registerProperty(EntityAngry.class, dEntity.class); - PropertyParser.registerProperty(EntityAreaEffectCloud.class, dEntity.class); - PropertyParser.registerProperty(EntityArmorBonus.class, dEntity.class); - PropertyParser.registerProperty(EntityArrowDamage.class, dEntity.class); - PropertyParser.registerProperty(EntityInvulnerable.class, dEntity.class); - PropertyParser.registerProperty(EntityBoatType.class, dEntity.class); - PropertyParser.registerProperty(EntityArmorPose.class, dEntity.class); - PropertyParser.registerProperty(EntityArms.class, dEntity.class); - PropertyParser.registerProperty(EntityBasePlate.class, dEntity.class); - PropertyParser.registerProperty(EntityBeamTarget.class, dEntity.class); - PropertyParser.registerProperty(EntityBodyArrows.class, dEntity.class); - PropertyParser.registerProperty(EntityBoundingBox.class, dEntity.class); - PropertyParser.registerProperty(EntityChestCarrier.class, dEntity.class); - PropertyParser.registerProperty(EntityColor.class, dEntity.class); - PropertyParser.registerProperty(EntityCritical.class, dEntity.class); - PropertyParser.registerProperty(EntityCustomName.class, dEntity.class); - PropertyParser.registerProperty(EntityDisabledSlots.class, dEntity.class); - PropertyParser.registerProperty(EntityPotionEffects.class, dEntity.class); - PropertyParser.registerProperty(EntityElder.class, dEntity.class); - PropertyParser.registerProperty(EntityEquipment.class, dEntity.class); - PropertyParser.registerProperty(EntityExplosionFire.class, dEntity.class); - PropertyParser.registerProperty(EntityExplosionRadius.class, dEntity.class); - PropertyParser.registerProperty(EntityFirework.class, dEntity.class); - PropertyParser.registerProperty(EntityFramed.class, dEntity.class); - PropertyParser.registerProperty(EntityGravity.class, dEntity.class); - PropertyParser.registerProperty(EntityHealth.class, dEntity.class); - PropertyParser.registerProperty(EntityInfected.class, dEntity.class); - PropertyParser.registerProperty(EntityInventory.class, dEntity.class); - PropertyParser.registerProperty(EntityIsShowingBottom.class, dEntity.class); - PropertyParser.registerProperty(EntityItem.class, dEntity.class); - PropertyParser.registerProperty(EntityJumpStrength.class, dEntity.class); - PropertyParser.registerProperty(EntityKnockback.class, dEntity.class); - PropertyParser.registerProperty(EntityMarker.class, dEntity.class); - PropertyParser.registerProperty(EntityMaxFuseTicks.class, dEntity.class); - PropertyParser.registerProperty(EntityPainting.class, dEntity.class); - PropertyParser.registerProperty(EntityPickupStatus.class, dEntity.class); - PropertyParser.registerProperty(EntityPotion.class, dEntity.class); - PropertyParser.registerProperty(EntityPowered.class, dEntity.class); - PropertyParser.registerProperty(EntityProfession.class, dEntity.class); + // register core EntityTag properties + PropertyParser.registerProperty(EntityAge.class, EntityTag.class); + PropertyParser.registerProperty(EntityAI.class, EntityTag.class); + PropertyParser.registerProperty(EntityAnger.class, EntityTag.class); + PropertyParser.registerProperty(EntityAngry.class, EntityTag.class); + PropertyParser.registerProperty(EntityAreaEffectCloud.class, EntityTag.class); + PropertyParser.registerProperty(EntityArmorBonus.class, EntityTag.class); + PropertyParser.registerProperty(EntityArrowDamage.class, EntityTag.class); + PropertyParser.registerProperty(EntityInvulnerable.class, EntityTag.class); + PropertyParser.registerProperty(EntityBoatType.class, EntityTag.class); + PropertyParser.registerProperty(EntityArmorPose.class, EntityTag.class); + PropertyParser.registerProperty(EntityArms.class, EntityTag.class); + PropertyParser.registerProperty(EntityBasePlate.class, EntityTag.class); + PropertyParser.registerProperty(EntityBeamTarget.class, EntityTag.class); + PropertyParser.registerProperty(EntityBodyArrows.class, EntityTag.class); + PropertyParser.registerProperty(EntityBoundingBox.class, EntityTag.class); + PropertyParser.registerProperty(EntityChestCarrier.class, EntityTag.class); + PropertyParser.registerProperty(EntityColor.class, EntityTag.class); + PropertyParser.registerProperty(EntityCritical.class, EntityTag.class); + PropertyParser.registerProperty(EntityCustomName.class, EntityTag.class); + PropertyParser.registerProperty(EntityDisabledSlots.class, EntityTag.class); + PropertyParser.registerProperty(EntityPotionEffects.class, EntityTag.class); + PropertyParser.registerProperty(EntityElder.class, EntityTag.class); + PropertyParser.registerProperty(EntityEquipment.class, EntityTag.class); + PropertyParser.registerProperty(EntityExplosionFire.class, EntityTag.class); + PropertyParser.registerProperty(EntityExplosionRadius.class, EntityTag.class); + PropertyParser.registerProperty(EntityFirework.class, EntityTag.class); + PropertyParser.registerProperty(EntityFramed.class, EntityTag.class); + PropertyParser.registerProperty(EntityGravity.class, EntityTag.class); + PropertyParser.registerProperty(EntityHealth.class, EntityTag.class); + PropertyParser.registerProperty(EntityInfected.class, EntityTag.class); + PropertyParser.registerProperty(EntityInventory.class, EntityTag.class); + PropertyParser.registerProperty(EntityIsShowingBottom.class, EntityTag.class); + PropertyParser.registerProperty(EntityItem.class, EntityTag.class); + PropertyParser.registerProperty(EntityJumpStrength.class, EntityTag.class); + PropertyParser.registerProperty(EntityKnockback.class, EntityTag.class); + PropertyParser.registerProperty(EntityMarker.class, EntityTag.class); + PropertyParser.registerProperty(EntityMaxFuseTicks.class, EntityTag.class); + PropertyParser.registerProperty(EntityPainting.class, EntityTag.class); + PropertyParser.registerProperty(EntityPickupStatus.class, EntityTag.class); + PropertyParser.registerProperty(EntityPotion.class, EntityTag.class); + PropertyParser.registerProperty(EntityPowered.class, EntityTag.class); + PropertyParser.registerProperty(EntityProfession.class, EntityTag.class); if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13_R2)) { - PropertyParser.registerProperty(EntityRiptide.class, dEntity.class); + PropertyParser.registerProperty(EntityRiptide.class, EntityTag.class); } - PropertyParser.registerProperty(EntityRotation.class, dEntity.class); - PropertyParser.registerProperty(EntitySmall.class, dEntity.class); - PropertyParser.registerProperty(EntitySilent.class, dEntity.class); - PropertyParser.registerProperty(EntitySitting.class, dEntity.class); - PropertyParser.registerProperty(EntitySize.class, dEntity.class); - PropertyParser.registerProperty(EntitySkeleton.class, dEntity.class); - PropertyParser.registerProperty(EntitySpeed.class, dEntity.class); - PropertyParser.registerProperty(EntitySpell.class, dEntity.class); - PropertyParser.registerProperty(EntityTame.class, dEntity.class); - PropertyParser.registerProperty(EntityTrades.class, dEntity.class); - PropertyParser.registerProperty(EntityVisible.class, dEntity.class); + PropertyParser.registerProperty(EntityRotation.class, EntityTag.class); + PropertyParser.registerProperty(EntitySmall.class, EntityTag.class); + PropertyParser.registerProperty(EntitySilent.class, EntityTag.class); + PropertyParser.registerProperty(EntitySitting.class, EntityTag.class); + PropertyParser.registerProperty(EntitySize.class, EntityTag.class); + PropertyParser.registerProperty(EntitySkeleton.class, EntityTag.class); + PropertyParser.registerProperty(EntitySpeed.class, EntityTag.class); + PropertyParser.registerProperty(EntitySpell.class, EntityTag.class); + PropertyParser.registerProperty(EntityTame.class, EntityTag.class); + PropertyParser.registerProperty(EntityTrades.class, EntityTag.class); + PropertyParser.registerProperty(EntityVisible.class, EntityTag.class); - // register core dInventory properties - PropertyParser.registerProperty(InventoryHolder.class, dInventory.class); // Holder must be loaded first to initiate correctly - PropertyParser.registerProperty(InventorySize.class, dInventory.class); // Same with size... (too small for contents) - PropertyParser.registerProperty(InventoryContents.class, dInventory.class); - PropertyParser.registerProperty(InventoryTitle.class, dInventory.class); + // register core InventoryTag properties + PropertyParser.registerProperty(InventoryHolder.class, InventoryTag.class); // Holder must be loaded first to initiate correctly + PropertyParser.registerProperty(InventorySize.class, InventoryTag.class); // Same with size... (too small for contents) + PropertyParser.registerProperty(InventoryContents.class, InventoryTag.class); + PropertyParser.registerProperty(InventoryTitle.class, InventoryTag.class); - // register core dItem properties - PropertyParser.registerProperty(ItemApple.class, dItem.class); - PropertyParser.registerProperty(ItemBaseColor.class, dItem.class); - PropertyParser.registerProperty(ItemBook.class, dItem.class); - PropertyParser.registerProperty(ItemDisplayname.class, dItem.class); - PropertyParser.registerProperty(ItemDurability.class, dItem.class); - PropertyParser.registerProperty(ItemCanDestroy.class, dItem.class); - PropertyParser.registerProperty(ItemCanPlaceOn.class, dItem.class); - PropertyParser.registerProperty(ItemColor.class, dItem.class); + // register core ItemTag properties + PropertyParser.registerProperty(ItemApple.class, ItemTag.class); + PropertyParser.registerProperty(ItemBaseColor.class, ItemTag.class); + PropertyParser.registerProperty(ItemBook.class, ItemTag.class); + PropertyParser.registerProperty(ItemDisplayname.class, ItemTag.class); + PropertyParser.registerProperty(ItemDurability.class, ItemTag.class); + PropertyParser.registerProperty(ItemCanDestroy.class, ItemTag.class); + PropertyParser.registerProperty(ItemCanPlaceOn.class, ItemTag.class); + PropertyParser.registerProperty(ItemColor.class, ItemTag.class); if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_14_R1)) { - PropertyParser.registerProperty(ItemCustomModel.class, dItem.class); - PropertyParser.registerProperty(ItemChargedProjectile.class, dItem.class); + PropertyParser.registerProperty(ItemCustomModel.class, ItemTag.class); + PropertyParser.registerProperty(ItemChargedProjectile.class, ItemTag.class); } - PropertyParser.registerProperty(ItemEnchantments.class, dItem.class); - PropertyParser.registerProperty(ItemFirework.class, dItem.class); - PropertyParser.registerProperty(ItemFlags.class, dItem.class); - PropertyParser.registerProperty(ItemInventory.class, dItem.class); - PropertyParser.registerProperty(ItemLock.class, dItem.class); - PropertyParser.registerProperty(ItemLore.class, dItem.class); - PropertyParser.registerProperty(ItemMap.class, dItem.class); - PropertyParser.registerProperty(ItemNBT.class, dItem.class); - PropertyParser.registerProperty(ItemAttributeNBT.class, dItem.class); - PropertyParser.registerProperty(ItemPatterns.class, dItem.class); - PropertyParser.registerProperty(ItemPlantgrowth.class, dItem.class); - PropertyParser.registerProperty(ItemPotion.class, dItem.class); - PropertyParser.registerProperty(ItemQuantity.class, dItem.class); - PropertyParser.registerProperty(ItemRepairCost.class, dItem.class); - PropertyParser.registerProperty(ItemScript.class, dItem.class); - PropertyParser.registerProperty(ItemSignContents.class, dItem.class); - PropertyParser.registerProperty(ItemSkullskin.class, dItem.class); - PropertyParser.registerProperty(ItemSpawnEgg.class, dItem.class); - PropertyParser.registerProperty(ItemUnbreakable.class, dItem.class); + PropertyParser.registerProperty(ItemEnchantments.class, ItemTag.class); + PropertyParser.registerProperty(ItemFirework.class, ItemTag.class); + PropertyParser.registerProperty(ItemFlags.class, ItemTag.class); + PropertyParser.registerProperty(ItemInventory.class, ItemTag.class); + PropertyParser.registerProperty(ItemLock.class, ItemTag.class); + PropertyParser.registerProperty(ItemLore.class, ItemTag.class); + PropertyParser.registerProperty(ItemMap.class, ItemTag.class); + PropertyParser.registerProperty(ItemNBT.class, ItemTag.class); + PropertyParser.registerProperty(ItemAttributeNBT.class, ItemTag.class); + PropertyParser.registerProperty(ItemPatterns.class, ItemTag.class); + PropertyParser.registerProperty(ItemPlantgrowth.class, ItemTag.class); + PropertyParser.registerProperty(ItemPotion.class, ItemTag.class); + PropertyParser.registerProperty(ItemQuantity.class, ItemTag.class); + PropertyParser.registerProperty(ItemRepairCost.class, ItemTag.class); + PropertyParser.registerProperty(ItemScript.class, ItemTag.class); + PropertyParser.registerProperty(ItemSignContents.class, ItemTag.class); + PropertyParser.registerProperty(ItemSkullskin.class, ItemTag.class); + PropertyParser.registerProperty(ItemSpawnEgg.class, ItemTag.class); + PropertyParser.registerProperty(ItemUnbreakable.class, ItemTag.class); - // register core dMaterial properties + // register core MaterialTag properties if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13_R2)) { - PropertyParser.registerProperty(MaterialAge.class, dMaterial.class); - PropertyParser.registerProperty(MaterialDirectional.class, dMaterial.class); - PropertyParser.registerProperty(MaterialHalf.class, dMaterial.class); - PropertyParser.registerProperty(MaterialLevel.class, dMaterial.class); - PropertyParser.registerProperty(MaterialSwitchFace.class, dMaterial.class); + PropertyParser.registerProperty(MaterialAge.class, MaterialTag.class); + PropertyParser.registerProperty(MaterialDirectional.class, MaterialTag.class); + PropertyParser.registerProperty(MaterialHalf.class, MaterialTag.class); + PropertyParser.registerProperty(MaterialLevel.class, MaterialTag.class); + PropertyParser.registerProperty(MaterialSwitchFace.class, MaterialTag.class); } - // register core dTrade properties - PropertyParser.registerProperty(TradeHasXp.class, dTrade.class); - PropertyParser.registerProperty(TradeInputs.class, dTrade.class); - PropertyParser.registerProperty(TradeMaxUses.class, dTrade.class); - PropertyParser.registerProperty(TradeResult.class, dTrade.class); - PropertyParser.registerProperty(TradeUses.class, dTrade.class); + // register core TradeTag properties + PropertyParser.registerProperty(TradeHasXp.class, TradeTag.class); + PropertyParser.registerProperty(TradeInputs.class, TradeTag.class); + PropertyParser.registerProperty(TradeMaxUses.class, TradeTag.class); + PropertyParser.registerProperty(TradeResult.class, TradeTag.class); + PropertyParser.registerProperty(TradeUses.class, TradeTag.class); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/bukkit/BukkitElementProperties.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/bukkit/BukkitElementProperties.java index bf4703cb81..2a12ae9973 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/bukkit/BukkitElementProperties.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/bukkit/BukkitElementProperties.java @@ -55,14 +55,14 @@ public String getAttribute(Attribute attribute) { // <--[tag] // @attribute - // @returns dChunk + // @returns ChunkTag // @group conversion // @description // Returns the element as a chunk. Note: the value must be a valid chunk. // --> if (attribute.startsWith("aschunk") || attribute.startsWith("as_chunk")) { - ObjectTag object = ElementTag.handleNull(element.asString(), dChunk.valueOf(element.asString(), + ObjectTag object = ElementTag.handleNull(element.asString(), ChunkTag.valueOf(element.asString(), new BukkitTagContext(attribute.getScriptEntry(), false)), "dChunk", attribute.hasAlternative()); if (object != null) { return object.getAttribute(attribute.fulfill(1)); @@ -71,14 +71,14 @@ public String getAttribute(Attribute attribute) { // <--[tag] // @attribute - // @returns dColor + // @returns ColorTag // @group conversion // @description - // Returns the element as a dColor. Note: the value must be a valid color. + // Returns the element as a ColorTag. Note: the value must be a valid color. // --> if (attribute.startsWith("ascolor") || attribute.startsWith("as_color")) { - ObjectTag object = ElementTag.handleNull(element.asString(), dColor.valueOf(element.asString(), + ObjectTag object = ElementTag.handleNull(element.asString(), ColorTag.valueOf(element.asString(), new BukkitTagContext(attribute.getScriptEntry(), false)), "dColor", attribute.hasAlternative()); if (object != null) { return object.getAttribute(attribute.fulfill(1)); @@ -87,14 +87,14 @@ public String getAttribute(Attribute attribute) { // <--[tag] // @attribute - // @returns dCuboid + // @returns CuboidTag // @group conversion // @description // Returns the element as a cuboid. Note: the value must be a valid cuboid. // --> if (attribute.startsWith("ascuboid") || attribute.startsWith("as_cuboid")) { - ObjectTag object = ElementTag.handleNull(element.asString(), dCuboid.valueOf(element.asString(), + ObjectTag object = ElementTag.handleNull(element.asString(), CuboidTag.valueOf(element.asString(), new BukkitTagContext(attribute.getScriptEntry(), false)), "dCuboid", attribute.hasAlternative()); if (object != null) { return object.getAttribute(attribute.fulfill(1)); @@ -103,14 +103,14 @@ public String getAttribute(Attribute attribute) { // <--[tag] // @attribute - // @returns dEntity + // @returns EntityTag // @group conversion // @description // Returns the element as an entity. Note: the value must be a valid entity. // --> if (attribute.startsWith("asentity") || attribute.startsWith("as_entity")) { - ObjectTag object = ElementTag.handleNull(element.asString(), dEntity.valueOf(element.asString(), + ObjectTag object = ElementTag.handleNull(element.asString(), EntityTag.valueOf(element.asString(), new BukkitTagContext(attribute.getScriptEntry(), false)), "dEntity", attribute.hasAlternative()); if (object != null) { return object.getAttribute(attribute.fulfill(1)); @@ -119,14 +119,14 @@ public String getAttribute(Attribute attribute) { // <--[tag] // @attribute - // @returns dInventory + // @returns InventoryTag // @group conversion // @description // Returns the element as an inventory. Note: the value must be a valid inventory. // --> if (attribute.startsWith("asinventory") || attribute.startsWith("as_inventory")) { - ObjectTag object = ElementTag.handleNull(element.asString(), dInventory.valueOf(element.asString(), + ObjectTag object = ElementTag.handleNull(element.asString(), InventoryTag.valueOf(element.asString(), new BukkitTagContext(attribute.getScriptEntry(), false)), "dInventory", attribute.hasAlternative()); if (object != null) { return object.getAttribute(attribute.fulfill(1)); @@ -135,15 +135,15 @@ public String getAttribute(Attribute attribute) { // <--[tag] // @attribute - // @returns dItem + // @returns ItemTag // @group conversion // @description - // Returns the element as an item. Additional attributes can be accessed by dItem. + // Returns the element as an item. Additional attributes can be accessed by ItemTag. // Note: the value must be a valid item. // --> if (attribute.startsWith("asitem") || attribute.startsWith("as_item")) { - ObjectTag object = ElementTag.handleNull(element.asString(), dItem.valueOf(element.asString(), + ObjectTag object = ElementTag.handleNull(element.asString(), ItemTag.valueOf(element.asString(), new BukkitTagContext(attribute.getScriptEntry(), false)), "dItem", attribute.hasAlternative()); if (object != null) { return object.getAttribute(attribute.fulfill(1)); @@ -152,14 +152,14 @@ public String getAttribute(Attribute attribute) { // <--[tag] // @attribute - // @returns dLocation + // @returns LocationTag // @group conversion // @description // Returns the element as a location. Note: the value must be a valid location. // --> if (attribute.startsWith("aslocation") || attribute.startsWith("as_location")) { - ObjectTag object = ElementTag.handleNull(element.asString(), dLocation.valueOf(element.asString(), + ObjectTag object = ElementTag.handleNull(element.asString(), LocationTag.valueOf(element.asString(), new BukkitTagContext(attribute.getScriptEntry(), false)), "dLocation", attribute.hasAlternative()); if (object != null) { return object.getAttribute(attribute.fulfill(1)); @@ -168,14 +168,14 @@ public String getAttribute(Attribute attribute) { // <--[tag] // @attribute - // @returns dMaterial + // @returns MaterialTag // @group conversion // @description // Returns the element as a material. Note: the value must be a valid material. // --> if (attribute.startsWith("asmaterial") || attribute.startsWith("as_material")) { - ObjectTag object = ElementTag.handleNull(element.asString(), dMaterial.valueOf(element.asString(), + ObjectTag object = ElementTag.handleNull(element.asString(), MaterialTag.valueOf(element.asString(), new BukkitTagContext(attribute.getScriptEntry(), false)), "dMaterial", attribute.hasAlternative()); if (object != null) { return object.getAttribute(attribute.fulfill(1)); @@ -184,14 +184,14 @@ public String getAttribute(Attribute attribute) { // <--[tag] // @attribute - // @returns dNPC + // @returns NPCTag // @group conversion // @description // Returns the element as an NPC. Note: the value must be a valid NPC. // --> if (attribute.startsWith("asnpc") || attribute.startsWith("as_npc")) { - ObjectTag object = ElementTag.handleNull(element.asString(), dNPC.valueOf(element.asString(), + ObjectTag object = ElementTag.handleNull(element.asString(), NPCTag.valueOf(element.asString(), new BukkitTagContext(attribute.getScriptEntry(), false)), "dNPC", attribute.hasAlternative()); if (object != null) { return object.getAttribute(attribute.fulfill(1)); @@ -200,14 +200,14 @@ public String getAttribute(Attribute attribute) { // <--[tag] // @attribute - // @returns dPlayer + // @returns PlayerTag // @group conversion // @description // Returns the element as a player. Note: the value must be a valid player. Can be online or offline. // --> if (attribute.startsWith("asplayer") || attribute.startsWith("as_player")) { - ObjectTag object = ElementTag.handleNull(element.asString(), dPlayer.valueOf(element.asString(), + ObjectTag object = ElementTag.handleNull(element.asString(), PlayerTag.valueOf(element.asString(), new BukkitTagContext(attribute.getScriptEntry(), false)), "dPlayer", attribute.hasAlternative()); if (object != null) { return object.getAttribute(attribute.fulfill(1)); @@ -216,14 +216,14 @@ public String getAttribute(Attribute attribute) { // <--[tag] // @attribute - // @returns dWorld + // @returns WorldTag // @group conversion // @description // Returns the element as a world. // --> if (attribute.startsWith("asworld") || attribute.startsWith("as_world")) { - ObjectTag object = ElementTag.handleNull(element.asString(), dWorld.valueOf(element.asString(), + ObjectTag object = ElementTag.handleNull(element.asString(), WorldTag.valueOf(element.asString(), new BukkitTagContext(attribute.getScriptEntry(), false)), "dWorld", attribute.hasAlternative()); if (object != null) { return object.getAttribute(attribute.fulfill(1)); @@ -232,14 +232,14 @@ public String getAttribute(Attribute attribute) { // <--[tag] // @attribute - // @returns dPlugin + // @returns PluginTag // @group conversion // @description // Returns the element as a plugin. Note: the value must be a valid plugin. // --> if (attribute.startsWith("asplugin") || attribute.startsWith("as_plugin")) { - ObjectTag object = ElementTag.handleNull(element.asString(), dPlugin.valueOf(element.asString(), + ObjectTag object = ElementTag.handleNull(element.asString(), PluginTag.valueOf(element.asString(), new BukkitTagContext(attribute.getScriptEntry(), false)), "dPlugin", attribute.hasAlternative()); if (object != null) { return object.getAttribute(attribute.fulfill(1)); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/bukkit/BukkitListProperties.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/bukkit/BukkitListProperties.java index c175bfa4b6..bcfee6fca4 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/bukkit/BukkitListProperties.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/bukkit/BukkitListProperties.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.objects.properties.bukkit; import com.denizenscript.denizen.utilities.DenizenAPI; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; @@ -55,7 +55,7 @@ public String getAttribute(Attribute attribute) { for (int n = 0; n < list.size(); n++) { if (list.get(n).startsWith("p@")) { - dPlayer gotten = dPlayer.valueOf(list.get(n)); + PlayerTag gotten = PlayerTag.valueOf(list.get(n)); if (gotten != null) { dScriptArg.append(gotten.getName()); } @@ -64,7 +64,7 @@ public String getAttribute(Attribute attribute) { } } else if (list.get(n).startsWith("e@") || list.get(n).startsWith("n@")) { - dEntity gotten = dEntity.valueOf(list.get(n)); + EntityTag gotten = EntityTag.valueOf(list.get(n)); if (gotten != null) { dScriptArg.append(gotten.getName()); } @@ -92,7 +92,7 @@ else if (list.get(n).startsWith("e@") || list.get(n).startsWith("n@")) { // @attribute // @returns DurationTag // @description - // Returns a Duration of the time remaining on the flag, if it + // Returns a DurationTag of the time remaining on the flag, if it // has an expiration. // --> if (attribute.startsWith("expiration") && list.flag != null) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/bukkit/BukkitQueueProperties.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/bukkit/BukkitQueueProperties.java index e8dcf77139..7fd50840c0 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/bukkit/BukkitQueueProperties.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/bukkit/BukkitQueueProperties.java @@ -2,8 +2,8 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.BukkitScriptEntryData; -import com.denizenscript.denizen.objects.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.objects.core.QueueTag; @@ -46,13 +46,13 @@ public String getAttribute(Attribute attribute) { // <--[tag] // @attribute - // @returns dNPC + // @returns NPCTag // @mechanism ScriptQueue.linked_npc // @description - // Returns the dNPC linked to a queue. + // Returns the NPCTag linked to a queue. // --> if (attribute.startsWith("npc")) { - dNPC npc = null; + NPCTag npc = null; if (queue.getLastEntryExecuted() != null) { npc = ((BukkitScriptEntryData) queue.getLastEntryExecuted().entryData).getNPC(); } @@ -72,13 +72,13 @@ else if (queue.getEntries().size() > 0) { // <--[tag] // @attribute - // @returns dPlayer + // @returns PlayerTag // @mechanism ScriptQueue.linked_player // @description - // Returns the dPlayer linked to a queue. + // Returns the PlayerTag linked to a queue. // --> if (attribute.startsWith("player")) { - dPlayer player = null; + PlayerTag player = null; if (queue.getLastEntryExecuted() != null) { player = ((BukkitScriptEntryData) queue.getLastEntryExecuted().entryData).getPlayer(); } @@ -114,14 +114,14 @@ public void adjust(Mechanism mechanism) { // <--[mechanism] // @object ScriptQueue // @name linked_player - // @input dPlayer + // @input PlayerTag // @description // Sets the linked player for the remainder of the queue. // @tags // // --> - if (mechanism.matches("linked_player") && mechanism.requireObject(dPlayer.class)) { - dPlayer player = mechanism.valueAsType(dPlayer.class); + if (mechanism.matches("linked_player") && mechanism.requireObject(PlayerTag.class)) { + PlayerTag player = mechanism.valueAsType(PlayerTag.class); for (ScriptEntry entry : queue.getEntries()) { BukkitScriptEntryData data = (BukkitScriptEntryData) entry.entryData; data.setPlayer(player); @@ -131,14 +131,14 @@ public void adjust(Mechanism mechanism) { // <--[mechanism] // @object ScriptQueue // @name linked_npc - // @input dNPC + // @input NPCTag // @description // Sets the linked NPC for the remainder of the queue. // @tags // // --> - if (mechanism.matches("linked_npc") && mechanism.requireObject(dNPC.class)) { - dNPC npc = mechanism.valueAsType(dNPC.class); + if (mechanism.matches("linked_npc") && mechanism.requireObject(NPCTag.class)) { + NPCTag npc = mechanism.valueAsType(NPCTag.class); for (ScriptEntry entry : queue.getEntries()) { BukkitScriptEntryData data = (BukkitScriptEntryData) entry.entryData; data.setNPC(npc); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/bukkit/BukkitScriptProperties.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/bukkit/BukkitScriptProperties.java index 3584c62d07..1eba341fbf 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/bukkit/BukkitScriptProperties.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/bukkit/BukkitScriptProperties.java @@ -3,7 +3,7 @@ import com.denizenscript.denizen.scripts.commands.core.CooldownCommand; import com.denizenscript.denizen.scripts.containers.core.InteractScriptHelper; import com.denizenscript.denizen.BukkitScriptEntryData; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -55,7 +55,7 @@ public String getAttribute(Attribute attribute) { // using the attached player available in the script entry. Not having a valid player will result in 'null'. // --> if (attribute.startsWith("cooled_down")) { - dPlayer player = (attribute.hasContext(1) ? dPlayer.valueOf(attribute.getContext(1)) + PlayerTag player = (attribute.hasContext(1) ? PlayerTag.valueOf(attribute.getContext(1)) : ((BukkitScriptEntryData) attribute.getScriptEntry().entryData).getPlayer()); if (player != null && player.isValid()) { return new ElementTag(CooldownCommand.checkCooldown(player, script.getContainer().getName())) @@ -73,7 +73,7 @@ public String getAttribute(Attribute attribute) { // Returns the time left for the player to cooldown for the script. // --> if (attribute.startsWith("cooldown")) { - dPlayer player = (attribute.hasContext(1) ? dPlayer.valueOf(attribute.getContext(1)) + PlayerTag player = (attribute.hasContext(1) ? PlayerTag.valueOf(attribute.getContext(1)) : ((BukkitScriptEntryData) attribute.getScriptEntry().entryData).getPlayer()); return CooldownCommand.getCooldownDuration(player, script.getName()) .getAttribute(attribute.fulfill(1)); @@ -89,7 +89,7 @@ public String getAttribute(Attribute attribute) { // Must be an INTERACT script. // --> if (attribute.startsWith("step")) { - dPlayer player = (attribute.hasContext(1) ? dPlayer.valueOf(attribute.getContext(1)) + PlayerTag player = (attribute.hasContext(1) ? PlayerTag.valueOf(attribute.getContext(1)) : ((BukkitScriptEntryData) attribute.getScriptEntry().entryData).getPlayer()); if (player != null && player.isValid()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityAI.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityAI.java index ce1b24fa28..d3adc45580 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityAI.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityAI.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.entity; import com.denizenscript.denizen.nms.NMSHandler; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -11,8 +11,8 @@ public class EntityAI implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity - && ((dEntity) entity).isLivingEntity(); + return entity instanceof EntityTag + && ((EntityTag) entity).isLivingEntity(); } public static EntityAI getFrom(ObjectTag entity) { @@ -20,7 +20,7 @@ public static EntityAI getFrom(ObjectTag entity) { return null; } else { - return new EntityAI((dEntity) entity); + return new EntityAI((EntityTag) entity); } } @@ -37,11 +37,11 @@ public static EntityAI getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityAI(dEntity ent) { + private EntityAI(EntityTag ent) { entity = ent; } - dEntity entity; + EntityTag entity; ///////// // Property Methods @@ -70,7 +70,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group attributes // @description @@ -90,14 +90,14 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name has_ai // @input Element(Boolean) // @description // Sets whether this entity will use the default // Minecraft AI to roam and look around. // @tags - // + // // --> if ((mechanism.matches("has_ai") || mechanism.matches("toggle_ai")) && mechanism.requireBoolean()) { NMSHandler.getInstance().getEntityHelper().toggleAI(entity.getBukkitEntity(), mechanism.getValue().asBoolean()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityAge.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityAge.java index 243793f07e..6bd52d67fa 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityAge.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityAge.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.entity; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; @@ -16,12 +16,12 @@ public class EntityAge implements Property { public static boolean describes(ObjectTag entity) { - if (!(entity instanceof dEntity)) { + if (!(entity instanceof EntityTag)) { return false; } // Check if entity is Ageable, or a Zombie - return (((dEntity) entity).getBukkitEntity() instanceof Ageable) - || (((dEntity) entity).getBukkitEntity() instanceof Zombie); + return (((EntityTag) entity).getBukkitEntity() instanceof Ageable) + || (((EntityTag) entity).getBukkitEntity() instanceof Zombie); } public static EntityAge getFrom(ObjectTag entity) { @@ -29,7 +29,7 @@ public static EntityAge getFrom(ObjectTag entity) { return null; } else { - return new EntityAge((dEntity) entity); + return new EntityAge((EntityTag) entity); } } @@ -46,11 +46,11 @@ public static EntityAge getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityAge(dEntity entity) { + private EntityAge(EntityTag entity) { ageable = entity; } - dEntity ageable; + EntityTag ageable; public boolean isBaby() { if (ageable.getBukkitEntity() instanceof Zombie) { @@ -145,9 +145,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) - // @mechanism dEntity.age + // @mechanism EntityTag.age // @group properties // @description // If the entity is ageable, returns the entity's age number (-24000 to 0) @@ -158,9 +158,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dEntity.age_lock + // @mechanism EntityTag.age_lock // @group properties // @description // If the entity is ageable, returns whether the entity is age locked. @@ -171,9 +171,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dEntity.age + // @mechanism EntityTag.age // @group properties // @description // If the entity is ageable, returns whether the entity is a baby. @@ -192,17 +192,17 @@ public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name age_lock // @input Element(Boolean) // @description // Sets whether the entity is locked into its current age. - // Also available: <@link mechanism dEntity.age> + // Also available: <@link mechanism EntityTag.age> // @tags - // - // - // - // + // + // + // + // // --> if (mechanism.matches("age_lock") @@ -211,7 +211,7 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name age // @input Element // @description @@ -219,12 +219,12 @@ public void adjust(Mechanism mechanism) { // Inputs can be 'baby', 'adult', or a valid age number (-24000 to 0) // Optionally, add '|locked' or 'unlocked' to lock/unlock the entity into/from the current age. // (EG, age:baby|locked or age:-24000|unlocked) - // Also available: <@link mechanism dEntity.age_lock> + // Also available: <@link mechanism EntityTag.age_lock> // @tags - // - // - // - // + // + // + // + // // --> if (mechanism.matches("age")) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityAnger.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityAnger.java index 6f7c41a1f7..4889f71df7 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityAnger.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityAnger.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -12,7 +12,7 @@ public class EntityAnger implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && ((dEntity) entity).getBukkitEntityType() == EntityType.PIG_ZOMBIE; + return entity instanceof EntityTag && ((EntityTag) entity).getBukkitEntityType() == EntityType.PIG_ZOMBIE; } public static EntityAnger getFrom(ObjectTag entity) { @@ -20,7 +20,7 @@ public static EntityAnger getFrom(ObjectTag entity) { return null; } else { - return new EntityAnger((dEntity) entity); + return new EntityAnger((EntityTag) entity); } } @@ -37,11 +37,11 @@ public static EntityAnger getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityAnger(dEntity entity) { + private EntityAnger(EntityTag entity) { this.entity = entity; } - dEntity entity; + EntityTag entity; ///////// // Property Methods @@ -69,9 +69,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) - // @mechanism dEntity.anger + // @mechanism EntityTag.anger // @group properties // @description // Returns the anger level of a PigZombie. @@ -90,13 +90,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name anger // @input Element(Boolean) // @description // Changes the anger level of a PigZombie. // @tags - // + // // --> if (mechanism.matches("anger") && mechanism.requireInteger()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityAngry.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityAngry.java index 8dbc85f1d0..45b56fe185 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityAngry.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityAngry.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -13,8 +13,8 @@ public class EntityAngry implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && (((dEntity) entity).getBukkitEntityType() == EntityType.WOLF - || ((dEntity) entity).getBukkitEntityType() == EntityType.PIG_ZOMBIE); + return entity instanceof EntityTag && (((EntityTag) entity).getBukkitEntityType() == EntityType.WOLF + || ((EntityTag) entity).getBukkitEntityType() == EntityType.PIG_ZOMBIE); } public static EntityAngry getFrom(ObjectTag entity) { @@ -22,7 +22,7 @@ public static EntityAngry getFrom(ObjectTag entity) { return null; } else { - return new EntityAngry((dEntity) entity); + return new EntityAngry((EntityTag) entity); } } @@ -39,11 +39,11 @@ public static EntityAngry getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityAngry(dEntity entity) { + private EntityAngry(EntityTag entity) { this.entity = entity; } - dEntity entity; + EntityTag entity; ///////// // Property Methods @@ -87,9 +87,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dEntity.angry + // @mechanism EntityTag.angry // @group properties // @description // If the entity is a wolf, returns whether the wolf is angry. @@ -112,13 +112,13 @@ else if (entity.getBukkitEntityType() == EntityType.PIG_ZOMBIE) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name angry // @input Element(Boolean) // @description // Changes the anger state of a Wolf or PigZombie. // @tags - // + // // --> if (mechanism.matches("angry") && mechanism.requireBoolean()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityAreaEffectCloud.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityAreaEffectCloud.java index 11a23870d0..e9ccd66440 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityAreaEffectCloud.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityAreaEffectCloud.java @@ -3,8 +3,8 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.utilities.entity.AreaEffectCloudHelper; import com.denizenscript.denizencore.objects.*; -import com.denizenscript.denizen.objects.dColor; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.ColorTag; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.DurationTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.core.ListTag; @@ -23,8 +23,8 @@ public class EntityAreaEffectCloud implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && - ((dEntity) entity).getBukkitEntityType() == EntityType.AREA_EFFECT_CLOUD; + return entity instanceof EntityTag && + ((EntityTag) entity).getBukkitEntityType() == EntityType.AREA_EFFECT_CLOUD; } public static EntityAreaEffectCloud getFrom(ObjectTag entity) { @@ -32,7 +32,7 @@ public static EntityAreaEffectCloud getFrom(ObjectTag entity) { return null; } else { - return new EntityAreaEffectCloud((dEntity) entity); + return new EntityAreaEffectCloud((EntityTag) entity); } } @@ -52,11 +52,11 @@ public static EntityAreaEffectCloud getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityAreaEffectCloud(dEntity ent) { + private EntityAreaEffectCloud(EntityTag ent) { entity = ent; } - dEntity entity; + EntityTag entity; ///////// // Property Methods @@ -85,7 +85,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @group properties // @description @@ -96,7 +96,7 @@ public String getAttribute(Attribute attribute) { attribute = attribute.fulfill(1); // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @group properties // @description @@ -108,7 +108,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group properties // @description @@ -120,7 +120,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group properties // @description @@ -136,7 +136,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @group properties // @description @@ -146,14 +146,14 @@ public String getAttribute(Attribute attribute) { attribute = attribute.fulfill(1); // <--[tag] - // @attribute - // @returns dColor + // @attribute + // @returns ColorTag // @group properties // @description // Returns the Area Effect Cloud's particle color. // --> if (attribute.startsWith("color")) { - return new dColor(getHelper().getColor()) + return new ColorTag(getHelper().getColor()) .getAttribute(attribute.fulfill(1)); } @@ -162,7 +162,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns DurationTag // @group properties // @description @@ -172,7 +172,7 @@ public String getAttribute(Attribute attribute) { attribute = attribute.fulfill(1); // <--[tag] - // @attribute + // @attribute // @returns DurationTag // @group properties // @description @@ -189,7 +189,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @group properties // @description @@ -199,7 +199,7 @@ public String getAttribute(Attribute attribute) { attribute = attribute.fulfill(1); // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @group properties // @description @@ -212,7 +212,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @group properties // @description @@ -229,7 +229,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns DurationTag // @group properties // @description @@ -242,7 +242,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns DurationTag // @group properties // @description @@ -255,7 +255,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Boolean) // @group properties // @description @@ -279,8 +279,8 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @returns dEntity + // @attribute + // @returns EntityTag // @group properties // @description // Returns the source of the Area Effect Cloud. @@ -288,13 +288,13 @@ public String getAttribute(Attribute attribute) { if (attribute.startsWith("source")) { ProjectileSource shooter = getHelper().getSource(); if (shooter != null && shooter instanceof LivingEntity) { - return new dEntity((LivingEntity) shooter) + return new EntityTag((LivingEntity) shooter) .getAttribute(attribute.fulfill(1)); } } // <--[tag] - // @attribute + // @attribute // @returns ListTag // @group properties // @description @@ -325,7 +325,7 @@ public String getAttribute(Attribute attribute) { PotionEffect effect = effects.get(val); // <--[tag] - // @attribute ].type> + // @attribute ].type> // @returns ElementTag // @group properties // @description @@ -337,7 +337,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ].amplifier> + // @attribute ].amplifier> // @returns ElementTag(Number) // @group properties // @description @@ -349,7 +349,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ].duration> + // @attribute ].duration> // @returns DurationTag // @group properties // @description @@ -361,7 +361,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ].has_particles> + // @attribute ].has_particles> // @returns ElementTag(Boolean) // @group properties // @description @@ -373,7 +373,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ].is_ambient> + // @attribute ].is_ambient> // @returns ElementTag(Boolean) // @group properties // @description @@ -402,26 +402,26 @@ public AreaEffectCloudHelper getHelper() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name clear_custom_effects // @input None // @description // Clears all custom effects from the Area Effect Cloud // @tags - // + // // --> if (mechanism.matches("clear_custom_effects")) { getHelper().clearEffects(); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name remove_custom_effect // @input Element // @description // Removes the specified custom effect from the Area Effect Cloud // @tags - // + // // --> if (mechanism.matches("remove_custom_effect")) { PotionEffectType type = PotionEffectType.getByName(mechanism.getValue().asString().toUpperCase()); @@ -431,14 +431,14 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name custom_effects // @input ListTag // @description // Adds a list of custom potion effects to the Area Effect Cloud // In the form Type,Amplifier,Duration(,Ambient,Particles)|... // @tags - // + // // --> if (mechanism.matches("custom_effects")) { ListTag list = mechanism.valueAsType(ListTag.class); @@ -469,20 +469,20 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name particle_color - // @input dColor + // @input ColorTag // @description // Sets the Area Effect Cloud's particle color. // @tags - // + // // --> - if (mechanism.matches("particle_color") && mechanism.requireObject(dColor.class)) { - getHelper().setColor(dColor.valueOf(mechanism.getValue().asString()).getColor()); + if (mechanism.matches("particle_color") && mechanism.requireObject(ColorTag.class)) { + getHelper().setColor(ColorTag.valueOf(mechanism.getValue().asString()).getColor()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name base_potion // @input Element // @description @@ -490,10 +490,10 @@ public void adjust(Mechanism mechanism) { // In the form: Type,Upgraded,Extended // NOTE: Potion cannot be both upgraded and extended // @tags - // - // - // - // + // + // + // + // // // --> if (mechanism.matches("base_potion")) { @@ -520,122 +520,122 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name duration // @input Duration // @description // Sets the Area Effect Cloud's duration. // @tags - // + // // --> if (mechanism.matches("duration") && mechanism.requireObject(DurationTag.class)) { getHelper().setDuration(DurationTag.valueOf(mechanism.getValue().asString()).getTicksAsInt()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name duration_on_use // @input Duration // @description // Sets the duration the Area Effect Cloud // will increase by when it applies an effect to an entity. // @tags - // + // // --> if (mechanism.matches("duration_on_use") && mechanism.requireObject(DurationTag.class)) { getHelper().setDurationOnUse(DurationTag.valueOf(mechanism.getValue().asString()).getTicksAsInt()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name particle // @input Element // @description // Sets the particle of the Area Effect Cloud // @tags - // + // // --> if (mechanism.matches("particle") && mechanism.hasValue()) { getHelper().setParticle(mechanism.getValue().asString().toUpperCase()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name radius // @input Element(Decimal) // @description // Sets the radius of the Area Effect Cloud // @tags - // + // // --> if (mechanism.matches("radius") && mechanism.requireFloat()) { getHelper().setRadius(mechanism.getValue().asFloat()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name radius_on_use // @input Element(Decimal) // @description // Sets the radius the Area Effect Cloud // will increase by when it applies an effect to an entity. // @tags - // + // // --> if (mechanism.matches("radius_on_use") && mechanism.requireFloat()) { getHelper().setRadiusOnUse(mechanism.getValue().asFloat()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name radius_per_tick // @input Element(Decimal) // @description // Sets the radius the Area Effect Cloud // will increase by every tick. // @tags - // + // // --> if (mechanism.matches("radius_per_tick") && mechanism.requireFloat()) { getHelper().setRadiusPerTick(mechanism.getValue().asFloat()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name reapplication_delay // @input Duration // @description // Sets the duration an entity will be immune // from the Area Effect Cloud's subsequent exposure. // @tags - // + // // --> if (mechanism.matches("reapplication_delay") && mechanism.requireObject(DurationTag.class)) { getHelper().setReappDelay(DurationTag.valueOf(mechanism.getValue().asString()).getTicksAsInt()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name source - // @input dEntity + // @input EntityTag // @description // Sets the source of the Area Effect Cloud // @tags - // + // // --> - if (mechanism.matches("source") && mechanism.requireObject(dEntity.class)) { - getHelper().setSource((ProjectileSource) dEntity.valueOf(mechanism.getValue().asString()).getBukkitEntity()); + if (mechanism.matches("source") && mechanism.requireObject(EntityTag.class)) { + getHelper().setSource((ProjectileSource) EntityTag.valueOf(mechanism.getValue().asString()).getBukkitEntity()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name wait_time // @input Duration // @description // Sets the duration an entity must be exposed to // the Area Effect Cloud before its effect is applied. // @tags - // + // // --> if (mechanism.matches("wait_time") && mechanism.requireObject(DurationTag.class)) { getHelper().setWaitTime(DurationTag.valueOf(mechanism.getValue().asString()).getTicksAsInt()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityArmorBonus.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityArmorBonus.java index d48300df3e..f783d3fad8 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityArmorBonus.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityArmorBonus.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -10,17 +10,17 @@ public class EntityArmorBonus implements Property { public static boolean describes(ObjectTag entity) { - if (!(entity instanceof dEntity)) { + if (!(entity instanceof EntityTag)) { return false; } - return ((dEntity) entity).isLivingEntity(); + return ((EntityTag) entity).isLivingEntity(); } public static EntityArmorBonus getFrom(ObjectTag entity) { if (!describes(entity)) { return null; } - return new EntityArmorBonus((dEntity) entity); + return new EntityArmorBonus((EntityTag) entity); } public static final String[] handledTags = new String[] { @@ -36,11 +36,11 @@ public static EntityArmorBonus getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityArmorBonus(dEntity ent) { + private EntityArmorBonus(EntityTag ent) { entity = ent; } - dEntity entity; + EntityTag entity; ///////// // Property Methods @@ -76,9 +76,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) - // @mechanism dEntity.armor_bonus + // @mechanism EntityTag.armor_bonus // @group attributes // @description // Returns the entity's base armor bonus. @@ -95,13 +95,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name armor_bonus // @input Element(Decimal) // @description // Sets the entity's base armor bonus. // @tags - // + // // --> if (mechanism.matches("armor_bonus") && mechanism.requireDouble()) { entity.getLivingEntity().getAttribute(org.bukkit.attribute.Attribute.GENERIC_ARMOR) diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityArmorPose.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityArmorPose.java index 75a64d7fde..c47b8cdd74 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityArmorPose.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityArmorPose.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.objects.properties.entity; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; import com.denizenscript.denizencore.objects.ObjectTag; @@ -18,8 +18,8 @@ public class EntityArmorPose implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity - && ((dEntity) entity).getBukkitEntityType() == EntityType.ARMOR_STAND; + return entity instanceof EntityTag + && ((EntityTag) entity).getBukkitEntityType() == EntityType.ARMOR_STAND; } public static EntityArmorPose getFrom(ObjectTag entity) { @@ -27,7 +27,7 @@ public static EntityArmorPose getFrom(ObjectTag entity) { return null; } else { - return new EntityArmorPose((dEntity) entity); + return new EntityArmorPose((EntityTag) entity); } } @@ -44,11 +44,11 @@ public static EntityArmorPose getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityArmorPose(dEntity ent) { + private EntityArmorPose(EntityTag ent) { entity = ent; } - dEntity entity; + EntityTag entity; ///////// // Property Methods @@ -86,7 +86,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ListTag // @group attributes // @description @@ -100,8 +100,8 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ]> - // @returns dLocation + // @attribute ]> + // @returns LocationTag // @group attributes // @description // Returns the current angle pose for the specified part. @@ -129,7 +129,7 @@ else if (attribute.startsWith("armor_pose") && attribute.hasContext(1)) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name armor_pose // @input ListTag // @description @@ -139,8 +139,8 @@ public void adjust(Mechanism mechanism) { // Valid parts: HEAD, BODY, LEFT_ARM, RIGHT_ARM, LEFT_LEG, RIGHT_LEG // Angles are in radians! // @tags - // - // ]> + // + // ]> // --> if (mechanism.matches("armor_pose")) { ArmorStand armorStand = (ArmorStand) entity.getBukkitEntity(); @@ -154,17 +154,17 @@ public void adjust(Mechanism mechanism) { Debug.echoError("Invalid pose part specified: " + name + "; ignoring next: " + angle); } else { - posePart.setAngle(armorStand, toEulerAngle(dLocation.valueOf(angle))); + posePart.setAngle(armorStand, toEulerAngle(LocationTag.valueOf(angle))); } } } } - private static dLocation fromEulerAngle(EulerAngle eulerAngle) { - return new dLocation(null, eulerAngle.getX(), eulerAngle.getY(), eulerAngle.getZ()); + private static LocationTag fromEulerAngle(EulerAngle eulerAngle) { + return new LocationTag(null, eulerAngle.getX(), eulerAngle.getY(), eulerAngle.getZ()); } - private static EulerAngle toEulerAngle(dLocation location) { + private static EulerAngle toEulerAngle(LocationTag location) { return new EulerAngle(location.getX(), location.getY(), location.getZ()); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityArms.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityArms.java index 2b9b03a841..79dd050e1f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityArms.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityArms.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -12,7 +12,7 @@ public class EntityArms implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && ((dEntity) entity).getBukkitEntityType() == EntityType.ARMOR_STAND; + return entity instanceof EntityTag && ((EntityTag) entity).getBukkitEntityType() == EntityType.ARMOR_STAND; } public static EntityArms getFrom(ObjectTag entity) { @@ -20,7 +20,7 @@ public static EntityArms getFrom(ObjectTag entity) { return null; } else { - return new EntityArms((dEntity) entity); + return new EntityArms((EntityTag) entity); } } @@ -37,11 +37,11 @@ public static EntityArms getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityArms(dEntity entity) { + private EntityArms(EntityTag entity) { dentity = entity; } - dEntity dentity; + EntityTag dentity; ///////// // Property Methods @@ -74,9 +74,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dEntity.arms + // @mechanism EntityTag.arms // @group properties // @description // If the entity is an armor stand, returns whether the armor stand has arms. @@ -93,13 +93,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name arms // @input Element(Boolean) // @description // Changes the arms state of an armor stand. // @tags - // + // // --> if (mechanism.matches("arms") && mechanism.requireBoolean()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityArrowDamage.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityArrowDamage.java index 95e4f163bf..a2c043c3c9 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityArrowDamage.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityArrowDamage.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.entity; import com.denizenscript.denizen.nms.NMSHandler; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -12,14 +12,14 @@ public class EntityArrowDamage implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && ((dEntity) entity).getBukkitEntity() instanceof Arrow; + return entity instanceof EntityTag && ((EntityTag) entity).getBukkitEntity() instanceof Arrow; } public static EntityArrowDamage getFrom(ObjectTag entity) { if (!describes(entity)) { return null; } - return new EntityArrowDamage((dEntity) entity); + return new EntityArrowDamage((EntityTag) entity); } public static final String[] handledTags = { @@ -35,11 +35,11 @@ public static EntityArrowDamage getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityArrowDamage(dEntity entity) { + private EntityArrowDamage(EntityTag entity) { dentity = entity; } - dEntity dentity; + EntityTag dentity; ///////// // Property Methods @@ -67,9 +67,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) - // @mechanism dEntity.damage + // @mechanism EntityTag.damage // @group properties // @description // Returns the damage that the arrow/trident will inflict. @@ -87,13 +87,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name damage // @input Element(Decimal) // @description // Changes how much damage an arrow/trident will inflict. // @tags - // + // // --> if (mechanism.matches("damage") && mechanism.requireDouble()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityBasePlate.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityBasePlate.java index ba4335f458..faa3184218 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityBasePlate.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityBasePlate.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -12,7 +12,7 @@ public class EntityBasePlate implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && ((dEntity) entity).getBukkitEntityType() == EntityType.ARMOR_STAND; + return entity instanceof EntityTag && ((EntityTag) entity).getBukkitEntityType() == EntityType.ARMOR_STAND; } public static EntityBasePlate getFrom(ObjectTag entity) { @@ -20,7 +20,7 @@ public static EntityBasePlate getFrom(ObjectTag entity) { return null; } else { - return new EntityBasePlate((dEntity) entity); + return new EntityBasePlate((EntityTag) entity); } } @@ -37,11 +37,11 @@ public static EntityBasePlate getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityBasePlate(dEntity entity) { + private EntityBasePlate(EntityTag entity) { dentity = entity; } - dEntity dentity; + EntityTag dentity; ///////// // Property Methods @@ -74,9 +74,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dEntity.base_plate + // @mechanism EntityTag.base_plate // @group properties // @description // If the entity is an armor stand, returns whether the armor stand has a base plate. @@ -93,13 +93,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name base_plate // @input Element(Boolean) // @description // Changes the base plate state of an armor stand. // @tags - // + // // --> if (mechanism.matches("base_plate") && mechanism.requireBoolean()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityBeamTarget.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityBeamTarget.java index 0b95b9fb6b..d347bc9c36 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityBeamTarget.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityBeamTarget.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.objects.properties.Property; @@ -13,7 +13,7 @@ public class EntityBeamTarget implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && ((dEntity) entity).getBukkitEntityType() == EntityType.ENDER_CRYSTAL; + return entity instanceof EntityTag && ((EntityTag) entity).getBukkitEntityType() == EntityType.ENDER_CRYSTAL; } public static EntityBeamTarget getFrom(ObjectTag entity) { @@ -21,7 +21,7 @@ public static EntityBeamTarget getFrom(ObjectTag entity) { return null; } else { - return new EntityBeamTarget((dEntity) entity); + return new EntityBeamTarget((EntityTag) entity); } } @@ -38,11 +38,11 @@ public static EntityBeamTarget getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityBeamTarget(dEntity entity) { + private EntityBeamTarget(EntityTag entity) { dentity = entity; } - dEntity dentity; + EntityTag dentity; ///////// // Property Methods @@ -50,7 +50,7 @@ private EntityBeamTarget(dEntity entity) { @Override public String getPropertyString() { - return new dLocation(((EnderCrystal) dentity.getBukkitEntity()).getBeamTarget()).identify(); + return new LocationTag(((EnderCrystal) dentity.getBukkitEntity()).getBeamTarget()).identify(); } @Override @@ -70,9 +70,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @returns dLocation - // @mechanism dEntity.beam_target + // @attribute + // @returns LocationTag + // @mechanism EntityTag.beam_target // @group properties // @description // Returns the target location of the ender crystal's beam, if any. @@ -80,7 +80,7 @@ public String getAttribute(Attribute attribute) { if (attribute.startsWith("beam_target")) { Location beamTarget = ((EnderCrystal) dentity.getBukkitEntity()).getBeamTarget(); if (beamTarget != null) { - return new dLocation(beamTarget).getAttribute(attribute.fulfill(1)); + return new LocationTag(beamTarget).getAttribute(attribute.fulfill(1)); } } @@ -91,20 +91,20 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name beam_target - // @input dLocation + // @input LocationTag // @description // Sets a new target location for the ender crystal's beam. // Provide no input to remove the beam. // @tags - // + // // --> if (mechanism.matches("beam_target")) { if (mechanism.hasValue()) { - if (mechanism.requireObject(dLocation.class)) { - ((EnderCrystal) dentity.getBukkitEntity()).setBeamTarget(mechanism.valueAsType(dLocation.class)); + if (mechanism.requireObject(LocationTag.class)) { + ((EnderCrystal) dentity.getBukkitEntity()).setBeamTarget(mechanism.valueAsType(LocationTag.class)); } } else { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityBoatType.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityBoatType.java index 3928d9a1bd..9b9ca72e2e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityBoatType.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityBoatType.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -13,7 +13,7 @@ public class EntityBoatType implements Property { public static boolean describes(ObjectTag object) { - return object instanceof dEntity && ((dEntity) object).getBukkitEntityType() == EntityType.BOAT; + return object instanceof EntityTag && ((EntityTag) object).getBukkitEntityType() == EntityType.BOAT; } public static EntityBoatType getFrom(ObjectTag object) { @@ -21,7 +21,7 @@ public static EntityBoatType getFrom(ObjectTag object) { return null; } else { - return new EntityBoatType((dEntity) object); + return new EntityBoatType((EntityTag) object); } } @@ -38,11 +38,11 @@ public static EntityBoatType getFrom(ObjectTag object) { // Instance Fields and Methods ///////////// - private EntityBoatType(dEntity entity) { + private EntityBoatType(EntityTag entity) { this.entity = entity; } - dEntity entity; + EntityTag entity; ///////// // Property Methods @@ -65,9 +65,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dEntity.boat_type + // @mechanism EntityTag.boat_type // @group properties // @description // Returns the wood type of the boat. @@ -84,14 +84,14 @@ public String getAttribute(Attribute attribute) { @Override public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name boat_type // @input Element // @description // Changes the wood type of the boat. // Valid wood types: GENERIC, REDWOOD, BIRCH, JUNGLE, ACACIA, DARK_OAK. // @tags - // + // // --> if (mechanism.matches("boat_type")) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityBodyArrows.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityBodyArrows.java index 1b608a345a..fae5f9818f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityBodyArrows.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityBodyArrows.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.entity; import com.denizenscript.denizen.nms.NMSHandler; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -10,7 +10,7 @@ public class EntityBodyArrows implements Property { public static boolean describes(ObjectTag object) { - return object instanceof dEntity && ((dEntity) object).isLivingEntity(); + return object instanceof EntityTag && ((EntityTag) object).isLivingEntity(); } public static EntityBodyArrows getFrom(ObjectTag object) { @@ -18,7 +18,7 @@ public static EntityBodyArrows getFrom(ObjectTag object) { return null; } else { - return new EntityBodyArrows((dEntity) object); + return new EntityBodyArrows((EntityTag) object); } } @@ -35,11 +35,11 @@ public static EntityBodyArrows getFrom(ObjectTag object) { // Instance Fields and Methods ///////////// - private EntityBodyArrows(dEntity entity) { + private EntityBodyArrows(EntityTag entity) { this.entity = entity; } - dEntity entity; + EntityTag entity; ///////// // Property Methods @@ -72,9 +72,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) - // @mechanism dEntity.body_arrows + // @mechanism EntityTag.body_arrows // @group properties // @description // Returns the number of arrows stuck in the entity's body. @@ -92,28 +92,28 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name body_arrows // @input Element(Number) // @description // Sets the number of arrows stuck in the entity's body. // Note: Body arrows will only be visible for players or player-type npcs. // @tags - // + // // --> if (mechanism.matches("body_arrows") && mechanism.requireInteger()) { setBodyArrows(mechanism.getValue().asInt()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name clear_body_arrows // @input None // @description // Clears all arrows stuck in the entity's body. // Note: Body arrows will only be visible for players or player-type npcs. // @tags - // + // // --> if (mechanism.matches("clear_body_arrows")) { setBodyArrows(0); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityBoundingBox.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityBoundingBox.java index 09177c20df..267b9ba913 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityBoundingBox.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityBoundingBox.java @@ -3,8 +3,8 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.util.BoundingBox; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; import com.denizenscript.denizencore.objects.ObjectTag; @@ -19,7 +19,7 @@ public class EntityBoundingBox implements Property { public static boolean describes(ObjectTag object) { - return object instanceof dEntity; + return object instanceof EntityTag; } public static EntityBoundingBox getFrom(ObjectTag object) { @@ -27,7 +27,7 @@ public static EntityBoundingBox getFrom(ObjectTag object) { return null; } else { - return new EntityBoundingBox((dEntity) object); + return new EntityBoundingBox((EntityTag) object); } } @@ -52,17 +52,17 @@ public static void remove(UUID uuid) { // Instance Fields and Methods ///////////// - private EntityBoundingBox(dEntity entity) { + private EntityBoundingBox(EntityTag entity) { this.entity = entity; } - dEntity entity; + EntityTag entity; private ListTag getBoundingBox() { BoundingBox boundingBox = NMSHandler.getInstance().getEntityHelper().getBoundingBox(entity.getBukkitEntity()); ListTag list = new ListTag(); - list.add(new dLocation(boundingBox.getLow().toLocation(entity.getWorld())).identify()); - list.add(new dLocation(boundingBox.getHigh().toLocation(entity.getWorld())).identify()); + list.add(new LocationTag(boundingBox.getLow().toLocation(entity.getWorld())).identify()); + list.add(new LocationTag(boundingBox.getHigh().toLocation(entity.getWorld())).identify()); return list; } @@ -93,9 +93,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @returns ListTag(dLocation) - // @mechanism dEntity.bounding_box + // @attribute + // @returns ListTag(LocationTag) + // @mechanism EntityTag.bounding_box // @group properties // @description // Returns the collision bounding box of the entity in the format "|", essentially a cuboid with decimals. @@ -111,13 +111,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name bounding_box - // @input ListTag(dLocation) + // @input ListTag(LocationTag) // @description // Changes the collision bounding box of the entity in the format "|", essentially a cuboid with decimals. // @tags - // + // // --> if (mechanism.matches("bounding_box")) { @@ -125,14 +125,14 @@ public void adjust(Mechanism mechanism) { // TODO: Allow editing NPC boxes properly? return; } - List locations = mechanism.valueAsType(ListTag.class).filter(dLocation.class, mechanism.context); + List locations = mechanism.valueAsType(ListTag.class).filter(LocationTag.class, mechanism.context); if (locations.size() == 2) { BoundingBox boundingBox = new BoundingBox(locations.get(0).toVector(), locations.get(1).toVector()); NMSHandler.getInstance().getEntityHelper().setBoundingBox(entity.getBukkitEntity(), boundingBox); modifiedBoxes.add(entity.getUUID()); } else { - Debug.echoError("Must specify exactly 2 dLocations in the format '|'!"); + Debug.echoError("Must specify exactly 2 LocationTags in the format '|'!"); } } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityChestCarrier.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityChestCarrier.java index 5a41f0924e..eedf7e218a 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityChestCarrier.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityChestCarrier.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.entity; import com.denizenscript.denizen.nms.NMSHandler; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -11,8 +11,8 @@ public class EntityChestCarrier implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity - && NMSHandler.getInstance().getEntityHelper().isChestedHorse(((dEntity) entity).getBukkitEntity()); + return entity instanceof EntityTag + && NMSHandler.getInstance().getEntityHelper().isChestedHorse(((EntityTag) entity).getBukkitEntity()); } public static EntityChestCarrier getFrom(ObjectTag entity) { @@ -20,7 +20,7 @@ public static EntityChestCarrier getFrom(ObjectTag entity) { return null; } else { - return new EntityChestCarrier((dEntity) entity); + return new EntityChestCarrier((EntityTag) entity); } } @@ -37,11 +37,11 @@ public static EntityChestCarrier getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityChestCarrier(dEntity entity) { + private EntityChestCarrier(EntityTag entity) { this.entity = entity; } - dEntity entity; + EntityTag entity; ///////// // Property Methods @@ -69,9 +69,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dEntity.carries_chest + // @mechanism EntityTag.carries_chest // @group properties // @description // If the entity is a horse, returns whether it is carrying a chest. @@ -88,13 +88,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name carries_chest // @input Element(Boolean) // @description // Changes whether a Horse carries a chest. // @tags - // + // // --> if (mechanism.matches("carries_chest") && mechanism.requireBoolean()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityColor.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityColor.java index f36d0897f3..5b9147f68c 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityColor.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityColor.java @@ -5,7 +5,7 @@ import com.denizenscript.denizen.utilities.entity.ParrotHelper; import com.denizenscript.denizen.utilities.entity.RabbitType; import com.denizenscript.denizen.utilities.entity.ShulkerHelper; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; @@ -20,10 +20,10 @@ public class EntityColor implements Property { public static boolean describes(ObjectTag entity) { - if (!(entity instanceof dEntity)) { + if (!(entity instanceof EntityTag)) { return false; } - EntityType type = ((dEntity) entity).getBukkitEntityType(); + EntityType type = ((EntityTag) entity).getBukkitEntityType(); return type == EntityType.SHEEP || type == EntityType.HORSE || type == EntityType.WOLF || @@ -39,7 +39,7 @@ public static EntityColor getFrom(ObjectTag entity) { return null; } else { - return new EntityColor((dEntity) entity); + return new EntityColor((EntityTag) entity); } } @@ -56,11 +56,11 @@ public static EntityColor getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityColor(dEntity entity) { + private EntityColor(EntityTag entity) { colored = entity; } - dEntity colored; + EntityTag colored; private String getColor() { EntityType type = colored.getBukkitEntityType(); @@ -120,7 +120,7 @@ public String getPropertyId() { // @group Properties // @description // This is a quick rundown of the styling information used to create a horse, - // used for both <@link tag e@entity.color> and <@link mechanism e@entity.color>. + // used for both <@link tag EntityTag.color> and <@link mechanism EntityTag.color>. // // The output/input is formatted as COLOR|STYLE(|VARIANT) // Where color is: @@ -155,9 +155,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dEntity.color + // @mechanism EntityTag.color // @group properties // @description // If the entity can have a color, returns the entity's color. @@ -182,7 +182,7 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name color // @input Element // @description @@ -195,8 +195,8 @@ public void adjust(Mechanism mechanism) { // For llamas, the types are CREAMY, WHITE, BROWN, and GRAY. // For sheep, wolf, and shulker entities, see <@link url https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/DyeColor.html> // @tags - // - // + // + // // --> if (mechanism.matches("color")) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityCritical.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityCritical.java index c6055c12dc..3b77bd411d 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityCritical.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityCritical.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -11,7 +11,7 @@ public class EntityCritical implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && ((dEntity) entity).getBukkitEntity() instanceof Arrow; + return entity instanceof EntityTag && ((EntityTag) entity).getBukkitEntity() instanceof Arrow; } public static EntityCritical getFrom(ObjectTag entity) { @@ -19,7 +19,7 @@ public static EntityCritical getFrom(ObjectTag entity) { return null; } else { - return new EntityCritical((dEntity) entity); + return new EntityCritical((EntityTag) entity); } } @@ -36,11 +36,11 @@ public static EntityCritical getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityCritical(dEntity entity) { + private EntityCritical(EntityTag entity) { critical = entity; } - dEntity critical; + EntityTag critical; ///////// // Property Methods @@ -73,9 +73,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dEntity.critical + // @mechanism EntityTag.critical // @group properties // @description // If the entity is an arrow or trident, returns whether the arrow/trident is critical. @@ -92,13 +92,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name critical // @input Element(Boolean) // @description // Changes whether an arrow/trident is critical. // @tags - // + // // --> if (mechanism.matches("critical") && mechanism.requireBoolean()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityCustomName.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityCustomName.java index 4d3686b2a2..cad3f35ff6 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityCustomName.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityCustomName.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -10,14 +10,14 @@ public class EntityCustomName implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity; + return entity instanceof EntityTag; } public static EntityCustomName getFrom(ObjectTag entity) { if (!describes(entity)) { return null; } - return new EntityCustomName((dEntity) entity); + return new EntityCustomName((EntityTag) entity); } public static final String[] handledTags = new String[] { @@ -28,11 +28,11 @@ public static EntityCustomName getFrom(ObjectTag entity) { "custom_name_visibility", "custom_name_visible", "custom_name" }; - private EntityCustomName(dEntity ent) { + private EntityCustomName(EntityTag ent) { entity = ent; } - dEntity entity; + EntityTag entity; @Override public String getPropertyString() { @@ -58,7 +58,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group attributes // @description @@ -73,7 +73,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @group attributes // @description @@ -97,13 +97,13 @@ else if (attribute.startsWith("custom_name")) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name custom_name_visible // @input Element(Boolean) // @description // Sets whether the custom name is visible. // @tags - // + // // --> if ((mechanism.matches("custom_name_visibility") || mechanism.matches("custom_name_visible")) && mechanism.requireBoolean()) { @@ -111,13 +111,13 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name custom_name // @input Element // @description // Sets the custom name of the entity. // @tags - // + // // --> else if (mechanism.matches("custom_name")) { entity.getBukkitEntity().setCustomName(mechanism.getValue().asString()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityDisabledSlots.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityDisabledSlots.java index 4a57fd637c..a19040c0bf 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityDisabledSlots.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityDisabledSlots.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.utilities.nbt.CustomNBT; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; @@ -18,7 +18,7 @@ public class EntityDisabledSlots implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && ((dEntity) entity).getBukkitEntityType() == EntityType.ARMOR_STAND; + return entity instanceof EntityTag && ((EntityTag) entity).getBukkitEntityType() == EntityType.ARMOR_STAND; } public static EntityDisabledSlots getFrom(ObjectTag entity) { @@ -26,7 +26,7 @@ public static EntityDisabledSlots getFrom(ObjectTag entity) { return null; } else { - return new EntityDisabledSlots((dEntity) entity); + return new EntityDisabledSlots((EntityTag) entity); } } @@ -43,11 +43,11 @@ public static EntityDisabledSlots getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityDisabledSlots(dEntity entity) { + private EntityDisabledSlots(EntityTag entity) { dentity = entity; } - dEntity dentity; + EntityTag dentity; public enum Action { ALL(0), REMOVE(8), PLACE(16); @@ -101,9 +101,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) - // @mechanism dEntity.disabled_slots_raw + // @mechanism EntityTag.disabled_slots_raw // @group properties // @description // If the entity is an armor stand, returns its raw disabled slots value. @@ -115,9 +115,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ListTag - // @mechanism dEntity.disabled_slots + // @mechanism EntityTag.disabled_slots // @group properties // @description // If the entity is an armor stand, returns a list of its disabled slots in the form li@slot/action|... @@ -133,22 +133,22 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name disabled_slots_raw // @input Element(Number) // @description // Sets the raw disabled slots value of an armor stand. // See <@link url https://minecraft.gamepedia.com/Armor_Stand/ED> // @tags - // - // + // + // // --> if (mechanism.matches("disabled_slots_raw") && mechanism.requireInteger()) { CustomNBT.addCustomNBT(dentity.getBukkitEntity(), CustomNBT.KEY_DISABLED_SLOTS, mechanism.getValue().asInt()); } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name disabled_slots // @input ListTag // @description @@ -160,8 +160,8 @@ public void adjust(Mechanism mechanism) { // NOTE: Minecraft contains a bug where disabling HAND/ALL still allows item removal. // To fully disable hand interaction, disable HAND/ALL and HAND/REMOVE. // @tags - // - // + // + // // --> if (mechanism.matches("disabled_slots")) { if (!mechanism.hasValue()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityElder.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityElder.java index 3b7edcd1c8..5f2bc7c410 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityElder.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityElder.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -12,7 +12,7 @@ public class EntityElder implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && ((dEntity) entity).getBukkitEntityType() == EntityType.GUARDIAN; + return entity instanceof EntityTag && ((EntityTag) entity).getBukkitEntityType() == EntityType.GUARDIAN; } public static EntityElder getFrom(ObjectTag entity) { @@ -20,7 +20,7 @@ public static EntityElder getFrom(ObjectTag entity) { return null; } else { - return new EntityElder((dEntity) entity); + return new EntityElder((EntityTag) entity); } } @@ -37,11 +37,11 @@ public static EntityElder getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityElder(dEntity entity) { + private EntityElder(EntityTag entity) { this.entity = entity; } - dEntity entity; + EntityTag entity; private boolean getElder() { return ((Guardian) (entity.getBukkitEntity())).isElder(); @@ -86,9 +86,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dEntity.elder + // @mechanism EntityTag.elder // @group properties // @description // If the entity is a guardian, returns whether it is elder. @@ -105,13 +105,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name elder // @input Element(Boolean) // @description // Changes the elder state of a Guardian. // @tags - // + // // --> if (mechanism.matches("elder") && mechanism.requireBoolean()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityEquipment.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityEquipment.java index 972c307041..80cb043586 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityEquipment.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityEquipment.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; import com.denizenscript.denizencore.objects.ObjectTag; @@ -14,8 +14,8 @@ public class EntityEquipment implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity - && ((dEntity) entity).getBukkitEntity() instanceof LivingEntity; + return entity instanceof EntityTag + && ((EntityTag) entity).getBukkitEntity() instanceof LivingEntity; } public static EntityEquipment getFrom(ObjectTag entity) { @@ -23,7 +23,7 @@ public static EntityEquipment getFrom(ObjectTag entity) { return null; } else { - return new EntityEquipment((dEntity) entity); + return new EntityEquipment((EntityTag) entity); } } @@ -40,11 +40,11 @@ public static EntityEquipment getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityEquipment(dEntity ent) { + private EntityEquipment(EntityTag ent) { entity = ent; } - dEntity entity; + EntityTag entity; ///////// // Property Methods @@ -73,26 +73,26 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @returns dItem + // @attribute + // @returns ItemTag // @group inventory // @description // Returns the item the entity is wearing as boots. // --> if (attribute.startsWith("equipment.boots")) { if (entity.getLivingEntity().getEquipment().getBoots() != null) { - return new dItem(entity.getLivingEntity().getEquipment().getBoots()) + return new ItemTag(entity.getLivingEntity().getEquipment().getBoots()) .getAttribute(attribute.fulfill(2)); } else { - return new dItem(Material.AIR) + return new ItemTag(Material.AIR) .getAttribute(attribute.fulfill(2)); } } // <--[tag] - // @attribute - // @returns dItem + // @attribute + // @returns ItemTag // @group inventory // @description // Returns the item the entity is wearing as a chestplate. @@ -100,18 +100,18 @@ public String getAttribute(Attribute attribute) { else if (attribute.startsWith("equipment.chestplate") || attribute.startsWith("equipment.chest")) { if (entity.getLivingEntity().getEquipment().getChestplate() != null) { - return new dItem(entity.getLivingEntity().getEquipment().getChestplate()) + return new ItemTag(entity.getLivingEntity().getEquipment().getChestplate()) .getAttribute(attribute.fulfill(2)); } else { - return new dItem(Material.AIR) + return new ItemTag(Material.AIR) .getAttribute(attribute.fulfill(2)); } } // <--[tag] - // @attribute - // @returns dItem + // @attribute + // @returns ItemTag // @group inventory // @description // Returns the item the entity is wearing as a helmet. @@ -119,18 +119,18 @@ else if (attribute.startsWith("equipment.chestplate") || else if (attribute.startsWith("equipment.helmet") || attribute.startsWith("equipment.head")) { if (entity.getLivingEntity().getEquipment().getHelmet() != null) { - return new dItem(entity.getLivingEntity().getEquipment().getHelmet()) + return new ItemTag(entity.getLivingEntity().getEquipment().getHelmet()) .getAttribute(attribute.fulfill(2)); } else { - return new dItem(Material.AIR) + return new ItemTag(Material.AIR) .getAttribute(attribute.fulfill(2)); } } // <--[tag] - // @attribute - // @returns dItem + // @attribute + // @returns ItemTag // @group inventory // @description // Returns the item the entity is wearing as leggings. @@ -138,17 +138,17 @@ else if (attribute.startsWith("equipment.helmet") || else if (attribute.startsWith("equipment.leggings") || attribute.startsWith("equipment.legs")) { if (entity.getLivingEntity().getEquipment().getLeggings() != null) { - return new dItem(entity.getLivingEntity().getEquipment().getLeggings()) + return new ItemTag(entity.getLivingEntity().getEquipment().getLeggings()) .getAttribute(attribute.fulfill(2)); } else { - return new dItem(Material.AIR) + return new ItemTag(Material.AIR) .getAttribute(attribute.fulfill(2)); } } // <--[tag] - // @attribute + // @attribute // @returns ListTag // @group inventory // @description @@ -166,20 +166,20 @@ else if (attribute.startsWith("equipment")) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name equipment - // @input ListTag(dItem) + // @input ListTag(ItemTag) // @description // Sets the entity's worn equipment. // Input list is boots|leggings|chestplate|helmet // @tags - // + // // --> if (mechanism.matches("equipment")) { ListTag list = ListTag.valueOf(mechanism.getValue().asString()); ItemStack[] stacks = new ItemStack[list.size()]; for (int i = 0; i < list.size(); i++) { - stacks[i] = dItem.valueOf(list.get(i), mechanism.context).getItemStack(); + stacks[i] = ItemTag.valueOf(list.get(i), mechanism.context).getItemStack(); } entity.getLivingEntity().getEquipment().setArmorContents(stacks); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityExplosionFire.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityExplosionFire.java index b79a706f2c..68759e6173 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityExplosionFire.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityExplosionFire.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -11,12 +11,12 @@ public class EntityExplosionFire implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity - && ((dEntity) entity).getBukkitEntity() instanceof Explosive; + return entity instanceof EntityTag + && ((EntityTag) entity).getBukkitEntity() instanceof Explosive; } public static EntityExplosionFire getFrom(ObjectTag entity) { - return describes(entity) ? new EntityExplosionFire((dEntity) entity) : null; + return describes(entity) ? new EntityExplosionFire((EntityTag) entity) : null; } public static final String[] handledTags = new String[] { @@ -35,11 +35,11 @@ public boolean isIncendiary() { // Instance Fields and Methods ///////////// - private EntityExplosionFire(dEntity ent) { + private EntityExplosionFire(EntityTag ent) { entity = ent; } - dEntity entity; + EntityTag entity; ///////// // Property Methods @@ -67,9 +67,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dEntity.explosion_fire + // @mechanism EntityTag.explosion_fire // @group properties // @description // If this entity is explosive, returns whether its explosion creates fire. @@ -86,13 +86,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name explosion_fire // @input Element(Boolean) // @description // If this entity is explosive, sets whether its explosion creates fire. // @tags - // + // // --> if (mechanism.matches("explosion_fire") && mechanism.requireBoolean()) { ((Explosive) entity.getBukkitEntity()).setIsIncendiary(mechanism.getValue().asBoolean()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityExplosionRadius.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityExplosionRadius.java index cf3c1fa487..364a920119 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityExplosionRadius.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityExplosionRadius.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -12,13 +12,13 @@ public class EntityExplosionRadius implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity - && (((dEntity) entity).getBukkitEntity() instanceof Explosive - || ((dEntity) entity).getBukkitEntity() instanceof Creeper); + return entity instanceof EntityTag + && (((EntityTag) entity).getBukkitEntity() instanceof Explosive + || ((EntityTag) entity).getBukkitEntity() instanceof Creeper); } public static EntityExplosionRadius getFrom(ObjectTag entity) { - return describes(entity) ? new EntityExplosionRadius((dEntity) entity) : null; + return describes(entity) ? new EntityExplosionRadius((EntityTag) entity) : null; } public static final String[] handledTags = new String[] { @@ -40,11 +40,11 @@ public float getExplosionRadius() { // Instance Fields and Methods ///////////// - private EntityExplosionRadius(dEntity ent) { + private EntityExplosionRadius(EntityTag ent) { entity = ent; } - dEntity entity; + EntityTag entity; ///////// // Property Methods @@ -72,9 +72,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) - // @mechanism dEntity.explosion_radius + // @mechanism EntityTag.explosion_radius // @group properties // @description // If this entity can explode, returns its explosion radius. @@ -91,13 +91,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name explosion_radius // @input Element(Decimal) // @description // If this entity can explode, sets its explosion radius. // @tags - // + // // --> if (mechanism.matches("explosion_radius") && mechanism.requireFloat()) { if (entity.getBukkitEntity() instanceof Creeper) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityFirework.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityFirework.java index ae6ce1eb81..5063238c04 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityFirework.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityFirework.java @@ -2,8 +2,8 @@ import com.denizenscript.denizen.utilities.MaterialCompat; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.objects.properties.Property; @@ -16,7 +16,7 @@ public class EntityFirework implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && ((dEntity) entity).getBukkitEntityType() == EntityType.FIREWORK; + return entity instanceof EntityTag && ((EntityTag) entity).getBukkitEntityType() == EntityType.FIREWORK; } public static EntityFirework getFrom(ObjectTag entity) { @@ -24,7 +24,7 @@ public static EntityFirework getFrom(ObjectTag entity) { return null; } else { - return new EntityFirework((dEntity) entity); + return new EntityFirework((EntityTag) entity); } } @@ -41,11 +41,11 @@ public static EntityFirework getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityFirework(dEntity entity) { + private EntityFirework(EntityTag entity) { firework = entity; } - dEntity firework; + EntityTag firework; ///////// // Property Methods @@ -55,7 +55,7 @@ private EntityFirework(dEntity entity) { public String getPropertyString() { ItemStack item = new ItemStack(MaterialCompat.FIREWORK_ROCKET); item.setItemMeta(((Firework) firework.getBukkitEntity()).getFireworkMeta()); - return new dItem(item).identify(); + return new ItemTag(item).identify(); } @Override @@ -75,9 +75,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @returns dItem - // @mechanism dEntity.firework_item + // @attribute + // @returns ItemTag + // @mechanism EntityTag.firework_item // @group properties // @description // If the entity is a firework, returns the firework item used to launch it. @@ -85,7 +85,7 @@ public String getAttribute(Attribute attribute) { if (attribute.startsWith("firework_item")) { ItemStack item = new ItemStack(MaterialCompat.FIREWORK_ROCKET); item.setItemMeta(((Firework) firework.getBukkitEntity()).getFireworkMeta()); - return new dItem(item).getAttribute(attribute.fulfill(1)); + return new ItemTag(item).getAttribute(attribute.fulfill(1)); } return null; @@ -95,16 +95,16 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name firework_item - // @input dItem + // @input ItemTag // @description // Changes the firework effect on this entity, using a firework item. // @tags - // + // // --> - if (mechanism.matches("firework_item") && mechanism.requireObject(dItem.class)) { - dItem item = mechanism.valueAsType(dItem.class); + if (mechanism.matches("firework_item") && mechanism.requireObject(ItemTag.class)) { + ItemTag item = mechanism.valueAsType(ItemTag.class); if (item != null && item.getItemStack().getItemMeta() instanceof FireworkMeta) { ((Firework) firework.getBukkitEntity()).setFireworkMeta((FireworkMeta) item.getItemStack().getItemMeta()); } @@ -114,13 +114,13 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name detonate // @input None // @description // If the entity is a firework, detonates it. // @tags - // + // // --> if (mechanism.matches("detonate")) { ((Firework) firework.getBukkitEntity()).detonate(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityFramed.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityFramed.java index 97855db0d1..d60908ea54 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityFramed.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityFramed.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.objects.properties.entity; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; @@ -19,7 +19,7 @@ public class EntityFramed implements Property { // TODO: Possibly merge class with EntityItem? public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && ((dEntity) entity).getBukkitEntityType() == EntityType.ITEM_FRAME; + return entity instanceof EntityTag && ((EntityTag) entity).getBukkitEntityType() == EntityType.ITEM_FRAME; } public static EntityFramed getFrom(ObjectTag entity) { @@ -27,7 +27,7 @@ public static EntityFramed getFrom(ObjectTag entity) { return null; } else { - return new EntityFramed((dEntity) entity); + return new EntityFramed((EntityTag) entity); } } @@ -44,11 +44,11 @@ public static EntityFramed getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityFramed(dEntity item) { + private EntityFramed(EntityTag item) { item_frame = item; } - dEntity item_frame; + EntityTag item_frame; public boolean hasItem() { return getItemFrameEntity().getItem() != null @@ -59,12 +59,12 @@ public ItemFrame getItemFrameEntity() { return (ItemFrame) item_frame.getBukkitEntity(); } - public void setItem(dItem item) { + public void setItem(ItemTag item) { getItemFrameEntity().setItem(item.getItemStack()); } - public dItem getItem() { - return new dItem(getItemFrameEntity().getItem()); + public ItemTag getItem() { + return new ItemTag(getItemFrameEntity().getItem()); } @@ -102,9 +102,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dEntity.framed + // @mechanism EntityTag.framed // @group properties // @description // If the entity is an item frame, returns the rotation of the material currently framed. @@ -115,9 +115,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @returns dItem - // @mechanism dEntity.framed + // @attribute + // @returns ItemTag + // @mechanism EntityTag.framed // @group properties // @description // If the entity is an item frame, returns the material currently framed. @@ -128,9 +128,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dEntity.framed + // @mechanism EntityTag.framed // @group properties // @description // If the entity is an item frame, returns whether the frame has an item in it. @@ -147,18 +147,18 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name framed - // @input dItem(|Element) + // @input ItemTag(|Element) // @description // Sets the entity's framed item and optionally the rotation as well. // Valid rotations: <@link url https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Rotation.html> // For example: framed:i@diamond_sword|clockwise // @tags - // - // - // - // + // + // + // + // // --> if (mechanism.matches("framed")) { @@ -167,8 +167,8 @@ public void adjust(Mechanism mechanism) { Debug.echoError("Missing value for 'framed' mechanism!"); return; } - if (new ElementTag(list.get(0)).matchesType(dItem.class)) { - setItem(new ElementTag(list.get(0)).asType(dItem.class, mechanism.context)); + if (new ElementTag(list.get(0)).matchesType(ItemTag.class)) { + setItem(new ElementTag(list.get(0)).asType(ItemTag.class, mechanism.context)); } else { Debug.echoError("Invalid item '" + list.get(0) + "'"); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityGravity.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityGravity.java index 785b53a307..3fdf4be0f9 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityGravity.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityGravity.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -10,7 +10,7 @@ public class EntityGravity implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity; + return entity instanceof EntityTag; } public static EntityGravity getFrom(ObjectTag entity) { @@ -18,7 +18,7 @@ public static EntityGravity getFrom(ObjectTag entity) { return null; } else { - return new EntityGravity((dEntity) entity); + return new EntityGravity((EntityTag) entity); } } @@ -35,11 +35,11 @@ public static EntityGravity getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityGravity(dEntity entity) { + private EntityGravity(EntityTag entity) { dentity = entity; } - dEntity dentity; + EntityTag dentity; ///////// // Property Methods @@ -72,9 +72,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dEntity.gravity + // @mechanism EntityTag.gravity // @group properties // @description // Returns whether the entity has gravity. @@ -91,13 +91,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name gravity // @input Element(Boolean) // @description // Changes the gravity state of an entity. // @tags - // + // // --> if (mechanism.matches("gravity") && mechanism.requireBoolean()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityHealth.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityHealth.java index eeb13edba1..e877493ae7 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityHealth.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityHealth.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.npc.traits.HealthTrait; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -15,8 +15,8 @@ public class EntityHealth implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity - && ((dEntity) entity).isLivingEntity(); + return entity instanceof EntityTag + && ((EntityTag) entity).isLivingEntity(); } public static EntityHealth getFrom(ObjectTag entity) { @@ -24,7 +24,7 @@ public static EntityHealth getFrom(ObjectTag entity) { return null; } else { - return new EntityHealth((dEntity) entity); + return new EntityHealth((EntityTag) entity); } } @@ -41,11 +41,11 @@ public static EntityHealth getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityHealth(dEntity ent) { + private EntityHealth(EntityTag ent) { entity = ent; } - dEntity entity; + EntityTag entity; ///////// // Property Methods @@ -61,7 +61,7 @@ public String getPropertyId() { return "health_data"; } - public static String getHealthFormatted(dEntity entity, Attribute attribute) { + public static String getHealthFormatted(EntityTag entity, Attribute attribute) { double maxHealth = entity.getLivingEntity().getMaxHealth(); if (attribute.hasContext(2)) { maxHealth = attribute.getIntContext(2); @@ -96,7 +96,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @group attributes // @description @@ -108,7 +108,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @group attributes // @description @@ -120,7 +120,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @group attributes // @description @@ -136,7 +136,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) // @group attributes // @description @@ -154,15 +154,15 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name max_health // @input Element(Number) // @description // Sets the maximum health the entity may have. // The entity must be living. // @tags - // - // + // + // // --> if (mechanism.matches("max_health") && mechanism.requireDouble()) { if (entity.isCitizensNPC()) { @@ -183,15 +183,15 @@ else if (entity.isLivingEntity()) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name health_data // @input Element(Decimal)/Element(Decimal) // @description // Sets the amount of health the entity has, and the maximum health it has. // The entity must be living. // @tags - // - // + // + // // --> if (mechanism.matches("health_data")) { if (entity.isLivingEntity()) { @@ -205,15 +205,15 @@ else if (entity.isLivingEntity()) { } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name health // @input Element(Decimal) // @description // Sets the amount of health the entity has. // The entity must be living. // @tags - // - // + // + // // --> if (mechanism.matches("health") && mechanism.requireDouble()) { if (entity.isLivingEntity()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityInfected.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityInfected.java index 5c0c116b0d..d5dadd55ee 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityInfected.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityInfected.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.entity; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -16,12 +16,12 @@ public class EntityInfected implements Property { public static boolean describes(ObjectTag entity) { - if (!(entity instanceof dEntity)) { + if (!(entity instanceof EntityTag)) { return false; } // Check if a Villager or Zombie -- the only two EntityTypes that can be 'infected' - return ((dEntity) entity).getBukkitEntityType() == EntityType.ZOMBIE - || ((dEntity) entity).getBukkitEntityType() == EntityType.VILLAGER; + return ((EntityTag) entity).getBukkitEntityType() == EntityType.ZOMBIE + || ((EntityTag) entity).getBukkitEntityType() == EntityType.VILLAGER; } public static EntityInfected getFrom(ObjectTag entity) { @@ -29,7 +29,7 @@ public static EntityInfected getFrom(ObjectTag entity) { return null; } else { - return new EntityInfected((dEntity) entity); + return new EntityInfected((EntityTag) entity); } } @@ -46,11 +46,11 @@ public static EntityInfected getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityInfected(dEntity item) { + private EntityInfected(EntityTag item) { infected = item; } - dEntity infected; + EntityTag infected; public boolean isInfected() { return infected.getBukkitEntity() instanceof Zombie @@ -73,7 +73,7 @@ public void setInfected(boolean bool) { infect.getEquipment().setArmorContents(entity.getEquipment().getArmorContents()); // Remove the Villager entity.remove(); - // Set the dEntity to the new entity + // Set the EntityTag to the new entity infected.setEntity(infect); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityInventory.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityInventory.java index 8ecbfa52ec..cddbd31dc6 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityInventory.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityInventory.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.objects.properties.entity; import com.denizenscript.denizen.objects.properties.inventory.InventoryContents; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dInventory; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.InventoryTag; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; import com.denizenscript.denizencore.objects.ObjectTag; @@ -14,8 +14,8 @@ public class EntityInventory implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity - && ((dEntity) entity).getBukkitEntity() instanceof InventoryHolder; + return entity instanceof EntityTag + && ((EntityTag) entity).getBukkitEntity() instanceof InventoryHolder; } public static EntityInventory getFrom(ObjectTag entity) { @@ -23,7 +23,7 @@ public static EntityInventory getFrom(ObjectTag entity) { return null; } else { - return new EntityInventory((dEntity) entity); + return new EntityInventory((EntityTag) entity); } } @@ -40,11 +40,11 @@ public static EntityInventory getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityInventory(dEntity ent) { + private EntityInventory(EntityTag ent) { entity = ent; } - dEntity entity; + EntityTag entity; ///////// // Property Methods @@ -73,14 +73,14 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @returns dInventory + // @attribute + // @returns InventoryTag // @group inventory // @description // Returns the entity's inventory, if it has one. // --> if (attribute.startsWith("inventory")) { - dInventory inventory = entity.getInventory(); + InventoryTag inventory = entity.getInventory(); if (inventory != null) { return inventory.getAttribute(attribute.fulfill(1)); } @@ -97,22 +97,22 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name inventory_contents - // @input ListTag(dItem) + // @input ListTag(ItemTag) // @description // Clears the entity's inventory and sets it's item list to match the input. // @tags - // - // + // + // // --> if (mechanism.matches("inventory_contents")) { ListTag list = ListTag.valueOf(mechanism.getValue().asString()); - dInventory inv = entity.getInventory(); + InventoryTag inv = entity.getInventory(); inv.clear(); int i = 0; for (String str : list) { - inv.setSlots(i, dItem.valueOf(str, mechanism.context).getItemStack()); + inv.setSlots(i, ItemTag.valueOf(str, mechanism.context).getItemStack()); i++; } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityInvulnerable.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityInvulnerable.java index 6941f19362..849105ac1f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityInvulnerable.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityInvulnerable.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -10,7 +10,7 @@ public class EntityInvulnerable implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity; + return entity instanceof EntityTag; } public static EntityInvulnerable getFrom(ObjectTag entity) { @@ -18,7 +18,7 @@ public static EntityInvulnerable getFrom(ObjectTag entity) { return null; } else { - return new EntityInvulnerable((dEntity) entity); + return new EntityInvulnerable((EntityTag) entity); } } @@ -35,11 +35,11 @@ public static EntityInvulnerable getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityInvulnerable(dEntity entity) { + private EntityInvulnerable(EntityTag entity) { dentity = entity; } - dEntity dentity; + EntityTag dentity; ///////// // Property Methods @@ -72,9 +72,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dEntity.invulnerable + // @mechanism EntityTag.invulnerable // @group properties // @description // Returns whether the entity is invulnerable (cannot be damaged). @@ -91,13 +91,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name invulnerable // @input Element(Boolean) // @description // Sets whether the entity is invulnerable (cannot be damaged). // @tags - // + // // --> if (mechanism.matches("invulnerable") && mechanism.requireBoolean()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityIsShowingBottom.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityIsShowingBottom.java index c9d2aa4e51..fabf479384 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityIsShowingBottom.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityIsShowingBottom.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -12,7 +12,7 @@ public class EntityIsShowingBottom implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && ((dEntity) entity).getBukkitEntityType() == EntityType.ENDER_CRYSTAL; + return entity instanceof EntityTag && ((EntityTag) entity).getBukkitEntityType() == EntityType.ENDER_CRYSTAL; } public static EntityIsShowingBottom getFrom(ObjectTag entity) { @@ -20,7 +20,7 @@ public static EntityIsShowingBottom getFrom(ObjectTag entity) { return null; } else { - return new EntityIsShowingBottom((dEntity) entity); + return new EntityIsShowingBottom((EntityTag) entity); } } @@ -37,11 +37,11 @@ public static EntityIsShowingBottom getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityIsShowingBottom(dEntity entity) { + private EntityIsShowingBottom(EntityTag entity) { dentity = entity; } - dEntity dentity; + EntityTag dentity; ///////// // Property Methods @@ -74,9 +74,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dEntity.is_showing_bottom + // @mechanism EntityTag.is_showing_bottom // @group properties // @description // If the entity is an ender crystal, returns whether the ender crystal has its bottom showing. @@ -93,13 +93,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name is_showing_bottom // @input Element(Boolean) // @description // Changes the bottom state of an ender crystal. // @tags - // + // // --> if (mechanism.matches("is_showing_bottom") && mechanism.requireBoolean()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityItem.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityItem.java index 8f282c53a8..4c4ceb2ee2 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityItem.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityItem.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.objects.properties.entity; import com.denizenscript.denizen.nms.NMSHandler; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.objects.properties.Property; @@ -15,9 +15,9 @@ public class EntityItem implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && - (((dEntity) entity).getBukkitEntityType() == EntityType.DROPPED_ITEM - || ((dEntity) entity).getBukkitEntityType() == EntityType.ENDERMAN); + return entity instanceof EntityTag && + (((EntityTag) entity).getBukkitEntityType() == EntityType.DROPPED_ITEM + || ((EntityTag) entity).getBukkitEntityType() == EntityType.ENDERMAN); } public static EntityItem getFrom(ObjectTag entity) { @@ -25,7 +25,7 @@ public static EntityItem getFrom(ObjectTag entity) { return null; } else { - return new EntityItem((dEntity) entity); + return new EntityItem((EntityTag) entity); } } @@ -42,18 +42,18 @@ public static EntityItem getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityItem(dEntity entity) { + private EntityItem(EntityTag entity) { item = entity; } - dEntity item; + EntityTag item; - public dItem getItem() { + public ItemTag getItem() { if (item.getBukkitEntity() instanceof Item) { - return new dItem(((Item) item.getBukkitEntity()).getItemStack()); + return new ItemTag(((Item) item.getBukkitEntity()).getItemStack()); } else { - return new dItem(((Enderman) item.getBukkitEntity()) + return new ItemTag(((Enderman) item.getBukkitEntity()) .getCarriedMaterial()); } } @@ -64,7 +64,7 @@ public dItem getItem() { @Override public String getPropertyString() { - dItem item = getItem(); + ItemTag item = getItem(); if (item.getItemStack().getType() != Material.AIR) { return item.identify(); } @@ -90,12 +90,12 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @returns dItem - // @mechanism dEntity.item + // @attribute + // @returns ItemTag + // @mechanism EntityTag.item // @group properties // @description - // If the entity is a dropped item or an Enderman, returns the dItem the entity holds. + // If the entity is a dropped item or an Enderman, returns the ItemTag the entity holds. // --> if (attribute.startsWith("item")) { return getItem().getAttribute(attribute.fulfill(1)); @@ -108,23 +108,23 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name item - // @input dItem + // @input ItemTag // @description // Changes what item a dropped item or an Enderman holds. // @tags - // + // // --> - if (mechanism.matches("item") && mechanism.requireObject(dItem.class)) { + if (mechanism.matches("item") && mechanism.requireObject(ItemTag.class)) { if (item.getBukkitEntity() instanceof Item) { ((Item) item.getBukkitEntity()).setItemStack(mechanism.getValue() - .asType(dItem.class, mechanism.context).getItemStack()); + .asType(ItemTag.class, mechanism.context).getItemStack()); } else { NMSHandler.getInstance().getEntityHelper().setCarriedItem((Enderman) item.getBukkitEntity(), - mechanism.valueAsType(dItem.class).getItemStack()); + mechanism.valueAsType(ItemTag.class).getItemStack()); } } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityJumpStrength.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityJumpStrength.java index af7d334aa3..b38d4da58f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityJumpStrength.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityJumpStrength.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -13,8 +13,8 @@ public class EntityJumpStrength implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && - ((dEntity) entity).getBukkitEntityType() == EntityType.HORSE; + return entity instanceof EntityTag && + ((EntityTag) entity).getBukkitEntityType() == EntityType.HORSE; } public static EntityJumpStrength getFrom(ObjectTag entity) { @@ -22,7 +22,7 @@ public static EntityJumpStrength getFrom(ObjectTag entity) { return null; } else { - return new EntityJumpStrength((dEntity) entity); + return new EntityJumpStrength((EntityTag) entity); } } @@ -39,11 +39,11 @@ public static EntityJumpStrength getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityJumpStrength(dEntity ent) { + private EntityJumpStrength(EntityTag ent) { entity = ent; } - dEntity entity; + EntityTag entity; ///////// // Property Methods @@ -72,9 +72,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) - // @mechanism dEntity.jump_strength + // @mechanism EntityTag.jump_strength // @group properties // @description // Returns the power of a horse's jump. @@ -91,13 +91,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name jump_strength // @input Element(Number) // @description // Sets the power of the horse's jump. // @tags - // + // // --> if (mechanism.matches("jump_strength") && mechanism.requireDouble()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityKnockback.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityKnockback.java index e99ea69fe9..52672528db 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityKnockback.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityKnockback.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -11,7 +11,7 @@ public class EntityKnockback implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && ((dEntity) entity).getBukkitEntity() instanceof Arrow; + return entity instanceof EntityTag && ((EntityTag) entity).getBukkitEntity() instanceof Arrow; } public static EntityKnockback getFrom(ObjectTag entity) { @@ -19,7 +19,7 @@ public static EntityKnockback getFrom(ObjectTag entity) { return null; } else { - return new EntityKnockback((dEntity) entity); + return new EntityKnockback((EntityTag) entity); } } @@ -36,11 +36,11 @@ public static EntityKnockback getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityKnockback(dEntity entity) { + private EntityKnockback(EntityTag entity) { arrow = entity; } - dEntity arrow; + EntityTag arrow; ///////// // Property Methods @@ -68,9 +68,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) - // @mechanism dEntity.knockback + // @mechanism EntityTag.knockback // @group properties // @description // If the entity is an arrow or trident, returns the knockback strength of the arrow/trident. @@ -87,13 +87,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name knockback // @input Element(Number) // @description // Changes an arrow's/trident's knockback strength. // @tags - // + // // --> if (mechanism.matches("knockback") && mechanism.requireInteger()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityMarker.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityMarker.java index 08a8ad3db0..28734f35cb 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityMarker.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityMarker.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -12,7 +12,7 @@ public class EntityMarker implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && ((dEntity) entity).getBukkitEntityType() == EntityType.ARMOR_STAND; + return entity instanceof EntityTag && ((EntityTag) entity).getBukkitEntityType() == EntityType.ARMOR_STAND; } public static EntityMarker getFrom(ObjectTag entity) { @@ -20,7 +20,7 @@ public static EntityMarker getFrom(ObjectTag entity) { return null; } else { - return new EntityMarker((dEntity) entity); + return new EntityMarker((EntityTag) entity); } } @@ -37,11 +37,11 @@ public static EntityMarker getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityMarker(dEntity entity) { + private EntityMarker(EntityTag entity) { dentity = entity; } - dEntity dentity; + EntityTag dentity; ///////// // Property Methods @@ -74,9 +74,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dEntity.marker + // @mechanism EntityTag.marker // @group properties // @description // If the entity is an armor stand, returns whether the armor stand is a marker. @@ -93,13 +93,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name marker // @input Element(Boolean) // @description // Changes the marker state of an armor stand. // @tags - // + // // --> if (mechanism.matches("marker") && mechanism.requireBoolean()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityMaxFuseTicks.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityMaxFuseTicks.java index 3e1cb9d02d..578f225fd2 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityMaxFuseTicks.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityMaxFuseTicks.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -12,7 +12,7 @@ public class EntityMaxFuseTicks implements Property { public static boolean describes(ObjectTag object) { - return object instanceof dEntity && ((dEntity) object).getBukkitEntityType() == EntityType.CREEPER; + return object instanceof EntityTag && ((EntityTag) object).getBukkitEntityType() == EntityType.CREEPER; } public static EntityMaxFuseTicks getFrom(ObjectTag object) { @@ -20,7 +20,7 @@ public static EntityMaxFuseTicks getFrom(ObjectTag object) { return null; } else { - return new EntityMaxFuseTicks((dEntity) object); + return new EntityMaxFuseTicks((EntityTag) object); } } @@ -37,11 +37,11 @@ public static EntityMaxFuseTicks getFrom(ObjectTag object) { // Instance Fields and Methods ///////////// - private EntityMaxFuseTicks(dEntity entity) { + private EntityMaxFuseTicks(EntityTag entity) { this.entity = entity; } - dEntity entity; + EntityTag entity; ///////// // Property Methods @@ -65,9 +65,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) - // @mechanism dEntity.max_fuse_ticks + // @mechanism EntityTag.max_fuse_ticks // @group properties // @description // Returns the default number of ticks until the creeper explodes when primed (NOT the time remaining if already primed). @@ -84,13 +84,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name max_fuse_ticks // @input Element(Number) // @description // Sets the default number of ticks until the creeper explodes when primed (NOT the time remaining if already primed). // @tags - // + // // --> if (mechanism.matches("max_fuse_ticks") && mechanism.requireInteger()) { ((Creeper) entity.getBukkitEntity()).setMaxFuseTicks(mechanism.getValue().asInt()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityPainting.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityPainting.java index 833fe1b4ce..c8e98a8d4d 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityPainting.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityPainting.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -13,7 +13,7 @@ public class EntityPainting implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && ((dEntity) entity).getBukkitEntityType() == EntityType.PAINTING; + return entity instanceof EntityTag && ((EntityTag) entity).getBukkitEntityType() == EntityType.PAINTING; } public static EntityPainting getFrom(ObjectTag entity) { @@ -21,7 +21,7 @@ public static EntityPainting getFrom(ObjectTag entity) { return null; } else { - return new EntityPainting((dEntity) entity); + return new EntityPainting((EntityTag) entity); } } @@ -38,11 +38,11 @@ public static EntityPainting getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityPainting(dEntity entity) { + private EntityPainting(EntityTag entity) { painting = entity; } - dEntity painting; + EntityTag painting; ///////// // Property Methods @@ -70,9 +70,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dEntity.painting + // @mechanism EntityTag.painting // @group properties // @description // If the entity is a painting, returns its width. @@ -83,9 +83,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dEntity.painting + // @mechanism EntityTag.painting // @group properties // @description // If the entity is a painting, returns its height. @@ -96,9 +96,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dEntity.painting + // @mechanism EntityTag.painting // @group properties // @description // If the entity is a painting, returns what art it shows. @@ -115,13 +115,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name painting // @input Element // @description // Changes the art shown by a painting. // @tags - // + // // --> if (mechanism.matches("painting") && mechanism.requireEnum(false, Art.values())) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityPickupStatus.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityPickupStatus.java index 78b2afbe8e..6dfacdc0c8 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityPickupStatus.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityPickupStatus.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.entity; import com.denizenscript.denizen.nms.NMSHandler; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -12,14 +12,14 @@ public class EntityPickupStatus implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && ((dEntity) entity).getBukkitEntity() instanceof Arrow; + return entity instanceof EntityTag && ((EntityTag) entity).getBukkitEntity() instanceof Arrow; } public static EntityPickupStatus getFrom(ObjectTag entity) { if (!describes(entity)) { return null; } - return new EntityPickupStatus((dEntity) entity); + return new EntityPickupStatus((EntityTag) entity); } public static final String[] handledTags = { @@ -35,11 +35,11 @@ public static EntityPickupStatus getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityPickupStatus(dEntity entity) { + private EntityPickupStatus(EntityTag entity) { dentity = entity; } - dEntity dentity; + EntityTag dentity; ///////// // Property Methods @@ -67,9 +67,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dEntity.pickup_status + // @mechanism EntityTag.pickup_status // @group properties // @description // If the entity is an arrow or trident, returns the pickup status of the arrow/trident. @@ -86,14 +86,14 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name pickup_status // @input Element // @description // Changes the pickup status of an arrow/trident. // Available pickup statuses can be found here: <@link url https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Arrow.PickupStatus.html> // @tags - // + // // --> if (mechanism.matches("pickup_status")) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityPotion.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityPotion.java index 6348e956bf..9ecd6799dd 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityPotion.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityPotion.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.objects.properties.Property; @@ -13,11 +13,11 @@ public class EntityPotion implements Property { public static boolean describes(ObjectTag entity) { - if (!(entity instanceof dEntity)) { + if (!(entity instanceof EntityTag)) { return false; } // Check if the entity is a SPLASH_POTION, the EntityType alias for ThrownPotion - return ((dEntity) entity).getBukkitEntityType() == EntityType.SPLASH_POTION; + return ((EntityTag) entity).getBukkitEntityType() == EntityType.SPLASH_POTION; } public static EntityPotion getFrom(ObjectTag entity) { @@ -25,7 +25,7 @@ public static EntityPotion getFrom(ObjectTag entity) { return null; } else { - return new EntityPotion((dEntity) entity); + return new EntityPotion((EntityTag) entity); } } @@ -42,9 +42,9 @@ public static EntityPotion getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - dEntity potion; + EntityTag potion; - private EntityPotion(dEntity entity) { + private EntityPotion(EntityTag entity) { potion = entity; } @@ -71,7 +71,7 @@ public String getPropertyString() { if (potion == null) { return null; } - return new dItem(getPotion().getItem()).identify(); + return new ItemTag(getPotion().getItem()).identify(); } @Override @@ -91,15 +91,15 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @returns dItem - // @mechanism dEntity.potion + // @attribute + // @returns ItemTag + // @mechanism EntityTag.potion // @group properties // @description - // Returns the dItem of the splash potion. + // Returns the ItemTag of the splash potion. // --> if (attribute.startsWith("potion")) { - return new dItem(getPotion().getItem()).getAttribute(attribute.fulfill(1)); + return new ItemTag(getPotion().getItem()).getAttribute(attribute.fulfill(1)); } return null; @@ -109,16 +109,16 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name potion - // @input dItem + // @input ItemTag // @description // Sets the splash potion's ItemStack (must be a potion), thereby changing the effects. // @tags - // + // // --> - if (mechanism.matches("potion") && mechanism.requireObject(dItem.class)) { - setPotion(mechanism.valueAsType(dItem.class).getItemStack()); + if (mechanism.matches("potion") && mechanism.requireObject(ItemTag.class)) { + setPotion(mechanism.valueAsType(ItemTag.class).getItemStack()); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityPotionEffects.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityPotionEffects.java index 2d5a74eb8e..fb9136f0d9 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityPotionEffects.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityPotionEffects.java @@ -3,7 +3,7 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.NMSVersion; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; @@ -22,9 +22,9 @@ public class EntityPotionEffects implements Property { public static boolean describes(ObjectTag object) { - return object instanceof dEntity && - (((dEntity) object).isLivingEntity() - || ((dEntity) object).getBukkitEntity() instanceof TippedArrow); + return object instanceof EntityTag && + (((EntityTag) object).isLivingEntity() + || ((EntityTag) object).getBukkitEntity() instanceof TippedArrow); } public static EntityPotionEffects getFrom(ObjectTag object) { @@ -32,7 +32,7 @@ public static EntityPotionEffects getFrom(ObjectTag object) { return null; } else { - return new EntityPotionEffects((dEntity) object); + return new EntityPotionEffects((EntityTag) object); } } @@ -49,11 +49,11 @@ public static EntityPotionEffects getFrom(ObjectTag object) { // Instance Fields and Methods ///////////// - private EntityPotionEffects(dEntity entity) { + private EntityPotionEffects(EntityTag entity) { this.entity = entity; } - dEntity entity; + EntityTag entity; public Collection getEffectsList() { if (entity.isLivingEntity()) { @@ -98,10 +98,10 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ListTag // @group attribute - // @mechanism dEntity.potion_effects + // @mechanism EntityTag.potion_effects // @description // Returns the list of active potion effects on the entity, in the format: li@TYPE,AMPLIFIER,DURATION,IS_AMBIENT,HAS_PARTICLES,HAS_ICON|... // Note that AMPLIFIER is a number representing the level, and DURATION is a number representing the time, in ticks, it will last for. @@ -116,7 +116,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Boolean) // @group attributes // @description @@ -145,7 +145,7 @@ else if (!getEffectsList().isEmpty()) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name potion_effects // @input ListTag // @description @@ -155,7 +155,7 @@ public void adjust(Mechanism mechanism) { // IS_AMBIENT, HAS_PARTICLES, and HAS_ICON are booleans. // For example: SPEED,0,120,false,true,true would give the entity a swiftness potion for 120 ticks. // @tags - // + // // --> if (mechanism.matches("potion_effects")) { ListTag effects = ListTag.valueOf(mechanism.getValue().asString()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityPowered.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityPowered.java index fc657557fc..77948a7c0f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityPowered.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityPowered.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -12,7 +12,7 @@ public class EntityPowered implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && ((dEntity) entity).getBukkitEntityType() == EntityType.CREEPER; + return entity instanceof EntityTag && ((EntityTag) entity).getBukkitEntityType() == EntityType.CREEPER; } public static EntityPowered getFrom(ObjectTag entity) { @@ -20,7 +20,7 @@ public static EntityPowered getFrom(ObjectTag entity) { return null; } else { - return new EntityPowered((dEntity) entity); + return new EntityPowered((EntityTag) entity); } } @@ -37,11 +37,11 @@ public static EntityPowered getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityPowered(dEntity entity) { + private EntityPowered(EntityTag entity) { powered = entity; } - dEntity powered; + EntityTag powered; private boolean getPowered() { return ((Creeper) (powered.getBukkitEntity())).isPowered(); @@ -86,9 +86,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dEntity.powered + // @mechanism EntityTag.powered // @group properties // @description // If the entity is a creeper, returns whether the creeper is powered. @@ -105,13 +105,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name powered // @input Element(Boolean) // @description // Changes the powered state of a Creeper. // @tags - // + // // --> if (mechanism.matches("powered") && mechanism.requireBoolean()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityProfession.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityProfession.java index 84f6013e8a..064e8d2899 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityProfession.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityProfession.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -15,12 +15,12 @@ public class EntityProfession implements Property { public static boolean describes(ObjectTag entity) { - if (!(entity instanceof dEntity)) { + if (!(entity instanceof EntityTag)) { return false; } - return ((dEntity) entity).getBukkitEntityType() == EntityType.VILLAGER - || ((dEntity) entity).getBukkitEntityType() == EntityType.ZOMBIE - || ((dEntity) entity).getBukkitEntityType() == EntityType.ZOMBIE_VILLAGER; + return ((EntityTag) entity).getBukkitEntityType() == EntityType.VILLAGER + || ((EntityTag) entity).getBukkitEntityType() == EntityType.ZOMBIE + || ((EntityTag) entity).getBukkitEntityType() == EntityType.ZOMBIE_VILLAGER; } public static EntityProfession getFrom(ObjectTag entity) { @@ -28,7 +28,7 @@ public static EntityProfession getFrom(ObjectTag entity) { return null; } else { - return new EntityProfession((dEntity) entity); + return new EntityProfession((EntityTag) entity); } } @@ -45,11 +45,11 @@ public static EntityProfession getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityProfession(dEntity entity) { + private EntityProfession(EntityTag entity) { professional = entity; } - dEntity professional; + EntityTag professional; private Villager.Profession getProfession() { if (professional.getBukkitEntityType() == EntityType.ZOMBIE_VILLAGER) { @@ -95,9 +95,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dEntity.profession + // @mechanism EntityTag.profession // @group properties // @description // If the entity can have professions, returns the entity's profession. @@ -116,7 +116,7 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name profession // @input Element // @description @@ -124,7 +124,7 @@ public void adjust(Mechanism mechanism) { // Currently, only Villager-type entities can have professions. // For the list of possible professions, refer to <@link url https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Villager.Profession.html> // @tags - // + // // --> if (mechanism.matches("profession") && mechanism.requireEnum(false, Villager.Profession.values())) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityRiptide.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityRiptide.java index 6d683907aa..2d96e57413 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityRiptide.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityRiptide.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.entity; import com.denizenscript.denizen.nms.NMSHandler; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -10,7 +10,7 @@ public class EntityRiptide implements Property { public static boolean describes(ObjectTag object) { - return object instanceof dEntity && ((dEntity) object).isLivingEntity(); + return object instanceof EntityTag && ((EntityTag) object).isLivingEntity(); } public static EntityRiptide getFrom(ObjectTag object) { @@ -18,7 +18,7 @@ public static EntityRiptide getFrom(ObjectTag object) { return null; } else { - return new EntityRiptide((dEntity) object); + return new EntityRiptide((EntityTag) object); } } @@ -35,11 +35,11 @@ public static EntityRiptide getFrom(ObjectTag object) { // Instance Fields and Methods ///////////// - private EntityRiptide(dEntity entity) { + private EntityRiptide(EntityTag entity) { this.entity = entity; } - dEntity entity; + EntityTag entity; ///////// // Property Methods @@ -63,9 +63,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dEntity.is_using_riptide + // @mechanism EntityTag.is_using_riptide // @group properties // @description // Returns whether this entity is using the Riptide enchantment. @@ -82,13 +82,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name is_using_riptide // @input Element(Boolean) // @description // Sets whether this entity is using the Riptide enchantment. // @tags - // + // // --> if (mechanism.matches("is_using_riptide") && mechanism.requireBoolean()) { NMSHandler.getInstance().getEntityHelper().setRiptide(entity.getBukkitEntity(), mechanism.getValue().asBoolean()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityRotation.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityRotation.java index 5591b6e6e1..ca0c5f2915 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityRotation.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityRotation.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -15,11 +15,11 @@ public class EntityRotation implements Property { public static boolean describes(ObjectTag entity) { - if (!(entity instanceof dEntity)) { + if (!(entity instanceof EntityTag)) { return false; } - return ((dEntity) entity).getBukkitEntityType() == EntityType.PAINTING - || ((dEntity) entity).getBukkitEntityType() == EntityType.ITEM_FRAME; + return ((EntityTag) entity).getBukkitEntityType() == EntityType.PAINTING + || ((EntityTag) entity).getBukkitEntityType() == EntityType.ITEM_FRAME; } public static EntityRotation getFrom(ObjectTag entity) { @@ -27,7 +27,7 @@ public static EntityRotation getFrom(ObjectTag entity) { return null; } else { - return new EntityRotation((dEntity) entity); + return new EntityRotation((EntityTag) entity); } } @@ -44,11 +44,11 @@ public static EntityRotation getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityRotation(dEntity entity) { + private EntityRotation(EntityTag entity) { this.entity = entity; } - dEntity entity; + EntityTag entity; private BlockFace getRotation() { return ((Hanging) entity.getBukkitEntity()).getAttachedFace().getOppositeFace(); @@ -86,9 +86,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dEntity.rotiation + // @mechanism EntityTag.rotiation // @group properties // @description // If the entity can have a rotation, returns the entity's rotation. @@ -106,14 +106,14 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name rotation // @input Element // @description // Changes the entity's rotation. // Currently, only Hanging-type entities can have rotations. // @tags - // + // // --> if (mechanism.matches("rotation") && mechanism.requireEnum(false, BlockFace.values())) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySilent.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySilent.java index 88a5448135..d19a96bb98 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySilent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySilent.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.entity; import com.denizenscript.denizen.nms.NMSHandler; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -11,7 +11,7 @@ public class EntitySilent implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity; + return entity instanceof EntityTag; } public static EntitySilent getFrom(ObjectTag entity) { @@ -19,7 +19,7 @@ public static EntitySilent getFrom(ObjectTag entity) { return null; } else { - return new EntitySilent((dEntity) entity); + return new EntitySilent((EntityTag) entity); } } @@ -36,11 +36,11 @@ public static EntitySilent getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntitySilent(dEntity ent) { + private EntitySilent(EntityTag ent) { entity = ent; } - dEntity entity; + EntityTag entity; ///////// // Property Methods @@ -69,7 +69,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group attributes // @description @@ -88,13 +88,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name silent // @input Element(Boolean) // @description // Sets whether this entity is silent. (Plays no sounds) // @tags - // + // // --> if (mechanism.matches("silent") && mechanism.requireBoolean()) { NMSHandler.getInstance().getEntityHelper().setSilent(entity.getBukkitEntity(), mechanism.getValue().asBoolean()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySitting.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySitting.java index 71243b3a55..e6726c9e83 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySitting.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySitting.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -11,8 +11,8 @@ public class EntitySitting implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity - && ((dEntity) entity).getBukkitEntity() instanceof Sittable; + return entity instanceof EntityTag + && ((EntityTag) entity).getBukkitEntity() instanceof Sittable; } public static EntitySitting getFrom(ObjectTag entity) { @@ -20,7 +20,7 @@ public static EntitySitting getFrom(ObjectTag entity) { return null; } else { - return new EntitySitting((dEntity) entity); + return new EntitySitting((EntityTag) entity); } } @@ -37,11 +37,11 @@ public static EntitySitting getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntitySitting(dEntity entity) { + private EntitySitting(EntityTag entity) { this.entity = entity; } - dEntity entity; + EntityTag entity; ///////// // Property Methods @@ -72,9 +72,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dEntity.sitting + // @mechanism EntityTag.sitting // @group properties // @description // If the entity is a wolf, cat, or parrot, returns whether the animal is sitting. @@ -91,13 +91,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name sitting // @input Element(Boolean) // @description // Changes the sitting state of a wolf, cat, or parrot. // @tags - // + // // --> if (mechanism.matches("sitting") && mechanism.requireBoolean()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySize.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySize.java index 3dc7ff85ef..8ebb0d5850 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySize.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySize.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.NMSVersion; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -14,10 +14,10 @@ public class EntitySize implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && - (((dEntity) entity).getBukkitEntity() instanceof Slime + return entity instanceof EntityTag && + (((EntityTag) entity).getBukkitEntity() instanceof Slime || (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13_R2) - && ((dEntity) entity).getBukkitEntity() instanceof Phantom)); + && ((EntityTag) entity).getBukkitEntity() instanceof Phantom)); } public static EntitySize getFrom(ObjectTag entity) { @@ -25,7 +25,7 @@ public static EntitySize getFrom(ObjectTag entity) { return null; } else { - return new EntitySize((dEntity) entity); + return new EntitySize((EntityTag) entity); } } @@ -42,11 +42,11 @@ public static EntitySize getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntitySize(dEntity ent) { + private EntitySize(EntityTag ent) { entity = ent; } - dEntity entity; + EntityTag entity; ///////// // Property Methods @@ -78,9 +78,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) - // @mechanism dEntity.size + // @mechanism EntityTag.size // @group properties // @description // Returns the size of a slime-type entity or a Phantom (1-120). @@ -101,13 +101,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name size // @input Element(Number) // @description // Sets the size of a slime-type entity or a Phantom (1-120). // @tags - // + // // --> if (mechanism.matches("size") && mechanism.requireInteger()) { if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13_R2) && entity.getBukkitEntity() instanceof Phantom) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySkeleton.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySkeleton.java index 3e78e63445..f9bd98d0d7 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySkeleton.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySkeleton.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.entity; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -13,7 +13,7 @@ public class EntitySkeleton implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && ((dEntity) entity).getBukkitEntity() instanceof Skeleton; + return entity instanceof EntityTag && ((EntityTag) entity).getBukkitEntity() instanceof Skeleton; } public static EntitySkeleton getFrom(ObjectTag entity) { @@ -21,7 +21,7 @@ public static EntitySkeleton getFrom(ObjectTag entity) { return null; } else { - return new EntitySkeleton((dEntity) entity); + return new EntitySkeleton((EntityTag) entity); } } @@ -38,11 +38,11 @@ public static EntitySkeleton getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntitySkeleton(dEntity entity) { + private EntitySkeleton(EntityTag entity) { skeleton = entity; } - dEntity skeleton; + EntityTag skeleton; ///////// // Property Methods diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySmall.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySmall.java index 4638b5179b..b1f68f5ca1 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySmall.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySmall.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -12,8 +12,8 @@ public class EntitySmall implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && - ((dEntity) entity).getBukkitEntity() instanceof ArmorStand; + return entity instanceof EntityTag && + ((EntityTag) entity).getBukkitEntity() instanceof ArmorStand; } public static EntitySmall getFrom(ObjectTag entity) { @@ -21,7 +21,7 @@ public static EntitySmall getFrom(ObjectTag entity) { return null; } else { - return new EntitySmall((dEntity) entity); + return new EntitySmall((EntityTag) entity); } } @@ -38,11 +38,11 @@ public static EntitySmall getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntitySmall(dEntity entity) { + private EntitySmall(EntityTag entity) { this.entity = entity; } - dEntity entity; + EntityTag entity; ///////// // Property Methods @@ -74,9 +74,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dEntity.is_small + // @mechanism EntityTag.is_small // @group properties // @description // Returns whether the armor stand is small. @@ -93,13 +93,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name is_small // @input Element(Boolean) // @description // Sets whether the armor stand is small. // @tags - // + // // --> if (mechanism.matches("is_small") && mechanism.requireBoolean()) { ((ArmorStand) entity.getBukkitEntity()).setSmall(mechanism.getValue().asBoolean()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySpeed.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySpeed.java index 8b832c1c10..2bbebd29c2 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySpeed.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySpeed.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.entity; import com.denizenscript.denizen.nms.NMSHandler; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -14,10 +14,10 @@ public class EntitySpeed implements Property { public static boolean describes(ObjectTag entity) { - if (!(entity instanceof dEntity)) { + if (!(entity instanceof EntityTag)) { return false; } - dEntity ent = (dEntity) entity; + EntityTag ent = (EntityTag) entity; if (ent.isLivingEntity()) { return true; } @@ -39,7 +39,7 @@ public static EntitySpeed getFrom(ObjectTag entity) { return null; } else { - return new EntitySpeed((dEntity) entity); + return new EntitySpeed((EntityTag) entity); } } @@ -56,11 +56,11 @@ public static EntitySpeed getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntitySpeed(dEntity ent) { + private EntitySpeed(EntityTag ent) { entity = ent; } - dEntity entity; + EntityTag entity; ///////// // Property Methods @@ -111,9 +111,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Decimal) - // @mechanism dEntity.speed + // @mechanism EntityTag.speed // @group attributes // @description // Returns how fast the entity can move. @@ -130,13 +130,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name speed // @input Element(Decimal) // @description // Sets how fast the entity can move. // @tags - // + // // --> if (mechanism.matches("speed") && mechanism.requireDouble()) { double value = mechanism.getValue().asDouble(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySpell.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySpell.java index 91239932e9..052f87583c 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySpell.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntitySpell.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -11,7 +11,7 @@ public class EntitySpell implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && ((dEntity) entity).getBukkitEntity() instanceof Spellcaster; + return entity instanceof EntityTag && ((EntityTag) entity).getBukkitEntity() instanceof Spellcaster; } public static EntitySpell getFrom(ObjectTag entity) { @@ -19,7 +19,7 @@ public static EntitySpell getFrom(ObjectTag entity) { return null; } else { - return new EntitySpell((dEntity) entity); + return new EntitySpell((EntityTag) entity); } } @@ -36,11 +36,11 @@ public static EntitySpell getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntitySpell(dEntity entity) { + private EntitySpell(EntityTag entity) { dentity = entity; } - dEntity dentity; + EntityTag dentity; ///////// // Property Methods @@ -68,9 +68,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dEntity.spell + // @mechanism EntityTag.spell // @group properties // @description // Returns the spell the entity is currently casting. @@ -88,13 +88,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name spell // @input Element // @description // Sets the spell the entity should cast. Valid spells are: <@link url https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Spellcaster.Spell.html> // @tags - // + // // --> if (mechanism.matches("spell") && mechanism.requireEnum(false, Spellcaster.Spell.values())) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityTame.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityTame.java index 4a7d0e1d66..6afb6b6c04 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityTame.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityTame.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.objects.properties.entity; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; @@ -16,8 +16,8 @@ public class EntityTame implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && - ((dEntity) entity).getBukkitEntity() instanceof Tameable; + return entity instanceof EntityTag && + ((EntityTag) entity).getBukkitEntity() instanceof Tameable; } public static EntityTame getFrom(ObjectTag entity) { @@ -25,7 +25,7 @@ public static EntityTame getFrom(ObjectTag entity) { return null; } else { - return new EntityTame((dEntity) entity); + return new EntityTame((EntityTag) entity); } } @@ -42,11 +42,11 @@ public static EntityTame getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityTame(dEntity tame) { + private EntityTame(EntityTag tame) { entity = tame; } - dEntity entity; + EntityTag entity; ///////// // Property Methods @@ -86,9 +86,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dEntity.tame + // @mechanism EntityTag.tame // @group properties // @description // Returns whether the entity has been tamed. @@ -99,16 +99,16 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @returns dPlayer - // @mechanism dEntity.owner + // @attribute + // @returns PlayerTag + // @mechanism EntityTag.owner // @group properties // @description // Returns the owner of a tamed entity. // --> if (attribute.startsWith("owner") || attribute.startsWith("get_owner")) { if (((Tameable) entity.getBukkitEntity()).isTamed()) { - return new dPlayer((OfflinePlayer) ((Tameable) entity.getBukkitEntity()).getOwner()) + return new PlayerTag((OfflinePlayer) ((Tameable) entity.getBukkitEntity()).getOwner()) .getAttribute(attribute.fulfill(1)); } else { @@ -123,15 +123,15 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name tame // @input Element(Boolean)(|dPlayer) // @description // Sets whether the entity has been tamed. - // Also available: <@link mechanism dEntity.owner> + // Also available: <@link mechanism EntityTag.owner> // @tags - // - // + // + // // --> if (mechanism.matches("tame")) { @@ -146,27 +146,27 @@ public void adjust(Mechanism mechanism) { else { Debug.echoError("Invalid boolean value!"); } - if (list.size() > 1 && new ElementTag(list.get(1)).matchesType(dPlayer.class)) { - ((Tameable) entity.getBukkitEntity()).setOwner(new ElementTag(list.get(1)).asType(dPlayer.class, mechanism.context).getOfflinePlayer()); + if (list.size() > 1 && new ElementTag(list.get(1)).matchesType(PlayerTag.class)) { + ((Tameable) entity.getBukkitEntity()).setOwner(new ElementTag(list.get(1)).asType(PlayerTag.class, mechanism.context).getOfflinePlayer()); } } // <--[mechanism] - // @object dEntity + // @object EntityTag // @name owner - // @input dPlayer + // @input PlayerTag // @description // Sets the entity's owner. Use with no input to make it not have an owner. - // Also available: <@link mechanism dEntity.tame> + // Also available: <@link mechanism EntityTag.tame> // @tags - // - // - // + // + // + // // --> if (mechanism.matches("owner")) { - if (mechanism.hasValue() && mechanism.requireObject(dPlayer.class)) { - ((Tameable) entity.getBukkitEntity()).setOwner(mechanism.valueAsType(dPlayer.class).getOfflinePlayer()); + if (mechanism.hasValue() && mechanism.requireObject(PlayerTag.class)) { + ((Tameable) entity.getBukkitEntity()).setOwner(mechanism.valueAsType(PlayerTag.class).getOfflinePlayer()); } else { ((Tameable) entity.getBukkitEntity()).setOwner(null); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityTrades.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityTrades.java index afbc592b57..65a3f17e43 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityTrades.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityTrades.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.entity; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dTrade; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.TradeTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; import com.denizenscript.denizencore.objects.ObjectTag; @@ -15,15 +15,15 @@ public class EntityTrades implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity - && ((dEntity) entity).getBukkitEntity() instanceof Merchant; + return entity instanceof EntityTag + && ((EntityTag) entity).getBukkitEntity() instanceof Merchant; } public static EntityTrades getFrom(ObjectTag entity) { if (!describes(entity)) { return null; } - return new EntityTrades((dEntity) entity); + return new EntityTrades((EntityTag) entity); } public static final String[] handledTags = new String[] { @@ -36,18 +36,18 @@ public static EntityTrades getFrom(ObjectTag entity) { public ListTag getTradeRecipes() { if (entity.getBukkitEntity() instanceof Merchant) { - ArrayList recipes = new ArrayList<>(); + ArrayList recipes = new ArrayList<>(); for (MerchantRecipe recipe : ((Merchant) entity.getBukkitEntity()).getRecipes()) { - recipes.add(new dTrade(recipe)); + recipes.add(new TradeTag(recipe)); } return new ListTag(recipes); } return null; } - private dEntity entity; + private EntityTag entity; - public EntityTrades(dEntity entity) { + public EntityTrades(EntityTag entity) { this.entity = entity; } @@ -68,9 +68,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @returns ListTag(dTrade) - // @mechanism dEntity.trades + // @attribute + // @returns ListTag(TradeTag) + // @mechanism EntityTag.trades // @description // Returns a list of the Villager's trade recipes. // --> @@ -84,17 +84,17 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name trades - // @input ListTag(dTrade) + // @input ListTag(TradeTag) // @description // Sets the trades that the entity will offer. // @tags - // + // // --> if (mechanism.matches("trades")) { ArrayList recipes = new ArrayList<>(); - for (dTrade recipe : mechanism.valueAsType(ListTag.class).filter(dTrade.class, mechanism.context)) { + for (TradeTag recipe : mechanism.valueAsType(ListTag.class).filter(TradeTag.class, mechanism.context)) { recipes.add(recipe.getRecipe()); } ((Merchant) entity.getBukkitEntity()).setRecipes(recipes); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityVisible.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityVisible.java index cb4a067650..017cc88f6a 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityVisible.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityVisible.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.utilities.depends.Depends; import com.denizenscript.denizen.npc.traits.InvisibleTrait; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -15,8 +15,8 @@ public class EntityVisible implements Property { public static boolean describes(ObjectTag entity) { - return entity instanceof dEntity && - ((dEntity) entity).getBukkitEntityType() == EntityType.ARMOR_STAND; + return entity instanceof EntityTag && + ((EntityTag) entity).getBukkitEntityType() == EntityType.ARMOR_STAND; } public static EntityVisible getFrom(ObjectTag entity) { @@ -24,7 +24,7 @@ public static EntityVisible getFrom(ObjectTag entity) { return null; } else { - return new EntityVisible((dEntity) entity); + return new EntityVisible((EntityTag) entity); } } @@ -41,12 +41,12 @@ public static EntityVisible getFrom(ObjectTag entity) { // Instance Fields and Methods ///////////// - private EntityVisible(dEntity ent) { + private EntityVisible(EntityTag ent) { entity = ent; stand = (ArmorStand) ent.getBukkitEntity(); } - dEntity entity; + EntityTag entity; ArmorStand stand; @@ -80,7 +80,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group attributes // @description @@ -98,13 +98,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dEntity + // @object EntityTag // @name visible // @input Element(Boolean) // @description // Sets whether the armor stand is visible. // @tags - // + // // --> if (mechanism.matches("visible") && mechanism.requireBoolean()) { if (Depends.citizens != null) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventoryContents.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventoryContents.java index e4651bc5cb..39294ef786 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventoryContents.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventoryContents.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.inventory; -import com.denizenscript.denizen.objects.dInventory; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.InventoryTag; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; import com.denizenscript.denizencore.objects.ObjectTag; @@ -15,14 +15,14 @@ public class InventoryContents implements Property { public static boolean describes(ObjectTag inventory) { // All inventories should have contents - return inventory instanceof dInventory; + return inventory instanceof InventoryTag; } public static InventoryContents getFrom(ObjectTag inventory) { if (!describes(inventory)) { return null; } - return new InventoryContents((dInventory) inventory); + return new InventoryContents((InventoryTag) inventory); } public static final String[] handledTags = new String[] { @@ -37,9 +37,9 @@ public static InventoryContents getFrom(ObjectTag inventory) { // Instance Fields and Methods ///////////// - dInventory inventory; + InventoryTag inventory; - public InventoryContents(dInventory inventory) { + public InventoryContents(InventoryTag inventory) { this.inventory = inventory; } @@ -53,13 +53,13 @@ public ListTag getContents(int simpleOrFull) { if (item != null && item.getType() != Material.AIR) { containsNonAir = true; if (simpleOrFull == 1) { - contents.add(new dItem(item).identifySimple()); + contents.add(new ItemTag(item).identifySimple()); } else if (simpleOrFull == 2) { - contents.add(new dItem(item).getFullString()); + contents.add(new ItemTag(item).getFullString()); } else { - contents.add(new dItem(item).identify()); + contents.add(new ItemTag(item).identify()); } } else { @@ -89,10 +89,10 @@ public ListTag getContentsWithLore(String lore, boolean simple) { // the context if (ChatColor.stripColor(line).equalsIgnoreCase(lore)) { if (simple) { - contents.add(new dItem(item).identifySimple()); + contents.add(new ItemTag(item).identifySimple()); } else { - contents.add(new dItem(item).identify()); + contents.add(new ItemTag(item).identify()); } break; } @@ -135,10 +135,10 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @returns ListTag(dItem) + // @attribute + // @returns ListTag(ItemTag) // @group properties - // @mechanism dInventory.contents + // @mechanism InventoryTag.contents // @description // Returns a list of all items in the inventory. // --> @@ -146,10 +146,10 @@ public String getAttribute(Attribute attribute) { attribute.fulfill(1); // <--[tag] - // @attribute - // @returns ListTag(dItem) + // @attribute + // @returns ListTag(ItemTag) // @group properties - // @mechanism dInventory.contents + // @mechanism InventoryTag.contents // @description // Returns a list of all items in the inventory, without item properties. // --> @@ -158,10 +158,10 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @returns ListTag(dItem) + // @attribute + // @returns ListTag(ItemTag) // @group properties - // @mechanism dInventory.contents + // @mechanism InventoryTag.contents // @description // Returns a list of all items in the inventory, with the tag item.full used. // Irrelevant on modern (1.13+) servers. @@ -171,10 +171,10 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ]> - // @returns ListTag(dItem) + // @attribute ]> + // @returns ListTag(ItemTag) // @group properties - // @mechanism dInventory.contents + // @mechanism InventoryTag.contents // @description // Returns a list of all items in the inventory with the specified // lore. Color codes are ignored. @@ -187,10 +187,10 @@ public String getAttribute(Attribute attribute) { String lore = attribute.getContext(1); attribute.fulfill(1); // <--[tag] - // @attribute ].simple> - // @returns ListTag(dItem) + // @attribute ].simple> + // @returns ListTag(ItemTag) // @group properties - // @mechanism dInventory.contents + // @mechanism InventoryTag.contents // @description // Returns a list of all items in the inventory with the specified // lore, without item properties. Color codes are ignored. @@ -215,16 +215,16 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dInventory + // @object InventoryTag // @name contents - // @input ListTag(dItem) + // @input ListTag(ItemTag) // @description // Sets the contents of the inventory. // @tags - // - // - // ]> - // ].simple> + // + // + // ]> + // ].simple> // --> if (mechanism.matches("contents") && inventory.getIdType().equals("generic")) { inventory.setContents(mechanism.valueAsType(ListTag.class), mechanism.context); 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 1d51d57db7..5ed091deeb 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 @@ -22,14 +22,14 @@ public class InventoryHolder implements Property { public static boolean describes(ObjectTag inventory) { // All inventories should have a holder - return inventory instanceof dInventory; + return inventory instanceof InventoryTag; } public static InventoryHolder getFrom(ObjectTag inventory) { if (!describes(inventory)) { return null; } - return new InventoryHolder((dInventory) inventory); + return new InventoryHolder((InventoryTag) inventory); } public static final String[] handledTags = new String[] { @@ -44,10 +44,10 @@ public static InventoryHolder getFrom(ObjectTag inventory) { // Instance Fields and Methods ///////////// - dInventory inventory; + InventoryTag inventory; ObjectTag holder; - public InventoryHolder(dInventory inventory) { + public InventoryHolder(InventoryTag inventory) { this.inventory = inventory; this.holder = getHolder(); } @@ -58,7 +58,7 @@ public ObjectTag getHolder() { } if (inventory.getIdType() != null && (inventory.getIdType().equals("player") || inventory.getIdType().equals("enderchest"))) { - return dPlayer.valueOf(inventory.getIdHolder()); + return PlayerTag.valueOf(inventory.getIdHolder()); } else if (inventory.getIdType() != null && inventory.getIdType().equalsIgnoreCase("script") && ScriptTag.matches(inventory.getIdHolder())) { @@ -67,23 +67,23 @@ else if (inventory.getIdType() != null && inventory.getIdType().equalsIgnoreCase org.bukkit.inventory.InventoryHolder holder = inventory.getInventory().getHolder(); if (holder != null) { - if (holder instanceof dNPC) { - return (dNPC) holder; + if (holder instanceof NPCTag) { + return (NPCTag) holder; } else if (holder instanceof Player) { if (Depends.citizens != null && CitizensAPI.getNPCRegistry().isNPC((Player) holder)) { - return new dNPC(CitizensAPI.getNPCRegistry().getNPC((Player) holder)); + return new NPCTag(CitizensAPI.getNPCRegistry().getNPC((Player) holder)); } - return new dPlayer((Player) holder); + return new PlayerTag((Player) holder); } else if (holder instanceof Entity) { - return new dEntity((Entity) holder); + return new EntityTag((Entity) holder); } else if (holder instanceof DoubleChest) { - return new dLocation(((DoubleChest) holder).getLocation()); + return new LocationTag(((DoubleChest) holder).getLocation()); } else if (holder instanceof BlockState) { - return new dLocation(((BlockState) holder).getLocation()); + return new LocationTag(((BlockState) holder).getLocation()); } } else { @@ -93,7 +93,7 @@ else if (holder instanceof BlockState) { return null; } - public void setHolder(dPlayer player) { + public void setHolder(PlayerTag player) { if (inventory.getIdType().equals("enderchest")) { inventory.setInventory(player.getBukkitEnderChest(), player); } @@ -115,15 +115,15 @@ else if (inventory.getIdType().equals("crafting")) { } } - public void setHolder(dNPC npc) { + public void setHolder(NPCTag npc) { inventory.setInventory(npc.getInventory()); } - public void setHolder(dEntity entity) { + public void setHolder(EntityTag entity) { inventory.setInventory(entity.getBukkitInventory()); } - public void setHolder(dLocation location) { + public void setHolder(LocationTag location) { inventory.setInventory(location.getBukkitInventory()); } @@ -168,10 +168,10 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ObjectTag // @group properties - // @mechanism dInventory.holder + // @mechanism InventoryTag.holder // @description // Returns Denizen's holder ID for this inventory. (p@aufdemrand, l@123,321,123, etc.) // --> @@ -190,30 +190,30 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dInventory + // @object InventoryTag // @name holder // @input ObjectTag // @description - // Changes the holder of the dInventory, therefore completely reconfiguring + // Changes the holder of the InventoryTag, therefore completely reconfiguring // the inventory to that of the holder. // @tags - // + // // --> if (mechanism.matches("holder")) { if (mechanism.getValue().matchesEnum(InventoryType.values())) { setHolder(mechanism.getValue()); } - else if (mechanism.getValue().matchesType(dPlayer.class)) { - setHolder(mechanism.valueAsType(dPlayer.class)); + else if (mechanism.getValue().matchesType(PlayerTag.class)) { + setHolder(mechanism.valueAsType(PlayerTag.class)); } - else if (Depends.citizens != null && mechanism.getValue().matchesType(dNPC.class)) { - setHolder(mechanism.valueAsType(dNPC.class)); + else if (Depends.citizens != null && mechanism.getValue().matchesType(NPCTag.class)) { + setHolder(mechanism.valueAsType(NPCTag.class)); } - else if (mechanism.getValue().matchesType(dEntity.class)) { - setHolder(mechanism.valueAsType(dEntity.class)); + else if (mechanism.getValue().matchesType(EntityTag.class)) { + setHolder(mechanism.valueAsType(EntityTag.class)); } - else if (mechanism.getValue().matchesType(dLocation.class)) { - setHolder(mechanism.valueAsType(dLocation.class)); + else if (mechanism.getValue().matchesType(LocationTag.class)) { + setHolder(mechanism.valueAsType(LocationTag.class)); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventorySize.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventorySize.java index cb36c4d64b..729c3f6ea4 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventorySize.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventorySize.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.inventory; -import com.denizenscript.denizen.objects.dInventory; +import com.denizenscript.denizen.objects.InventoryTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -11,14 +11,14 @@ public class InventorySize implements Property { public static boolean describes(ObjectTag inventory) { // All inventories should have a size - return inventory instanceof dInventory; + return inventory instanceof InventoryTag; } public static InventorySize getFrom(ObjectTag inventory) { if (!describes(inventory)) { return null; } - return new InventorySize((dInventory) inventory); + return new InventorySize((InventoryTag) inventory); } public static final String[] handledTags = new String[] { @@ -33,9 +33,9 @@ public static InventorySize getFrom(ObjectTag inventory) { // Instance Fields and Methods ///////////// - dInventory inventory; + InventoryTag inventory; - public InventorySize(dInventory inventory) { + public InventorySize(InventoryTag inventory) { this.inventory = inventory; } @@ -84,10 +84,10 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @group properties - // @mechanism dInventory.size + // @mechanism InventoryTag.size // @description // Return the number of slots in the inventory. // --> @@ -104,13 +104,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dInventory + // @object InventoryTag // @name size // @input Element(Number) // @description // Sets the size of the inventory. (Only works for "generic" chest inventories.) // @tags - // + // // --> if (mechanism.matches("size") && inventory.getIdType().equals("generic") && mechanism.requireInteger()) { setSize(mechanism.getValue().asInt()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventoryTitle.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventoryTitle.java index 1d7e73e327..25d891bd44 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventoryTitle.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventoryTitle.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.inventory; import com.denizenscript.denizen.nms.NMSHandler; -import com.denizenscript.denizen.objects.dInventory; +import com.denizenscript.denizen.objects.InventoryTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -12,14 +12,14 @@ public class InventoryTitle implements Property { public static boolean describes(ObjectTag inventory) { // All inventories could possibly have a title - return inventory instanceof dInventory; + return inventory instanceof InventoryTag; } public static InventoryTitle getFrom(ObjectTag inventory) { if (!describes(inventory)) { return null; } - return new InventoryTitle((dInventory) inventory); + return new InventoryTitle((InventoryTag) inventory); } public static final String[] handledTags = new String[] { @@ -34,9 +34,9 @@ public static InventoryTitle getFrom(ObjectTag inventory) { // Instance Fields and Methods ///////////// - dInventory inventory; + InventoryTag inventory; - public InventoryTitle(dInventory inventory) { + public InventoryTitle(InventoryTag inventory) { this.inventory = inventory; } @@ -45,7 +45,7 @@ public String getTitle() { String title = NMSHandler.getInstance().getTitle(inventory.getInventory()); if (title != null) { if (inventory.isUnique()) { - return title.substring(0, title.length() - dInventory.inventoryNameNotableRequired); + return title.substring(0, title.length() - InventoryTag.inventoryNameNotableRequired); } else if (!title.startsWith("container.")) { return title; @@ -86,10 +86,10 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @group properties - // @mechanism dInventory.title + // @mechanism InventoryTag.title // @description // Returns the title of the inventory. // --> @@ -104,13 +104,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dInventory + // @object InventoryTag // @name title // @input Element // @description // Sets the title of the inventory. (Only works for "generic" inventories.) // @tags - // + // // --> if (mechanism.matches("title") && inventory.getIdType().equals("generic")) { inventory.setTitle(mechanism.getValue().asString()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemApple.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemApple.java index 2c9052f9ea..436701dbed 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemApple.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemApple.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.NMSVersion; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -13,9 +13,9 @@ public class ItemApple implements Property { public static boolean describes(ObjectTag item) { - return item instanceof dItem - && ((((dItem) item).getItemStack().getType() == Material.GOLDEN_APPLE) - || (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13_R2) && ((dItem) item).getItemStack().getType() == Material.ENCHANTED_GOLDEN_APPLE)); + return item instanceof ItemTag + && ((((ItemTag) item).getItemStack().getType() == Material.GOLDEN_APPLE) + || (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13_R2) && ((ItemTag) item).getItemStack().getType() == Material.ENCHANTED_GOLDEN_APPLE)); } public static ItemApple getFrom(ObjectTag _item) { @@ -23,7 +23,7 @@ public static ItemApple getFrom(ObjectTag _item) { return null; } else { - return new ItemApple((dItem) _item); + return new ItemApple((ItemTag) _item); } } @@ -36,11 +36,11 @@ public static ItemApple getFrom(ObjectTag _item) { }; - private ItemApple(dItem _item) { + private ItemApple(ItemTag _item) { item = _item; } - dItem item; + ItemTag item; @Override public String getAttribute(Attribute attribute) { @@ -50,10 +50,10 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group properties - // @mechanism dItem.apple_enchanted + // @mechanism ItemTag.apple_enchanted // @description // Returns whether a golden apple item is enchanted. // NOTE: In 1.13+, enchanted golden apples are now a separate Material type, making this tag no longer required. @@ -93,14 +93,14 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name apple_enchanted // @input Element(Boolean) // @description // Changes whether a golden apple is enchanted. // NOTE: In 1.13+, enchanted golden apples are now a separate Material type, making this mechanism no longer required. // @tags - // + // // --> if (mechanism.matches("apple_enchanted") && mechanism.requireBoolean()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemAttributeNBT.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemAttributeNBT.java index 9f343853e6..03797846c9 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemAttributeNBT.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemAttributeNBT.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.utilities.nbt.CustomNBT; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; @@ -21,7 +21,7 @@ public class ItemAttributeNBT implements Property { public static boolean describes(ObjectTag item) { - return item instanceof dItem; + return item instanceof ItemTag; } public static ItemAttributeNBT getFrom(ObjectTag item) { @@ -29,7 +29,7 @@ public static ItemAttributeNBT getFrom(ObjectTag item) { return null; } else { - return new ItemAttributeNBT((dItem) item); + return new ItemAttributeNBT((ItemTag) item); } } @@ -41,11 +41,11 @@ public static ItemAttributeNBT getFrom(ObjectTag item) { "nbt_attributes" }; - private ItemAttributeNBT(dItem item) { + private ItemAttributeNBT(ItemTag item) { this.item = item; } - dItem item; + ItemTag item; @Override public String getAttribute(Attribute attribute) { @@ -55,10 +55,10 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ListTag // @group properties - // @mechanism dItem.nbt_attributes + // @mechanism ItemTag.nbt_attributes // @description // Returns the NBT attribute data (as matches the mechanism input), if any. // --> @@ -99,7 +99,7 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name nbt_attributes // @input ListTag // @description @@ -107,7 +107,7 @@ public void adjust(Mechanism mechanism) { // Attribute is text ( http://minecraft.gamepedia.com/Attribute ), slot is the name of the slot, // op is the number code for operation, and amount is a decimal. // @tags - // + // // --> if (mechanism.matches("nbt_attributes")) { if (item.getMaterial().getMaterial() == Material.AIR) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemBaseColor.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemBaseColor.java index 39d97fbee2..a98aeaa2fa 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemBaseColor.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemBaseColor.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.item; import com.denizenscript.denizen.utilities.MaterialCompat; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -18,8 +18,8 @@ public class ItemBaseColor implements Property { public static boolean describes(ObjectTag item) { - if (item instanceof dItem) { - Material material = ((dItem) item).getItemStack().getType(); + if (item instanceof ItemTag) { + Material material = ((ItemTag) item).getItemStack().getType(); return MaterialCompat.isBannerOrShield(material); } return false; @@ -30,7 +30,7 @@ public static ItemBaseColor getFrom(ObjectTag item) { return null; } else { - return new ItemBaseColor((dItem) item); + return new ItemBaseColor((ItemTag) item); } } @@ -43,11 +43,11 @@ public static ItemBaseColor getFrom(ObjectTag item) { }; - private ItemBaseColor(dItem item) { + private ItemBaseColor(ItemTag item) { this.item = item; } - dItem item; + ItemTag item; private DyeColor getBaseColor() { ItemMeta itemMeta = item.getItemStack().getItemMeta(); @@ -82,10 +82,10 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @group properties - // @mechanism dItem.base_color + // @mechanism ItemTag.base_color // @description // Gets the base color of a banner. // For the list of possible colors, see <@link url http://bit.ly/1dydq12>. @@ -120,14 +120,14 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name base_color // @input Element // @description // Changes the base color of a banner. // For the list of possible colors, see <@link url http://bit.ly/1dydq12>. // @tags - // + // // --> if (mechanism.matches("base_color")) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemBook.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemBook.java index a3c02eeea2..515e1837c3 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemBook.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemBook.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.utilities.MaterialCompat; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ArgumentHelper; @@ -21,7 +21,7 @@ public class ItemBook implements Property { public static boolean describes(ObjectTag item) { - Material material = ((dItem) item).getItemStack().getType(); + Material material = ((ItemTag) item).getItemStack().getType(); return (material == Material.WRITTEN_BOOK || material == MaterialCompat.WRITABLE_BOOK); } @@ -30,7 +30,7 @@ public static ItemBook getFrom(ObjectTag _item) { return null; } else { - return new ItemBook((dItem) _item); + return new ItemBook((ItemTag) _item); } } @@ -43,11 +43,11 @@ public static ItemBook getFrom(ObjectTag _item) { }; - private ItemBook(dItem _item) { + private ItemBook(ItemTag _item) { item = _item; } - dItem item; + ItemTag item; @Override public String getAttribute(Attribute attribute) { @@ -63,9 +63,9 @@ public String getAttribute(Attribute attribute) { if (item.getItemStack().getType() == Material.WRITTEN_BOOK) { // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dItem.book + // @mechanism ItemTag.book // @group properties // @description // Returns the author of the book. @@ -76,9 +76,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dItem.book + // @mechanism ItemTag.book // @group properties // @description // Returns the title of the book. @@ -90,9 +90,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) - // @mechanism dItem.book + // @mechanism ItemTag.book // @group properties // @description // Returns the number of pages in the book. @@ -103,9 +103,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag - // @mechanism dItem.book + // @mechanism ItemTag.book // @group properties // @description // Returns the page specified from the book as an element. @@ -116,9 +116,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag - // @mechanism dItem.book + // @mechanism ItemTag.book // @group properties // @description // Returns the page specified from the book as an element containing raw JSON. @@ -140,9 +140,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ListTag - // @mechanism dItem.book + // @mechanism ItemTag.book // @group properties // @description // Returns the plain-text pages of the book as a ListTag. @@ -153,9 +153,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ListTag - // @mechanism dItem.book + // @mechanism ItemTag.book // @group properties // @description // Returns the pages of the book as a ListTag of raw JSON. @@ -169,9 +169,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dItem.book + // @mechanism ItemTag.book // @group properties // @description // Returns full information on the book item, in the format @@ -226,16 +226,16 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name book_raw_pages // @input ListTag // @description // Changes the raw JSON pages of a book item. // See <@link language Property Escaping> // @tags - // - // ]> - // + // + // ]> + // // --> if (mechanism.matches("book_raw_pages")) { @@ -250,16 +250,16 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dItem + // @object ItemTag // @name book_pages // @input ListTag // @description // Changes the plain-text pages of a book item. // See <@link language Property Escaping> // @tags - // - // ]> - // + // + // ]> + // // --> if (mechanism.matches("book_pages")) { @@ -274,13 +274,13 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dItem + // @object ItemTag // @name book_author // @input Element // @description // Changes the author of a book item. // @tags - // + // // --> if (mechanism.matches("book_author")) { @@ -295,13 +295,13 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dItem + // @object ItemTag // @name book_title // @input Element // @description // Changes the title of a book item. // @tags - // + // // --> if (mechanism.matches("book_title")) { @@ -316,22 +316,22 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dItem + // @object ItemTag // @name book // @input Element // @description // Changes the information on a book item. // See <@link language Property Escaping> // @tags - // - // - // - // - // ]> - // - // ]> - // - // + // + // + // + // + // ]> + // + // ]> + // + // // --> if (mechanism.matches("book")) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemCanDestroy.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemCanDestroy.java index 14d203c7a5..4f7eb8eaf1 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemCanDestroy.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemCanDestroy.java @@ -2,8 +2,8 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.utilities.nbt.CustomNBT; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; import com.denizenscript.denizencore.objects.ObjectTag; @@ -18,7 +18,7 @@ public class ItemCanDestroy implements Property { public static boolean describes(ObjectTag item) { - return item instanceof dItem; + return item instanceof ItemTag; } public static ItemCanDestroy getFrom(ObjectTag item) { @@ -26,7 +26,7 @@ public static ItemCanDestroy getFrom(ObjectTag item) { return null; } else { - return new ItemCanDestroy((dItem) item); + return new ItemCanDestroy((ItemTag) item); } } @@ -39,11 +39,11 @@ public static ItemCanDestroy getFrom(ObjectTag item) { }; - private ItemCanDestroy(dItem item) { + private ItemCanDestroy(ItemTag item) { this.item = item; } - dItem item; + ItemTag item; private ListTag getMaterials() { ItemStack itemStack = item.getItemStack(); @@ -51,7 +51,7 @@ private ListTag getMaterials() { if (materials != null && !materials.isEmpty()) { ListTag list = new ListTag(); for (Material material : materials) { - list.addObject(new dMaterial(material)); + list.addObject(new MaterialTag(material)); } return list; } @@ -66,10 +66,10 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @returns ListTag(dMaterial) + // @attribute + // @returns ListTag(MaterialTag) // @group properties - // @mechanism dItem.can_destroy + // @mechanism ItemTag.can_destroy // @description // Returns a list of materials this item can destroy while in adventure mode, if any. // --> @@ -98,14 +98,14 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name can_destroy - // @input ListTag(dMaterial) + // @input ListTag(MaterialTag) // @description // Sets the materials this item can destroy while in adventure mode. // Leave empty to remove this property. // @tags - // + // // --> if (mechanism.matches("can_destroy")) { if (item.getMaterial().getMaterial() == Material.AIR) { @@ -116,8 +116,8 @@ public void adjust(Mechanism mechanism) { ItemStack itemStack = item.getItemStack(); if (mechanism.hasValue()) { - List materials = mechanism.valueAsType(ListTag.class).filter(dMaterial.class, mechanism.context) - .stream().map(dMaterial::getMaterial).collect(Collectors.toList()); + List materials = mechanism.valueAsType(ListTag.class).filter(MaterialTag.class, mechanism.context) + .stream().map(MaterialTag::getMaterial).collect(Collectors.toList()); itemStack = CustomNBT.setNBTMaterials(itemStack, CustomNBT.KEY_CAN_DESTROY, materials); } else { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemCanPlaceOn.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemCanPlaceOn.java index fb3bafdd9a..34fdfda098 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemCanPlaceOn.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemCanPlaceOn.java @@ -2,8 +2,8 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.utilities.nbt.CustomNBT; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; import com.denizenscript.denizencore.objects.ObjectTag; @@ -18,7 +18,7 @@ public class ItemCanPlaceOn implements Property { public static boolean describes(ObjectTag item) { - return item instanceof dItem; + return item instanceof ItemTag; } public static ItemCanPlaceOn getFrom(ObjectTag item) { @@ -26,7 +26,7 @@ public static ItemCanPlaceOn getFrom(ObjectTag item) { return null; } else { - return new ItemCanPlaceOn((dItem) item); + return new ItemCanPlaceOn((ItemTag) item); } } @@ -39,11 +39,11 @@ public static ItemCanPlaceOn getFrom(ObjectTag item) { }; - private ItemCanPlaceOn(dItem item) { + private ItemCanPlaceOn(ItemTag item) { this.item = item; } - dItem item; + ItemTag item; private ListTag getMaterials() { ItemStack itemStack = item.getItemStack(); @@ -51,7 +51,7 @@ private ListTag getMaterials() { if (materials != null && !materials.isEmpty()) { ListTag list = new ListTag(); for (Material material : materials) { - list.addObject(new dMaterial(material)); + list.addObject(new MaterialTag(material)); } return list; } @@ -66,10 +66,10 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @returns ListTag(dMaterial) + // @attribute + // @returns ListTag(MaterialTag) // @group properties - // @mechanism dItem.can_place_on + // @mechanism ItemTag.can_place_on // @description // Returns a list of materials this item can be placed on while in adventure mode, if any. // --> @@ -98,14 +98,14 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name can_place_on - // @input ListTag(dMaterial) + // @input ListTag(MaterialTag) // @description // Sets the materials this item can be placed on while in adventure mode. // Leave empty to remove this property. // @tags - // + // // --> if (mechanism.matches("can_place_on")) { if (item.getMaterial().getMaterial() == Material.AIR) { @@ -116,8 +116,8 @@ public void adjust(Mechanism mechanism) { ItemStack itemStack = item.getItemStack(); if (mechanism.hasValue()) { - List materials = mechanism.valueAsType(ListTag.class).filter(dMaterial.class, mechanism.context) - .stream().map(dMaterial::getMaterial).collect(Collectors.toList()); + List materials = mechanism.valueAsType(ListTag.class).filter(MaterialTag.class, mechanism.context) + .stream().map(MaterialTag::getMaterial).collect(Collectors.toList()); itemStack = CustomNBT.setNBTMaterials(itemStack, CustomNBT.KEY_CAN_PLACE_ON, materials); } else { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemChargedProjectile.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemChargedProjectile.java index 14b2a12e00..f19708ec06 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemChargedProjectile.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemChargedProjectile.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.item; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; @@ -15,8 +15,8 @@ public class ItemChargedProjectile implements Property { public static boolean describes(ObjectTag item) { - return item instanceof dItem - && ((dItem) item).getItemStack().getType() == Material.CROSSBOW; + return item instanceof ItemTag + && ((ItemTag) item).getItemStack().getType() == Material.CROSSBOW; } public static ItemChargedProjectile getFrom(ObjectTag item) { @@ -24,7 +24,7 @@ public static ItemChargedProjectile getFrom(ObjectTag item) { return null; } else { - return new ItemChargedProjectile((dItem) item); + return new ItemChargedProjectile((ItemTag) item); } } @@ -36,11 +36,11 @@ public static ItemChargedProjectile getFrom(ObjectTag item) { "charged_projectiles", "add_charged_projectile", "remove_charged_projectiles" }; - private ItemChargedProjectile(dItem _item) { + private ItemChargedProjectile(ItemTag _item) { item = _item; } - dItem item; + ItemTag item; @Override public String getAttribute(Attribute attribute) { @@ -49,9 +49,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @returns ListTag(dItem) - // @mechanism dItem.charged_projectiles + // @attribute + // @returns ListTag(ItemTag) + // @mechanism ItemTag.charged_projectiles // @group properties // @description // Returns a list of charged projectile items on this crossbow. @@ -62,9 +62,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dItem.charged_projectiles + // @mechanism ItemTag.charged_projectiles // @group properties // @description // Returns whether this crossbow is charged. @@ -85,7 +85,7 @@ public ListTag getChargedProjectiles() { } for (ItemStack projectile : meta.getChargedProjectiles()) { - list.addObject(new dItem(projectile)); + list.addObject(new ItemTag(projectile)); } return list; } @@ -105,19 +105,19 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name charged_projectiles - // @input ListTag(dItem) + // @input ListTag(ItemTag) // @description // Sets the charged projectile items on this crossbow. Charged projectiles may only be arrows and fireworks. // @tags - // - // + // + // // --> if (mechanism.matches("charged_projectiles")) { CrossbowMeta meta = (CrossbowMeta) item.getItemStack().getItemMeta(); meta.setChargedProjectiles(null); - for (dItem projectile : mechanism.valueAsType(ListTag.class).filter(dItem.class, mechanism.context)) { + for (ItemTag projectile : mechanism.valueAsType(ListTag.class).filter(ItemTag.class, mechanism.context)) { try { meta.addChargedProjectile(projectile.getItemStack()); } @@ -129,19 +129,19 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dItem + // @object ItemTag // @name add_charged_projectile - // @input dItem + // @input ItemTag // @description // Adds a new charged projectile item on this crossbow. Charged projectiles may only be arrows and fireworks. // @tags - // - // + // + // // --> - if (mechanism.matches("add_charged_projectile") && mechanism.requireObject(dItem.class)) { + if (mechanism.matches("add_charged_projectile") && mechanism.requireObject(ItemTag.class)) { CrossbowMeta meta = (CrossbowMeta) item.getItemStack().getItemMeta(); try { - meta.addChargedProjectile(mechanism.valueAsType(dItem.class).getItemStack()); + meta.addChargedProjectile(mechanism.valueAsType(ItemTag.class).getItemStack()); } catch (IllegalArgumentException e) { Debug.echoError("Charged crossbow projectiles may only be arrows or fireworks!"); @@ -150,14 +150,14 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dItem + // @object ItemTag // @name remove_charged_projectiles // @input None // @description // Removes all charged projectiles from this crossbow. // @tags - // - // + // + // // --> if (mechanism.matches("remove_charged_projectiles")) { CrossbowMeta meta = (CrossbowMeta) item.getItemStack().getItemMeta(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemColor.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemColor.java index 4c0177f075..969056c530 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemColor.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemColor.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.item; -import com.denizenscript.denizen.objects.dColor; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ColorTag; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.objects.properties.Property; @@ -15,14 +15,14 @@ public class ItemColor implements Property { public static boolean describes(ObjectTag item) { // Leather armor and potions - return item instanceof dItem - && (((dItem) item).getItemStack().getType() == Material.LEATHER_BOOTS - || ((dItem) item).getItemStack().getType() == Material.LEATHER_CHESTPLATE - || ((dItem) item).getItemStack().getType() == Material.LEATHER_HELMET - || ((dItem) item).getItemStack().getType() == Material.LEATHER_LEGGINGS - || ((dItem) item).getItemStack().getType() == Material.POTION - || ((dItem) item).getItemStack().getType() == Material.SPLASH_POTION - || ((dItem) item).getItemStack().getType() == Material.LINGERING_POTION); + return item instanceof ItemTag + && (((ItemTag) item).getItemStack().getType() == Material.LEATHER_BOOTS + || ((ItemTag) item).getItemStack().getType() == Material.LEATHER_CHESTPLATE + || ((ItemTag) item).getItemStack().getType() == Material.LEATHER_HELMET + || ((ItemTag) item).getItemStack().getType() == Material.LEATHER_LEGGINGS + || ((ItemTag) item).getItemStack().getType() == Material.POTION + || ((ItemTag) item).getItemStack().getType() == Material.SPLASH_POTION + || ((ItemTag) item).getItemStack().getType() == Material.LINGERING_POTION); } public static ItemColor getFrom(ObjectTag _item) { @@ -30,7 +30,7 @@ public static ItemColor getFrom(ObjectTag _item) { return null; } else { - return new ItemColor((dItem) _item); + return new ItemColor((ItemTag) _item); } } @@ -43,11 +43,11 @@ public static ItemColor getFrom(ObjectTag _item) { }; - private ItemColor(dItem _item) { + private ItemColor(ItemTag _item) { item = _item; } - dItem item; + ItemTag item; @Override public String getAttribute(Attribute attribute) { @@ -57,9 +57,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @returns dColor - // @mechanism dItem.color + // @attribute + // @returns ColorTag + // @mechanism ItemTag.color // @group properties // @description // Returns the color of the leather armor item or potion item. @@ -71,11 +71,11 @@ public String getAttribute(Attribute attribute) { || mat == Material.SPLASH_POTION) { PotionMeta pm = (PotionMeta) item.getItemStack().getItemMeta(); if (!pm.hasColor()) { - return new dColor(Color.WHITE).getAttribute(attribute.fulfill((1))); + return new ColorTag(Color.WHITE).getAttribute(attribute.fulfill((1))); } - return new dColor(pm.getColor()).getAttribute(attribute.fulfill((1))); + return new ColorTag(pm.getColor()).getAttribute(attribute.fulfill((1))); } - return new dColor(((LeatherArmorMeta) item.getItemStack().getItemMeta()).getColor()).getAttribute(attribute.fulfill(1)); + return new ColorTag(((LeatherArmorMeta) item.getItemStack().getItemMeta()).getColor()).getAttribute(attribute.fulfill(1)); } return null; @@ -92,9 +92,9 @@ public String getPropertyString() { if (!pm.hasColor()) { return null; } - return new dColor(pm.getColor()).identify(); + return new ColorTag(pm.getColor()).identify(); } - return new dColor(((LeatherArmorMeta) item.getItemStack().getItemMeta()).getColor()).identify(); + return new ColorTag(((LeatherArmorMeta) item.getItemStack().getItemMeta()).getColor()).identify(); } @Override @@ -106,18 +106,18 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name color - // @input dColor + // @input ColorTag // @description // Sets the leather armor item's dye color or the potion item's color in the format RED,GREEN,BLUE. // @tags - // - // + // + // // --> if ((mechanism.matches("dye") || mechanism.matches("dye_color") - || mechanism.matches("color")) && (mechanism.requireObject(dColor.class))) { - dColor color = mechanism.valueAsType(dColor.class); + || mechanism.matches("color")) && (mechanism.requireObject(ColorTag.class))) { + ColorTag color = mechanism.valueAsType(ColorTag.class); Material mat = item.getItemStack().getType(); if (mat == Material.POTION || mat == Material.LINGERING_POTION diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemCustomModel.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemCustomModel.java index 480fb4f711..8b617ad4d7 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemCustomModel.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemCustomModel.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.item; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -11,7 +11,7 @@ public class ItemCustomModel implements Property { public static boolean describes(ObjectTag item) { - return item instanceof dItem; + return item instanceof ItemTag; } public static ItemCustomModel getFrom(ObjectTag _item) { @@ -19,7 +19,7 @@ public static ItemCustomModel getFrom(ObjectTag _item) { return null; } else { - return new ItemCustomModel((dItem) _item); + return new ItemCustomModel((ItemTag) _item); } } @@ -32,11 +32,11 @@ public static ItemCustomModel getFrom(ObjectTag _item) { }; - private ItemCustomModel(dItem _item) { + private ItemCustomModel(ItemTag _item) { item = _item; } - dItem item; + ItemTag item; @Override public String getAttribute(Attribute attribute) { @@ -46,13 +46,13 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dItem.custom_model_data + // @mechanism ItemTag.custom_model_data // @group properties // @description // Returns whether the item has a custom model data ID number set on it. - // Also see <@link tag i@item.custom_model_data>. + // Also see <@link tag ItemTag.custom_model_data>. // --> if (attribute.startsWith("has_custom_model_data")) { return new ElementTag(item.getItemStack().getItemMeta().hasCustomModelData()) @@ -60,14 +60,14 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) - // @mechanism dItem.custom_model_data + // @mechanism ItemTag.custom_model_data // @group properties // @description // Returns the custom model data ID number of the item. // This tag is invalid for items that do not have a custom model data ID. - // Also see <@link tag i@item.has_custom_model_data>. + // Also see <@link tag ItemTag.has_custom_model_data>. // --> if (attribute.startsWith("custom_model_data")) { if (item.getItemStack().getItemMeta().hasCustomModelData()) { @@ -99,15 +99,15 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name custom_model_data // @input Element(Number) // @description // Changes the custom model data ID number of the item. // Use with no input to remove the custom model data. // @tags - // - // + // + // // --> if (mechanism.matches("custom_model_data")) { ItemMeta meta = (item.getItemStack().getItemMeta()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemDisplayname.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemDisplayname.java index 65685baf7a..69cc71b19d 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemDisplayname.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemDisplayname.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.item; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -13,7 +13,7 @@ public class ItemDisplayname implements Property { public static boolean describes(ObjectTag item) { // Technically, all items can have a display name - return item instanceof dItem; + return item instanceof ItemTag; } public static ItemDisplayname getFrom(ObjectTag _item) { @@ -21,7 +21,7 @@ public static ItemDisplayname getFrom(ObjectTag _item) { return null; } else { - return new ItemDisplayname((dItem) _item); + return new ItemDisplayname((ItemTag) _item); } } @@ -34,11 +34,11 @@ public static ItemDisplayname getFrom(ObjectTag _item) { }; - private ItemDisplayname(dItem _item) { + private ItemDisplayname(ItemTag _item) { item = _item; } - dItem item; + ItemTag item; public boolean hasDisplayName() { return item.getItemStack().hasItemMeta() @@ -53,9 +53,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dItem.display_name + // @mechanism ItemTag.display_name // @group properties // @description // Returns the display name of the item, as set by plugin or an anvil. @@ -68,9 +68,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dItem.display_name + // @mechanism ItemTag.display_name // @group properties // @description // Returns whether the item has a custom set display name. @@ -103,14 +103,14 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name display_name // @input Element // @description // Changes the items display name. // See <@link language Property Escaping> // @tags - // + // // --> if (mechanism.matches("display_name")) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemDurability.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemDurability.java index 865c5c4af6..ee905ae392 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemDurability.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemDurability.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.item; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -10,8 +10,8 @@ public class ItemDurability implements Property { public static boolean describes(ObjectTag item) { - return item instanceof dItem - && ((dItem) item).isRepairable(); + return item instanceof ItemTag + && ((ItemTag) item).isRepairable(); } public static ItemDurability getFrom(ObjectTag _item) { @@ -19,7 +19,7 @@ public static ItemDurability getFrom(ObjectTag _item) { return null; } else { - return new ItemDurability((dItem) _item); + return new ItemDurability((ItemTag) _item); } } @@ -32,11 +32,11 @@ public static ItemDurability getFrom(ObjectTag _item) { }; - private ItemDurability(dItem _item) { + private ItemDurability(ItemTag _item) { item = _item; } - dItem item; + ItemTag item; @Override public String getAttribute(Attribute attribute) { @@ -46,9 +46,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) - // @mechanism dItem.durability + // @mechanism ItemTag.durability // @group properties // @description // Returns the current durability (number of uses) on the item. @@ -59,12 +59,12 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @group properties // @description // Returns the maximum durability (number of uses) of this item. - // For use with <@link tag i@item.durability> and <@link mechanism dItem.durability>. + // For use with <@link tag ItemTag.durability> and <@link mechanism ItemTag.durability>. // --> if (attribute.startsWith("max_durability")) { return new ElementTag(item.getMaterial().getMaterial().getMaxDurability()) @@ -94,15 +94,15 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name durability // @input Element(Number) // @description // Changes the durability of damageable items. // @tags - // - // - // + // + // + // // --> if (mechanism.matches("durability") && mechanism.requireInteger()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemEnchantments.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemEnchantments.java index 858afe7ed6..c29740a91a 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemEnchantments.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemEnchantments.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.item; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; @@ -19,7 +19,7 @@ public class ItemEnchantments implements Property { public static boolean describes(ObjectTag item) { // Technically, all items can hold enchants. - return item instanceof dItem; + return item instanceof ItemTag; } public static ItemEnchantments getFrom(ObjectTag _item) { @@ -27,7 +27,7 @@ public static ItemEnchantments getFrom(ObjectTag _item) { return null; } else { - return new ItemEnchantments((dItem) _item); + return new ItemEnchantments((ItemTag) _item); } } @@ -40,11 +40,11 @@ public static ItemEnchantments getFrom(ObjectTag _item) { }; - private ItemEnchantments(dItem _item) { + private ItemEnchantments(ItemTag _item) { item = _item; } - dItem item; + ItemTag item; @Override public String getAttribute(Attribute attribute) { @@ -54,9 +54,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dItem.enchantments + // @mechanism ItemTag.enchantments // @group properties // @description // Returns whether the item has any enchantments. @@ -67,9 +67,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ListTag - // @mechanism dItem.enchantments + // @mechanism ItemTag.enchantments // @group properties // @description // Returns a list of enchantments on the item, with their levels listed too. @@ -88,9 +88,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ListTag - // @mechanism dItem.enchantments + // @mechanism ItemTag.enchantments // @group properties // @description // Returns a list of enchantments on the item, showing only the level. @@ -108,9 +108,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Number) - // @mechanism dItem.enchantments + // @mechanism ItemTag.enchantments // @group properties // @description // Returns the level of a specified enchantment. @@ -131,9 +131,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ListTag - // @mechanism dItem.enchantments + // @mechanism ItemTag.enchantments // @group properties // @description // Returns a list of enchantments on the item. @@ -188,16 +188,16 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name remove_enchantments // @input None // @description // Removes the specified enchantments from the item (as a list of enchantment names). // Give no value input to remove all enchantments. // @tags - // - // - // + // + // + // // --> if (mechanism.matches("remove_enchantments")) { HashSet names = null; @@ -226,16 +226,16 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dItem + // @object ItemTag // @name enchantments // @input ListTag // @description // Sets the item's enchantments. // For a list of valid enchantment names, refer to <@link url https://hub.spigotmc.org/javadocs/spigot/org/bukkit/enchantments/Enchantment.html> // @tags - // - // - // + // + // + // // --> if (mechanism.matches("enchantments")) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemFirework.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemFirework.java index 5c4f8ee280..1aa29ad116 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemFirework.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemFirework.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.item; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; @@ -20,9 +20,9 @@ public class ItemFirework implements Property { public static boolean describes(ObjectTag item) { - return item instanceof dItem - && ((((dItem) item).getItemStack().getItemMeta() instanceof FireworkMeta) - || (((dItem) item).getItemStack().getItemMeta() instanceof FireworkEffectMeta)); + return item instanceof ItemTag + && ((((ItemTag) item).getItemStack().getItemMeta() instanceof FireworkMeta) + || (((ItemTag) item).getItemStack().getItemMeta() instanceof FireworkEffectMeta)); } public static ItemFirework getFrom(ObjectTag _item) { @@ -30,7 +30,7 @@ public static ItemFirework getFrom(ObjectTag _item) { return null; } else { - return new ItemFirework((dItem) _item); + return new ItemFirework((ItemTag) _item); } } @@ -43,11 +43,11 @@ public static ItemFirework getFrom(ObjectTag _item) { }; - private ItemFirework(dItem _item) { + private ItemFirework(ItemTag _item) { item = _item; } - dItem item; + ItemTag item; public ListTag getFireworkData() { List effects; @@ -85,10 +85,10 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ListTag // @group properties - // @mechanism dItem.firework + // @mechanism ItemTag.firework // @description // Returns the firework's property value as a list, matching the format of the mechanism. // --> @@ -116,7 +116,7 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name firework // @input ListTag // @description @@ -125,7 +125,7 @@ public void adjust(Mechanism mechanism) { // For example: true,false,BALL,255,0,0,0,255,0 would create a trailing ball firework that fades from red to green. // Optionally add a list entry that's just a single number to set the power. // @tags - // + // // --> if (mechanism.matches("firework")) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemFlags.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemFlags.java index 0f4d0c367b..efb3566e44 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemFlags.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemFlags.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.item; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; import com.denizenscript.denizencore.objects.ObjectTag; @@ -15,7 +15,7 @@ public class ItemFlags implements Property { public static boolean describes(ObjectTag item) { // All items can have flags - return item instanceof dItem && ((dItem) item).getItemStack().getType() != Material.AIR; + return item instanceof ItemTag && ((ItemTag) item).getItemStack().getType() != Material.AIR; } public static ItemFlags getFrom(ObjectTag _item) { @@ -23,7 +23,7 @@ public static ItemFlags getFrom(ObjectTag _item) { return null; } else { - return new ItemFlags((dItem) _item); + return new ItemFlags((ItemTag) _item); } } @@ -36,7 +36,7 @@ public static ItemFlags getFrom(ObjectTag _item) { }; - private ItemFlags(dItem _item) { + private ItemFlags(ItemTag _item) { item = _item; } @@ -51,7 +51,7 @@ public ListTag flags() { return output; } - dItem item; + ItemTag item; @Override public String getAttribute(Attribute attribute) { @@ -61,9 +61,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ListTag - // @mechanism dItem.flags + // @mechanism ItemTag.flags // @group properties // @description // Returns a list of flags set on this item. @@ -99,13 +99,13 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name flags // @input ListTag // @description // Sets the item's meta flag set. // @tags - // + // // --> if (mechanism.matches("flags")) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemInventory.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemInventory.java index 19e5264cb3..98c9cdd59b 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemInventory.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemInventory.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.objects.properties.item; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dInventory; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.InventoryTag; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.objects.properties.Property; @@ -15,9 +15,9 @@ public class ItemInventory implements Property { public static boolean describes(ObjectTag item) { - return item instanceof dItem - && ((dItem) item).getItemStack().getItemMeta() instanceof BlockStateMeta - && ((BlockStateMeta) ((dItem) item).getItemStack().getItemMeta()).getBlockState() instanceof InventoryHolder; + return item instanceof ItemTag + && ((ItemTag) item).getItemStack().getItemMeta() instanceof BlockStateMeta + && ((BlockStateMeta) ((ItemTag) item).getItemStack().getItemMeta()).getBlockState() instanceof InventoryHolder; } public static ItemInventory getFrom(ObjectTag _item) { @@ -25,7 +25,7 @@ public static ItemInventory getFrom(ObjectTag _item) { return null; } else { - return new ItemInventory((dItem) _item); + return new ItemInventory((ItemTag) _item); } } @@ -38,15 +38,15 @@ public static ItemInventory getFrom(ObjectTag _item) { }; - private dInventory getItemInventory() { - return dInventory.mirrorBukkitInventory(((InventoryHolder) ((BlockStateMeta) item.getItemStack().getItemMeta()).getBlockState()).getInventory()); + private InventoryTag getItemInventory() { + return InventoryTag.mirrorBukkitInventory(((InventoryHolder) ((BlockStateMeta) item.getItemStack().getItemMeta()).getBlockState()).getInventory()); } - private ItemInventory(dItem _item) { + private ItemInventory(ItemTag _item) { item = _item; } - dItem item; + ItemTag item; @Override public String getAttribute(Attribute attribute) { @@ -56,12 +56,12 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @returns dInventory - // @mechanism dItem.inventory + // @attribute + // @returns InventoryTag + // @mechanism ItemTag.inventory // @group properties // @description - // Returns a dInventory of a container item. + // Returns a InventoryTag of a container item. // --> if (attribute.startsWith("inventory")) { return getItemInventory().getAttribute(attribute.fulfill(1)); @@ -73,7 +73,7 @@ public String getAttribute(Attribute attribute) { @Override public String getPropertyString() { - dInventory inv = getItemInventory(); + InventoryTag inv = getItemInventory(); return inv != null ? inv.identify() : null; } @@ -86,16 +86,16 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name inventory - // @input dInventory + // @input InventoryTag // @description // Sets the item's inventory contents. // @tags - // + // // --> - if (mechanism.matches("inventory") && mechanism.requireObject(dInventory.class)) { - dInventory inventory = mechanism.valueAsType(dInventory.class); + if (mechanism.matches("inventory") && mechanism.requireObject(InventoryTag.class)) { + InventoryTag inventory = mechanism.valueAsType(InventoryTag.class); if (inventory == null || inventory.getInventory() == null) { return; } @@ -105,7 +105,7 @@ public void adjust(Mechanism mechanism) { InventoryHolder invHolder = (InventoryHolder) bsm.getBlockState(); if (inventory.getSize() > invHolder.getInventory().getSize()) { - Debug.echoError("Invalid dInventory size; expected " + invHolder.getInventory().getSize() + " or less."); + Debug.echoError("Invalid InventoryTag size; expected " + invHolder.getInventory().getSize() + " or less."); return; } diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemLock.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemLock.java index 702568a3ef..2b816076e9 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemLock.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemLock.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.item; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -14,9 +14,9 @@ public class ItemLock implements Property { public static boolean describes(ObjectTag item) { - return item instanceof dItem - && ((dItem) item).getItemStack().getItemMeta() instanceof BlockStateMeta - && ((BlockStateMeta) ((dItem) item).getItemStack().getItemMeta()).getBlockState() instanceof Lockable; + return item instanceof ItemTag + && ((ItemTag) item).getItemStack().getItemMeta() instanceof BlockStateMeta + && ((BlockStateMeta) ((ItemTag) item).getItemStack().getItemMeta()).getBlockState() instanceof Lockable; } public static ItemLock getFrom(ObjectTag _item) { @@ -24,7 +24,7 @@ public static ItemLock getFrom(ObjectTag _item) { return null; } else { - return new ItemLock((dItem) _item); + return new ItemLock((ItemTag) _item); } } @@ -45,11 +45,11 @@ private boolean isLocked() { return ((Lockable) ((BlockStateMeta) item.getItemStack().getItemMeta()).getBlockState()).isLocked(); } - private ItemLock(dItem _item) { + private ItemLock(ItemTag _item) { item = _item; } - dItem item; + ItemTag item; @Override public String getAttribute(Attribute attribute) { @@ -59,9 +59,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dItem.lock + // @mechanism ItemTag.lock // @group properties // @description // Returns the lock password of this item. @@ -71,9 +71,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dItem.lock + // @mechanism ItemTag.lock // @group properties // @description // Returns whether this item has a lock password. @@ -100,16 +100,16 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name lock // @input Element // @description // Sets the item's lock password. // Locked blocks can only be opened while holding an item with the name of the lock. // @tags - // - // - // + // + // + // // --> if (mechanism.matches("lock")) { ItemStack itemStack = item.getItemStack(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemLore.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemLore.java index d9138afcda..42d0f5bbfa 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemLore.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemLore.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.scripts.containers.core.ItemScriptHelper; import com.denizenscript.denizen.Settings; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; @@ -19,7 +19,7 @@ public class ItemLore implements Property { public static boolean describes(ObjectTag item) { // Technically, all items can hold lore - return item instanceof dItem; + return item instanceof ItemTag; } public static ItemLore getFrom(ObjectTag _item) { @@ -27,7 +27,7 @@ public static ItemLore getFrom(ObjectTag _item) { return null; } else { - return new ItemLore((dItem) _item); + return new ItemLore((ItemTag) _item); } } @@ -46,11 +46,11 @@ public boolean hasLore() { } - private ItemLore(dItem _item) { + private ItemLore(ItemTag _item) { item = _item; } - dItem item; + ItemTag item; @Override public String getAttribute(Attribute attribute) { @@ -67,19 +67,19 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ListTag - // @mechanism dItem.lore + // @mechanism ItemTag.lore // @group properties // @description // Returns lore as a ListTag. Excludes the custom-script-id lore. - // To get that information, use . + // To get that information, use . // --> if (attribute.startsWith("lore")) { if (hasLore()) { List loreList = new ArrayList<>(); for (String itemLore : item.getItemStack().getItemMeta().getLore()) { - if (!itemLore.startsWith(dItem.itemscriptIdentifier) + if (!itemLore.startsWith(ItemTag.itemscriptIdentifier) && !itemLore.startsWith(ItemScriptHelper.ItemScriptHashID)) { loreList.add(itemLore); } @@ -89,9 +89,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dItem.lore + // @mechanism ItemTag.lore // @group properties // @description // Returns whether the item has lore set on it. @@ -110,7 +110,7 @@ public String getPropertyString() { if (hasLore()) { StringBuilder output = new StringBuilder(); for (String itemLore : item.getItemStack().getItemMeta().getLore()) { - if (!itemLore.startsWith(dItem.itemscriptIdentifier) + if (!itemLore.startsWith(ItemTag.itemscriptIdentifier) && !itemLore.startsWith(ItemScriptHelper.ItemScriptHashID)) { output.append(EscapeTags.escape(itemLore)).append("|"); } @@ -131,14 +131,14 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name lore // @input ListTag // @description // Sets the item's lore. // See <@link language Property Escaping> // @tags - // + // // --> if (mechanism.matches("lore")) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemMap.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemMap.java index bcf89a6497..44b1060c52 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemMap.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemMap.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.NMSVersion; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -16,8 +16,8 @@ public class ItemMap implements Property { public static Material MAP_MATERIAL = NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13_R2) ? Material.FILLED_MAP : Material.MAP; public static boolean describes(ObjectTag item) { - return item instanceof dItem - && (((dItem) item).getItemStack().getType() == MAP_MATERIAL); + return item instanceof ItemTag + && (((ItemTag) item).getItemStack().getType() == MAP_MATERIAL); } public static ItemMap getFrom(ObjectTag _item) { @@ -25,7 +25,7 @@ public static ItemMap getFrom(ObjectTag _item) { return null; } else { - return new ItemMap((dItem) _item); + return new ItemMap((ItemTag) _item); } } @@ -38,11 +38,11 @@ public static ItemMap getFrom(ObjectTag _item) { }; - private ItemMap(dItem _item) { + private ItemMap(ItemTag _item) { item = _item; } - dItem item; + ItemTag item; @Override public String getAttribute(Attribute attribute) { @@ -52,10 +52,10 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @group properties - // @mechanism dItem.map + // @mechanism ItemTag.map // @description // Returns the ID number of the map item's map. // --> @@ -115,13 +115,13 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name map // @input Element(Number) // @description // Changes what map ID number a map item uses. // @tags - // + // // --> if (mechanism.matches("map") && mechanism.requireInteger()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemNBT.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemNBT.java index 564ce6b7ec..ea2538e349 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemNBT.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemNBT.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.utilities.nbt.CustomNBT; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; @@ -18,7 +18,7 @@ public class ItemNBT implements Property { public static boolean describes(ObjectTag item) { - return item instanceof dItem; + return item instanceof ItemTag; } public static ItemNBT getFrom(ObjectTag item) { @@ -26,7 +26,7 @@ public static ItemNBT getFrom(ObjectTag item) { return null; } else { - return new ItemNBT((dItem) item); + return new ItemNBT((ItemTag) item); } } @@ -39,11 +39,11 @@ public static ItemNBT getFrom(ObjectTag item) { }; - private ItemNBT(dItem item) { + private ItemNBT(ItemTag item) { this.item = item; } - dItem item; + ItemTag item; @Override public String getAttribute(Attribute attribute) { @@ -53,7 +53,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag(Boolean) // @group properties // @description @@ -65,7 +65,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ListTag // @group properties // @description @@ -77,9 +77,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag - // @mechanism dItem.nbt + // @mechanism ItemTag.nbt // @group properties // @description // Returns the value of this item's NBT key as an ElementTag as best it can. @@ -136,15 +136,15 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name remove_nbt // @input ListTag // @description // Removes the Denizen NBT keys specified, or all Denizen NBT if no value is given. // @tags - // ]> - // - // ]> + // ]> + // + // ]> // --> if (mechanism.matches("remove_nbt")) { if (item.getMaterial().getMaterial() == Material.AIR) { @@ -166,16 +166,16 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dItem + // @object ItemTag // @name nbt // @input ListTag // @description // Sets the Denizen NBT for this item in the format li@key/value|key/value... // See also <@link language property escaping>. // @tags - // ]> - // - // ]> + // ]> + // + // ]> // --> if (mechanism.matches("nbt")) { if (item.getMaterial().getMaterial() == Material.AIR) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemPatterns.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemPatterns.java index 16c8941a20..c7867dff01 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemPatterns.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemPatterns.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.utilities.MaterialCompat; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; import com.denizenscript.denizencore.objects.ObjectTag; @@ -25,8 +25,8 @@ public class ItemPatterns implements Property { public static boolean describes(ObjectTag item) { - if (item instanceof dItem) { - Material material = ((dItem) item).getItemStack().getType(); + if (item instanceof ItemTag) { + Material material = ((ItemTag) item).getItemStack().getType(); return MaterialCompat.isBannerOrShield(material); } return false; @@ -37,7 +37,7 @@ public static ItemPatterns getFrom(ObjectTag item) { return null; } else { - return new ItemPatterns((dItem) item); + return new ItemPatterns((ItemTag) item); } } @@ -50,11 +50,11 @@ public static ItemPatterns getFrom(ObjectTag item) { }; - private ItemPatterns(dItem item) { + private ItemPatterns(ItemTag item) { this.item = item; } - dItem item; + ItemTag item; private ListTag listPatterns() { ListTag list = new ListTag(); @@ -110,10 +110,10 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ListTag // @group properties - // @mechanism dItem.patterns + // @mechanism ItemTag.patterns // @description // Lists a banner's patterns in the form "li@COLOR/PATTERN|COLOR/PATTERN" etc. // TODO: Local meta for these links @@ -146,7 +146,7 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name patterns // @input ListTag // @description @@ -155,7 +155,7 @@ public void adjust(Mechanism mechanism) { // For the list of possible colors, see <@link url http://bit.ly/1dydq12>. // For the list of possible patterns, see <@link url http://bit.ly/1MqRn7T>. // @tags - // + // // // --> diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemPlantgrowth.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemPlantgrowth.java index da69005197..fa5dfcefaf 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemPlantgrowth.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemPlantgrowth.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.item; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -16,15 +16,15 @@ public class ItemPlantgrowth implements Property { public static boolean describes(ObjectTag item) { - return item instanceof dItem + return item instanceof ItemTag && ( - ((dItem) item).getItemStack().getData() instanceof Crops - || ((dItem) item).getItemStack().getData() instanceof NetherWarts - || ((dItem) item).getItemStack().getData() instanceof CocoaPlant - || ((dItem) item).getItemStack().getType().equals(Material.PUMPKIN_STEM) - || ((dItem) item).getItemStack().getType().equals(Material.MELON_STEM) - || ((dItem) item).getItemStack().getType().equals(Material.CARROT) - || ((dItem) item).getItemStack().getType().equals(Material.POTATO) + ((ItemTag) item).getItemStack().getData() instanceof Crops + || ((ItemTag) item).getItemStack().getData() instanceof NetherWarts + || ((ItemTag) item).getItemStack().getData() instanceof CocoaPlant + || ((ItemTag) item).getItemStack().getType().equals(Material.PUMPKIN_STEM) + || ((ItemTag) item).getItemStack().getType().equals(Material.MELON_STEM) + || ((ItemTag) item).getItemStack().getType().equals(Material.CARROT) + || ((ItemTag) item).getItemStack().getType().equals(Material.POTATO) ); } @@ -33,7 +33,7 @@ public static ItemPlantgrowth getFrom(ObjectTag _item) { return null; } else { - return new ItemPlantgrowth((dItem) _item); + return new ItemPlantgrowth((ItemTag) _item); } } @@ -46,11 +46,11 @@ public static ItemPlantgrowth getFrom(ObjectTag _item) { }; - private ItemPlantgrowth(dItem _item) { + private ItemPlantgrowth(ItemTag _item) { item = _item; } - dItem item; + ItemTag item; @Override public String getAttribute(Attribute attribute) { @@ -60,9 +60,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dItem.plant_growth + // @mechanism ItemTag.plant_growth // @group properties // @description // Returns the growth level of a plant item as one of the following: @@ -70,7 +70,7 @@ public String getAttribute(Attribute attribute) { // Nether Warts: SEEDED, STAGE_ONE, STAGE_TWO, RIPE // Cocoa Plants: SMALL, MEDIUM, LARGE // Pumpkin stem, melon stem, carrot, potato: 0-7 - // Deprecated as of MC 1.13, use <@link tag m@material.plant_growth> instead. + // Deprecated as of MC 1.13, use <@link tag MaterialTag.plant_growth> instead. // --> if (attribute.startsWith("plant_growth")) { if (item.getItemStack().getData() instanceof Crops) { @@ -128,16 +128,16 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name plant_growth // @input Element // @description // Changes the growth level of plant items. - // See <@link tag i@item.plant_growth> for valid inputs. - // Deprecated as of MC 1.13, use <@link mechanism dMaterial.plant_growth> instead. + // See <@link tag ItemTag.plant_growth> for valid inputs. + // Deprecated as of MC 1.13, use <@link mechanism MaterialTag.plant_growth> instead. // @tags - // - // + // + // // --> if (mechanism.matches("plant_growth")) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemPotion.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemPotion.java index ed54d63bb8..7456ea65c4 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemPotion.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemPotion.java @@ -4,8 +4,8 @@ import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.NMSVersion; import com.denizenscript.denizen.nms.interfaces.ItemHelper; -import com.denizenscript.denizen.objects.dColor; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ColorTag; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; @@ -25,11 +25,11 @@ public class ItemPotion implements Property { public static boolean describes(ObjectTag item) { - return item instanceof dItem - && (((dItem) item).getItemStack().getType() == Material.POTION - || ((dItem) item).getItemStack().getType() == Material.SPLASH_POTION - || ((dItem) item).getItemStack().getType() == Material.LINGERING_POTION - || ((dItem) item).getItemStack().getType() == Material.TIPPED_ARROW); + return item instanceof ItemTag + && (((ItemTag) item).getItemStack().getType() == Material.POTION + || ((ItemTag) item).getItemStack().getType() == Material.SPLASH_POTION + || ((ItemTag) item).getItemStack().getType() == Material.LINGERING_POTION + || ((ItemTag) item).getItemStack().getType() == Material.TIPPED_ARROW); } public static ItemPotion getFrom(ObjectTag _item) { @@ -37,7 +37,7 @@ public static ItemPotion getFrom(ObjectTag _item) { return null; } else { - return new ItemPotion((dItem) _item); + return new ItemPotion((ItemTag) _item); } } @@ -50,11 +50,11 @@ public static ItemPotion getFrom(ObjectTag _item) { }; - private ItemPotion(dItem item) { + private ItemPotion(ItemTag item) { this.item = item; } - dItem item; + ItemTag item; @Override @@ -70,7 +70,7 @@ public String getPropertyString() { effects.add(meta.getBasePotionData().getType() + "," + meta.getBasePotionData().isUpgraded() + "," + meta.getBasePotionData().isExtended() - + (meta.hasColor() ? "," + new dColor(meta.getColor()).identify().replace(",", "&comma") : "") + + (meta.hasColor() ? "," + new ColorTag(meta.getColor()).identify().replace(",", "&comma") : "") ); for (PotionEffect pot : meta.getCustomEffects()) { StringBuilder sb = new StringBuilder(); @@ -80,7 +80,7 @@ public String getPropertyString() { .append(pot.isAmbient()).append(",") .append(pot.hasParticles()); if (pot.getColor() != null) { - sb.append(",").append(new dColor(pot.getColor()).identify().replace(",", "&comma")); + sb.append(",").append(new ColorTag(pot.getColor()).identify().replace(",", "&comma")); } effects.add(sb.toString()); } @@ -104,9 +104,9 @@ public String getAttribute(Attribute attribute) { // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dItem.potion_effects + // @mechanism ItemTag.potion_effects // @group properties // @description // Returns the potion effect on this item. @@ -116,14 +116,14 @@ public String getAttribute(Attribute attribute) { PotionMeta meta = ((PotionMeta) item.getItemStack().getItemMeta()); return new ElementTag(meta.getBasePotionData().getType().name() + "," + (meta.getBasePotionData().isUpgraded() ? 2 : 1) + "," + meta.getBasePotionData().isExtended() + "," + (item.getItemStack().getType() == Material.SPLASH_POTION) - + (meta.hasColor() ? "," + new dColor(meta.getColor()).identify() : "") + + (meta.hasColor() ? "," + new ColorTag(meta.getColor()).identify() : "") ).getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dItem.potion + // @mechanism ItemTag.potion // @description // Returns whether the potion has a potion effect. // --> @@ -145,9 +145,9 @@ public String getAttribute(Attribute attribute) { // <--[tag] - // @attribute ].is_splash> + // @attribute ].is_splash> // @returns ElementTag(Boolean) - // @mechanism dItem.potion_effects + // @mechanism ItemTag.potion_effects // @group properties // @description // Returns whether the potion is a splash potion. @@ -158,9 +158,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ].is_extended> + // @attribute ].is_extended> // @returns ElementTag(Boolean) - // @mechanism dItem.potion_effects + // @mechanism ItemTag.potion_effects // @group properties // @description // Returns whether the potion effect is extended. @@ -171,9 +171,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ].level> + // @attribute ].level> // @returns ElementTag(Number) - // @mechanism dItem.potion_effects + // @mechanism ItemTag.potion_effects // @group properties // @description // Returns the potion effect's level. @@ -184,9 +184,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ].is_ambient> + // @attribute ].is_ambient> // @returns ElementTag(Boolean) - // @mechanism dItem.potion_effects + // @mechanism ItemTag.potion_effects // @group properties // @description // Returns whether the potion effect is ambient. @@ -197,9 +197,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ].color> - // @returns dColor - // @mechanism dItem.potion_effects + // @attribute ].color> + // @returns ColorTag + // @mechanism ItemTag.potion_effects // @group properties // @description // Returns the potion effect's color. @@ -210,14 +210,14 @@ public String getAttribute(Attribute attribute) { Debug.echoError("Custom effects with the color option are not supported as of Minecraft version 1.13."); return null; } - return new dColor(meta.getCustomEffects().get(potN).getColor()) + return new ColorTag(meta.getCustomEffects().get(potN).getColor()) .getAttribute(attribute.fulfill(1)); } // <--[tag] - // @attribute ].icon> + // @attribute ].icon> // @returns ElementTag(Boolean) - // @mechanism dItem.potion_effects + // @mechanism ItemTag.potion_effects // @group properties // @description // Returns whether the potion effect shows an icon. @@ -227,9 +227,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ].has_particles> + // @attribute ].has_particles> // @returns ElementTag(Boolean) - // @mechanism dItem.potion_effects + // @mechanism ItemTag.potion_effects // @group properties // @description // Returns whether the potion effect has particles. @@ -240,9 +240,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ].duration> + // @attribute ].duration> // @returns ElementTag(Number) - // @mechanism dItem.potion_effects + // @mechanism ItemTag.potion_effects // @group properties // @description // Returns the duration in ticks of the potion. @@ -253,9 +253,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ].amplifier> + // @attribute ].amplifier> // @returns ElementTag(Number) - // @mechanism dItem.potion_effects + // @mechanism ItemTag.potion_effects // @group properties // @description // Returns the amplifier level of the potion effect. @@ -266,9 +266,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ].type> + // @attribute ].type> // @returns ElementTag - // @mechanism dItem.potion_effects + // @mechanism ItemTag.potion_effects // @group properties // @description // Returns the type of the potion effect. @@ -284,9 +284,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute ]> + // @attribute ]> // @returns ElementTag - // @mechanism dItem.potion_effects + // @mechanism ItemTag.potion_effects // @group properties // @warning Don't use this directly, use its sub-tags! // @description @@ -306,7 +306,7 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name potion_effects // @input ListTag // @description @@ -315,14 +315,14 @@ public void adjust(Mechanism mechanism) { // For example: SPEED,true,false|SPEED,2,200,false,true,true // NOTE: In pre-1.13 Minecraft versions, you could set a color in the custom effects list instead of "icon". // @tags - // ]> - // ].type> - // ].duration> - // ].amplifier> - // ].is_ambient> - // ].has_particles> - // ].color> - // ].icon> + // ]> + // ].type> + // ].duration> + // ].amplifier> + // ].is_ambient> + // ].has_particles> + // ].color> + // ].icon> // // // --> @@ -334,7 +334,7 @@ public void adjust(Mechanism mechanism) { CoreUtilities.toLowerCase(d1[2]).equals("true"), CoreUtilities.toLowerCase(d1[1]).equals("true"))); if (d1.length > 3) { - meta.setColor(dColor.valueOf(d1[3].replace("&comma", ",")).getColor()); + meta.setColor(ColorTag.valueOf(d1[3].replace("&comma", ",")).getColor()); } meta.clearCustomEffects(); ItemHelper itemHelper = NMSHandler.getInstance().getItemHelper(); @@ -361,8 +361,8 @@ public void adjust(Mechanism mechanism) { } else { String check = d2[5].replace("&comma", ","); - if (dColor.matches(check)) { - color = dColor.valueOf(check).getColor(); + if (ColorTag.matches(check)) { + color = ColorTag.valueOf(check).getColor(); } } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemQuantity.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemQuantity.java index 26eac9cc34..162b260636 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemQuantity.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemQuantity.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.item; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -11,7 +11,7 @@ public class ItemQuantity implements Property { public static boolean describes(ObjectTag item) { // all items can have a quantity - return item instanceof dItem; + return item instanceof ItemTag; } public static ItemQuantity getFrom(ObjectTag _item) { @@ -19,7 +19,7 @@ public static ItemQuantity getFrom(ObjectTag _item) { return null; } else { - return new ItemQuantity((dItem) _item); + return new ItemQuantity((ItemTag) _item); } } @@ -32,11 +32,11 @@ public static ItemQuantity getFrom(ObjectTag _item) { }; - private ItemQuantity(dItem _item) { + private ItemQuantity(ItemTag _item) { item = _item; } - dItem item; + ItemTag item; @Override public String getAttribute(Attribute attribute) { @@ -46,12 +46,12 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) - // @mechanism dItem.quantity + // @mechanism ItemTag.quantity // @group properties // @description - // Returns the number of items in the dItem's itemstack. + // Returns the number of items in the ItemTag's itemstack. // --> if (attribute.startsWith("quantity") || attribute.startsWith("qty")) { return new ElementTag(item.getItemStack().getAmount()) @@ -59,12 +59,12 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @group properties // @description // Returns the max number of this item possible in a single stack of this type. - // For use with <@link tag i@item.quantity> and <@link mechanism dItem.quantity>. + // For use with <@link tag ItemTag.quantity> and <@link mechanism ItemTag.quantity>. // --> if (attribute.startsWith("max_stack")) { return new ElementTag(item.getItemStack().getMaxStackSize()) @@ -94,14 +94,14 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name quantity // @input Element(Number) // @description // Changes the number of items in this stack. // @tags - // - // + // + // // --> if (mechanism.matches("quantity") && mechanism.requireInteger()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemRepairCost.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemRepairCost.java index ea97ee44e2..94eaf5b430 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemRepairCost.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemRepairCost.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.item; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -12,8 +12,8 @@ public class ItemRepairCost implements Property { public static boolean describes(ObjectTag item) { - return item instanceof dItem - && ((dItem) item).getItemStack().getItemMeta() instanceof Repairable; + return item instanceof ItemTag + && ((ItemTag) item).getItemStack().getItemMeta() instanceof Repairable; } public static ItemRepairCost getFrom(ObjectTag _item) { @@ -21,7 +21,7 @@ public static ItemRepairCost getFrom(ObjectTag _item) { return null; } else { - return new ItemRepairCost((dItem) _item); + return new ItemRepairCost((ItemTag) _item); } } @@ -34,11 +34,11 @@ public static ItemRepairCost getFrom(ObjectTag _item) { }; - private ItemRepairCost(dItem _item) { + private ItemRepairCost(ItemTag _item) { item = _item; } - dItem item; + ItemTag item; @Override public String getAttribute(Attribute attribute) { @@ -48,9 +48,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) - // @mechanism dItem.repair_cost + // @mechanism ItemTag.repair_cost // @group properties // @description // Returns the current repair cost (on an anvil) for this item. @@ -85,13 +85,13 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name repair_cost // @input Element(Number) // @description // Changes the repair cost (on an anvil) of the item. // @tags - // + // // --> if (mechanism.matches("repair_cost") && mechanism.requireInteger()) { Repairable meta = ((Repairable) item.getItemStack().getItemMeta()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemScript.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemScript.java index 9e52094062..1a1a64b61e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemScript.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemScript.java @@ -6,7 +6,7 @@ import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.objects.core.ScriptTag; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.properties.Property; import com.denizenscript.denizencore.tags.Attribute; @@ -14,7 +14,7 @@ public class ItemScript implements Property { public static boolean describes(ObjectTag item) { // All items can have a script - return item instanceof dItem; + return item instanceof ItemTag; } public static ItemScript getFrom(ObjectTag _item) { @@ -22,7 +22,7 @@ public static ItemScript getFrom(ObjectTag _item) { return null; } else { - return new ItemScript((dItem) _item); + return new ItemScript((ItemTag) _item); } } @@ -35,11 +35,11 @@ public static ItemScript getFrom(ObjectTag _item) { }; - private ItemScript(dItem _item) { + private ItemScript(ItemTag _item) { item = _item; } - dItem item; + ItemTag item; @Override public String getAttribute(Attribute attribute) { @@ -49,7 +49,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group scripts // @description @@ -61,7 +61,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @group scripts // @description @@ -75,7 +75,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ScriptTag // @group scripts // @description diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemSignContents.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemSignContents.java index 388c4658d8..09906e64ec 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemSignContents.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemSignContents.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.item; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; import com.denizenscript.denizencore.objects.ObjectTag; @@ -17,9 +17,9 @@ public class ItemSignContents implements Property { public static boolean describes(ObjectTag item) { - return item instanceof dItem - && ((dItem) item).getItemStack().getItemMeta() instanceof BlockStateMeta - && ((BlockStateMeta) ((dItem) item).getItemStack().getItemMeta()).getBlockState() instanceof Sign; + return item instanceof ItemTag + && ((ItemTag) item).getItemStack().getItemMeta() instanceof BlockStateMeta + && ((BlockStateMeta) ((ItemTag) item).getItemStack().getItemMeta()).getBlockState() instanceof Sign; } public static ItemSignContents getFrom(ObjectTag _item) { @@ -27,7 +27,7 @@ public static ItemSignContents getFrom(ObjectTag _item) { return null; } else { - return new ItemSignContents((dItem) _item); + return new ItemSignContents((ItemTag) _item); } } @@ -44,11 +44,11 @@ private ListTag getSignContents() { return new ListTag(Arrays.asList(((Sign) ((BlockStateMeta) item.getItemStack().getItemMeta()).getBlockState()).getLines())); } - private ItemSignContents(dItem _item) { + private ItemSignContents(ItemTag _item) { item = _item; } - dItem item; + ItemTag item; @Override public String getAttribute(Attribute attribute) { @@ -58,9 +58,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ListTag - // @mechanism dItem.sign_contents + // @mechanism ItemTag.sign_contents // @group properties // @description // Returns a list of lines on a sign item. @@ -92,13 +92,13 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name sign_contents // @input ListTag // @description // Sets the contents of a sign item. // @tags - // + // // --> if (mechanism.matches("sign_contents")) { ItemStack itemStack = item.getItemStack(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemSkullskin.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemSkullskin.java index bdd48eee0f..af2d20f37e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemSkullskin.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemSkullskin.java @@ -3,7 +3,7 @@ import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.NMSVersion; import com.denizenscript.denizen.nms.util.PlayerProfile; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; @@ -19,8 +19,8 @@ public class ItemSkullskin implements Property { public static boolean describes(ObjectTag item) { - return item instanceof dItem - && ((dItem) item).getItemStack().getItemMeta() instanceof SkullMeta; + return item instanceof ItemTag + && ((ItemTag) item).getItemStack().getItemMeta() instanceof SkullMeta; } public static ItemSkullskin getFrom(ObjectTag _item) { @@ -28,7 +28,7 @@ public static ItemSkullskin getFrom(ObjectTag _item) { return null; } else { - return new ItemSkullskin((dItem) _item); + return new ItemSkullskin((ItemTag) _item); } } @@ -41,11 +41,11 @@ public static ItemSkullskin getFrom(ObjectTag _item) { }; - private ItemSkullskin(dItem _item) { + private ItemSkullskin(ItemTag _item) { item = _item; } - dItem item; + ItemTag item; @Override public String getAttribute(Attribute attribute) { @@ -55,18 +55,18 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dItem.skull_skin + // @mechanism ItemTag.skull_skin // @group properties // @description // Returns the UUID of the player whose skin a skull item uses. // Note: Item must be a 'skull_item' with a skin. // --> // <--[tag] - // @attribute + // @attribute // @returns ElementTag|Element - // @mechanism dItem.skull_skin + // @mechanism ItemTag.skull_skin // @group properties // @description // Returns the UUID of the player whose skin a skull item uses, along @@ -89,9 +89,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dItem.skull_skin + // @mechanism ItemTag.skull_skin // @group properties // @description // Returns whether the item has a custom skin set. @@ -134,7 +134,7 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name skull_skin // @input Element(|Element(|Element)) // @description @@ -143,9 +143,9 @@ public void adjust(Mechanism mechanism) { // Optionally, use the second ElementTag for the skin texture cache. // Optionally, use the third ElementTag for a player name. // @tags - // - // - // + // + // + // // --> if (mechanism.matches("skull_skin")) { if (!isCorrectDurability()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemSpawnEgg.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemSpawnEgg.java index 60eed61a06..d8cee4badc 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemSpawnEgg.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemSpawnEgg.java @@ -3,7 +3,7 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.NMSVersion; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -15,8 +15,8 @@ public class ItemSpawnEgg implements Property { public static boolean describes(ObjectTag item) { - return item instanceof dItem - && ((dItem) item).getItemStack().getItemMeta() instanceof SpawnEggMeta; + return item instanceof ItemTag + && ((ItemTag) item).getItemStack().getItemMeta() instanceof SpawnEggMeta; } public static ItemSpawnEgg getFrom(ObjectTag _item) { @@ -24,7 +24,7 @@ public static ItemSpawnEgg getFrom(ObjectTag _item) { return null; } else { - return new ItemSpawnEgg((dItem) _item); + return new ItemSpawnEgg((ItemTag) _item); } } @@ -37,11 +37,11 @@ public static ItemSpawnEgg getFrom(ObjectTag _item) { }; - private ItemSpawnEgg(dItem _item) { + private ItemSpawnEgg(ItemTag _item) { item = _item; } - dItem item; + ItemTag item; private EntityType getEntityType() { return ((SpawnEggMeta) item.getItemStack().getItemMeta()).getSpawnedType(); @@ -55,13 +55,13 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @group properties - // @mechanism dItem.spawn_id + // @mechanism ItemTag.spawn_id // @description // NOTE: ID numbers are deprecated since 1.11 - // Use instead! + // Use instead! // Returns the spawn egg number of the item. // --> if ((attribute.startsWith("spawn_id") || attribute.startsWith("spawn_egg_entity")) @@ -71,10 +71,10 @@ && getEntityType() != null) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag // @group properties - // @mechanism dItem.spawn_type + // @mechanism ItemTag.spawn_type // @description // Returns the spawn egg's entity type. // --> @@ -104,15 +104,15 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name spawn_id // @input Element(Number) // @description // NOTE: ID numbers are deprecated since 1.11 - // Use <@link mechanism dItem.spawn_type> instead! + // Use <@link mechanism ItemTag.spawn_type> instead! // Sets what mob a spawn egg holds. // @tags - // + // // --> if ((mechanism.matches("spawn_id") || mechanism.matches("spawn_egg")) && mechanism.requireInteger()) { @@ -122,13 +122,13 @@ public void adjust(Mechanism mechanism) { } // <--[mechanism] - // @object dItem + // @object ItemTag // @name spawn_type // @input Element // @description // Sets what entity type a spawn egg holds. // @tags - // + // // --> if (mechanism.matches("spawn_type") && mechanism.requireEnum(false, EntityType.values())) { try { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemUnbreakable.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemUnbreakable.java index a3e3839f63..e5c8951525 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemUnbreakable.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemUnbreakable.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.item; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -12,14 +12,14 @@ public class ItemUnbreakable implements Property { public static boolean describes(ObjectTag object) { - return object instanceof dItem; + return object instanceof ItemTag; } public static ItemUnbreakable getFrom(ObjectTag object) { if (!describes(object)) { return null; } - return new ItemUnbreakable((dItem) object); + return new ItemUnbreakable((ItemTag) object); } public static final String[] handledTags = new String[] { @@ -31,11 +31,11 @@ public static ItemUnbreakable getFrom(ObjectTag object) { }; - private ItemUnbreakable(dItem item) { + private ItemUnbreakable(ItemTag item) { this.item = item; } - dItem item; + ItemTag item; public String getAttribute(Attribute attribute) { @@ -44,10 +44,10 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group properties - // @mechanism dItem.unbreakable + // @mechanism ItemTag.unbreakable // @description // Returns whether an item has the unbreakable flag. // --> @@ -70,13 +70,13 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dItem + // @object ItemTag // @name unbreakable // @input Element(Boolean) // @description // Changes whether an item has the unbreakable item flag. // @tags - // + // // --> if (mechanism.matches("unbreakable") && mechanism.requireBoolean()) { ItemStack itemStack = item.getItemStack().clone(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialAge.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialAge.java index 6f4cfa3697..3f53a3866a 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialAge.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialAge.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.material; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -12,9 +12,9 @@ public class MaterialAge implements Property { public static boolean describes(ObjectTag material) { - return material instanceof dMaterial - && ((dMaterial) material).hasModernData() - && ((dMaterial) material).getModernData().data instanceof Ageable; + return material instanceof MaterialTag + && ((MaterialTag) material).hasModernData() + && ((MaterialTag) material).getModernData().data instanceof Ageable; } public static MaterialAge getFrom(ObjectTag _material) { @@ -22,7 +22,7 @@ public static MaterialAge getFrom(ObjectTag _material) { return null; } else { - return new MaterialAge((dMaterial) _material); + return new MaterialAge((MaterialTag) _material); } } @@ -35,11 +35,11 @@ public static MaterialAge getFrom(ObjectTag _material) { }; - private MaterialAge(dMaterial _material) { + private MaterialAge(MaterialTag _material) { material = _material; } - dMaterial material; + MaterialTag material; @Override public String getAttribute(Attribute attribute) { @@ -49,7 +49,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @group properties // @description @@ -60,9 +60,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) - // @mechanism dMaterial.age + // @mechanism MaterialTag.age // @group properties // @description // Returns the current age for an ageable material. @@ -100,14 +100,14 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dMaterial + // @object MaterialTag // @name age // @input Element(Number) // @description // Sets an ageable material's current age. // @tags - // - // + // + // // --> if ((mechanism.matches("age") || mechanism.matches("plant_growth")) && mechanism.requireInteger()) { int age = mechanism.getValue().asInt(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDirectional.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDirectional.java index a0c0a13a27..9d15205eb1 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDirectional.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDirectional.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.material; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; @@ -13,9 +13,9 @@ public class MaterialDirectional implements Property { public static boolean describes(ObjectTag material) { - return material instanceof dMaterial - && ((dMaterial) material).hasModernData() - && ((dMaterial) material).getModernData().data instanceof Directional; + return material instanceof MaterialTag + && ((MaterialTag) material).hasModernData() + && ((MaterialTag) material).getModernData().data instanceof Directional; } public static MaterialDirectional getFrom(ObjectTag _material) { @@ -23,7 +23,7 @@ public static MaterialDirectional getFrom(ObjectTag _material) { return null; } else { - return new MaterialDirectional((dMaterial) _material); + return new MaterialDirectional((MaterialTag) _material); } } @@ -36,11 +36,11 @@ public static MaterialDirectional getFrom(ObjectTag _material) { }; - private MaterialDirectional(dMaterial _material) { + private MaterialDirectional(MaterialTag _material) { material = _material; } - dMaterial material; + MaterialTag material; @Override public String getAttribute(Attribute attribute) { @@ -50,9 +50,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dMaterial.direction + // @mechanism MaterialTag.direction // @group properties // @description // Returns a list of directions that are valid for a directional material. @@ -67,9 +67,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dMaterial.direction + // @mechanism MaterialTag.direction // @group properties // @description // Returns the current facing direction for a directional material (like a door or a bed). @@ -104,14 +104,14 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dMaterial + // @object MaterialTag // @name direction // @input Element // @description // Sets the current facing direction for a directional material (like a door or a bed). // @tags - // - // + // + // // --> if (mechanism.matches("direction") && mechanism.requireEnum(false, BlockFace.values())) { getDirectional().setFacing(BlockFace.valueOf(mechanism.getValue().asString().toUpperCase())); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialHalf.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialHalf.java index 214a2fd1e0..12a9dfd9ec 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialHalf.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialHalf.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.material; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -11,9 +11,9 @@ public class MaterialHalf implements Property { public static boolean describes(ObjectTag material) { - return material instanceof dMaterial - && ((dMaterial) material).hasModernData() - && ((dMaterial) material).getModernData().data instanceof Bisected; + return material instanceof MaterialTag + && ((MaterialTag) material).hasModernData() + && ((MaterialTag) material).getModernData().data instanceof Bisected; } public static MaterialHalf getFrom(ObjectTag _material) { @@ -21,7 +21,7 @@ public static MaterialHalf getFrom(ObjectTag _material) { return null; } else { - return new MaterialHalf((dMaterial) _material); + return new MaterialHalf((MaterialTag) _material); } } @@ -34,11 +34,11 @@ public static MaterialHalf getFrom(ObjectTag _material) { }; - private MaterialHalf(dMaterial _material) { + private MaterialHalf(MaterialTag _material) { material = _material; } - dMaterial material; + MaterialTag material; @Override public String getAttribute(Attribute attribute) { @@ -48,9 +48,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dMaterial.half + // @mechanism MaterialTag.half // @group properties // @description // Returns the current half for a bisected material (like stairs). @@ -81,13 +81,13 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dMaterial + // @object MaterialTag // @name half // @input Element // @description // Sets the current half for a bisected material (like stairs). // @tags - // + // // --> if (mechanism.matches("half") && mechanism.requireEnum(false, Bisected.Half.values())) { getBisected().setHalf(Bisected.Half.valueOf(mechanism.getValue().asString().toUpperCase())); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialLevel.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialLevel.java index 4f142bf856..21f272a008 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialLevel.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialLevel.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.material; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -12,9 +12,9 @@ public class MaterialLevel implements Property { public static boolean describes(ObjectTag material) { - return material instanceof dMaterial - && ((dMaterial) material).hasModernData() - && ((dMaterial) material).getModernData().data instanceof Levelled; + return material instanceof MaterialTag + && ((MaterialTag) material).hasModernData() + && ((MaterialTag) material).getModernData().data instanceof Levelled; } public static MaterialLevel getFrom(ObjectTag _material) { @@ -22,7 +22,7 @@ public static MaterialLevel getFrom(ObjectTag _material) { return null; } else { - return new MaterialLevel((dMaterial) _material); + return new MaterialLevel((MaterialTag) _material); } } @@ -35,11 +35,11 @@ public static MaterialLevel getFrom(ObjectTag _material) { }; - private MaterialLevel(dMaterial _material) { + private MaterialLevel(MaterialTag _material) { material = _material; } - dMaterial material; + MaterialTag material; @Override public String getAttribute(Attribute attribute) { @@ -49,7 +49,7 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @group properties // @description @@ -60,9 +60,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) - // @mechanism dMaterial.level + // @mechanism MaterialTag.level // @group properties // @description // Returns the current level for a levelable material (like water, lava, and Cauldrons). @@ -100,14 +100,14 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dMaterial + // @object MaterialTag // @name level // @input Element(Number) // @description // Sets the current level for a levelable material (like water, lava, and Cauldrons). // @tags - // - // + // + // // --> if (mechanism.matches("level") && mechanism.requireInteger()) { int level = mechanism.getValue().asInt(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialSwitchFace.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialSwitchFace.java index efb067450a..9833dfc93e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialSwitchFace.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialSwitchFace.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.material; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -12,9 +12,9 @@ public class MaterialSwitchFace implements Property { public static boolean describes(ObjectTag material) { - return material instanceof dMaterial - && ((dMaterial) material).hasModernData() - && ((dMaterial) material).getModernData().data instanceof Switch; + return material instanceof MaterialTag + && ((MaterialTag) material).hasModernData() + && ((MaterialTag) material).getModernData().data instanceof Switch; } public static MaterialSwitchFace getFrom(ObjectTag _material) { @@ -22,7 +22,7 @@ public static MaterialSwitchFace getFrom(ObjectTag _material) { return null; } else { - return new MaterialSwitchFace((dMaterial) _material); + return new MaterialSwitchFace((MaterialTag) _material); } } @@ -35,11 +35,11 @@ public static MaterialSwitchFace getFrom(ObjectTag _material) { }; - private MaterialSwitchFace(dMaterial _material) { + private MaterialSwitchFace(MaterialTag _material) { material = _material; } - dMaterial material; + MaterialTag material; @Override public String getAttribute(Attribute attribute) { @@ -49,9 +49,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag - // @mechanism dMaterial.switch_face + // @mechanism MaterialTag.switch_face // @group properties // @description // Returns the current attach direction for a switch. @@ -95,13 +95,13 @@ public String getPropertyId() { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dMaterial + // @object MaterialTag // @name switch_face // @input Element // @description // Sets the current attach direction for a switch. // @tags - // + // // --> if (mechanism.matches("switch_face") && mechanism.requireEnum(false, Switch.Face.values())) { getSwitch().setFace(Switch.Face.valueOf(mechanism.getValue().asString().toUpperCase())); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/trade/TradeHasXp.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/trade/TradeHasXp.java index 3b72a15133..d6e3ed262f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/trade/TradeHasXp.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/trade/TradeHasXp.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.trade; -import com.denizenscript.denizen.objects.dTrade; +import com.denizenscript.denizen.objects.TradeTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -10,14 +10,14 @@ public class TradeHasXp implements Property { public static boolean describes(ObjectTag recipe) { - return recipe instanceof dTrade; + return recipe instanceof TradeTag; } public static TradeHasXp getFrom(ObjectTag recipe) { if (!describes(recipe)) { return null; } - return new TradeHasXp((dTrade) recipe); + return new TradeHasXp((TradeTag) recipe); } public static final String[] handledTags = new String[] { @@ -28,9 +28,9 @@ public static TradeHasXp getFrom(ObjectTag recipe) { "has_xp" }; - private dTrade recipe; + private TradeTag recipe; - public TradeHasXp(dTrade recipe) { + public TradeHasXp(TradeTag recipe) { this.recipe = recipe; } @@ -51,9 +51,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism dTrade.has_xp + // @mechanism TradeTag.has_xp // @description // Returns whether the trade has an experience reward. // --> @@ -67,13 +67,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dTrade + // @object TradeTag // @name has_xp // @input Element(Boolean) // @description // Sets whether this trade will reward XP upon successful trading. // @tags - // + // // --> if (mechanism.matches("has_xp") && mechanism.requireBoolean()) { recipe.getRecipe().setExperienceReward(mechanism.getValue().asBoolean()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/trade/TradeInputs.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/trade/TradeInputs.java index 1b96369b3a..658de5890d 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/trade/TradeInputs.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/trade/TradeInputs.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.objects.properties.trade; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dTrade; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.TradeTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.core.ListTag; import com.denizenscript.denizencore.objects.ObjectTag; @@ -16,14 +16,14 @@ public class TradeInputs implements Property { public static boolean describes(ObjectTag recipe) { - return recipe instanceof dTrade; + return recipe instanceof TradeTag; } public static TradeInputs getFrom(ObjectTag recipe) { if (!describes(recipe)) { return null; } - return new TradeInputs((dTrade) recipe); + return new TradeInputs((TradeTag) recipe); } public static final String[] handledTags = new String[] { @@ -34,9 +34,9 @@ public static TradeInputs getFrom(ObjectTag recipe) { "inputs" }; - private dTrade recipe; + private TradeTag recipe; - public TradeInputs(dTrade recipe) { + public TradeInputs(TradeTag recipe) { this.recipe = recipe; } @@ -46,7 +46,7 @@ public String getPropertyString() { } ListTag ingredients = new ListTag(); for (ItemStack item : recipe.getRecipe().getIngredients()) { - ingredients.addObject(new dItem(item)); + ingredients.addObject(new ItemTag(item)); } return ingredients.identify(); } @@ -61,16 +61,16 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @returns ListTag(dItem) - // @mechanism dTrade.inputs + // @attribute + // @returns ListTag(ItemTag) + // @mechanism TradeTag.inputs // @description // Returns the list of items required to make the trade. // --> if (attribute.startsWith("inputs")) { - ArrayList itemList = new ArrayList<>(); + ArrayList itemList = new ArrayList<>(); for (ItemStack item : recipe.getRecipe().getIngredients()) { - itemList.add(new dItem(item)); + itemList.add(new ItemTag(item)); } return new ListTag(itemList).getAttribute(attribute.fulfill(1)); } @@ -81,25 +81,25 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dTrade + // @object TradeTag // @name inputs - // @input ListTag(dItem) + // @input ListTag(ItemTag) // @description // Sets the items required to make a successful trade. Use an empty input to make the trade impossible. // NOTE: If a more than two items are specified, then only the first two items will be used. // @tags - // + // // --> if (mechanism.matches("inputs")) { List ingredients = new ArrayList<>(); - List list = mechanism.valueAsType(ListTag.class).filter(dItem.class, mechanism.context); + List list = mechanism.valueAsType(ListTag.class).filter(ItemTag.class, mechanism.context); if (!mechanism.hasValue() || list.isEmpty()) { recipe.getRecipe().setIngredients(ingredients); return; } - for (dItem item : list) { + for (ItemTag item : list) { ingredients.add(item.getItemStack()); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/trade/TradeMaxUses.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/trade/TradeMaxUses.java index 6d98790dce..71d0362a16 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/trade/TradeMaxUses.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/trade/TradeMaxUses.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.trade; -import com.denizenscript.denizen.objects.dTrade; +import com.denizenscript.denizen.objects.TradeTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -10,14 +10,14 @@ public class TradeMaxUses implements Property { public static boolean describes(ObjectTag recipe) { - return recipe instanceof dTrade; + return recipe instanceof TradeTag; } public static TradeMaxUses getFrom(ObjectTag recipe) { if (!describes(recipe)) { return null; } - return new TradeMaxUses((dTrade) recipe); + return new TradeMaxUses((TradeTag) recipe); } public static final String[] handledTags = new String[] { @@ -28,9 +28,9 @@ public static TradeMaxUses getFrom(ObjectTag recipe) { "max_uses" }; - private dTrade recipe; + private TradeTag recipe; - public TradeMaxUses(dTrade recipe) { + public TradeMaxUses(TradeTag recipe) { this.recipe = recipe; } @@ -51,9 +51,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) - // @mechanism dTrade.max_uses + // @mechanism TradeTag.max_uses // @description // Returns the maximum amount of times that the trade can be used. // --> @@ -67,7 +67,7 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dTrade + // @object TradeTag // @name max_uses // @input Element(Number) // @description diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/trade/TradeResult.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/trade/TradeResult.java index 9b11ae6498..5f14b522e1 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/trade/TradeResult.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/trade/TradeResult.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.objects.properties.trade; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dTrade; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.TradeTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.objects.properties.Property; @@ -12,14 +12,14 @@ public class TradeResult implements Property { public static boolean describes(ObjectTag recipe) { - return recipe instanceof dTrade; + return recipe instanceof TradeTag; } public static TradeResult getFrom(ObjectTag recipe) { if (!describes(recipe)) { return null; } - return new TradeResult((dTrade) recipe); + return new TradeResult((TradeTag) recipe); } public static final String[] handledTags = new String[] { @@ -30,9 +30,9 @@ public static TradeResult getFrom(ObjectTag recipe) { "result" }; - private dTrade recipe; + private TradeTag recipe; - public TradeResult(dTrade recipe) { + public TradeResult(TradeTag recipe) { this.recipe = recipe; } @@ -40,7 +40,7 @@ public String getPropertyString() { if (recipe.getRecipe() == null) { return null; } - return (new dItem(recipe.getRecipe().getResult())).identify(); + return (new ItemTag(recipe.getRecipe().getResult())).identify(); } public String getPropertyId() { @@ -53,14 +53,14 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute - // @returns dItem - // @mechanism dTrade.result + // @attribute + // @returns ItemTag + // @mechanism TradeTag.result // @description // Returns what the trade will give the player. // --> if (attribute.startsWith("result")) { - return new dItem(recipe.getRecipe().getResult()).getAttribute(attribute.fulfill(1)); + return new ItemTag(recipe.getRecipe().getResult()).getAttribute(attribute.fulfill(1)); } return null; @@ -69,16 +69,16 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dTrade + // @object TradeTag // @name result - // @input dItem + // @input ItemTag // @description // Sets what the trade will give the player. // @tags - // + // // --> - if (mechanism.matches("result") && mechanism.requireObject(dItem.class)) { - ItemStack item = mechanism.valueAsType(dItem.class).getItemStack(); + if (mechanism.matches("result") && mechanism.requireObject(ItemTag.class)) { + ItemStack item = mechanism.valueAsType(ItemTag.class).getItemStack(); MerchantRecipe oldRecipe = recipe.getRecipe(); MerchantRecipe newRecipe = new MerchantRecipe(item, oldRecipe.getUses(), oldRecipe.getMaxUses(), oldRecipe.hasExperienceReward()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/trade/TradeUses.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/trade/TradeUses.java index ec963b1e1d..9a7c420ee2 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/trade/TradeUses.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/trade/TradeUses.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.objects.properties.trade; -import com.denizenscript.denizen.objects.dTrade; +import com.denizenscript.denizen.objects.TradeTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.objects.ObjectTag; @@ -10,14 +10,14 @@ public class TradeUses implements Property { public static boolean describes(ObjectTag recipe) { - return recipe instanceof dTrade; + return recipe instanceof TradeTag; } public static TradeUses getFrom(ObjectTag recipe) { if (!describes(recipe)) { return null; } - return new TradeUses((dTrade) recipe); + return new TradeUses((TradeTag) recipe); } public static final String[] handledTags = new String[] { @@ -28,9 +28,9 @@ public static TradeUses getFrom(ObjectTag recipe) { "uses" }; - private dTrade recipe; + private TradeTag recipe; - public TradeUses(dTrade recipe) { + public TradeUses(TradeTag recipe) { this.recipe = recipe; } @@ -51,9 +51,9 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) - // @mechanism dTrade.uses + // @mechanism TradeTag.uses // @description // Returns how many times the trade has been used. // --> @@ -67,13 +67,13 @@ public String getAttribute(Attribute attribute) { public void adjust(Mechanism mechanism) { // <--[mechanism] - // @object dTrade + // @object TradeTag // @name uses // @input Element(Number) // @description // Sets the amount of times the trade has been used. // @tags - // + // // --> if (mechanism.matches("uses") && mechanism.requireInteger()) { recipe.getRecipe().setUses(mechanism.getValue().asInt()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/core/CooldownCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/core/CooldownCommand.java index 7d07de94a2..8e4de0ef9e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/core/CooldownCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/core/CooldownCommand.java @@ -3,7 +3,7 @@ import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.DurationTag; @@ -29,7 +29,7 @@ public class CooldownCommand extends AbstractCommand { // requirements check allowing the next highest priority script to trigger. If any other type of script, a // manual requirements check () will also return false until the cooldown // period is completed. Cooldown requires a type (player or global), a script, and a duration. It also requires - // a valid link to a dPlayer if using player-type cooldown. + // a valid link to a PlayerTag if using player-type cooldown. // // Cooldown periods are persistent through a server restart as they are saved in the saves.yml. // @@ -70,7 +70,7 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException scriptEntry.addObject("type", Type.valueOf(arg.getValue().toUpperCase())); } - // Duration does not need a prefix, but is required. + // DurationTag does not need a prefix, but is required. else if (!scriptEntry.hasObject("duration") && arg.matchesArgumentType(DurationTag.class)) { scriptEntry.addObject("duration", arg.asType(DurationTag.class)); @@ -138,9 +138,9 @@ public void execute(ScriptEntry scriptEntry) { * * @param player the Player to check, null if only checking Global. * @param scriptName the name of the script to check - * @return a Duration of the time remaining + * @return a DurationTag of the time remaining */ - public static DurationTag getCooldownDuration(dPlayer player, String scriptName) { + public static DurationTag getCooldownDuration(PlayerTag player, String scriptName) { // Change to UPPERCASE so there's no case-sensitivity. scriptName = scriptName.toUpperCase(); @@ -189,7 +189,7 @@ public static DurationTag getCooldownDuration(dPlayer player, String scriptName) * @param scriptName the name of the script to check * @return true if the script is cool */ - public static boolean checkCooldown(dPlayer player, String scriptName) { + public static boolean checkCooldown(PlayerTag player, String scriptName) { // Change to UPPERCASE so there's no case-sensitivity. scriptName = scriptName.toUpperCase(); @@ -234,7 +234,7 @@ public static boolean checkCooldown(dPlayer player, String scriptName) { * @param scriptName the name of the script to cooldown * @param global whether the script should be cooled down globally */ - public static void setCooldown(dPlayer player, DurationTag duration, String scriptName, boolean global) { + public static void setCooldown(PlayerTag player, DurationTag duration, String scriptName, boolean global) { scriptName = scriptName.toUpperCase(); // Set global cooldown if (global) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/core/FlagCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/core/FlagCommand.java index d23938c933..c32cdbe988 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/core/FlagCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/core/FlagCommand.java @@ -5,9 +5,9 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.flags.FlagManager; import com.denizenscript.denizen.flags.FlagManager.Flag; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.DenizenCore; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.*; @@ -45,15 +45,15 @@ public class FlagCommand extends AbstractCommand implements Listener { // // // @Tags - // ]> - // ]> - // ]> - // ]> - // ]> - // ]> - // ]> - // ]> - // ]> + // ]> + // ]> + // ]> + // ]> + // ]> + // ]> + // ]> + // ]> + // ]> // ]> // ]> // ]> @@ -136,37 +136,37 @@ else if (!scriptEntry.hasObject("flag_target") scriptEntry.addObject("flag_target", Utilities.getEntryPlayer(scriptEntry)); } - // Allow a p@player or n@npc entity to specify the target to be flagged. + // Allow a PlayerTag or NPCTag entity to specify the target to be flagged. // Don't check if the player/npc is valid until after the argument // is being processed to make sure the objects don't accidentally get set // as the name of the flag.. else if (!scriptEntry.hasObject("flag_target") && arg.startsWith("n@") && !arg.hasPrefix()) { - if (dNPC.valueOf(arg.getValue()) == null) // TODO: Optimize + if (NPCTag.valueOf(arg.getValue()) == null) // TODO: Optimize { throw new InvalidArgumentsException("Invalid NPC target."); } specified_target = true; - scriptEntry.addObject("flag_target", arg.asType(dNPC.class)); + scriptEntry.addObject("flag_target", arg.asType(NPCTag.class)); } else if (!scriptEntry.hasObject("flag_target") && arg.startsWith("p@") && !arg.hasPrefix()) { - if (dPlayer.valueOf(arg.getValue()) == null) // TODO: Optimize + if (PlayerTag.valueOf(arg.getValue()) == null) // TODO: Optimize { throw new InvalidArgumentsException("Invalid Player target."); } specified_target = true; - scriptEntry.addObject("flag_target", arg.asType(dPlayer.class)); + scriptEntry.addObject("flag_target", arg.asType(PlayerTag.class)); } else if (!scriptEntry.hasObject("flag_target") && !arg.hasPrefix()) { - if (dEntity.valueOf(arg.getValue()) == null) // TODO: Optimize + if (EntityTag.valueOf(arg.getValue()) == null) // TODO: Optimize { throw new InvalidArgumentsException("Invalid Entity target."); } specified_target = true; - scriptEntry.addObject("flag_target", arg.asType(dEntity.class)); + scriptEntry.addObject("flag_target", arg.asType(EntityTag.class)); } @@ -305,14 +305,14 @@ public void execute(ScriptEntry scriptEntry) { if (flag_target instanceof ElementTag) { flag = DenizenAPI.getCurrentInstance().flagManager().getGlobalFlag(name.asString()); } - else if (flag_target instanceof dPlayer) { - flag = DenizenAPI.getCurrentInstance().flagManager().getPlayerFlag((dPlayer) flag_target, name.asString()); + else if (flag_target instanceof PlayerTag) { + flag = DenizenAPI.getCurrentInstance().flagManager().getPlayerFlag((PlayerTag) flag_target, name.asString()); } - else if (flag_target instanceof dNPC) { - flag = DenizenAPI.getCurrentInstance().flagManager().getNPCFlag(((dNPC) flag_target).getId(), name.asString()); + else if (flag_target instanceof NPCTag) { + flag = DenizenAPI.getCurrentInstance().flagManager().getNPCFlag(((NPCTag) flag_target).getId(), name.asString()); } - else if (flag_target instanceof dEntity) { - flag = DenizenAPI.getCurrentInstance().flagManager().getEntityFlag((dEntity) flag_target, name.asString()); + else if (flag_target instanceof EntityTag) { + flag = DenizenAPI.getCurrentInstance().flagManager().getEntityFlag((EntityTag) flag_target, name.asString()); } else { Debug.echoError("Could not fetch a flag for this entity: " + flag_target.debug()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/core/NoteCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/core/NoteCommand.java index df1b6f26b9..ab3d414adf 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/core/NoteCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/core/NoteCommand.java @@ -27,10 +27,10 @@ public class NoteCommand extends AbstractCommand { // // @Tags // ]> - // - // - // - // + // + // + // + // // // @Usage // Use to add a notable cuboid. diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/core/ResetCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/core/ResetCommand.java index f87b36e0a6..a76953acd2 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/core/ResetCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/core/ResetCommand.java @@ -4,7 +4,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizencore.objects.*; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.core.DurationTag; import com.denizenscript.denizencore.objects.core.ListTag; @@ -52,7 +52,7 @@ else if (arg.matches("saves") && !scriptEntry.hasObject("type")) { else if (arg.matchesArgumentType(ScriptTag.class)) { scriptEntry.addObject("script", arg.asType(ScriptTag.class)); } - else if (arg.matchesArgumentList(dPlayer.class)) { + else if (arg.matchesArgumentList(PlayerTag.class)) { scriptEntry.addObject("players", arg.asType(ListTag.class)); } // TODO: Reset NPCs option too! @@ -79,7 +79,7 @@ public void execute(ScriptEntry scriptEntry) { // We allow players to be a single player or multiple players ObjectTag player = scriptEntry.getdObject("players"); ListTag players; - if (player instanceof dPlayer) { + if (player instanceof PlayerTag) { players = new ListTag(player.identify()); } else { @@ -107,7 +107,7 @@ public void execute(ScriptEntry scriptEntry) { // Now deal with the rest for (String object : players) { - dPlayer resettable = dPlayer.valueOf(object); + PlayerTag resettable = PlayerTag.valueOf(object); if (resettable.isValid()) { switch (type) { 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 257eab2175..661fe1b313 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 @@ -1,7 +1,7 @@ package com.denizenscript.denizen.scripts.commands.entity; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.objects.properties.entity.EntityAge; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; @@ -31,7 +31,7 @@ public class AgeCommand extends AbstractCommand { // specified. // // @Tags - // + // // // @Usage // Use to make an ageable entity a permanant baby. @@ -56,8 +56,8 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("entities") - && arg.matchesArgumentList(dEntity.class)) { - scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(dEntity.class, scriptEntry)); + && arg.matchesArgumentList(EntityTag.class)) { + scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(EntityTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("agetype") && arg.matchesEnum(AgeType.values())) { @@ -91,7 +91,7 @@ else if (!scriptEntry.hasObject("lock") public void execute(final ScriptEntry scriptEntry) { // Get objects - List entities = (List) scriptEntry.getObject("entities"); + List entities = (List) scriptEntry.getObject("entities"); AgeType ageType = (AgeType) scriptEntry.getObject("agetype"); int age = scriptEntry.getElement("age").asInt(); boolean lock = scriptEntry.hasObject("lock"); @@ -105,7 +105,7 @@ public void execute(final ScriptEntry scriptEntry) { } // Go through all the entities and set their ages - for (dEntity entity : entities) { + for (EntityTag entity : entities) { if (entity.isSpawned()) { // Check if entity specified can be described by 'EntityAge' diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/AnimateCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/AnimateCommand.java index 5b95bcce4c..cdbcb88b66 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/AnimateCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/AnimateCommand.java @@ -4,7 +4,7 @@ import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.abstracts.AnimationHelper; import com.denizenscript.denizen.nms.interfaces.EntityAnimation; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.ArgumentHelper; @@ -63,9 +63,9 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("entities") - && arg.matchesArgumentList(dEntity.class)) { + && arg.matchesArgumentList(EntityTag.class)) { // Entity arg - scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(dEntity.class, scriptEntry)); + scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(EntityTag.class, scriptEntry)); } if (!scriptEntry.hasObject("animation") && @@ -100,7 +100,7 @@ else if (animationHelper.hasEntityAnimation(arg.getValue())) { public void execute(final ScriptEntry scriptEntry) { // Get objects - List entities = (List) scriptEntry.getObject("entities"); + List entities = (List) scriptEntry.getObject("entities"); PlayerAnimation animation = scriptEntry.hasObject("animation") ? (PlayerAnimation) scriptEntry.getObject("animation") : null; EntityEffect effect = scriptEntry.hasObject("effect") ? @@ -118,7 +118,7 @@ public void execute(final ScriptEntry scriptEntry) { } // Go through all the entities and animate them - for (dEntity entity : entities) { + for (EntityTag entity : entities) { if (entity.isSpawned()) { try { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/AttackCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/AttackCommand.java index c95a770526..82a7dd5bc4 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/AttackCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/AttackCommand.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.ArgumentHelper; @@ -34,9 +34,9 @@ public class AttackCommand extends AbstractCommand { // To cancel an attack, use the 'cancel' argument instead of specifying a target. // // @Tags - // - // - // + // + // + // // // @Usage // Use to make an NPC attack a player in an interact script. @@ -66,15 +66,15 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException scriptEntry.addObject("cancel", "true"); } else if (!scriptEntry.hasObject("target") - && arg.matchesArgumentType(dEntity.class) + && arg.matchesArgumentType(EntityTag.class) && arg.matchesPrefix("target", "t")) { // Single entity arg - scriptEntry.addObject("target", arg.asType(dEntity.class)); + scriptEntry.addObject("target", arg.asType(EntityTag.class)); } else if (!scriptEntry.hasObject("entities") - && arg.matchesArgumentList(dEntity.class) + && arg.matchesArgumentList(EntityTag.class) && !arg.matchesPrefix("target", "t")) { - scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(dEntity.class, scriptEntry)); + scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(EntityTag.class, scriptEntry)); } else { arg.reportUnhandled(); @@ -105,8 +105,8 @@ else if (!scriptEntry.hasObject("entities") public void execute(final ScriptEntry scriptEntry) { // Get objects - List entities = (List) scriptEntry.getObject("entities"); - dEntity target = (dEntity) scriptEntry.getObject("target"); + List entities = (List) scriptEntry.getObject("entities"); + EntityTag target = (EntityTag) scriptEntry.getObject("target"); boolean cancel = scriptEntry.hasObject("cancel"); // Report to dB @@ -119,7 +119,7 @@ public void execute(final ScriptEntry scriptEntry) { // Go through all the entities and make them either attack // the target or stop attacking - for (dEntity entity : entities) { + for (EntityTag entity : entities) { if (entity.isCitizensNPC()) { Navigator nav = entity.getDenizenNPC().getCitizen().getNavigator(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/BurnCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/BurnCommand.java index 298ed71301..03e39feb2b 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/BurnCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/BurnCommand.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.DurationTag; @@ -31,7 +31,7 @@ public class BurnCommand extends AbstractCommand { // in a 5 second burn. // // @Tags - // + // // // @Usage // Use to set an entity on fire. @@ -48,9 +48,9 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("entities") - && arg.matchesArgumentList(dEntity.class)) { + && arg.matchesArgumentList(EntityTag.class)) { - scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(dEntity.class, scriptEntry)); + scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(EntityTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("duration") && arg.matchesArgumentType(DurationTag.class)) { @@ -76,7 +76,7 @@ else if (!scriptEntry.hasObject("duration") public void execute(final ScriptEntry scriptEntry) { // Get objects - List entities = (List) scriptEntry.getObject("entities"); + List entities = (List) scriptEntry.getObject("entities"); DurationTag duration = (DurationTag) scriptEntry.getObject("duration"); // Report to dB @@ -86,7 +86,7 @@ public void execute(final ScriptEntry scriptEntry) { } // Go through all the entities and set them on fire - for (dEntity entity : entities) { + for (EntityTag entity : entities) { if (entity.isSpawned()) { entity.getBukkitEntity().setFireTicks(duration.getTicksAsInt()); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/CastCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/CastCommand.java index 15a859e6e2..bb9c63c5b8 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/CastCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/CastCommand.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.*; import com.denizenscript.denizencore.objects.core.DurationTag; @@ -39,7 +39,7 @@ public class CastCommand extends AbstractCommand { // Optionally, specify "hide_particles" to remove the particle effects entirely. // // @Tags - // ]> + // ]> // // // @Usage @@ -86,8 +86,8 @@ else if (!scriptEntry.hasObject("effect") scriptEntry.addObject("effect", PotionEffectType.getByName(arg.asElement().asString())); } else if (!scriptEntry.hasObject("entities") - && arg.matchesArgumentList(dEntity.class)) { - scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(dEntity.class, scriptEntry)); + && arg.matchesArgumentList(EntityTag.class)) { + scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(EntityTag.class, scriptEntry)); } else { @@ -118,7 +118,7 @@ else if (!scriptEntry.hasObject("entities") @Override public void execute(ScriptEntry scriptEntry) { // Fetch objects - List entities = (List) scriptEntry.getObject("entities"); + List entities = (List) scriptEntry.getObject("entities"); PotionEffectType effect = (PotionEffectType) scriptEntry.getObject("effect"); int amplifier = scriptEntry.getElement("amplifier").asInt(); DurationTag duration = (DurationTag) scriptEntry.getObject("duration"); @@ -141,7 +141,7 @@ public void execute(ScriptEntry scriptEntry) { boolean showP = showParticles.asBoolean(); // Apply the PotionEffect to the targets! - for (dEntity entity : entities) { + for (EntityTag entity : entities) { if (entity.getLivingEntity().hasPotionEffect(effect)) { entity.getLivingEntity().removePotionEffect(effect); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/EquipCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/EquipCommand.java index f6fe55c2f1..237224f0a3 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/EquipCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/EquipCommand.java @@ -3,9 +3,9 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.nms.NMSHandler; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dNPC; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.NPCTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.ArgumentHelper; @@ -38,12 +38,12 @@ public class EquipCommand extends AbstractCommand { // Set the item to 'i@air' to unequip any slot. // // @Tags - // - // - // - // - // - // + // + // + // + // + // + // // // @Usage // Use to equip a stone block on the player's head. @@ -69,48 +69,48 @@ public class EquipCommand extends AbstractCommand { @Override public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException { - Map equipment = new HashMap<>(); + Map equipment = new HashMap<>(); // Initialize necessary fields for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("entities") - && arg.matchesArgumentList(dEntity.class)) { + && arg.matchesArgumentList(EntityTag.class)) { - scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(dEntity.class, scriptEntry)); + scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(EntityTag.class, scriptEntry)); } - else if (arg.matchesArgumentType(dItem.class) + else if (arg.matchesArgumentType(ItemTag.class) && arg.matchesPrefix("head", "helmet")) { - equipment.put("head", dItem.valueOf(arg.getValue(), scriptEntry.entryData.getTagContext())); + equipment.put("head", ItemTag.valueOf(arg.getValue(), scriptEntry.entryData.getTagContext())); } - else if (arg.matchesArgumentType(dItem.class) + else if (arg.matchesArgumentType(ItemTag.class) && arg.matchesPrefix("chest", "chestplate")) { - equipment.put("chest", dItem.valueOf(arg.getValue(), scriptEntry.entryData.getTagContext())); + equipment.put("chest", ItemTag.valueOf(arg.getValue(), scriptEntry.entryData.getTagContext())); } - else if (arg.matchesArgumentType(dItem.class) + else if (arg.matchesArgumentType(ItemTag.class) && arg.matchesPrefix("legs", "leggings")) { - equipment.put("legs", dItem.valueOf(arg.getValue(), scriptEntry.entryData.getTagContext())); + equipment.put("legs", ItemTag.valueOf(arg.getValue(), scriptEntry.entryData.getTagContext())); } - else if (arg.matchesArgumentType(dItem.class) + else if (arg.matchesArgumentType(ItemTag.class) && arg.matchesPrefix("boots", "feet")) { - equipment.put("boots", dItem.valueOf(arg.getValue(), scriptEntry.entryData.getTagContext())); + equipment.put("boots", ItemTag.valueOf(arg.getValue(), scriptEntry.entryData.getTagContext())); } - else if (arg.matchesArgumentType(dItem.class) + else if (arg.matchesArgumentType(ItemTag.class) && arg.matchesPrefix("saddle")) { - equipment.put("saddle", dItem.valueOf(arg.getValue(), scriptEntry.entryData.getTagContext())); + equipment.put("saddle", ItemTag.valueOf(arg.getValue(), scriptEntry.entryData.getTagContext())); } - else if (arg.matchesArgumentType(dItem.class) + else if (arg.matchesArgumentType(ItemTag.class) && arg.matchesPrefix("horse_armor", "horse_armour")) { - equipment.put("horse_armor", dItem.valueOf(arg.getValue(), scriptEntry.entryData.getTagContext())); + equipment.put("horse_armor", ItemTag.valueOf(arg.getValue(), scriptEntry.entryData.getTagContext())); } - else if (arg.matchesArgumentType(dItem.class) + else if (arg.matchesArgumentType(ItemTag.class) && arg.matchesPrefix("offhand")) { - equipment.put("offhand", dItem.valueOf(arg.getValue(), scriptEntry.entryData.getTagContext())); + equipment.put("offhand", ItemTag.valueOf(arg.getValue(), scriptEntry.entryData.getTagContext())); } // Default to item in hand if no prefix is used - else if (arg.matchesArgumentType(dItem.class)) { - equipment.put("hand", dItem.valueOf(arg.getValue(), scriptEntry.entryData.getTagContext())); + else if (arg.matchesArgumentType(ItemTag.class)) { + equipment.put("hand", ItemTag.valueOf(arg.getValue(), scriptEntry.entryData.getTagContext())); } else if (arg.matches("player") && Utilities.entryHasPlayer(scriptEntry)) { // Player arg for compatibility with old scripts @@ -138,8 +138,8 @@ else if (arg.matches("player") && Utilities.entryHasPlayer(scriptEntry)) { @Override public void execute(ScriptEntry scriptEntry) { - Map equipment = (Map) scriptEntry.getObject("equipment"); - List entities = (List) scriptEntry.getObject("entities"); + Map equipment = (Map) scriptEntry.getObject("equipment"); + List entities = (List) scriptEntry.getObject("entities"); // Report to dB if (scriptEntry.dbCallShouldDebug()) { @@ -147,14 +147,14 @@ public void execute(ScriptEntry scriptEntry) { ArgumentHelper.debugObj("equipment", equipment.toString())); } - for (dEntity entity : entities) { + for (EntityTag entity : entities) { if (entity.isGeneric()) { Debug.echoError(scriptEntry.getResidingQueue(), "Cannot equip generic entity " + entity.identify() + "!"); } else if (entity.isCitizensNPC()) { - dNPC npc = entity.getDenizenNPC(); + NPCTag npc = entity.getDenizenNPC(); if (npc != null) { @@ -194,7 +194,7 @@ else if (entity.isCitizensNPC()) { } else if (livingEntity.getType() == EntityType.PIG) { if (equipment.get("saddle") != null) { - dItem saddle = equipment.get("saddle"); + ItemTag saddle = equipment.get("saddle"); if (saddle.getItemStack().getType() == Material.SADDLE) { ((Pig) livingEntity).setSaddle(true); } @@ -223,7 +223,7 @@ else if (livingEntity.getType() == EntityType.PIG) { } else if (livingEntity.getType() == EntityType.PIG) { if (equipment.get("saddle") != null) { - dItem saddle = equipment.get("saddle"); + ItemTag saddle = equipment.get("saddle"); if (saddle.getItemStack().getType() == Material.SADDLE) { ((Pig) livingEntity).setSaddle(true); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/FeedCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/FeedCommand.java index 1ee90f5ebc..b6d7e69218 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/FeedCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/FeedCommand.java @@ -4,8 +4,8 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.utilities.depends.Depends; import com.denizenscript.denizen.npc.traits.HungerTrait; -import com.denizenscript.denizen.objects.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -29,8 +29,8 @@ public class FeedCommand extends AbstractCommand { // NOTE: This command is outdated and bound to be updated. // // @Tags - // - // + // + // // // @Usage // Use to feed the player for 5 foodpoints or 2.5 bars. @@ -49,15 +49,15 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException && !scriptEntry.hasObject("amount")) { scriptEntry.addObject("amount", arg.asElement()); } - else if (arg.matchesArgumentType(dPlayer.class) + else if (arg.matchesArgumentType(PlayerTag.class) && !scriptEntry.hasObject("targetplayer") && !scriptEntry.hasObject("targetnpc")) { - scriptEntry.addObject("targetplayer", arg.asType(dPlayer.class)); + scriptEntry.addObject("targetplayer", arg.asType(PlayerTag.class)); } - else if (Depends.citizens != null && arg.matchesArgumentType(dNPC.class) + else if (Depends.citizens != null && arg.matchesArgumentType(NPCTag.class) && !scriptEntry.hasObject("targetplayer") && !scriptEntry.hasObject("targetnpc")) { - scriptEntry.addObject("targetnpc", arg.asType(dNPC.class)); + scriptEntry.addObject("targetnpc", arg.asType(NPCTag.class)); } // Backwards compatibility @@ -100,8 +100,8 @@ else if (Utilities.entryHasNPC(scriptEntry)) { @Override public void execute(ScriptEntry scriptEntry) { - dPlayer player = (dPlayer) scriptEntry.getObject("targetplayer"); - dNPC npc = (dNPC) scriptEntry.getObject("targetnpc"); + PlayerTag player = (PlayerTag) scriptEntry.getObject("targetplayer"); + NPCTag npc = (NPCTag) scriptEntry.getObject("targetnpc"); ElementTag amount = scriptEntry.getElement("amount"); if (scriptEntry.dbCallShouldDebug()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/FlyCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/FlyCommand.java index ccb0b38234..4e66469438 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/FlyCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/FlyCommand.java @@ -6,9 +6,9 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.utilities.entity.Position; import com.denizenscript.denizen.nms.NMSHandler; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -38,9 +38,9 @@ public class FlyCommand extends AbstractCommand { // TODO: Document Command Details // // @Tags - // - // - // + // + // + // // // @Usage // TODO: Document Command Details @@ -61,24 +61,24 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException else if (!scriptEntry.hasObject("destinations") && arg.matchesPrefix("destination", "destinations", "d")) { - scriptEntry.addObject("destinations", arg.asType(ListTag.class).filter(dLocation.class, scriptEntry)); + scriptEntry.addObject("destinations", arg.asType(ListTag.class).filter(LocationTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("controller") - && arg.matchesArgumentType(dPlayer.class) + && arg.matchesArgumentType(PlayerTag.class) && arg.matchesPrefix("controller", "c")) { - // Check if it matches a dPlayer, but save it as a dEntity - scriptEntry.addObject("controller", (arg.asType(dEntity.class))); + // Check if it matches a PlayerTag, but save it as a EntityTag + scriptEntry.addObject("controller", (arg.asType(EntityTag.class))); } else if (!scriptEntry.hasObject("origin") - && arg.matchesArgumentType(dLocation.class)) { + && arg.matchesArgumentType(LocationTag.class)) { - scriptEntry.addObject("origin", arg.asType(dLocation.class)); + scriptEntry.addObject("origin", arg.asType(LocationTag.class)); } else if (!scriptEntry.hasObject("entities") - && arg.matchesArgumentList(dEntity.class)) { + && arg.matchesArgumentList(EntityTag.class)) { - scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(dEntity.class, scriptEntry)); + scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(EntityTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("rotationthreshold") && arg.matchesPrefix("rotationthreshold", "rotation", "r") @@ -119,16 +119,16 @@ else if (!scriptEntry.hasObject("speed") public void execute(final ScriptEntry scriptEntry) { // Get objects - dLocation origin = (dLocation) scriptEntry.getObject("origin"); - List entities = (List) scriptEntry.getObject("entities"); - final List destinations = scriptEntry.hasObject("destinations") ? - (List) scriptEntry.getObject("destinations") : + LocationTag origin = (LocationTag) scriptEntry.getObject("origin"); + List entities = (List) scriptEntry.getObject("entities"); + final List destinations = scriptEntry.hasObject("destinations") ? + (List) scriptEntry.getObject("destinations") : new ArrayList<>(); // Set freeflight to true only if there are no destinations final boolean freeflight = destinations.size() < 1; - dEntity controller = (dEntity) scriptEntry.getObject("controller"); + EntityTag controller = (EntityTag) scriptEntry.getObject("controller"); // If freeflight is on, we need to do some checks if (freeflight) { @@ -136,7 +136,7 @@ public void execute(final ScriptEntry scriptEntry) { // If no controller was set, we need someone to control the // flying entities, so try to find a player in the entity list if (controller == null) { - for (dEntity entity : entities) { + for (EntityTag entity : entities) { if (entity.isPlayer()) { // If this player will be a rider on something, and will not // be at the bottom ridden by the other entities, set it as @@ -165,7 +165,7 @@ public void execute(final ScriptEntry scriptEntry) { else { boolean found = false; - for (dEntity entity : entities) { + for (EntityTag entity : entities) { if (entity.identify().equals(controller.identify())) { found = true; break; @@ -201,7 +201,7 @@ public void execute(final ScriptEntry scriptEntry) { if (!cancel) { // Go through all the entities, spawning/teleporting them - for (dEntity entity : entities) { + for (EntityTag entity : entities) { entity.spawnAt(origin); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/FollowCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/FollowCommand.java index 6b057d83c6..ded7524be9 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/FollowCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/FollowCommand.java @@ -3,8 +3,8 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.nms.NMSHandler; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dNPC; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.NPCTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -27,7 +27,7 @@ public class FollowCommand extends AbstractCommand { // The 'max' and 'allow_wander' arguments can only be used on non-NPC entities. // // @Tags - // returns the entity the npc is following. + // returns the entity the npc is following. // // @Usage // To make an NPC follow the player in an interact script @@ -65,12 +65,12 @@ else if (!scriptEntry.hasObject("speed") && } else if (!scriptEntry.hasObject("entities") && arg.matchesPrefix("followers", "follower") && - arg.matchesArgumentList(dEntity.class)) { + arg.matchesArgumentList(EntityTag.class)) { scriptEntry.addObject("entities", arg.asType(ListTag.class)); } else if (!scriptEntry.hasObject("target") && - arg.matchesArgumentType(dEntity.class)) { - scriptEntry.addObject("target", arg.asType(dEntity.class)); + arg.matchesArgumentType(EntityTag.class)) { + scriptEntry.addObject("target", arg.asType(EntityTag.class)); } else { arg.reportUnhandled(); @@ -106,7 +106,7 @@ public void execute(ScriptEntry scriptEntry) { ElementTag allowWander = scriptEntry.getElement("allow_wander"); ElementTag speed = scriptEntry.getElement("speed"); ListTag entities = scriptEntry.getdObject("entities"); - dEntity target = scriptEntry.getdObject("target"); + EntityTag target = scriptEntry.getdObject("target"); // Report to dB if (scriptEntry.dbCallShouldDebug()) { @@ -120,9 +120,9 @@ public void execute(ScriptEntry scriptEntry) { + target.debug()); } - for (dEntity entity : entities.filter(dEntity.class, scriptEntry)) { + for (EntityTag entity : entities.filter(EntityTag.class, scriptEntry)) { if (entity.isCitizensNPC()) { - dNPC npc = entity.getDenizenNPC(); + NPCTag npc = entity.getDenizenNPC(); if (lead != null) { npc.getNavigator().getLocalParameters().distanceMargin(lead.asDouble()); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HeadCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HeadCommand.java index 4235666e84..c22945853f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HeadCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HeadCommand.java @@ -3,8 +3,8 @@ import com.denizenscript.denizen.utilities.MaterialCompat; import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -34,8 +34,8 @@ public class HeadCommand extends AbstractCommand { // to the player attached to the script queue. It accepts a single entity or list of entities. // // @Tags - // - // + // + // // // @Usage // Use to stick an awesome head on your head with the head command. @@ -56,9 +56,9 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("material") - && arg.matchesArgumentType(dMaterial.class) + && arg.matchesArgumentType(MaterialTag.class) && !arg.matchesPrefix("skin", "s")) { - scriptEntry.addObject("material", arg.asType(dMaterial.class)); + scriptEntry.addObject("material", arg.asType(MaterialTag.class)); } else if (!scriptEntry.hasObject("skin") && (arg.matchesPrefix("skin", "s"))) { @@ -70,8 +70,8 @@ else if (!scriptEntry.hasObject("entities") scriptEntry.addObject("entities", Arrays.asList(Utilities.getEntryPlayer(scriptEntry).getDenizenEntity())); } else if (!scriptEntry.hasObject("entities") - && arg.matchesArgumentList(dEntity.class)) { - scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(dEntity.class, scriptEntry)); + && arg.matchesArgumentList(EntityTag.class)) { + scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(EntityTag.class, scriptEntry)); } else { arg.reportUnhandled(); @@ -92,9 +92,9 @@ else if (!scriptEntry.hasObject("entities") @Override public void execute(ScriptEntry scriptEntry) { - List entities = (List) scriptEntry.getObject("entities"); + List entities = (List) scriptEntry.getObject("entities"); ElementTag skin = scriptEntry.getElement("skin"); - dMaterial material = scriptEntry.getdObject("material"); + MaterialTag material = scriptEntry.getdObject("material"); // Report to dB if (scriptEntry.dbCallShouldDebug()) { @@ -119,7 +119,7 @@ else if (material != null) { // Loop through entities, apply the item/skin - for (dEntity entity : entities) { + for (EntityTag entity : entities) { if (entity.isCitizensNPC()) { if (!entity.getDenizenNPC().getCitizen().hasTrait(Equipment.class)) { entity.getDenizenNPC().getCitizen().addTrait(Equipment.class); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HealCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HealCommand.java index 5ec5916f99..c702e9fb19 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HealCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HealCommand.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -29,7 +29,7 @@ public class HealCommand extends AbstractCommand { // heal the specified player(s)/entity(s) fully. // // @Tags - // + // // // @Usage // Use to fully heal a player. @@ -58,13 +58,13 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException else if (!scriptEntry.hasObject("entities") && arg.matchesArgumentType(ListTag.class)) { // Entity arg - scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(dEntity.class, scriptEntry)); + scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(EntityTag.class, scriptEntry)); specified_targets = true; } else if (!scriptEntry.hasObject("entities") - && arg.matchesArgumentType(dEntity.class)) { + && arg.matchesArgumentType(EntityTag.class)) { // Entity arg - scriptEntry.addObject("entities", Arrays.asList(arg.asType(dEntity.class))); + scriptEntry.addObject("entities", Arrays.asList(arg.asType(EntityTag.class))); specified_targets = true; } else { @@ -77,7 +77,7 @@ else if (!scriptEntry.hasObject("entities") } if (!specified_targets) { - List entities = new ArrayList<>(); + List entities = new ArrayList<>(); if (Utilities.getEntryPlayer(scriptEntry) != null) { entities.add(Utilities.getEntryPlayer(scriptEntry).getDenizenEntity()); } @@ -96,7 +96,7 @@ else if (Utilities.getEntryNPC(scriptEntry) != null) { @Override public void execute(ScriptEntry scriptEntry) { - List entities = (List) scriptEntry.getObject("entities"); + List entities = (List) scriptEntry.getObject("entities"); if (entities == null) { return; } @@ -108,7 +108,7 @@ public void execute(ScriptEntry scriptEntry) { } if (amountelement.asDouble() == -1) { - for (dEntity entity : entities) { + for (EntityTag entity : entities) { if (entity.isLivingEntity()) { entity.getLivingEntity().setHealth(entity.getLivingEntity().getMaxHealth()); } @@ -116,7 +116,7 @@ public void execute(ScriptEntry scriptEntry) { } else { double amount = amountelement.asDouble(); - for (dEntity entity : entities) { + for (EntityTag entity : entities) { if (entity.getLivingEntity().getHealth() + amount < entity.getLivingEntity().getMaxHealth()) { entity.getLivingEntity().setHealth(entity.getLivingEntity().getHealth() + amount); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HealthCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HealthCommand.java index 1c95b4cda3..52b1a85a81 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HealthCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HealthCommand.java @@ -3,7 +3,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.npc.traits.HealthTrait; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -35,8 +35,8 @@ public class HealthCommand extends AbstractCommand { // explained above. // // @Tags - // - // + // + // // // @Usage // Use to set the NPC's maximum health to 50. @@ -74,8 +74,8 @@ else if (!scriptEntry.hasObject("qty") scriptEntry.addObject("qty", arg.asElement()); } else if (!scriptEntry.hasObject("target") - && arg.matchesArgumentList(dEntity.class)) { - scriptEntry.addObject("target", arg.asType(ListTag.class).filter(dEntity.class, scriptEntry)); + && arg.matchesArgumentList(EntityTag.class)) { + scriptEntry.addObject("target", arg.asType(ListTag.class).filter(EntityTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("action") && arg.matchesPrefix("state")) { @@ -107,7 +107,7 @@ public void execute(ScriptEntry scriptEntry) { ElementTag qty = scriptEntry.getElement("qty"); ElementTag action = scriptEntry.getElement("action"); - List targets = (List) scriptEntry.getObject("target"); + List targets = (List) scriptEntry.getObject("target"); if (scriptEntry.dbCallShouldDebug()) { @@ -125,7 +125,7 @@ public void execute(ScriptEntry scriptEntry) { action = new ElementTag(true); } - for (dEntity target : targets) { + for (EntityTag target : targets) { if (target.isCitizensNPC()) { if (action.asString().equalsIgnoreCase("true")) { target.getDenizenNPC().getCitizen().addTrait(HealthTrait.class); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HurtCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HurtCommand.java index 7e8de69bc1..9d9439be7a 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HurtCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HurtCommand.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -42,11 +42,11 @@ public class HurtCommand extends AbstractCommand { // To make the source only be included in the initial damage event, and not the application of damage, specify 'source_once'. // // @Tags - // - // - // - // - // + // + // + // + // + // // // @Usage // Use to hurt the player for 1 HP. @@ -73,12 +73,12 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException } else if (!scriptEntry.hasObject("source") && arg.matchesPrefix("source", "s") - && arg.matchesArgumentType(dEntity.class)) { - scriptEntry.addObject("source", arg.asType(dEntity.class)); + && arg.matchesArgumentType(EntityTag.class)) { + scriptEntry.addObject("source", arg.asType(EntityTag.class)); } else if (!scriptEntry.hasObject("entities") - && arg.matchesArgumentList(dEntity.class)) { - scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(dEntity.class, scriptEntry)); + && arg.matchesArgumentList(EntityTag.class)) { + scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(EntityTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("cause") && arg.matchesEnum(EntityDamageEvent.DamageCause.values())) { @@ -98,7 +98,7 @@ else if (!scriptEntry.hasObject("source_once") } if (!scriptEntry.hasObject("entities")) { - List entities = new ArrayList<>(); + List entities = new ArrayList<>(); if (Utilities.getEntryPlayer(scriptEntry) != null) { entities.add(Utilities.getEntryPlayer(scriptEntry).getDenizenEntity()); } @@ -117,8 +117,8 @@ else if (Utilities.getEntryNPC(scriptEntry) != null) { @Override public void execute(ScriptEntry scriptEntry) { - List entities = (List) scriptEntry.getObject("entities"); - dEntity source = (dEntity) scriptEntry.getObject("source"); + List entities = (List) scriptEntry.getObject("entities"); + EntityTag source = (EntityTag) scriptEntry.getObject("source"); ElementTag amountElement = scriptEntry.getElement("amount"); ElementTag cause = scriptEntry.getElement("cause"); ElementTag source_once = scriptEntry.getElement("source_once"); @@ -134,7 +134,7 @@ public void execute(ScriptEntry scriptEntry) { } double amount = amountElement.asDouble(); - for (dEntity entity : entities) { + for (EntityTag entity : entities) { if (entity.getLivingEntity() == null) { Debug.echoDebug(scriptEntry, entity + " is not a living entity!"); continue; diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/InvisibleCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/InvisibleCommand.java index 0386288dbf..dd38e05850 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/InvisibleCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/InvisibleCommand.java @@ -3,7 +3,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.npc.traits.InvisibleTrait; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -66,8 +66,8 @@ else if (!scriptEntry.hasObject("target") scriptEntry.addObject("target", Utilities.getEntryNPC(scriptEntry).getDenizenEntity()); } else if (!scriptEntry.hasObject("target") - && arg.matchesArgumentType(dEntity.class)) { - scriptEntry.addObject("target", arg.asType(dEntity.class)); + && arg.matchesArgumentType(EntityTag.class)) { + scriptEntry.addObject("target", arg.asType(EntityTag.class)); } else { arg.reportUnhandled(); @@ -78,7 +78,7 @@ else if (!scriptEntry.hasObject("target") scriptEntry.addObject("state", new ElementTag("TRUE")); } - if (!scriptEntry.hasObject("target") || !((dEntity) scriptEntry.getdObject("target")).isValid()) { + if (!scriptEntry.hasObject("target") || !((EntityTag) scriptEntry.getdObject("target")).isValid()) { throw new InvalidArgumentsException("Must specify a valid target!"); } } @@ -87,7 +87,7 @@ else if (!scriptEntry.hasObject("target") public void execute(ScriptEntry scriptEntry) { // Get objects ElementTag state = scriptEntry.getElement("state"); - dEntity target = (dEntity) scriptEntry.getObject("target"); + EntityTag target = (EntityTag) scriptEntry.getObject("target"); // Report to dB if (scriptEntry.dbCallShouldDebug()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/LeashCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/LeashCommand.java index 07d1ce014a..42ec13391f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/LeashCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/LeashCommand.java @@ -3,8 +3,8 @@ import com.denizenscript.denizen.utilities.MaterialCompat; import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.ArgumentHelper; @@ -35,8 +35,8 @@ public class LeashCommand extends AbstractCommand { // Non-player NPCs can be leashed if '/npc leashable' is enabled. // // @Tags - // - // + // + // // // @Usage // Use to attach a leash to the player's target. @@ -61,17 +61,17 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException scriptEntry.addObject("cancel", ""); } else if (!scriptEntry.hasObject("entities") - && arg.matchesArgumentList(dEntity.class)) { - scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(dEntity.class, scriptEntry)); + && arg.matchesArgumentList(EntityTag.class)) { + scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(EntityTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("holder") && arg.matchesPrefix("holder", "h")) { - if (arg.matchesArgumentType(dEntity.class)) { - scriptEntry.addObject("holder", arg.asType(dEntity.class)); + if (arg.matchesArgumentType(EntityTag.class)) { + scriptEntry.addObject("holder", arg.asType(EntityTag.class)); } - else if (arg.matchesArgumentType(dLocation.class)) { - scriptEntry.addObject("holder", arg.asType(dLocation.class)); + else if (arg.matchesArgumentType(LocationTag.class)) { + scriptEntry.addObject("holder", arg.asType(LocationTag.class)); } } else { @@ -97,17 +97,17 @@ else if (arg.matchesArgumentType(dLocation.class)) { public void execute(final ScriptEntry scriptEntry) { // Get objects - List entities = (List) scriptEntry.getObject("entities"); - dEntity holder = null; - dLocation holderLoc = null; + List entities = (List) scriptEntry.getObject("entities"); + EntityTag holder = null; + LocationTag holderLoc = null; Entity Holder = null; Object holderObject = scriptEntry.getObject("holder"); - if (holderObject instanceof dEntity) { - holder = (dEntity) scriptEntry.getObject("holder"); + if (holderObject instanceof EntityTag) { + holder = (EntityTag) scriptEntry.getObject("holder"); Holder = holder.getBukkitEntity(); } - else if (holderObject instanceof dLocation) { - holderLoc = ((dLocation) scriptEntry.getObject("holder")); + else if (holderObject instanceof LocationTag) { + holderLoc = ((LocationTag) scriptEntry.getObject("holder")); Material material = holderLoc.getBlock().getType(); if (material == MaterialCompat.OAK_FENCE || material == MaterialCompat.NETHER_FENCE || material == Material.ACACIA_FENCE || material == Material.BIRCH_FENCE @@ -130,7 +130,7 @@ else if (holderObject instanceof dLocation) { } // Go through all the entities and leash/unleash them - for (dEntity entity : entities) { + for (EntityTag entity : entities) { if (entity.isSpawned() && entity.isLivingEntity()) { if (cancel) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/LookCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/LookCommand.java index a7729db98d..f00f9d7007 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/LookCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/LookCommand.java @@ -4,8 +4,8 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.nms.NMSHandler; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.DurationTag; @@ -33,8 +33,8 @@ public class LookCommand extends AbstractCommand { // location. // // @Tags - // - // + // + // // // @Usage // Use to point an npc towards a spot. @@ -51,8 +51,8 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("location") - && arg.matchesArgumentType(dLocation.class)) { - scriptEntry.addObject("location", arg.asType(dLocation.class)); + && arg.matchesArgumentType(LocationTag.class)) { + scriptEntry.addObject("location", arg.asType(LocationTag.class)); } else if (!scriptEntry.hasObject("duration") && arg.matchesArgumentType(DurationTag.class) @@ -60,9 +60,9 @@ else if (!scriptEntry.hasObject("duration") scriptEntry.addObject("duration", arg.asType(DurationTag.class)); } else if (!scriptEntry.hasObject("entities") - && arg.matchesArgumentList(dEntity.class)) { + && arg.matchesArgumentList(EntityTag.class)) { // Entity arg - scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(dEntity.class, scriptEntry)); + scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(EntityTag.class, scriptEntry)); } else { arg.reportUnhandled(); @@ -84,8 +84,8 @@ else if (!scriptEntry.hasObject("entities") @Override public void execute(ScriptEntry scriptEntry) { - final dLocation loc = (dLocation) scriptEntry.getObject("location"); - final List entities = (List) scriptEntry.getObject("entities"); + final LocationTag loc = (LocationTag) scriptEntry.getObject("location"); + final List entities = (List) scriptEntry.getObject("entities"); final DurationTag duration = (DurationTag) scriptEntry.getObject("duration"); if (scriptEntry.dbCallShouldDebug()) { @@ -95,7 +95,7 @@ public void execute(ScriptEntry scriptEntry) { } - for (dEntity entity : entities) { + for (EntityTag entity : entities) { if (entity.isSpawned()) { NMSHandler.getInstance().getEntityHelper().faceLocation(entity.getBukkitEntity(), loc); } @@ -110,7 +110,7 @@ public void run() { this.cancel(); return; } - for (dEntity entity : entities) { + for (EntityTag entity : entities) { if (entity.isSpawned()) { NMSHandler.getInstance().getEntityHelper().faceLocation(entity.getBukkitEntity(), loc); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/MountCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/MountCommand.java index 4bf84a661b..8ab0c3c349 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/MountCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/MountCommand.java @@ -4,8 +4,8 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.utilities.entity.Position; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.ArgumentHelper; @@ -30,8 +30,8 @@ public class MountCommand extends AbstractCommand { // spawned. Accepts a location, which the entities will be teleported to on mounting. // // @Tags - // - // + // + // // returns a list of entities that were mounted. // // @Usage @@ -56,7 +56,7 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException // Initialize necessary fields - List entities = null; + List entities = null; for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { @@ -66,14 +66,14 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException scriptEntry.addObject("cancel", ""); } else if (!scriptEntry.hasObject("location") - && arg.matchesArgumentType(dLocation.class)) { + && arg.matchesArgumentType(LocationTag.class)) { // Location arg - scriptEntry.addObject("location", arg.asType(dLocation.class)); + scriptEntry.addObject("location", arg.asType(LocationTag.class)); } else if (!scriptEntry.hasObject("entities") - && arg.matchesArgumentList(dEntity.class)) { + && arg.matchesArgumentList(EntityTag.class)) { // Entity arg - entities = arg.asType(ListTag.class).filter(dEntity.class, scriptEntry); + entities = arg.asType(ListTag.class).filter(EntityTag.class, scriptEntry); scriptEntry.addObject("entities", entities); } else { @@ -109,8 +109,8 @@ else if (!scriptEntry.hasObject("entities") public void execute(final ScriptEntry scriptEntry) { // Get objects - dLocation location = (dLocation) scriptEntry.getObject("location"); - List entities = (List) scriptEntry.getObject("entities"); + LocationTag location = (LocationTag) scriptEntry.getObject("location"); + List entities = (List) scriptEntry.getObject("entities"); boolean cancel = scriptEntry.hasObject("cancel"); // Report to dB @@ -124,7 +124,7 @@ public void execute(final ScriptEntry scriptEntry) { if (!cancel) { // Go through all the entities, spawning/teleporting them - for (dEntity entity : entities) { + for (EntityTag entity : entities) { entity.spawnAt(location); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/PushCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/PushCommand.java index fa014803e5..6b313a8633 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/PushCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/PushCommand.java @@ -7,8 +7,8 @@ import com.denizenscript.denizen.utilities.entity.Position; import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.interfaces.BlockHelper; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.*; import com.denizenscript.denizencore.objects.core.DurationTag; @@ -43,7 +43,7 @@ public class PushCommand extends AbstractCommand implements Holdable { // when they stop moving. // // @Tags - // + // // // @Usage // Use to launch an arrow straight towards a target @@ -62,21 +62,21 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException if (!scriptEntry.hasObject("origin") && arg.matchesPrefix("origin", "o", "source", "shooter", "s")) { - if (arg.matchesArgumentType(dEntity.class)) { - scriptEntry.addObject("originEntity", arg.asType(dEntity.class)); + if (arg.matchesArgumentType(EntityTag.class)) { + scriptEntry.addObject("originEntity", arg.asType(EntityTag.class)); } - else if (arg.matchesArgumentType(dLocation.class)) { - scriptEntry.addObject("originLocation", arg.asType(dLocation.class)); + else if (arg.matchesArgumentType(LocationTag.class)) { + scriptEntry.addObject("originLocation", arg.asType(LocationTag.class)); } else { Debug.echoError("Ignoring unrecognized argument: " + arg.raw_value); } } else if (!scriptEntry.hasObject("destination") - && arg.matchesArgumentType(dLocation.class) + && arg.matchesArgumentType(LocationTag.class) && arg.matchesPrefix("destination", "d")) { - scriptEntry.addObject("destination", arg.asType(dLocation.class)); + scriptEntry.addObject("destination", arg.asType(LocationTag.class)); } else if (!scriptEntry.hasObject("duration") && arg.matchesArgumentType(DurationTag.class) @@ -96,9 +96,9 @@ else if (!scriptEntry.hasObject("script") scriptEntry.addObject("script", arg.asType(ScriptTag.class)); } else if (!scriptEntry.hasObject("entities") - && arg.matchesArgumentList(dEntity.class)) { + && arg.matchesArgumentList(EntityTag.class)) { - scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(dEntity.class, scriptEntry)); + scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(EntityTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("force_along") && arg.matches("force_along")) { @@ -153,10 +153,10 @@ else if (arg.matchesPrefix("def", "define", "context")) { @Override public void execute(final ScriptEntry scriptEntry) { - dEntity originEntity = (dEntity) scriptEntry.getObject("originentity"); - dLocation originLocation = scriptEntry.hasObject("originlocation") ? - (dLocation) scriptEntry.getObject("originlocation") : - new dLocation(originEntity.getEyeLocation() + EntityTag originEntity = (EntityTag) scriptEntry.getObject("originentity"); + LocationTag originLocation = scriptEntry.hasObject("originlocation") ? + (LocationTag) scriptEntry.getObject("originlocation") : + new LocationTag(originEntity.getEyeLocation() .add(originEntity.getEyeLocation().getDirection()) .subtract(0, 0.4, 0)); boolean no_rotate = scriptEntry.hasObject("no_rotate") && scriptEntry.getElement("no_rotate").asBoolean(); @@ -164,9 +164,9 @@ public void execute(final ScriptEntry scriptEntry) { // If there is no destination set, but there is a shooter, get a point // in front of the shooter and set it as the destination - final dLocation destination = scriptEntry.hasObject("destination") ? - (dLocation) scriptEntry.getObject("destination") : - (originEntity != null ? new dLocation(originEntity.getEyeLocation() + final LocationTag destination = scriptEntry.hasObject("destination") ? + (LocationTag) scriptEntry.getObject("destination") : + (originEntity != null ? new LocationTag(originEntity.getEyeLocation() .add(originEntity.getEyeLocation().getDirection() .multiply(30))) : null); @@ -180,7 +180,7 @@ public void execute(final ScriptEntry scriptEntry) { return; } - List entities = (List) scriptEntry.getObject("entities"); + List entities = (List) scriptEntry.getObject("entities"); final ScriptTag script = (ScriptTag) scriptEntry.getObject("script"); final ListTag definitions = (ListTag) scriptEntry.getObject("definitions"); @@ -212,7 +212,7 @@ public void execute(final ScriptEntry scriptEntry) { final ListTag entityList = new ListTag(); // Go through all the entities, spawning/teleporting and rotating them - for (dEntity entity : entities) { + for (EntityTag entity : entities) { entity.spawnAt(originLocation); // Only add to entityList after the entities have been @@ -240,7 +240,7 @@ public void execute(final ScriptEntry scriptEntry) { // Get the entity at the bottom of the entity list, because // only its gravity should be affected and tracked considering // that the other entities will be mounted on it - final dEntity lastEntity = entities.get(entities.size() - 1); + final EntityTag lastEntity = entities.get(entities.size() - 1); final Vector v2 = destination.toVector(); final Vector Origin = originLocation.toVector(); @@ -249,7 +249,7 @@ public void execute(final ScriptEntry scriptEntry) { BukkitRunnable task = new BukkitRunnable() { int runs = 0; - dLocation lastLocation; + LocationTag lastLocation; @Override public void run() { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/RemoveCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/RemoveCommand.java index 067cf06ab3..4d9882534d 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/RemoveCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/RemoveCommand.java @@ -3,8 +3,8 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.utilities.entity.DenizenEntityType; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dWorld; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.WorldTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -35,7 +35,7 @@ public class RemoveCommand extends AbstractCommand { // // // @Tags - // + // // // @Usage // Use to remove the entity the player is looking at. @@ -56,16 +56,16 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("entities") - && arg.matchesArgumentList(dEntity.class)) { - scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(dEntity.class, scriptEntry)); + && arg.matchesArgumentList(EntityTag.class)) { + scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(EntityTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("region") && arg.matchesPrefix("region", "r")) { scriptEntry.addObject("region", arg.asElement()); } else if (!scriptEntry.hasObject("world") - && arg.matchesArgumentType(dWorld.class)) { - scriptEntry.addObject("world", arg.asType(dWorld.class)); + && arg.matchesArgumentType(WorldTag.class)) { + scriptEntry.addObject("world", arg.asType(WorldTag.class)); } else { arg.reportUnhandled(); @@ -82,9 +82,9 @@ else if (!scriptEntry.hasObject("world") // world, or default to the specified world in the server properties if necessary scriptEntry.defaultObject("world", - (Utilities.entryHasNPC(scriptEntry) && Utilities.getEntryNPC(scriptEntry).isSpawned()) ? new dWorld(Utilities.getEntryNPC(scriptEntry).getWorld()) : null, - (Utilities.entryHasPlayer(scriptEntry) && Utilities.getEntryPlayer(scriptEntry).isOnline()) ? new dWorld(Utilities.getEntryPlayer(scriptEntry).getWorld()) : null, - new dWorld(Bukkit.getWorlds().get(0))); + (Utilities.entryHasNPC(scriptEntry) && Utilities.getEntryNPC(scriptEntry).isSpawned()) ? new WorldTag(Utilities.getEntryNPC(scriptEntry).getWorld()) : null, + (Utilities.entryHasPlayer(scriptEntry) && Utilities.getEntryPlayer(scriptEntry).isOnline()) ? new WorldTag(Utilities.getEntryPlayer(scriptEntry).getWorld()) : null, + new WorldTag(Bukkit.getWorlds().get(0))); } @SuppressWarnings("unchecked") @@ -92,8 +92,8 @@ else if (!scriptEntry.hasObject("world") public void execute(final ScriptEntry scriptEntry) { // Get objects - List entities = (List) scriptEntry.getObject("entities"); - dWorld world = (dWorld) scriptEntry.getObject("world"); + List entities = (List) scriptEntry.getObject("entities"); + WorldTag world = (WorldTag) scriptEntry.getObject("world"); ElementTag region = (ElementTag) scriptEntry.getObject("region"); // Report to dB @@ -106,7 +106,7 @@ public void execute(final ScriptEntry scriptEntry) { // Go through all of our entities and remove them - for (dEntity entity : entities) { + for (EntityTag entity : entities) { conditionsMet = true; @@ -146,7 +146,7 @@ public void execute(final ScriptEntry scriptEntry) { for (Entity worldEntity : world.getEntities()) { // If this entity from the world is of the same type - // as our current dEntity, and all other applicable + // as our current EntityTag, and all other applicable // conditions are met, remove it if (entity.getEntityType().equals(DenizenEntityType.getByEntity(worldEntity))) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/RotateCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/RotateCommand.java index cbb8a1d174..50bf9512b9 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/RotateCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/RotateCommand.java @@ -4,7 +4,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.nms.NMSHandler; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.*; import com.denizenscript.denizencore.objects.core.DurationTag; @@ -39,8 +39,8 @@ public class RotateCommand extends AbstractCommand implements Holdable { // You can use "cancel" to prematurely stop the ongoing rotation (useful when set to infinite) // // @Tags - // - // + // + // // // @Usage // Use to rotate the player's yaw by 10 every tick for 3 seconds total @@ -97,9 +97,9 @@ else if (!scriptEntry.hasObject("pitch") scriptEntry.addObject("pitch", arg.asElement()); } else if (!scriptEntry.hasObject("entities") - && arg.matchesArgumentList(dEntity.class)) { + && arg.matchesArgumentList(EntityTag.class)) { - scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(dEntity.class, scriptEntry)); + scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(EntityTag.class, scriptEntry)); } else { arg.reportUnhandled(); @@ -126,7 +126,7 @@ else if (!scriptEntry.hasObject("entities") @Override public void execute(final ScriptEntry scriptEntry) { - final List entities = new ArrayList<>((List) scriptEntry.getObject("entities")); + final List entities = new ArrayList<>((List) scriptEntry.getObject("entities")); final DurationTag duration = (DurationTag) scriptEntry.getObject("duration"); final DurationTag frequency = (DurationTag) scriptEntry.getObject("frequency"); final ElementTag yaw = (ElementTag) scriptEntry.getObject("yaw"); @@ -146,7 +146,7 @@ public void execute(final ScriptEntry scriptEntry) { // Add entities to the rotatingEntities list or remove // them from it - for (dEntity entity : entities) { + for (EntityTag entity : entities) { if (cancel) { rotatingEntities.remove(entity.getUUID()); } @@ -167,7 +167,7 @@ public void execute(final ScriptEntry scriptEntry) { // Track entities that are no longer used, to remove them from // the regular list - Collection unusedEntities = new LinkedList<>(); + Collection unusedEntities = new LinkedList<>(); @Override public void run() { @@ -177,7 +177,7 @@ public void run() { this.cancel(); } else if (infinite || ticks < maxTicks) { - for (dEntity entity : entities) { + for (EntityTag entity : entities) { if (entity.isSpawned() && rotatingEntities.contains(entity.getUUID())) { NMSHandler.getInstance().getEntityHelper().rotate(entity.getBukkitEntity(), NMSHandler.getInstance().getEntityHelper().normalizeYaw(entity.getLocation().getYaw() + yaw.asFloat()), @@ -191,7 +191,7 @@ else if (infinite || ticks < maxTicks) { // Remove any entities that are no longer spawned if (!unusedEntities.isEmpty()) { - for (dEntity unusedEntity : unusedEntities) { + for (EntityTag unusedEntity : unusedEntities) { entities.remove(unusedEntity); } unusedEntities.clear(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/ShootCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/ShootCommand.java index ffde9fa7b8..7ced6f8fba 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/ShootCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/ShootCommand.java @@ -7,8 +7,8 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.utilities.entity.Position; import com.denizenscript.denizen.nms.NMSHandler; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.*; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -71,7 +71,7 @@ public class ShootCommand extends AbstractCommand implements Listener, Holdable // - shoot arrow origin: speed:2 // --> - Map arrows = new HashMap<>(); + Map arrows = new HashMap<>(); @Override public void onEnable() { @@ -86,27 +86,27 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException if (!scriptEntry.hasObject("origin") && arg.matchesPrefix("origin", "o", "source", "s")) { - if (arg.matchesArgumentType(dEntity.class)) { - scriptEntry.addObject("originEntity", arg.asType(dEntity.class)); + if (arg.matchesArgumentType(EntityTag.class)) { + scriptEntry.addObject("originEntity", arg.asType(EntityTag.class)); } - else if (arg.matchesArgumentType(dLocation.class)) { - scriptEntry.addObject("originLocation", arg.asType(dLocation.class)); + else if (arg.matchesArgumentType(LocationTag.class)) { + scriptEntry.addObject("originLocation", arg.asType(LocationTag.class)); } else { Debug.echoError("Ignoring unrecognized argument: " + arg.raw_value); } } else if (!scriptEntry.hasObject("destination") - && arg.matchesArgumentType(dLocation.class) + && arg.matchesArgumentType(LocationTag.class) && arg.matchesPrefix("destination", "d")) { - scriptEntry.addObject("destination", arg.asType(dLocation.class)); + scriptEntry.addObject("destination", arg.asType(LocationTag.class)); } else if (!scriptEntry.hasObject("lead") - && arg.matchesArgumentType(dLocation.class) + && arg.matchesArgumentType(LocationTag.class) && arg.matchesPrefix("lead")) { - scriptEntry.addObject("lead", arg.asType(dLocation.class)); + scriptEntry.addObject("lead", arg.asType(LocationTag.class)); } else if (!scriptEntry.hasObject("height") && arg.matchesPrimitive(ArgumentHelper.PrimitiveType.Double) @@ -126,14 +126,14 @@ else if (!scriptEntry.hasObject("script") scriptEntry.addObject("script", arg.asType(ScriptTag.class)); } else if (!scriptEntry.hasObject("shooter") - && arg.matchesArgumentType(dEntity.class) + && arg.matchesArgumentType(EntityTag.class) && arg.matchesPrefix("shooter")) { - scriptEntry.addObject("shooter", arg.asType(dEntity.class)); + scriptEntry.addObject("shooter", arg.asType(EntityTag.class)); } else if (!scriptEntry.hasObject("entities") - && arg.matchesArgumentList(dEntity.class)) { + && arg.matchesArgumentList(EntityTag.class)) { - scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(dEntity.class, scriptEntry)); + scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(EntityTag.class, scriptEntry)); } // Don't document this argument; it is for debug purposes only @@ -186,20 +186,20 @@ else if (arg.matchesPrefix("def", "define", "context")) { @Override public void execute(final ScriptEntry scriptEntry) { - dEntity originEntity = (dEntity) scriptEntry.getObject("originentity"); - dLocation originLocation = scriptEntry.hasObject("originlocation") ? - (dLocation) scriptEntry.getObject("originlocation") : - new dLocation(originEntity.getEyeLocation() + EntityTag originEntity = (EntityTag) scriptEntry.getObject("originentity"); + LocationTag originLocation = scriptEntry.hasObject("originlocation") ? + (LocationTag) scriptEntry.getObject("originlocation") : + new LocationTag(originEntity.getEyeLocation() .add(originEntity.getEyeLocation().getDirection())); boolean no_rotate = scriptEntry.hasObject("no_rotate") && scriptEntry.getElement("no_rotate").asBoolean(); // If there is no destination set, but there is a shooter, get a point // in front of the shooter and set it as the destination - final dLocation destination = scriptEntry.hasObject("destination") ? - (dLocation) scriptEntry.getObject("destination") : - (originEntity != null ? new dLocation(originEntity.getEyeLocation().clone() + final LocationTag destination = scriptEntry.hasObject("destination") ? + (LocationTag) scriptEntry.getObject("destination") : + (originEntity != null ? new LocationTag(originEntity.getEyeLocation().clone() .add(originEntity.getEyeLocation().clone().getDirection().multiply(30))) - : (originLocation != null ? new dLocation(originLocation.clone().add( + : (originLocation != null ? new LocationTag(originLocation.clone().add( originLocation.getDirection().multiply(30))) : null)); // TODO: Same as PUSH -- is this the place to do this? @@ -210,17 +210,17 @@ public void execute(final ScriptEntry scriptEntry) { return; } - final List entities = (List) scriptEntry.getObject("entities"); + final List entities = (List) scriptEntry.getObject("entities"); final ScriptTag script = (ScriptTag) scriptEntry.getObject("script"); final ListTag definitions = (ListTag) scriptEntry.getObject("definitions"); - dEntity shooter = (dEntity) scriptEntry.getObject("shooter"); + EntityTag shooter = (EntityTag) scriptEntry.getObject("shooter"); ElementTag height = scriptEntry.getElement("height"); ElementTag gravity = scriptEntry.getElement("gravity"); ElementTag speed = scriptEntry.getElement("speed"); ElementTag spread = scriptEntry.getElement("spread"); - dLocation lead = (dLocation) scriptEntry.getObject("lead"); + LocationTag lead = (LocationTag) scriptEntry.getObject("lead"); // Report to dB if (scriptEntry.dbCallShouldDebug()) { @@ -244,7 +244,7 @@ public void execute(final ScriptEntry scriptEntry) { final ListTag entityList = new ListTag(); // Go through all the entities, spawning/teleporting and rotating them - for (dEntity entity : entities) { + for (EntityTag entity : entities) { if (!entity.isSpawned() || !no_rotate) { entity.spawnAt(originLocation); } @@ -278,7 +278,7 @@ public void execute(final ScriptEntry scriptEntry) { // Get the entity at the bottom of the entity list, because // only its gravity should be affected and tracked considering // that the other entities will be mounted on it - final dEntity lastEntity = entities.get(entities.size() - 1); + final EntityTag lastEntity = entities.get(entities.size() - 1); if (gravity == null) { gravity = new ElementTag(lastEntity.getEntityType().getGravity()); @@ -317,14 +317,14 @@ else if (lead == null) { if (spread != null) { Vector base = lastEntity.getVelocity().clone(); float sf = spread.asFloat(); - for (dEntity entity : entities) { + for (EntityTag entity : entities) { Vector newvel = Velocity.spread(base, (CoreUtilities.getRandom().nextDouble() > 0.5f ? 1 : -1) * Math.toRadians(CoreUtilities.getRandom().nextDouble() * sf), (CoreUtilities.getRandom().nextDouble() > 0.5f ? 1 : -1) * Math.toRadians(CoreUtilities.getRandom().nextDouble() * sf)); entity.setVelocity(newvel); } } - final dLocation start = new dLocation(lastEntity.getLocation()); + final LocationTag start = new LocationTag(lastEntity.getLocation()); final Vector start_vel = lastEntity.getVelocity(); // A task used to trigger a script if the entity is no longer @@ -332,7 +332,7 @@ else if (lead == null) { BukkitRunnable task = new BukkitRunnable() { boolean flying = true; - dLocation lastLocation = null; + LocationTag lastLocation = null; Vector lastVelocity = null; public void run() { @@ -377,9 +377,9 @@ else if (lastLocation != null && lastVelocity != null) { // Handle hit_entities definition ListTag hitEntities = new ListTag(); - for (dEntity entity : entities) { + for (EntityTag entity : entities) { if (arrows.containsKey(entity.getUUID())) { - dEntity hit = arrows.get(entity.getUUID()); + EntityTag hit = arrows.get(entity.getUUID()); arrows.remove(entity.getUUID()); if (hit != null) { hitEntities.add(hit.identify()); @@ -438,6 +438,6 @@ public void arrowDamage(EntityDamageByEntityEvent event) { // Replace its entry with the hit entity. arrows.remove(arrow.getUniqueId()); - arrows.put(arrow.getUniqueId(), new dEntity(event.getEntity())); + arrows.put(arrow.getUniqueId(), new EntityTag(event.getEntity())); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/SpawnCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/SpawnCommand.java index ffeed4d67e..0d4e52efde 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/SpawnCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/SpawnCommand.java @@ -2,8 +2,8 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -32,7 +32,7 @@ public class SpawnCommand extends AbstractCommand { // the enity to remain until killed. // // @Tags - // + // // ]> // // returns a list of entities that were spawned. @@ -57,20 +57,20 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("entities") - && arg.matchesArgumentList(dEntity.class)) { + && arg.matchesArgumentList(EntityTag.class)) { - scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(dEntity.class, scriptEntry)); + scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(EntityTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("location") - && arg.matchesArgumentType(dLocation.class)) { + && arg.matchesArgumentType(LocationTag.class)) { - scriptEntry.addObject("location", arg.asType(dLocation.class)); + scriptEntry.addObject("location", arg.asType(LocationTag.class)); } else if (!scriptEntry.hasObject("target") - && arg.matchesArgumentType(dEntity.class) + && arg.matchesArgumentType(EntityTag.class) && arg.matchesPrefix("target")) { - scriptEntry.addObject("target", arg.asType(dEntity.class)); + scriptEntry.addObject("target", arg.asType(EntityTag.class)); } else if (!scriptEntry.hasObject("spread") && arg.matchesPrimitive(ArgumentHelper.PrimitiveType.Integer)) { @@ -106,9 +106,9 @@ else if (!scriptEntry.hasObject("persistent") public void execute(final ScriptEntry scriptEntry) { // Get objects - List entities = (List) scriptEntry.getObject("entities"); - dLocation location = (dLocation) scriptEntry.getObject("location"); - dEntity target = (dEntity) scriptEntry.getObject("target"); + List entities = (List) scriptEntry.getObject("entities"); + LocationTag location = (LocationTag) scriptEntry.getObject("location"); + EntityTag target = (EntityTag) scriptEntry.getObject("target"); ElementTag spread = scriptEntry.getElement("spread"); boolean persistent = scriptEntry.hasObject("persistent"); @@ -129,7 +129,7 @@ public void execute(final ScriptEntry scriptEntry) { // Go through all the entities and spawn them or teleport them, // then set their targets if applicable - for (dEntity entity : entities) { + for (EntityTag entity : entities) { Location loc = location.clone(); if (spread != null) { loc.add(CoreUtilities.getRandom().nextInt(spread.asInt() * 2) - spread.asInt(), diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/TeleportCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/TeleportCommand.java index 91314f936f..ed61989146 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/TeleportCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/TeleportCommand.java @@ -2,8 +2,8 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.ArgumentHelper; @@ -33,7 +33,7 @@ public class TeleportCommand extends AbstractCommand { // command, assuming the location is valid. // // @Tags - // + // // // @Usage // Use to teleport a player to the location its cursor is pointing on @@ -59,12 +59,12 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("location") - && arg.matchesArgumentType(dLocation.class)) { - scriptEntry.addObject("location", arg.asType(dLocation.class)); + && arg.matchesArgumentType(LocationTag.class)) { + scriptEntry.addObject("location", arg.asType(LocationTag.class)); } else if (!scriptEntry.hasObject("entities") - && arg.matchesArgumentList(dEntity.class)) { - scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(dEntity.class, scriptEntry)); + && arg.matchesArgumentList(EntityTag.class)) { + scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(EntityTag.class, scriptEntry)); } // NPC arg for compatibility with old scripts @@ -93,8 +93,8 @@ else if (arg.matches("npc") && Utilities.entryHasNPC(scriptEntry)) { public void execute(final ScriptEntry scriptEntry) { // Get objects - dLocation location = (dLocation) scriptEntry.getObject("location"); - List entities = (List) scriptEntry.getObject("entities"); + LocationTag location = (LocationTag) scriptEntry.getObject("location"); + List entities = (List) scriptEntry.getObject("entities"); // Report to dB if (scriptEntry.dbCallShouldDebug()) { @@ -102,7 +102,7 @@ public void execute(final ScriptEntry scriptEntry) { ArgumentHelper.debugObj("entities", entities.toString())); } - for (dEntity entity : entities) { + for (EntityTag entity : entities) { // Call a Bukkit event for compatibility with "on entity teleports" // world event and other plugins if (entity.isSpawned()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/WalkCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/WalkCommand.java index 844293b365..55eac7a7ac 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/WalkCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/WalkCommand.java @@ -7,9 +7,9 @@ import com.denizenscript.denizencore.objects.Argument; import com.google.common.base.Function; import com.denizenscript.denizen.nms.NMSHandler; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dNPC; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.NPCTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.ArgumentHelper; @@ -37,10 +37,10 @@ public class WalkCommand extends AbstractCommand implements Holdable { // TODO: Document Command Details // // @Tags - // - // - // - // + // + // + // + // // // @Usage // TODO: Document Command Details @@ -55,8 +55,8 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException if (!scriptEntry.hasObject("lookat") && arg.matchesPrefix("lookat") - && arg.matchesArgumentType(dLocation.class)) { - scriptEntry.addObject("lookat", arg.asType(dLocation.class)); + && arg.matchesArgumentType(LocationTag.class)) { + scriptEntry.addObject("lookat", arg.asType(LocationTag.class)); } else if (!scriptEntry.hasObject("speed") && arg.matchesPrimitive(ArgumentHelper.PrimitiveType.Percentage) @@ -77,12 +77,12 @@ else if (!scriptEntry.hasObject("stop") scriptEntry.addObject("stop", new ElementTag(true)); } else if (!scriptEntry.hasObject("location") - && arg.matchesArgumentType(dLocation.class)) { - scriptEntry.addObject("location", arg.asType(dLocation.class)); + && arg.matchesArgumentType(LocationTag.class)) { + scriptEntry.addObject("location", arg.asType(LocationTag.class)); } else if (!scriptEntry.hasObject("entities") - && arg.matchesArgumentList(dEntity.class)) { - scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(dEntity.class, scriptEntry)); + && arg.matchesArgumentList(EntityTag.class)) { + scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(EntityTag.class, scriptEntry)); } else { arg.reportUnhandled(); @@ -117,13 +117,13 @@ public void execute(ScriptEntry scriptEntry) { // Fetch required objects - dLocation loc = (dLocation) scriptEntry.getObject("location"); + LocationTag loc = (LocationTag) scriptEntry.getObject("location"); ElementTag speed = scriptEntry.getElement("speed"); ElementTag auto_range = scriptEntry.getElement("auto_range"); ElementTag radius = scriptEntry.getElement("radius"); ElementTag stop = scriptEntry.getElement("stop"); - List entities = (List) scriptEntry.getObject("entities"); - final dLocation lookat = scriptEntry.getdObject("lookat"); + List entities = (List) scriptEntry.getObject("entities"); + final LocationTag lookat = scriptEntry.getdObject("lookat"); // Debug the execution @@ -144,11 +144,11 @@ public void execute(ScriptEntry scriptEntry) { boolean shouldStop = stop.asBoolean(); - List npcs = new ArrayList<>(); - final List waitForEntities = new ArrayList<>(); - for (final dEntity entity : entities) { + List npcs = new ArrayList<>(); + final List waitForEntities = new ArrayList<>(); + for (final EntityTag entity : entities) { if (entity.isCitizensNPC()) { - dNPC npc = entity.getDenizenNPC(); + NPCTag npc = entity.getDenizenNPC(); npcs.add(npc); if (!npc.isSpawned()) { Debug.echoError(scriptEntry.getResidingQueue(), "NPC " + npc.identify() + " is not spawned!"); @@ -219,16 +219,16 @@ public void run() { // Held script entries public static List held = new ArrayList<>(); - public void checkHeld(dEntity entity) { + public void checkHeld(EntityTag entity) { for (int i = 0; i < held.size(); i++) { ScriptEntry entry = held.get(i); - List waitForEntities = (List) entry.getObject("entities"); + List waitForEntities = (List) entry.getObject("entities"); if (waitForEntities == null) { continue; } waitForEntities.remove(entity); if (waitForEntities.isEmpty()) { - if (!entry.hasObject("tally") || ((List) entry.getObject("tally")).isEmpty()) { + if (!entry.hasObject("tally") || ((List) entry.getObject("tally")).isEmpty()) { entry.setFinished(true); held.remove(i); i--; diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/WalkCommandCitizensEvents.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/WalkCommandCitizensEvents.java index 2cd193d5d0..9ad8d84704 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/WalkCommandCitizensEvents.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/WalkCommandCitizensEvents.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.scripts.commands.entity; -import com.denizenscript.denizen.objects.dNPC; +import com.denizenscript.denizen.objects.NPCTag; import com.denizenscript.denizencore.scripts.ScriptEntry; import net.citizensnpcs.api.ai.event.NavigationCancelEvent; import net.citizensnpcs.api.ai.event.NavigationCompleteEvent; @@ -58,7 +58,7 @@ public void checkHeld(NavigationEvent e) { // Get all NPCs associated with the entry. They must all // finish navigation before the entry can be let go - List tally = (List) entry.getObject("tally"); + List tally = (List) entry.getObject("tally"); if (tally == null) { continue; @@ -70,7 +70,7 @@ public void checkHeld(NavigationEvent e) { } } // If the NPC is the NPC from the event, take it from the list. - tally.remove(dNPC.mirrorCitizensNPC(e.getNPC())); + tally.remove(NPCTag.mirrorCitizensNPC(e.getNPC())); // Check if tally is empty. if (tally.isEmpty()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/DisplayItemCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/DisplayItemCommand.java index 42c1eff864..9f72f76b4a 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/DisplayItemCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/DisplayItemCommand.java @@ -2,9 +2,9 @@ import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.DurationTag; @@ -38,8 +38,8 @@ public class DisplayItemCommand extends AbstractCommand implements Listener { // If no duration is specified the item will stay for 1 minute, after which the item will disappear. // // @Tags - // - // returns a dEntity of the spawned item. + // + // returns a EntityTag of the spawned item. // // @Usage // Use to display a stone block dropped at a players location @@ -72,13 +72,13 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException && !scriptEntry.hasObject("duration")) { scriptEntry.addObject("duration", arg.asType(DurationTag.class)); } - else if (arg.matchesArgumentType(dLocation.class) + else if (arg.matchesArgumentType(LocationTag.class) && !scriptEntry.hasObject("location")) { - scriptEntry.addObject("location", arg.asType(dLocation.class)); + scriptEntry.addObject("location", arg.asType(LocationTag.class)); } - else if (arg.matchesArgumentType(dItem.class) + else if (arg.matchesArgumentType(ItemTag.class) && !scriptEntry.hasObject("item")) { - scriptEntry.addObject("item", arg.asType(dItem.class)); + scriptEntry.addObject("item", arg.asType(ItemTag.class)); } else { arg.reportUnhandled(); @@ -126,9 +126,9 @@ public void onItemEntityPickup(EntityPickupItemEvent event) { @Override public void execute(ScriptEntry scriptEntry) { - dItem item = (dItem) scriptEntry.getObject("item"); + ItemTag item = (ItemTag) scriptEntry.getObject("item"); DurationTag duration = (DurationTag) scriptEntry.getObject("duration"); - dLocation location = (dLocation) scriptEntry.getObject("location"); + LocationTag location = (LocationTag) scriptEntry.getObject("location"); if (scriptEntry.dbCallShouldDebug()) { @@ -152,7 +152,7 @@ public void execute(ScriptEntry scriptEntry) { protectedEntities.add(itemUUID); // Remember the item entity - scriptEntry.addObject("dropped", new dEntity(dropped)); + scriptEntry.addObject("dropped", new EntityTag(dropped)); // Remove it later Bukkit.getScheduler().scheduleSyncDelayedTask(DenizenAPI.getCurrentInstance(), diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/FakeItemCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/FakeItemCommand.java index b2ccaec6e1..94cf1a8071 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/FakeItemCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/FakeItemCommand.java @@ -5,8 +5,8 @@ import com.denizenscript.denizen.utilities.inventory.SlotHelper; import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.interfaces.PacketHelper; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.DenizenCore; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.*; @@ -65,13 +65,13 @@ else if (!scriptEntry.hasObject("duration") scriptEntry.addObject("duration", arg.asType(DurationTag.class)); } else if (!scriptEntry.hasObject("item") - && arg.matchesArgumentList(dItem.class)) { - scriptEntry.addObject("item", arg.asType(ListTag.class).filter(dItem.class, scriptEntry)); + && arg.matchesArgumentList(ItemTag.class)) { + scriptEntry.addObject("item", arg.asType(ListTag.class).filter(ItemTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("players") - && arg.matchesArgumentList(dPlayer.class) + && arg.matchesArgumentList(PlayerTag.class) && arg.matchesPrefix("players")) { - scriptEntry.addObject("players", arg.asType(ListTag.class).filter(dPlayer.class, scriptEntry)); + scriptEntry.addObject("players", arg.asType(ListTag.class).filter(PlayerTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("player_only") && arg.matches("player_only")) { @@ -99,10 +99,10 @@ else if (!scriptEntry.hasObject("player_only") @Override public void execute(ScriptEntry scriptEntry) { - List items = (List) scriptEntry.getObject("item"); + List items = (List) scriptEntry.getObject("item"); final ElementTag elSlot = scriptEntry.getElement("slot"); DurationTag duration = scriptEntry.getdObject("duration"); - final List players = (List) scriptEntry.getObject("players"); + final List players = (List) scriptEntry.getObject("players"); final ElementTag player_only = scriptEntry.getElement("player_only"); if (scriptEntry.dbCallShouldDebug()) { @@ -119,13 +119,13 @@ public void execute(ScriptEntry scriptEntry) { final PacketHelper packetHelper = NMSHandler.getInstance().getPacketHelper(); - for (dItem item : items) { + for (ItemTag item : items) { if (item == null) { slot++; continue; } - for (dPlayer player : players) { + for (PlayerTag player : players) { Player ent = player.getPlayerEntity(); packetHelper.setSlot(ent, translateSlot(ent, slot, playerOnly), item.getItemStack(), playerOnly); } @@ -137,7 +137,7 @@ public void execute(ScriptEntry scriptEntry) { DenizenCore.schedule(new OneTimeSchedulable(new Runnable() { @Override public void run() { - for (dPlayer player : players) { + for (PlayerTag player : players) { Player ent = player.getPlayerEntity(); int translated = translateSlot(ent, slotSnapshot, playerOnly); ItemStack original = ent.getOpenInventory().getItem(translated); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/GiveCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/GiveCommand.java index fbaeede29b..6dc38b5a3c 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/GiveCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/GiveCommand.java @@ -5,8 +5,8 @@ import com.denizenscript.denizen.utilities.depends.Depends; import com.denizenscript.denizen.utilities.inventory.SlotHelper; import com.denizenscript.denizen.utilities.nbt.CustomNBT; -import com.denizenscript.denizen.objects.dInventory; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.InventoryTag; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -38,7 +38,7 @@ public class GiveCommand extends AbstractCommand { // If an economy is registered, specifying money instead of a item will give money to the player's economy. // // @Tags - // + // // // @Usage // Use to give money to the player. @@ -89,14 +89,14 @@ else if (!scriptEntry.hasObject("unlimit_stack_size") } else if (!scriptEntry.hasObject("items") && !scriptEntry.hasObject("type") - && (arg.matchesArgumentList(dItem.class) || arg.startsWith("item:"))) { + && (arg.matchesArgumentList(ItemTag.class) || arg.startsWith("item:"))) { scriptEntry.addObject("items", ListTag.valueOf(arg.raw_value.startsWith("item:") ? - arg.raw_value.substring("item:".length()) : arg.raw_value).filter(dItem.class, scriptEntry)); + arg.raw_value.substring("item:".length()) : arg.raw_value).filter(ItemTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("inventory") && arg.matchesPrefix("t", "to") - && arg.matchesArgumentType(dInventory.class)) { - scriptEntry.addObject("inventory", arg.asType(dInventory.class)); + && arg.matchesArgumentType(InventoryTag.class)) { + scriptEntry.addObject("inventory", arg.asType(InventoryTag.class)); } else if (!scriptEntry.hasObject("slot") && arg.matchesPrefix("slot")) { @@ -135,16 +135,16 @@ public void execute(ScriptEntry scriptEntry) { ElementTag engrave = scriptEntry.getElement("engrave"); ElementTag unlimit_stack_size = scriptEntry.getElement("unlimit_stack_size"); - dInventory inventory = (dInventory) scriptEntry.getObject("inventory"); + InventoryTag inventory = (InventoryTag) scriptEntry.getObject("inventory"); ElementTag qty = scriptEntry.getElement("qty"); Type type = (Type) scriptEntry.getObject("type"); ElementTag slot = scriptEntry.getElement("slot"); Object items_object = scriptEntry.getObject("items"); - List items = null; + List items = null; if (items_object != null) { - items = (List) items_object; + items = (List) items_object; } if (scriptEntry.dbCallShouldDebug()) { @@ -178,7 +178,7 @@ public void execute(ScriptEntry scriptEntry) { case ITEM: boolean set_quantity = scriptEntry.hasObject("set_quantity"); boolean limited = !unlimit_stack_size.asBoolean(); - for (dItem item : items) { + for (ItemTag item : items) { ItemStack is = item.getItemStack(); if (is.getType() == Material.AIR) { Debug.echoError("Cannot give air!"); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/InventoryCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/InventoryCommand.java index c9eaff97c3..1f4fbc12ca 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/InventoryCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/InventoryCommand.java @@ -4,10 +4,10 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.utilities.inventory.SlotHelper; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dInventory; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.InventoryTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.*; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -64,17 +64,17 @@ public class InventoryCommand extends AbstractCommand { // is the current attached player's inventory. If you are copying, swapping, removing from // (including via "keep" and "exclude"), adding to, moving, or filling inventories, you'll need // both destination and origin inventories. Origin inventories may be specified as a list of - // dItems, but destinations must be actual dInventories. + // ItemTags, but destinations must be actual dInventories. // Using "open", "clear", or "update" only require a destination. "Update" also requires the // destination to be a valid player inventory. // Using "close" closes any inventory that the currently attached player has opened. // // @Tags - // - // - // - // - // + // + // + // + // + // // // @Usage // Use to open a chest inventory, at a location. @@ -124,20 +124,20 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException isAdjust = arg.toString().equalsIgnoreCase("adjust"); } - // Check for an origin, which can be a dInventory, dEntity, dLocation - // or a ListTag of dItems + // Check for an origin, which can be a InventoryTag, EntityTag, LocationTag + // or a ListTag of ItemTags else if (!scriptEntry.hasObject("origin") && arg.matchesPrefix("origin", "o", "source", "items", "item", "i", "from", "f") - && (arg.matchesArgumentTypes(dInventory.class, dEntity.class, dLocation.class) - || arg.matchesArgumentList(dItem.class))) { + && (arg.matchesArgumentTypes(InventoryTag.class, EntityTag.class, LocationTag.class) + || arg.matchesArgumentList(ItemTag.class))) { scriptEntry.addObject("origin", Conversion.getInventory(arg, scriptEntry)); } - // Check for a destination, which can be a dInventory, dEntity - // or dLocation + // Check for a destination, which can be a InventoryTag, EntityTag + // or LocationTag else if (!scriptEntry.hasObject("destination") && arg.matchesPrefix("destination", "dest", "d", "target", "to", "t") - && arg.matchesArgumentTypes(dInventory.class, dEntity.class, dLocation.class)) { + && arg.matchesArgumentTypes(InventoryTag.class, EntityTag.class, LocationTag.class)) { scriptEntry.addObject("destination", Conversion.getInventory(arg, scriptEntry)); } @@ -194,10 +194,10 @@ public void execute(final ScriptEntry scriptEntry) { // Get objects List actions = (List) scriptEntry.getObject("actions"); - AbstractMap.SimpleEntry originentry = (AbstractMap.SimpleEntry) scriptEntry.getObject("origin"); - dInventory origin = originentry != null ? originentry.getValue() : null; - AbstractMap.SimpleEntry destinationentry = (AbstractMap.SimpleEntry) scriptEntry.getObject("destination"); - dInventory destination = destinationentry.getValue(); + AbstractMap.SimpleEntry originentry = (AbstractMap.SimpleEntry) scriptEntry.getObject("origin"); + InventoryTag origin = originentry != null ? originentry.getValue() : null; + AbstractMap.SimpleEntry destinationentry = (AbstractMap.SimpleEntry) scriptEntry.getObject("destination"); + InventoryTag destination = destinationentry.getValue(); ElementTag slot = scriptEntry.getElement("slot"); ElementTag mechanism = scriptEntry.getElement("mechanism"); ElementTag mechanismValue = scriptEntry.getElement("mechanism_value"); @@ -265,7 +265,7 @@ public void execute(final ScriptEntry scriptEntry) { Debug.echoError(scriptEntry.getResidingQueue(), "Missing origin argument!"); return; } - dInventory temp = new dInventory(destination.getInventory()); + InventoryTag temp = new InventoryTag(destination.getInventory()); origin.replace(destination); temp.replace(origin); break; @@ -340,7 +340,7 @@ public void execute(final ScriptEntry scriptEntry) { break; case ADJUST: - dItem toAdjust = new dItem(destination.getInventory().getItem(slotId)); + ItemTag toAdjust = new ItemTag(destination.getInventory().getItem(slotId)); toAdjust.safeAdjust(new Mechanism(mechanism, mechanismValue, scriptEntry.entryData.getTagContext())); destination.getInventory().setItem(slotId, toAdjust.getItemStack()); break; diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/MapCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/MapCommand.java index 8fa4926f4b..4f8078bcb9 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/MapCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/MapCommand.java @@ -6,8 +6,8 @@ import com.denizenscript.denizen.utilities.maps.DenizenMapRenderer; import com.denizenscript.denizen.utilities.maps.MapAnimatedImage; import com.denizenscript.denizen.utilities.maps.MapImage; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dWorld; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.WorldTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -50,7 +50,7 @@ public class MapCommand extends AbstractCommand { // // @Usage // Use to add an image with the top-left corner at the center of a new map - // - map new:w@world image:my_map_images/my_center_image.png x:64 y:64 + // - map new:WorldTag image:my_map_images/my_center_image.png x:64 y:64 // // @Usage // Reset map to have the center at the player's location @@ -64,13 +64,13 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException if (!scriptEntry.hasObject("new") && arg.matchesPrefix("new") - && arg.matchesArgumentType(dWorld.class)) { - scriptEntry.addObject("new", arg.asType(dWorld.class)); + && arg.matchesArgumentType(WorldTag.class)) { + scriptEntry.addObject("new", arg.asType(WorldTag.class)); } else if (!scriptEntry.hasObject("reset-loc") && arg.matchesPrefix("r", "reset") - && arg.matchesArgumentType(dLocation.class)) { - scriptEntry.addObject("reset-loc", arg.asType(dLocation.class)); + && arg.matchesArgumentType(LocationTag.class)) { + scriptEntry.addObject("reset-loc", arg.asType(LocationTag.class)); scriptEntry.addObject("reset", new ElementTag(true)); } else if (!scriptEntry.hasObject("reset") @@ -137,9 +137,9 @@ else if (!scriptEntry.hasObject("map-id") public void execute(ScriptEntry scriptEntry) { ElementTag id = scriptEntry.getElement("map-id"); - dWorld create = scriptEntry.getdObject("new"); + WorldTag create = scriptEntry.getdObject("new"); ElementTag reset = scriptEntry.getElement("reset"); - dLocation resetLoc = scriptEntry.getdObject("reset-loc"); + LocationTag resetLoc = scriptEntry.getdObject("reset-loc"); ElementTag image = scriptEntry.getElement("image"); ScriptTag script = scriptEntry.getdObject("script"); ElementTag resize = scriptEntry.getElement("resize"); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/NBTCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/NBTCommand.java index 2187883c1b..79d5e9be86 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/NBTCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/NBTCommand.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.utilities.nbt.CustomNBT; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -55,8 +55,8 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException scriptEntry.addObject("value", new ElementTag(flagArgs[1])); } else if (!scriptEntry.hasObject("item") - && arg.matchesArgumentType(dItem.class)) { - scriptEntry.addObject("item", arg.asType(dItem.class)); + && arg.matchesArgumentType(ItemTag.class)) { + scriptEntry.addObject("item", arg.asType(ItemTag.class)); } else { arg.reportUnhandled(); @@ -76,7 +76,7 @@ else if (!scriptEntry.hasObject("item") @Override public void execute(ScriptEntry scriptEntry) { - dItem item = scriptEntry.getdObject("item"); + ItemTag item = scriptEntry.getdObject("item"); ElementTag key = scriptEntry.getElement("key"); ElementTag value = scriptEntry.getElement("value"); @@ -95,6 +95,6 @@ public void execute(ScriptEntry scriptEntry) { itemStack = CustomNBT.addCustomNBT(itemStack, key.asString(), value.asString(), CustomNBT.KEY_DENIZEN); } - scriptEntry.addObject("new_item", new dItem(itemStack)); + scriptEntry.addObject("new_item", new ItemTag(itemStack)); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/ScribeCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/ScribeCommand.java index c2772635ed..2e9c9adc61 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/ScribeCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/ScribeCommand.java @@ -3,8 +3,8 @@ import com.denizenscript.denizen.scripts.containers.core.BookScriptContainer; import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.TagRunnable; @@ -101,11 +101,11 @@ public class ScribeCommand extends AbstractCommand { // Read more about book-scripts here: <@link language book script containers> // // @Tags - // - // - // - // ]> - // + // + // + // + // ]> + // // // // @Usage @@ -147,13 +147,13 @@ else if (!scriptEntry.hasObject("script") scriptEntry.addObject("script", arg.asType(ScriptTag.class)); } else if (!scriptEntry.hasObject("location") - && arg.matchesArgumentType(dLocation.class)) { - scriptEntry.addObject("location", arg.asType(dLocation.class)); + && arg.matchesArgumentType(LocationTag.class)) { + scriptEntry.addObject("location", arg.asType(LocationTag.class)); scriptEntry.addObject("action", BookAction.DROP); } else if (!scriptEntry.hasObject("item") - && arg.matchesArgumentType(dItem.class)) { - scriptEntry.addObject("item", arg.asType(dItem.class)); + && arg.matchesArgumentType(ItemTag.class)) { + scriptEntry.addObject("item", arg.asType(ItemTag.class)); } else { @@ -162,7 +162,7 @@ else if (!scriptEntry.hasObject("item") } scriptEntry.defaultObject("action", BookAction.GIVE); - scriptEntry.defaultObject("item", new dItem(Material.WRITTEN_BOOK)); + scriptEntry.defaultObject("item", new ItemTag(Material.WRITTEN_BOOK)); // Must contain a book script if (!scriptEntry.hasObject("script")) { @@ -176,9 +176,9 @@ public void execute(ScriptEntry scriptEntry) { // Retrieve objects from ScriptEntry BookAction action = (BookAction) scriptEntry.getObject("action"); - dItem book = (dItem) scriptEntry.getObject("item"); + ItemTag book = (ItemTag) scriptEntry.getObject("item"); ScriptTag script = (ScriptTag) scriptEntry.getObject("script"); - dLocation location = (dLocation) scriptEntry.getObject("location"); + LocationTag location = (LocationTag) scriptEntry.getObject("location"); BookScriptContainer bookScript = (BookScriptContainer) script.getContainer(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/TakeCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/TakeCommand.java index 765280249e..f4579b431d 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/TakeCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/TakeCommand.java @@ -5,8 +5,8 @@ import com.denizenscript.denizen.utilities.depends.Depends; import com.denizenscript.denizen.utilities.inventory.SlotHelper; import com.denizenscript.denizen.utilities.nbt.CustomNBT; -import com.denizenscript.denizen.objects.dInventory; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.InventoryTag; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -37,8 +37,8 @@ public class TakeCommand extends AbstractCommand { // If no quantity is specified, exactly 1 item will be taken. // // @Tags - // - // + // + // // // @Usage // Use to take money from the player @@ -96,7 +96,7 @@ else if (!scriptEntry.hasObject("type") && !scriptEntry.hasObject("items") && arg.matchesPrefix("script", "scriptname")) { scriptEntry.addObject("type", Type.SCRIPTNAME); - scriptEntry.addObject("scriptitem", arg.asType(dItem.class)); + scriptEntry.addObject("scriptitem", arg.asType(ItemTag.class)); } else if (!scriptEntry.hasObject("slot") && !scriptEntry.hasObject("type") @@ -106,13 +106,13 @@ else if (!scriptEntry.hasObject("slot") } else if (!scriptEntry.hasObject("items") && !scriptEntry.hasObject("type") - && arg.matchesArgumentList(dItem.class)) { - scriptEntry.addObject("items", ListTag.valueOf(arg.raw_value.replace("item:", "")).filter(dItem.class, scriptEntry)); + && arg.matchesArgumentList(ItemTag.class)) { + scriptEntry.addObject("items", ListTag.valueOf(arg.raw_value.replace("item:", "")).filter(ItemTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("inventory") && arg.matchesPrefix("f", "from") - && arg.matchesArgumentType(dInventory.class)) { - scriptEntry.addObject("inventory", arg.asType(dInventory.class)); + && arg.matchesArgumentType(InventoryTag.class)) { + scriptEntry.addObject("inventory", arg.asType(InventoryTag.class)); } else if (!scriptEntry.hasObject("type") && arg.matches("inventory")) { @@ -147,20 +147,20 @@ else if (!scriptEntry.hasObject("inventory") @Override public void execute(ScriptEntry scriptEntry) { - dInventory inventory = (dInventory) scriptEntry.getObject("inventory"); + InventoryTag inventory = (InventoryTag) scriptEntry.getObject("inventory"); ElementTag qty = scriptEntry.getElement("qty"); ElementTag displayname = scriptEntry.getElement("displayname"); - dItem scriptitem = scriptEntry.getdObject("scriptitem"); + ItemTag scriptitem = scriptEntry.getdObject("scriptitem"); ElementTag slot = scriptEntry.getElement("slot"); ListTag titleAuthor = scriptEntry.getdObject("cover"); ElementTag nbtKey = scriptEntry.getElement("nbt_key"); Type type = (Type) scriptEntry.getObject("type"); Object items_object = scriptEntry.getObject("items"); - List items = null; + List items = null; if (items_object != null) { - items = (List) items_object; + items = (List) items_object; } if (scriptEntry.dbCallShouldDebug()) { @@ -218,7 +218,7 @@ public void execute(ScriptEntry scriptEntry) { } case ITEM: { - for (dItem item : items) { + for (ItemTag item : items) { ItemStack is = item.getItemStack(); is.setAmount(qty.asInt()); @@ -286,7 +286,7 @@ public void execute(ScriptEntry scriptEntry) { for (ItemStack it : inventory.getContents()) { if (script_items < qty.asInt() && it != null - && scriptitem.getScriptName().equalsIgnoreCase(new dItem(it).getScriptName())) { + && scriptitem.getScriptName().equalsIgnoreCase(new ItemTag(it).getScriptName())) { int amt = it.getAmount(); if (script_items + amt <= qty.asInt()) { inventory.getInventory().removeItem(it); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/ActionCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/ActionCommand.java index 6cde924653..98200ade91 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/ActionCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/ActionCommand.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dNPC; +import com.denizenscript.denizen.objects.NPCTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.*; import com.denizenscript.denizencore.objects.core.ListTag; @@ -52,8 +52,8 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("npcs") - && arg.matchesArgumentList(dNPC.class)) { - scriptEntry.addObject("npcs", arg.asType(ListTag.class).filter(dNPC.class, scriptEntry)); + && arg.matchesArgumentList(NPCTag.class)) { + scriptEntry.addObject("npcs", arg.asType(ListTag.class).filter(NPCTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("context") && arg.matchesPrefix("context", "c")) { @@ -90,7 +90,7 @@ public void execute(ScriptEntry scriptEntry) { ListTag actions = (ListTag) scriptEntry.getObject("actions"); ListTag context = (ListTag) scriptEntry.getObject("context"); - List npcs = (List) scriptEntry.getObject("npcs"); + List npcs = (List) scriptEntry.getObject("npcs"); if (scriptEntry.dbCallShouldDebug()) { @@ -108,7 +108,7 @@ public void execute(ScriptEntry scriptEntry) { context_map.put(context.get(i), ObjectFetcher.pickObjectFor(context.get(i + 1), scriptEntry.entryData.getTagContext())); } - for (dNPC npc : npcs) { + for (NPCTag npc : npcs) { for (String action : actions) { npc.action(action, Utilities.getEntryPlayer(scriptEntry), context_map); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/AnchorCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/AnchorCommand.java index efeb30f84d..9cf2e1360f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/AnchorCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/AnchorCommand.java @@ -2,8 +2,8 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dNPC; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.NPCTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.ArgumentHelper; @@ -35,9 +35,9 @@ public class AnchorCommand extends AbstractCommand { // NPC desired, can create a link, or alternatively override the default linked npc. // // @Tags - // - // - // + // + // + // // // @Usage // Use to add and remove anchors to an NPC. @@ -73,8 +73,8 @@ else if (!scriptEntry.hasObject("id") scriptEntry.addObject("id", arg.asElement()); } else if (!scriptEntry.hasObject("location") - && arg.matchesArgumentType(dLocation.class)) { - scriptEntry.addObject("location", arg.asType(dLocation.class)); + && arg.matchesArgumentType(LocationTag.class)) { + scriptEntry.addObject("location", arg.asType(LocationTag.class)); } else { arg.reportUnhandled(); @@ -98,10 +98,10 @@ public void execute(ScriptEntry scriptEntry) { // Get objects Action action = (Action) scriptEntry.getObject("action"); - dLocation location = (dLocation) scriptEntry.getObject("location"); + LocationTag location = (LocationTag) scriptEntry.getObject("location"); ElementTag range = (ElementTag) scriptEntry.getObject("range"); ElementTag id = (ElementTag) scriptEntry.getObject("id"); - dNPC npc = Utilities.getEntryNPC(scriptEntry); + NPCTag npc = Utilities.getEntryNPC(scriptEntry); // Report to dB if (scriptEntry.dbCallShouldDebug()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/AssignmentCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/AssignmentCommand.java index ee9b344a26..fed4c1f4e5 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/AssignmentCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/AssignmentCommand.java @@ -23,11 +23,11 @@ public class AssignmentCommand extends AbstractCommand { // @Description // Changes an NPC's assignment as though you used the '/npc assignment' command. // Uses the script: argument, which accepts an assignment script type. For this command to work an npc must - // be attached to the script queue or an npc specified with npc:n@npc. + // be attached to the script queue or an npc specified with npc:NPCTag. // // @Tags - // - // + // + // // ]> // // @Usage diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/BreakCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/BreakCommand.java index dce05728f3..4f00bac01a 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/BreakCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/BreakCommand.java @@ -3,9 +3,9 @@ import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; -import com.denizenscript.denizen.objects.dNPC; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; +import com.denizenscript.denizen.objects.NPCTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -37,8 +37,8 @@ public class BreakCommand extends AbstractCommand implements Holdable { // breaking the block from within. To specify the radius, prefix the radius with 'radius:'. // // @Tags - // - // + // + // // // @Usage // Use to make the npc break a block at 17,64,-87 in world. @@ -59,12 +59,12 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("location") - && arg.matchesArgumentType(dLocation.class)) { - scriptEntry.addObject("location", arg.asType(dLocation.class)); + && arg.matchesArgumentType(LocationTag.class)) { + scriptEntry.addObject("location", arg.asType(LocationTag.class)); } else if (!scriptEntry.hasObject("npc") - && arg.matchesArgumentType(dNPC.class)) { - scriptEntry.addObject("npc", arg.asType(dNPC.class)); + && arg.matchesArgumentType(NPCTag.class)) { + scriptEntry.addObject("npc", arg.asType(NPCTag.class)); } else if (!scriptEntry.hasObject("radius") && arg.matchesPrimitive(ArgumentHelper.PrimitiveType.Double)) { @@ -108,12 +108,12 @@ else if (!scriptEntry.hasObject("radius") @Override public void execute(ScriptEntry scriptEntry) { - final dLocation location = (dLocation) scriptEntry.getObject("location"); - final dNPC npc = (dNPC) scriptEntry.getObject("npc"); + final LocationTag location = (LocationTag) scriptEntry.getObject("location"); + final NPCTag npc = (NPCTag) scriptEntry.getObject("npc"); ElementTag radius = scriptEntry.getElement("radius"); final HashMap context = new HashMap<>(); - dMaterial material = new dMaterial(location.getBlock()); + MaterialTag material = new MaterialTag(location.getBlock()); context.put("location", location); context.put("material", material); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/CreateCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/CreateCommand.java index 1692f64de3..593abe6be5 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/CreateCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/CreateCommand.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.scripts.commands.npc; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dNPC; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.NPCTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.*; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -48,17 +48,17 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("entity_type") - && arg.matchesArgumentType(dEntity.class)) { + && arg.matchesArgumentType(EntityTag.class)) { // Avoid duplication of objects - dEntity ent = arg.asType(dEntity.class); + EntityTag ent = arg.asType(EntityTag.class); if (!ent.isGeneric() && !ent.isCitizensNPC()) { throw new InvalidArgumentsException("Entity supplied must be generic or a Citizens NPC!"); } scriptEntry.addObject("entity_type", ent); } else if (!scriptEntry.hasObject("spawn_location") - && arg.matchesArgumentType(dLocation.class)) { - scriptEntry.addObject("spawn_location", arg.asType(dLocation.class)); + && arg.matchesArgumentType(LocationTag.class)) { + scriptEntry.addObject("spawn_location", arg.asType(LocationTag.class)); } else if (!scriptEntry.hasObject("name")) { scriptEntry.addObject("name", arg.asElement()); @@ -84,8 +84,8 @@ else if (!scriptEntry.hasObject("traits") public void execute(final ScriptEntry scriptEntry) { ElementTag name = (ElementTag) scriptEntry.getObject("name"); - dEntity type = (dEntity) scriptEntry.getObject("entity_type"); - dLocation loc = (dLocation) scriptEntry.getObject("spawn_location"); + EntityTag type = (EntityTag) scriptEntry.getObject("entity_type"); + LocationTag loc = (LocationTag) scriptEntry.getObject("spawn_location"); ListTag traits = (ListTag) scriptEntry.getObject("traits"); if (scriptEntry.dbCallShouldDebug()) { @@ -95,13 +95,13 @@ public void execute(final ScriptEntry scriptEntry) { } - dNPC created; + NPCTag created; if (!type.isGeneric() && type.isCitizensNPC()) { - created = new dNPC(type.getDenizenNPC().getCitizen().clone()); + created = new NPCTag(type.getDenizenNPC().getCitizen().clone()); created.getCitizen().setName(name.asString()); } else { - created = dNPC.mirrorCitizensNPC(CitizensAPI.getNPCRegistry() + created = NPCTag.mirrorCitizensNPC(CitizensAPI.getNPCRegistry() .createNPC(type.getBukkitEntityType(), name.asString())); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/DespawnCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/DespawnCommand.java index 2c6889ef25..fdba620a4f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/DespawnCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/DespawnCommand.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dNPC; +import com.denizenscript.denizen.objects.NPCTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.ArgumentHelper; @@ -31,7 +31,7 @@ public class DespawnCommand extends AbstractCommand { // or interactable, but they still exist and can be respawned. // // @Tags - // + // // // @Usage // Use to despawn the linked NPC. @@ -48,8 +48,8 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("npcs") - && arg.matchesArgumentList(dNPC.class)) { - scriptEntry.addObject("npcs", arg.asType(ListTag.class).filter(dNPC.class, scriptEntry)); + && arg.matchesArgumentList(NPCTag.class)) { + scriptEntry.addObject("npcs", arg.asType(ListTag.class).filter(NPCTag.class, scriptEntry)); } else { arg.reportUnhandled(); @@ -72,7 +72,7 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException public void execute(final ScriptEntry scriptEntry) { // Get objects - List npcs = (List) scriptEntry.getObject("npcs"); + List npcs = (List) scriptEntry.getObject("npcs"); // Report to dB if (scriptEntry.dbCallShouldDebug()) { @@ -80,7 +80,7 @@ public void execute(final ScriptEntry scriptEntry) { ArgumentHelper.debugObj("NPCs", npcs.toString())); } - for (dNPC npc : npcs) { + for (NPCTag npc : npcs) { if (npc.isSpawned()) { if (npc.getCitizen().hasTrait(Spawned.class)) { npc.getCitizen().getTrait(Spawned.class).setSpawned(false); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/DisengageCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/DisengageCommand.java index f7ab708399..3601879607 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/DisengageCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/DisengageCommand.java @@ -19,7 +19,7 @@ public class DisengageCommand extends AbstractCommand { // @Description // Re-enables any toggled triggers that have been disabled by disengage. Using // disengage inside scripts must have an NPC to reference, or one may be specified - // by supplying a valid dNPC object with the npc argument. + // by supplying a valid NPCTag object with the npc argument. // // This is mostly regarded as an 'interact script command', though it may be used inside // other script types. This is because disengage works with the trigger system, which is an @@ -31,7 +31,7 @@ public class DisengageCommand extends AbstractCommand { // See <@link command Engage> // // @Tags - // + // // // @Usage // Use to reenable an NPC's triggers, disabled via 'engage'. diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/EngageCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/EngageCommand.java index 1ca470b6fe..25ae9bee0b 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/EngageCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/EngageCommand.java @@ -3,7 +3,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.Settings; -import com.denizenscript.denizen.objects.dNPC; +import com.denizenscript.denizen.objects.NPCTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.DurationTag; @@ -42,7 +42,7 @@ public class EngageCommand extends AbstractCommand { // See <@link command Disengage> // // @Tags - // + // // // @Usage // Use to make an NPC appear 'busy'. @@ -91,7 +91,7 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException public void execute(ScriptEntry scriptEntry) { DurationTag duration = scriptEntry.getdObject("duration"); - dNPC npc = Utilities.getEntryNPC(scriptEntry); + NPCTag npc = Utilities.getEntryNPC(scriptEntry); // Report to dB if (scriptEntry.dbCallShouldDebug()) { @@ -113,11 +113,11 @@ public void execute(ScriptEntry scriptEntry) { private static Map currentlyEngaged = new HashMap<>(); /** - * Checks if the dNPC is ENGAGED. Engaged NPCs do not respond to + * Checks if the NPCTag is ENGAGED. Engaged NPCs do not respond to * Player interaction. * * @param npc the Denizen NPC being checked - * @return if the dNPC is currently engaged + * @return if the NPCTag is currently engaged */ public static boolean getEngaged(NPC npc) { if (currentlyEngaged.containsKey(npc)) { @@ -129,12 +129,12 @@ public static boolean getEngaged(NPC npc) { } /** - * Sets a dNPC's ENGAGED status. Engaged NPCs do not respond to Player + * Sets a NPCTag's ENGAGED status. Engaged NPCs do not respond to Player * interaction. Note: Denizen NPC will automatically disengage after the * engage_timeout_in_seconds which is set in the Denizen config.yml. * - * @param npc the dNPC affected - * @param engaged true sets the dNPC engaged, false sets the dNPC as disengaged + * @param npc the NPCTag affected + * @param engaged true sets the NPCTag engaged, false sets the NPCTag as disengaged */ public static void setEngaged(NPC npc, boolean engaged) { if (engaged) { @@ -147,12 +147,12 @@ public static void setEngaged(NPC npc, boolean engaged) { } /** - * Sets a dNPC as ENGAGED for a specific amount of seconds. Engaged NPCs do not + * Sets a NPCTag as ENGAGED for a specific amount of seconds. Engaged NPCs do not * respond to Player interaction. If the NPC is previously engaged, using this will * over-ride the previously set duration. * - * @param npc the dNPC to set as engaged - * @param duration the number of seconds to engage the dNPC + * @param npc the NPCTag to set as engaged + * @param duration the number of seconds to engage the NPCTag */ public static void setEngaged(NPC npc, int duration) { currentlyEngaged.put(npc, System.currentTimeMillis() + duration * 1000); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/FishCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/FishCommand.java index b5aac7059e..464f60bf77 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/FishCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/FishCommand.java @@ -4,8 +4,8 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.nms.interfaces.FishingHelper; import com.denizenscript.denizen.npc.traits.FishingTrait; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dNPC; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.NPCTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -50,8 +50,8 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("location") - && arg.matchesArgumentType(dLocation.class)) { - scriptEntry.addObject("location", arg.asType(dLocation.class)); + && arg.matchesArgumentType(LocationTag.class)) { + scriptEntry.addObject("location", arg.asType(LocationTag.class)); } else if (!scriptEntry.hasObject("catch") && arg.matchesPrefix("catch") @@ -87,12 +87,12 @@ else if (!scriptEntry.hasObject("percent") @Override public void execute(ScriptEntry scriptEntry) { - dLocation location = scriptEntry.getdObject("location"); + LocationTag location = scriptEntry.getdObject("location"); ElementTag catchtype = scriptEntry.getElement("catch"); ElementTag stop = scriptEntry.getElement("stop"); ElementTag percent = scriptEntry.getElement("percent"); - dNPC npc = Utilities.getEntryNPC(scriptEntry); + NPCTag npc = Utilities.getEntryNPC(scriptEntry); FishingTrait trait = npc.getFishingTrait(); if (scriptEntry.dbCallShouldDebug()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/LookcloseCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/LookcloseCommand.java index fce3b39f3b..a2208498a2 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/LookcloseCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/LookcloseCommand.java @@ -3,7 +3,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.BukkitScriptEntryData; -import com.denizenscript.denizen.objects.dNPC; +import com.denizenscript.denizen.objects.NPCTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -58,9 +58,9 @@ else if (arg.matchesPrimitive(ArgumentHelper.PrimitiveType.Integer)) { else if (arg.matchesPrimitive(ArgumentHelper.PrimitiveType.Boolean)) { scriptEntry.addObject("toggle", arg.asElement()); } - else if (arg.matchesArgumentType(dNPC.class)) // TODO: better way of handling this? + else if (arg.matchesArgumentType(NPCTag.class)) // TODO: better way of handling this? { - ((BukkitScriptEntryData) scriptEntry.entryData).setNPC(arg.asType(dNPC.class)); + ((BukkitScriptEntryData) scriptEntry.entryData).setNPC(arg.asType(NPCTag.class)); } else { arg.reportUnhandled(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/PauseCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/PauseCommand.java index 000da57b36..18c38a0b92 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/PauseCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/PauseCommand.java @@ -3,7 +3,7 @@ import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dNPC; +import com.denizenscript.denizen.objects.NPCTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.ArgumentHelper; import com.denizenscript.denizencore.scripts.ScriptEntry; @@ -27,7 +27,7 @@ public class PauseCommand extends AbstractCommand { // TODO: Document Command Details // // @Tags - // + // // // @Usage // Use to pause an NPC's waypoint navigation indefinitely. @@ -55,7 +55,7 @@ public class PauseCommand extends AbstractCommand { // TODO: Document Command Details // // @Tags - // + // // // @Usage // Use to pause an NPC's waypoint navigation indefinitely. @@ -77,8 +77,6 @@ enum PauseType {ACTIVITY, WAYPOINTS, NAVIGATION} int duration; PauseType pauseType; - dNPC dNPC; - Player player; @Override public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException { @@ -86,14 +84,6 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException // Set defaults with information from the ScriptEntry duration = -1; pauseType = null; - dNPC = null; - player = null; - if (Utilities.getEntryNPC(scriptEntry) != null) { - dNPC = Utilities.getEntryNPC(scriptEntry); - } - if (Utilities.getEntryPlayer(scriptEntry) != null) { - player = Utilities.getEntryPlayer(scriptEntry).getPlayerEntity(); - } // Parse arguments // TODO: UPDATE COMMAND PARSING @@ -117,14 +107,21 @@ else if (ArgumentHelper.matchesArg("WAYPOINTS", arg) || ArgumentHelper.matchesAr @Override public void execute(ScriptEntry scriptEntry) { - - pause(dNPC, pauseType, !scriptEntry.getCommandName().equalsIgnoreCase("RESUME")); + Player player = null; + NPCTag npc = null; + if (Utilities.getEntryNPC(scriptEntry) != null) { + npc = Utilities.getEntryNPC(scriptEntry); + } + if (Utilities.getEntryPlayer(scriptEntry) != null) { + player = Utilities.getEntryPlayer(scriptEntry).getPlayerEntity(); + } + pause(npc, pauseType, !scriptEntry.getCommandName().equalsIgnoreCase("RESUME")); // If duration... if (duration > 0) { - if (durations.containsKey(dNPC.getCitizen().getId() + pauseType.name())) { + if (durations.containsKey(npc.getCitizen().getId() + pauseType.name())) { try { - DenizenAPI.getCurrentInstance().getServer().getScheduler().cancelTask(durations.get(dNPC.getCitizen().getId() + pauseType.name())); + DenizenAPI.getCurrentInstance().getServer().getScheduler().cancelTask(durations.get(npc.getCitizen().getId() + pauseType.name())); } catch (Exception e) { Debug.echoError(scriptEntry.getResidingQueue(), "There was an error pausing that!"); @@ -134,21 +131,22 @@ public void execute(ScriptEntry scriptEntry) { } Debug.echoDebug(scriptEntry, "Running delayed task: Unpause " + pauseType.toString()); + final NPCTag theNpc = npc; final ScriptEntry se = scriptEntry; - durations.put(dNPC.getId() + pauseType.name(), DenizenAPI.getCurrentInstance() + durations.put(npc.getId() + pauseType.name(), DenizenAPI.getCurrentInstance() .getServer().getScheduler().scheduleSyncDelayedTask(DenizenAPI.getCurrentInstance(), new Runnable() { @Override public void run() { Debug.echoDebug(se, "Running delayed task: Pausing " + pauseType.toString()); - pause(dNPC, pauseType, false); + pause(theNpc, pauseType, false); } }, duration * 20)); } } - public void pause(dNPC denizen, PauseType pauseType, boolean pause) { + public void pause(NPCTag denizen, PauseType pauseType, boolean pause) { switch (pauseType) { case WAYPOINTS: diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/PoseCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/PoseCommand.java index d626592428..075015fac2 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/PoseCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/PoseCommand.java @@ -2,8 +2,8 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dNPC; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.NPCTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.ArgumentHelper; @@ -30,8 +30,8 @@ public class PoseCommand extends AbstractCommand { // is the pitch and yaw. // // @Tags - // ]> - // ]> + // ]> + // ]> // // @Usage // Make an NPC assume a pose. @@ -65,8 +65,8 @@ else if (arg.matchesPrefix("id")) { else if (arg.matches("player")) { scriptEntry.addObject("target", TargetType.PLAYER); } - else if (arg.matchesArgumentType(dLocation.class)) { - scriptEntry.addObject("pose_loc", arg.asType(dLocation.class)); + else if (arg.matchesArgumentType(LocationTag.class)) { + scriptEntry.addObject("pose_loc", arg.asType(LocationTag.class)); } } @@ -103,10 +103,10 @@ public void execute(ScriptEntry scriptEntry) { // Get objects TargetType target = (TargetType) scriptEntry.getObject("target"); - dNPC npc = Utilities.getEntryNPC(scriptEntry); + NPCTag npc = Utilities.getEntryNPC(scriptEntry); Action action = (Action) scriptEntry.getObject("action"); String id = (String) scriptEntry.getObject("pose_id"); - dLocation pose_loc = (dLocation) scriptEntry.getObject("pose_loc"); + LocationTag pose_loc = (LocationTag) scriptEntry.getObject("pose_loc"); // Report to dB if (scriptEntry.dbCallShouldDebug()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/PushableCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/PushableCommand.java index 657cdc72b4..3383b57bc6 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/PushableCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/PushableCommand.java @@ -3,7 +3,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.npc.traits.PushableTrait; -import com.denizenscript.denizen.objects.dNPC; +import com.denizenscript.denizen.objects.NPCTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.DurationTag; @@ -65,7 +65,7 @@ else if (!scriptEntry.hasObject("return") @Override public void execute(ScriptEntry scriptEntry) { - dNPC denizenNPC = Utilities.getEntryNPC(scriptEntry); + NPCTag denizenNPC = Utilities.getEntryNPC(scriptEntry); if (denizenNPC == null) { Debug.echoError("No valid NPC attached to this queue!"); return; diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/RenameCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/RenameCommand.java index f603a63bae..eb111c6147 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/RenameCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/RenameCommand.java @@ -28,8 +28,8 @@ public class RenameCommand extends AbstractCommand { // NPC names may exceed the 16 character limit of normal Minecraft names. // // @Tags - // - // + // + // // // @Usage // Use to rename the linked NPC. diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/SitCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/SitCommand.java index 3e41832d83..7638ecf0a6 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/SitCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/SitCommand.java @@ -3,7 +3,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.npc.traits.SittingTrait; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.ArgumentHelper; @@ -37,9 +37,9 @@ public class SitCommand extends AbstractCommand { public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException { for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { - if (arg.matchesArgumentType(dLocation.class) + if (arg.matchesArgumentType(LocationTag.class) && !scriptEntry.hasObject("location")) { - scriptEntry.addObject("location", arg.asType(dLocation.class)); + scriptEntry.addObject("location", arg.asType(LocationTag.class)); } else { arg.reportUnhandled(); @@ -53,7 +53,7 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException @Override public void execute(ScriptEntry scriptEntry) { - dLocation location = (dLocation) scriptEntry.getObject("location"); + LocationTag location = (LocationTag) scriptEntry.getObject("location"); if (Utilities.getEntryNPC(scriptEntry).getEntityType() != EntityType.PLAYER && Utilities.getEntryNPC(scriptEntry).getEntityType() != EntityType.OCELOT && Utilities.getEntryNPC(scriptEntry).getEntityType() != EntityType.WOLF) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/TraitCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/TraitCommand.java index 0d5aefa3ca..8e55c827b7 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/TraitCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/TraitCommand.java @@ -26,8 +26,8 @@ public class TraitCommand extends AbstractCommand { // TODO: Document Command Details // // @Tags - // ]> - // + // ]> + // // // @Usage // TODO: Document Command Details diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/TriggerCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/TriggerCommand.java index 6f10eda854..46f597a55f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/TriggerCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/TriggerCommand.java @@ -3,7 +3,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.npc.traits.TriggerTrait; -import com.denizenscript.denizen.objects.dNPC; +import com.denizenscript.denizen.objects.NPCTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.DurationTag; @@ -25,7 +25,7 @@ public class TriggerCommand extends AbstractCommand { // TODO: Document Command Details // // @Tags - // ]> + // ]> // // @Usage // Use to enable the click trigger. @@ -61,8 +61,8 @@ else if (!scriptEntry.hasObject("toggle") scriptEntry.addObject("toggle", arg.asElement()); } else if (!scriptEntry.hasObject("npc") - && arg.matchesArgumentType(dNPC.class)) { - scriptEntry.addObject("npc", arg.asType(dNPC.class)); + && arg.matchesArgumentType(NPCTag.class)) { + scriptEntry.addObject("npc", arg.asType(NPCTag.class)); } else if (!scriptEntry.hasObject("trigger")) { scriptEntry.addObject("trigger", arg.asElement()); @@ -93,7 +93,7 @@ public void execute(ScriptEntry scriptEntry) { ElementTag trigger = scriptEntry.getElement("trigger"); ElementTag radius = scriptEntry.getElement("radius"); DurationTag cooldown = (DurationTag) scriptEntry.getObject("cooldown"); - dNPC npc = scriptEntry.hasObject("npc") ? (dNPC) scriptEntry.getObject("npc") : Utilities.getEntryNPC(scriptEntry); + NPCTag npc = scriptEntry.hasObject("npc") ? (NPCTag) scriptEntry.getObject("npc") : Utilities.getEntryNPC(scriptEntry); if (scriptEntry.dbCallShouldDebug()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/VulnerableCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/VulnerableCommand.java index 2b4a13d80f..052f7fd59b 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/VulnerableCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/VulnerableCommand.java @@ -25,7 +25,7 @@ public class VulnerableCommand extends AbstractCommand { // Toggles whether an NPC can be hurt or not. // // @Tags - // + // // // @Usage // Makes an NPC vulnerable. diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ActionBarCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ActionBarCommand.java index a69992f8e1..4638b83698 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ActionBarCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ActionBarCommand.java @@ -5,7 +5,7 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.nms.NMSHandler; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -63,8 +63,8 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException scriptEntry.addObject("format", format); } if (arg.matchesPrefix("targets", "target") - && arg.matchesArgumentList(dPlayer.class)) { - scriptEntry.addObject("targets", arg.asType(ListTag.class).filter(dPlayer.class, scriptEntry)); + && arg.matchesArgumentList(PlayerTag.class)) { + scriptEntry.addObject("targets", arg.asType(ListTag.class).filter(PlayerTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("text")) { scriptEntry.addObject("text", new ElementTag(TagManager.cleanOutputFully(arg.raw_value))); @@ -97,7 +97,7 @@ public void execute(ScriptEntry scriptEntry) { ElementTag text = scriptEntry.getElement("text"); FormatScriptContainer format = (FormatScriptContainer) scriptEntry.getObject("format"); - List targets = (List) scriptEntry.getObject("targets"); + List targets = (List) scriptEntry.getObject("targets"); if (scriptEntry.dbCallShouldDebug()) { @@ -108,7 +108,7 @@ public void execute(ScriptEntry scriptEntry) { text = new ElementTag(format.getFormattedText(scriptEntry)); } - for (dPlayer player : targets) { + for (PlayerTag player : targets) { if (player.isValid() && player.isOnline()) { NMSHandler.getInstance().getPacketHelper().sendActionBarMessage(player.getPlayerEntity(), text.asString()); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/AdvancementCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/AdvancementCommand.java index d606a2a845..bf1b7b06aa 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/AdvancementCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/AdvancementCommand.java @@ -5,8 +5,8 @@ import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.interfaces.AdvancementHelper; import com.denizenscript.denizen.nms.util.Advancement; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -93,18 +93,18 @@ else if (!scriptEntry.hasObject("delete") } else if (!scriptEntry.hasObject("grant") && arg.matchesPrefix("grant", "give", "g") - && arg.matchesArgumentList(dPlayer.class)) { + && arg.matchesArgumentList(PlayerTag.class)) { scriptEntry.addObject("grant", arg.asType(ListTag.class)); } else if (!scriptEntry.hasObject("revoke") && arg.matchesPrefix("revoke", "take", "r") - && arg.matchesArgumentList(dPlayer.class)) { + && arg.matchesArgumentList(PlayerTag.class)) { scriptEntry.addObject("revoke", arg.asType(ListTag.class)); } else if (!scriptEntry.hasObject("icon") && arg.matchesPrefix("icon", "i") - && arg.matchesArgumentType(dItem.class)) { - scriptEntry.addObject("icon", arg.asType(dItem.class)); + && arg.matchesArgumentType(ItemTag.class)) { + scriptEntry.addObject("icon", arg.asType(ItemTag.class)); } else if (!scriptEntry.hasObject("title") && arg.matchesPrefix("title", "text", "t")) { @@ -157,7 +157,7 @@ else if (!scriptEntry.hasObject("y") throw new InvalidArgumentsException("Must specify an ID!"); } - scriptEntry.defaultObject("icon", new dItem(Material.AIR)); + scriptEntry.defaultObject("icon", new ItemTag(Material.AIR)); scriptEntry.defaultObject("title", new ElementTag("")); scriptEntry.defaultObject("description", new ElementTag("")); scriptEntry.defaultObject("background", new ElementTag("minecraft:textures/gui/advancements/backgrounds/stone.png")); @@ -179,7 +179,7 @@ public void execute(ScriptEntry scriptEntry) { ElementTag delete = scriptEntry.getElement("delete"); ListTag grant = scriptEntry.getdObject("grant"); ListTag revoke = scriptEntry.getdObject("revoke"); - dItem icon = scriptEntry.getdObject("icon"); + ItemTag icon = scriptEntry.getdObject("icon"); ElementTag title = scriptEntry.getElement("title"); ElementTag description = scriptEntry.getElement("description"); ElementTag background = scriptEntry.getElement("background"); @@ -239,7 +239,7 @@ else if (delete != null) { } else if (grant != null) { Advancement advancement = customRegistered.get(key); - for (dPlayer target : grant.filter(dPlayer.class, scriptEntry)) { + for (PlayerTag target : grant.filter(PlayerTag.class, scriptEntry)) { Player player = target.getPlayerEntity(); if (player != null) { advancementHelper.grant(advancement, player); @@ -248,7 +248,7 @@ else if (grant != null) { } else /*if (revoke != null)*/ { Advancement advancement = customRegistered.get(key); - for (dPlayer target : revoke.filter(dPlayer.class, scriptEntry)) { + for (PlayerTag target : revoke.filter(PlayerTag.class, scriptEntry)) { Player player = target.getPlayerEntity(); if (player != null) { advancementHelper.revoke(advancement, player); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/BlockCrackCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/BlockCrackCommand.java index db81e816de..697932fe39 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/BlockCrackCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/BlockCrackCommand.java @@ -4,8 +4,8 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.interfaces.PacketHelper; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -59,15 +59,15 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (arg.matchesPrefix("players") - && arg.matchesArgumentList(dPlayer.class)) { - scriptEntry.addObject("players", arg.asType(ListTag.class).filter(dPlayer.class, scriptEntry)); + && arg.matchesArgumentList(PlayerTag.class)) { + scriptEntry.addObject("players", arg.asType(ListTag.class).filter(PlayerTag.class, scriptEntry)); } else if (arg.matchesPrefix("progress") && arg.matchesPrimitive(ArgumentHelper.PrimitiveType.Integer)) { scriptEntry.addObject("progress", arg.asElement()); } - else if (arg.matchesArgumentType(dLocation.class)) { - scriptEntry.addObject("location", arg.asType(dLocation.class)); + else if (arg.matchesArgumentType(LocationTag.class)) { + scriptEntry.addObject("location", arg.asType(LocationTag.class)); } else if (arg.matches("stack")) { scriptEntry.addObject("stack", new ElementTag(true)); @@ -101,9 +101,9 @@ private static class IntHolder { @Override public void execute(ScriptEntry scriptEntry) { - List players = (List) scriptEntry.getObject("players"); + List players = (List) scriptEntry.getObject("players"); ElementTag progress = scriptEntry.getElement("progress"); - dLocation location = scriptEntry.getdObject("location"); + LocationTag location = scriptEntry.getdObject("location"); ElementTag stack = scriptEntry.getElement("stack"); if (scriptEntry.dbCallShouldDebug()) { @@ -124,7 +124,7 @@ public void execute(ScriptEntry scriptEntry) { PacketHelper packetHelper = NMSHandler.getInstance().getPacketHelper(); - for (dPlayer player : players) { + for (PlayerTag player : players) { if (!player.isOnline()) { Debug.echoError("Players must be online!"); continue; diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ChatCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ChatCommand.java index c1823c7314..3a26957b9e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ChatCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ChatCommand.java @@ -5,7 +5,7 @@ import com.denizenscript.denizen.Settings; import com.denizenscript.denizen.npc.speech.DenizenSpeechContext; import com.denizenscript.denizen.npc.speech.DenizenSpeechController; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -75,7 +75,7 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { // Default target is the attached Player, if none specified otherwise. if (arg.matchesPrefix("target", "targets", "t")) { - if (arg.matchesArgumentList(dEntity.class)) { + if (arg.matchesArgumentList(EntityTag.class)) { scriptEntry.addObject("targets", arg.asType(ListTag.class)); } specified_targets = true; @@ -86,7 +86,7 @@ else if (arg.matches("no_target")) { // Default talker is the attached NPC, if none specified otherwise. else if (arg.matchesPrefix("talker", "talkers")) { - if (arg.matchesArgumentList(dEntity.class)) { + if (arg.matchesArgumentList(EntityTag.class)) { scriptEntry.addObject("talkers", arg.asType(ListTag.class)); } specified_talker = true; @@ -151,12 +151,12 @@ public void execute(ScriptEntry scriptEntry) { scriptEntry, chatRange.asDouble()); if (!targets.isEmpty()) { - for (dEntity ent : targets.filter(dEntity.class, scriptEntry)) { + for (EntityTag ent : targets.filter(EntityTag.class, scriptEntry)) { context.addRecipient(ent.getBukkitEntity()); } } - for (dEntity talker : talkers.filter(dEntity.class, scriptEntry)) { + for (EntityTag talker : talkers.filter(EntityTag.class, scriptEntry)) { Entity entity = talker.getBukkitEntity(); if (entity != null) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/CompassCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/CompassCommand.java index 93f67cf6b3..f179d0121c 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/CompassCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/CompassCommand.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -32,7 +32,7 @@ public class CompassCommand extends AbstractCommand { // Reset argument will turn the direction to default (spawn or bed) // // @Tags - // + // // // @Usage // Use to reset the compass direction to its default @@ -44,7 +44,7 @@ public class CompassCommand extends AbstractCommand { // // @Usage // Use to point with a compass to the world's spawn location - // - compass + // - compass // --> @Override @@ -55,8 +55,8 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("location") - && arg.matchesArgumentType(dLocation.class)) { - scriptEntry.addObject("location", arg.asType(dLocation.class)); + && arg.matchesArgumentType(LocationTag.class)) { + scriptEntry.addObject("location", arg.asType(LocationTag.class)); } else if (!scriptEntry.hasObject("reset") && arg.matches("reset")) { @@ -81,7 +81,7 @@ public void execute(ScriptEntry scriptEntry) { // Fetch required objects - dLocation location = scriptEntry.getdObject("location"); + LocationTag location = scriptEntry.getdObject("location"); ElementTag reset = scriptEntry.getElement("reset"); Player player = Utilities.getEntryPlayer(scriptEntry).getPlayerEntity(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ExperienceCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ExperienceCommand.java index 0b7d7e9a3a..7c1338808f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ExperienceCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ExperienceCommand.java @@ -27,10 +27,10 @@ public class ExperienceCommand extends AbstractCommand { // set the players experience bar to 0) // // @Tags - // - // - // - // + // + // + // + // // // @Usage // Use to set a player's experience bar to 0. diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/GlowCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/GlowCommand.java index cf0961e252..5cfd80bcf9 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/GlowCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/GlowCommand.java @@ -3,7 +3,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.utilities.depends.Depends; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -36,7 +36,7 @@ public class GlowCommand extends AbstractCommand { // This command does it's best to disable glow effect when the entity is unloaded, but does not guarantee it. // // @Tags - // + // // // @Usage // Use to make the player's target glow. @@ -65,8 +65,8 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("entities") - && arg.matchesArgumentList(dEntity.class)) { - scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(dEntity.class, scriptEntry)); + && arg.matchesArgumentList(EntityTag.class)) { + scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(EntityTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("glowing") && arg.matchesPrimitive(ArgumentHelper.PrimitiveType.Boolean)) { @@ -91,7 +91,7 @@ else if (!scriptEntry.hasObject("glowing") @Override public void execute(ScriptEntry scriptEntry) { - final ArrayList entities = (ArrayList) scriptEntry.getObject("entities"); + final ArrayList entities = (ArrayList) scriptEntry.getObject("entities"); ElementTag glowing = scriptEntry.getElement("glowing"); if (scriptEntry.dbCallShouldDebug()) { @@ -109,7 +109,7 @@ public void execute(ScriptEntry scriptEntry) { return; } - for (dEntity ent : entities) { + for (EntityTag ent : entities) { if (Depends.citizens != null && CitizensAPI.getNPCRegistry().isNPC(ent.getLivingEntity())) { CitizensAPI.getNPCRegistry().getNPC(ent.getLivingEntity()).data().setPersistent(NPC.GLOWING_METADATA, shouldGlow); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/GroupCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/GroupCommand.java index bda7b312ab..f9eb30c3d1 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/GroupCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/GroupCommand.java @@ -3,7 +3,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.utilities.depends.Depends; -import com.denizenscript.denizen.objects.dWorld; +import com.denizenscript.denizen.objects.WorldTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -31,10 +31,10 @@ public class GroupCommand extends AbstractCommand { // Note: This requires a permissions plugin. // // @Tags - // ]> - // ].global> - // ].world> - // + // ]> + // ].global> + // ].world> + // // // // @Usage @@ -66,8 +66,8 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException scriptEntry.addObject("action", arg.asElement()); } else if (!scriptEntry.hasObject("world") - && arg.matchesArgumentType(dWorld.class)) { - scriptEntry.addObject("world", arg.asType(dWorld.class)); + && arg.matchesArgumentType(WorldTag.class)) { + scriptEntry.addObject("world", arg.asType(WorldTag.class)); } else if (!scriptEntry.hasObject("group")) { scriptEntry.addObject("group", arg.asElement()); @@ -93,7 +93,7 @@ else if (!scriptEntry.hasObject("group")) { public void execute(ScriptEntry scriptEntry) { ElementTag action = scriptEntry.getElement("action"); - dWorld world = (dWorld) scriptEntry.getObject("world"); + WorldTag world = (WorldTag) scriptEntry.getObject("world"); ElementTag group = scriptEntry.getElement("group"); // Report to dB diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ItemCooldownCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ItemCooldownCommand.java index 72a634e168..2b3578e2bf 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ItemCooldownCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ItemCooldownCommand.java @@ -2,8 +2,8 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dMaterial; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.MaterialTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.DurationTag; @@ -27,7 +27,7 @@ public class ItemCooldownCommand extends AbstractCommand { // Places a cooldown on a material in a player's inventory. // // @Tags - // ]> + // ]> // // @Usage // Places a 1 second cooldown on using an ender pearl. @@ -45,9 +45,9 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("materials") - && (arg.matchesArgumentType(dMaterial.class) + && (arg.matchesArgumentType(MaterialTag.class) || arg.matchesArgumentType(ListTag.class))) { - scriptEntry.addObject("materials", arg.asType(ListTag.class).filter(dMaterial.class, scriptEntry)); + scriptEntry.addObject("materials", arg.asType(ListTag.class).filter(MaterialTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("duration") && arg.matchesPrefix("d", "duration") @@ -69,9 +69,9 @@ else if (!scriptEntry.hasObject("duration") @Override public void execute(ScriptEntry scriptEntry) { - ArrayList materials = (ArrayList) scriptEntry.getObject("materials"); + ArrayList materials = (ArrayList) scriptEntry.getObject("materials"); DurationTag duration = scriptEntry.getdObject("duration"); - dPlayer player = Utilities.getEntryPlayer(scriptEntry); + PlayerTag player = Utilities.getEntryPlayer(scriptEntry); if (player == null) { Debug.echoError("Invalid linked player."); @@ -84,7 +84,7 @@ public void execute(ScriptEntry scriptEntry) { } - for (dMaterial mat : materials) { + for (MaterialTag mat : materials) { player.getPlayerEntity().setCooldown(mat.getMaterial(), duration.getTicksAsInt()); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/KickCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/KickCommand.java index 02c21f2462..9ce4db9074 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/KickCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/KickCommand.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.scripts.commands.player; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -50,8 +50,8 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException scriptEntry.addObject("reason", arg.asElement()); } else if (arg.matchesPrefix("targets", "target", "players") - || arg.matchesArgumentList(dPlayer.class)) { - scriptEntry.addObject("targets", arg.asType(ListTag.class).filter(dPlayer.class, scriptEntry)); + || arg.matchesArgumentList(PlayerTag.class)) { + scriptEntry.addObject("targets", arg.asType(ListTag.class).filter(PlayerTag.class, scriptEntry)); } } @@ -67,7 +67,7 @@ else if (arg.matchesPrefix("targets", "target", "players") public void execute(ScriptEntry scriptEntry) { ElementTag reason = scriptEntry.getElement("reason"); - List targets = (List) scriptEntry.getObject("targets"); + List targets = (List) scriptEntry.getObject("targets"); if (scriptEntry.dbCallShouldDebug()) { @@ -77,7 +77,7 @@ public void execute(ScriptEntry scriptEntry) { } - for (dPlayer player : targets) { + for (PlayerTag player : targets) { if (player.isValid() && player.isOnline()) { player.getPlayerEntity().kickPlayer(reason.toString()); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/MoneyCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/MoneyCommand.java index 704bf29bab..60519722b9 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/MoneyCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/MoneyCommand.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.depends.Depends; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -33,7 +33,7 @@ public class MoneyCommand extends AbstractCommand { // NOTE: This requires an economy plugin. May work for offline players depending on economy plugin. // // @Tags - // + // // // @Usage // Use to give 1 money to the player. @@ -74,8 +74,8 @@ else if (!scriptEntry.hasObject("quantity") && arg.matchesPrefix("quantity", "qt scriptEntry.addObject("quantity", arg.asElement()); } else if (!scriptEntry.hasObject("players") && arg.matchesPrefix("to", "from", "players", "player") && - arg.matchesArgumentList(dPlayer.class)) { - scriptEntry.addObject("players", arg.asType(ListTag.class).filter(dPlayer.class, scriptEntry)); + arg.matchesArgumentList(PlayerTag.class)) { + scriptEntry.addObject("players", arg.asType(ListTag.class).filter(PlayerTag.class, scriptEntry)); } else { arg.reportUnhandled(); @@ -102,7 +102,7 @@ else if (!scriptEntry.hasObject("action")) { public void execute(ScriptEntry scriptEntry) { ElementTag action = scriptEntry.getElement("action"); ElementTag quantity = scriptEntry.getElement("quantity"); - List players = (List) scriptEntry.getObject("players"); + List players = (List) scriptEntry.getObject("players"); if (scriptEntry.dbCallShouldDebug()) { @@ -113,19 +113,19 @@ public void execute(ScriptEntry scriptEntry) { double amt = quantity.asDouble(); switch (Action.valueOf(action.asString().toUpperCase())) { case GIVE: - for (dPlayer player : players) { + for (PlayerTag player : players) { eco.depositPlayer(player.getOfflinePlayer(), amt); } break; case TAKE: - for (dPlayer player : players) { + for (PlayerTag player : players) { eco.withdrawPlayer(player.getOfflinePlayer(), amt); } break; case SET: - for (dPlayer player : players) { + for (PlayerTag player : players) { double balance = eco.getBalance(player.getOfflinePlayer()); if (amt > balance) { eco.depositPlayer(player.getOfflinePlayer(), amt - balance); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/NarrateCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/NarrateCommand.java index e544a5cadd..dce7a1f8b7 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/NarrateCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/NarrateCommand.java @@ -3,7 +3,7 @@ import com.denizenscript.denizen.scripts.containers.core.FormatScriptContainer; import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -67,7 +67,7 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException // Add players to target list else if (!scriptEntry.hasObject("targets") && arg.matchesPrefix("target", "targets", "t")) { - scriptEntry.addObject("targets", arg.asType(ListTag.class).filter(dPlayer.class, scriptEntry)); + scriptEntry.addObject("targets", arg.asType(ListTag.class).filter(PlayerTag.class, scriptEntry)); } // Use raw_value as to not accidentally strip a value before any :'s. @@ -97,7 +97,7 @@ else if (!scriptEntry.hasObject("text")) { @Override public void execute(ScriptEntry scriptEntry) { // Get objects - List targets = (List) scriptEntry.getObject("targets"); + List targets = (List) scriptEntry.getObject("targets"); String text = scriptEntry.getElement("text").asString(); FormatScriptContainer format = (FormatScriptContainer) scriptEntry.getObject("format"); @@ -114,7 +114,7 @@ public void execute(ScriptEntry scriptEntry) { return; } - for (dPlayer player : targets) { + for (PlayerTag player : targets) { if (player != null && player.isOnline()) { player.getPlayerEntity().sendMessage(format != null ? format.getFormattedText(scriptEntry) : text); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/OpenTradesCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/OpenTradesCommand.java index af5b410bc9..5ef894716e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/OpenTradesCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/OpenTradesCommand.java @@ -2,9 +2,9 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dPlayer; -import com.denizenscript.denizen.objects.dTrade; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.PlayerTag; +import com.denizenscript.denizen.objects.TradeTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -37,18 +37,18 @@ public class OpenTradesCommand extends AbstractCommand { // If no player is specified, by default the attached player will be forced to trade. // // @Tags - // - // - // - // + // + // + // + // // // @Usage // Use to open an unusable trade. - // - opentrades trade@trade + // - opentrades TradeTag // // @Usage // Use to open a list of trades with an optional title. - // - opentrades trade@trade[result=i@stone;inputs=li@i@stone;max_uses=9999]|trade@trade[result=i@barrier] "title:Useless Trades" + // - opentrades TradeTag[result=i@stone;inputs=li@i@stone;max_uses=9999]|TradeTag[result=i@barrier] "title:Useless Trades" // // @Usage // Use to force a player to trade with a villager. @@ -61,20 +61,20 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException if (!scriptEntry.hasObject("trades") && !scriptEntry.hasObject("entity") - && arg.matchesArgumentList(dTrade.class)) { - scriptEntry.addObject("trades", arg.asType(ListTag.class).filter(dTrade.class, scriptEntry)); + && arg.matchesArgumentList(TradeTag.class)) { + scriptEntry.addObject("trades", arg.asType(ListTag.class).filter(TradeTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("trades") && !scriptEntry.hasObject("entity") - && arg.matchesArgumentType(dEntity.class)) { - scriptEntry.addObject("entity", arg.asType(dEntity.class)); + && arg.matchesArgumentType(EntityTag.class)) { + scriptEntry.addObject("entity", arg.asType(EntityTag.class)); } else if (arg.matchesPrefix("title")) { scriptEntry.addObject("title", arg.asElement()); } else if (arg.matchesPrefix("players") - && arg.matchesArgumentList(dPlayer.class)) { - scriptEntry.addObject("players", arg.asType(ListTag.class).filter(dPlayer.class, scriptEntry)); + && arg.matchesArgumentList(PlayerTag.class)) { + scriptEntry.addObject("players", arg.asType(ListTag.class).filter(PlayerTag.class, scriptEntry)); } else { arg.reportUnhandled(); @@ -94,9 +94,9 @@ else if (arg.matchesPrefix("players") public void execute(ScriptEntry scriptEntry) { String title = scriptEntry.getElement("title").asString(); - dEntity entity = scriptEntry.getdObject("entity"); - List trades = (List) scriptEntry.getObject("trades"); - List players = (List) scriptEntry.getObject("players"); + EntityTag entity = scriptEntry.getdObject("entity"); + List trades = (List) scriptEntry.getObject("trades"); + List players = (List) scriptEntry.getObject("players"); if (scriptEntry.dbCallShouldDebug()) { @@ -114,7 +114,7 @@ public void execute(ScriptEntry scriptEntry) { return; } if (entity.getBukkitEntity() instanceof Merchant) { - dPlayer player = players.get(0); + PlayerTag player = players.get(0); if (player.isValid() && player.isOnline()) { player.getPlayerEntity().openMerchant((Merchant) entity.getBukkitEntity(), true); } @@ -128,11 +128,11 @@ public void execute(ScriptEntry scriptEntry) { } List recipes = new ArrayList<>(); - for (dTrade trade : trades) { + for (TradeTag trade : trades) { recipes.add(trade.getRecipe()); } - for (dPlayer player : players) { + for (PlayerTag player : players) { if (player.isValid() && player.isOnline()) { Merchant merchant = Bukkit.createMerchant(title); merchant.setRecipes(recipes); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/OxygenCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/OxygenCommand.java index 1d6ac71e31..ac1cc64619 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/OxygenCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/OxygenCommand.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -24,8 +24,8 @@ public class OxygenCommand extends AbstractCommand { // player's maximum oxygen level. Value is in ticks, so 30 equals to 1 bubble. // // @Tags - // - // + // + // // // @Usage // Use to set the player's current oxygen level to 5 bubbles. @@ -91,7 +91,7 @@ public void execute(ScriptEntry scriptEntry) { } - dPlayer player = Utilities.getEntryPlayer(scriptEntry); + PlayerTag player = Utilities.getEntryPlayer(scriptEntry); switch (Type.valueOf(type.asString().toUpperCase())) { case MAXIMUM: diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/PermissionCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/PermissionCommand.java index 8db92471cd..2f7c8bb784 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/PermissionCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/PermissionCommand.java @@ -3,7 +3,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.utilities.depends.Depends; -import com.denizenscript.denizen.objects.dWorld; +import com.denizenscript.denizen.objects.WorldTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -30,9 +30,9 @@ public class PermissionCommand extends AbstractCommand { // Note: This requires a permissions plugin. // // @Tags - // - // - // ]> + // + // + // ]> // // // @Usage @@ -72,8 +72,8 @@ else if (!scriptEntry.hasObject("group") scriptEntry.addObject("group", arg.asElement()); } else if (!scriptEntry.hasObject("world") - && arg.matchesArgumentType(dWorld.class)) { - scriptEntry.addObject("world", arg.asType(dWorld.class)); + && arg.matchesArgumentType(WorldTag.class)) { + scriptEntry.addObject("world", arg.asType(WorldTag.class)); } else if (!scriptEntry.hasObject("permission")) { scriptEntry.addObject("permission", arg.asElement()); @@ -101,7 +101,7 @@ public void execute(ScriptEntry scriptEntry) { ElementTag action = scriptEntry.getElement("action"); ElementTag permission = scriptEntry.getElement("permission"); ElementTag group = scriptEntry.getElement("group"); - dWorld world = (dWorld) scriptEntry.getObject("world"); + WorldTag world = (WorldTag) scriptEntry.getObject("world"); // Report to dB if (scriptEntry.dbCallShouldDebug()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ShowFakeCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ShowFakeCommand.java index 0eee66a7d0..45b37ea2a0 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ShowFakeCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ShowFakeCommand.java @@ -3,9 +3,9 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.blocks.FakeBlock; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.*; import com.denizenscript.denizencore.objects.core.DurationTag; @@ -39,7 +39,7 @@ public class ShowFakeCommand extends AbstractCommand { // If no duration is specefied, then it assumes the default duration of 10 seconds. // // @Tags - // + // // // @Usage // Use to place a fake gold block at where the player is looking @@ -66,25 +66,25 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException if (arg.matchesPrefix("to", "players")) { for (String entity : ListTag.valueOf(arg.getValue())) { - if (dPlayer.matches(entity)) { + if (PlayerTag.matches(entity)) { entities.add(entity); } } added_entities = true; // TODO: handle lists properly } - else if (arg.matchesArgumentList(dMaterial.class)) { + else if (arg.matchesArgumentList(MaterialTag.class)) { scriptEntry.addObject("materials", arg.asType(ListTag.class)); } else if (locations.isEmpty() && arg.matchesArgumentType(ListTag.class)) { for (String item : ListTag.valueOf(arg.getValue())) { - if (dLocation.matches(item)) { + if (LocationTag.matches(item)) { locations.add(item); } } } else if (locations.isEmpty() - && arg.matchesArgumentType(dLocation.class)) { + && arg.matchesArgumentType(LocationTag.class)) { locations.add(arg.getValue()); } else if (arg.matchesPrefix("d", "duration") @@ -147,18 +147,18 @@ public void execute(ScriptEntry scriptEntry) { boolean shouldCancel = cancel.asBoolean(); - List mats = null; + List mats = null; if (!shouldCancel) { - mats = material_list.filter(dMaterial.class, scriptEntry); + mats = material_list.filter(MaterialTag.class, scriptEntry); } int i = 0; - for (dLocation loc : list.filter(dLocation.class, scriptEntry)) { + for (LocationTag loc : list.filter(LocationTag.class, scriptEntry)) { if (!shouldCancel) { - FakeBlock.showFakeBlockTo(players.filter(dPlayer.class, scriptEntry), loc, mats.get(i % mats.size()), duration); + FakeBlock.showFakeBlockTo(players.filter(PlayerTag.class, scriptEntry), loc, mats.get(i % mats.size()), duration); } else { - FakeBlock.stopShowingTo(players.filter(dPlayer.class, scriptEntry), loc); + FakeBlock.stopShowingTo(players.filter(PlayerTag.class, scriptEntry), loc); } i++; } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/SidebarCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/SidebarCommand.java index 892f946f7e..4179a711b1 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/SidebarCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/SidebarCommand.java @@ -6,7 +6,7 @@ import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.abstracts.Sidebar; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.tags.BukkitTagContext; import com.denizenscript.denizencore.DenizenCore; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; @@ -60,9 +60,9 @@ public class SidebarCommand extends AbstractCommand { // lines and it will show each player specified their name on that line. // // @Tags - // - // - // + // + // + // // // @Usage // Show all online players a sidebar. @@ -243,7 +243,7 @@ public void execute(ScriptEntry scriptEntry) { switch (Action.valueOf(action.asString())) { case ADD: - for (dPlayer player : players.filter(dPlayer.class, scriptEntry)) { + for (PlayerTag player : players.filter(PlayerTag.class, scriptEntry)) { if (player == null || !player.isValid()) { Debug.echoError("Invalid player!"); continue; @@ -279,7 +279,7 @@ public void execute(ScriptEntry scriptEntry) { break; case REMOVE: - for (dPlayer player : players.filter(dPlayer.class, scriptEntry)) { + for (PlayerTag player : players.filter(PlayerTag.class, scriptEntry)) { if (player == null || !player.isValid()) { Debug.echoError("Invalid player!"); continue; @@ -336,7 +336,7 @@ public void execute(ScriptEntry scriptEntry) { break; case SET: - for (dPlayer player : players.filter(dPlayer.class, scriptEntry)) { + for (PlayerTag player : players.filter(PlayerTag.class, scriptEntry)) { if (player == null || !player.isValid()) { Debug.echoError("Invalid player!"); continue; @@ -395,7 +395,7 @@ public void execute(ScriptEntry scriptEntry) { private static final Map sidebars = new HashMap<>(); - private static Sidebar createSidebar(dPlayer denizenPlayer) { + private static Sidebar createSidebar(PlayerTag denizenPlayer) { if (!denizenPlayer.isOnline()) { return null; } @@ -407,7 +407,7 @@ private static Sidebar createSidebar(dPlayer denizenPlayer) { return sidebars.get(player.getUniqueId()); } - public static Sidebar getSidebar(dPlayer denizenPlayer) { + public static Sidebar getSidebar(PlayerTag denizenPlayer) { if (!denizenPlayer.isOnline()) { return null; } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/StatisticCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/StatisticCommand.java index 31785b423f..7680ac1aa7 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/StatisticCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/StatisticCommand.java @@ -2,9 +2,9 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dMaterial; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.MaterialTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -32,8 +32,8 @@ public class StatisticCommand extends AbstractCommand { // // // @Tags - // ]> - // ].qualifier[/]> + // ]> + // ].qualifier[/]> // // @Usage // TODO: Document Command Details @@ -54,7 +54,7 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException } else if (arg.matchesPrefix("players") && !scriptEntry.hasObject("players") - && arg.matchesArgumentList(dPlayer.class)) { + && arg.matchesArgumentList(PlayerTag.class)) { scriptEntry.addObject("players", arg.asType(ListTag.class)); specified_players = true; } @@ -69,11 +69,11 @@ else if (!scriptEntry.hasObject("amount") else if (arg.matchesPrefix("qualifier", "q") && !scriptEntry.hasObject("material") && !scriptEntry.hasObject("entity")) { - if (arg.matchesArgumentType(dMaterial.class)) { - scriptEntry.addObject("material", arg.asType(dMaterial.class)); + if (arg.matchesArgumentType(MaterialTag.class)) { + scriptEntry.addObject("material", arg.asType(MaterialTag.class)); } - else if (arg.matchesArgumentType(dEntity.class)) { - scriptEntry.addObject("entity", arg.asType(dEntity.class)); + else if (arg.matchesArgumentType(EntityTag.class)) { + scriptEntry.addObject("entity", arg.asType(EntityTag.class)); } } @@ -118,8 +118,8 @@ public void execute(ScriptEntry scriptEntry) { ListTag players = scriptEntry.getdObject("players"); ElementTag statistic = scriptEntry.getElement("statistic"); ElementTag amount = scriptEntry.getElement("amount"); - dMaterial material = scriptEntry.getdObject("material"); - dEntity entity = scriptEntry.getdObject("entity"); + MaterialTag material = scriptEntry.getdObject("material"); + EntityTag entity = scriptEntry.getdObject("entity"); if (scriptEntry.dbCallShouldDebug()) { @@ -138,17 +138,17 @@ public void execute(ScriptEntry scriptEntry) { Material mat = material.getMaterial(); switch (act) { case ADD: - for (dPlayer player : players.filter(dPlayer.class, scriptEntry)) { + for (PlayerTag player : players.filter(PlayerTag.class, scriptEntry)) { player.incrementStatistic(stat, mat, amt); } break; case TAKE: - for (dPlayer player : players.filter(dPlayer.class, scriptEntry)) { + for (PlayerTag player : players.filter(PlayerTag.class, scriptEntry)) { player.decrementStatistic(stat, mat, amt); } break; case SET: - for (dPlayer player : players.filter(dPlayer.class, scriptEntry)) { + for (PlayerTag player : players.filter(PlayerTag.class, scriptEntry)) { player.setStatistic(stat, mat, amt); } break; @@ -159,17 +159,17 @@ public void execute(ScriptEntry scriptEntry) { EntityType ent = entity.getBukkitEntityType(); switch (act) { case ADD: - for (dPlayer player : players.filter(dPlayer.class, scriptEntry)) { + for (PlayerTag player : players.filter(PlayerTag.class, scriptEntry)) { player.incrementStatistic(stat, ent, amt); } break; case TAKE: - for (dPlayer player : players.filter(dPlayer.class, scriptEntry)) { + for (PlayerTag player : players.filter(PlayerTag.class, scriptEntry)) { player.decrementStatistic(stat, ent, amt); } break; case SET: - for (dPlayer player : players.filter(dPlayer.class, scriptEntry)) { + for (PlayerTag player : players.filter(PlayerTag.class, scriptEntry)) { player.setStatistic(stat, ent, amt); } break; diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/TeamCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/TeamCommand.java index 5df613d0db..8ff4b3c7a5 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/TeamCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/TeamCommand.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.utilities.ScoreboardHelper; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -145,7 +145,7 @@ public void execute(ScriptEntry scriptEntry) { if (add != null) { for (String string : add) { if (string.startsWith("p@")) { - string = dPlayer.valueOf(string).getName(); + string = PlayerTag.valueOf(string).getName(); } if (!team.hasEntry(string)) { team.addEntry(string); @@ -156,7 +156,7 @@ public void execute(ScriptEntry scriptEntry) { if (remove != null) { for (String string : remove) { if (string.startsWith("p@")) { - string = dPlayer.valueOf(string).getName(); + string = PlayerTag.valueOf(string).getName(); } if (team.hasEntry(string)) { team.removeEntry(string); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/TitleCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/TitleCommand.java index 37ed0016cd..ea2bb489f0 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/TitleCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/TitleCommand.java @@ -3,7 +3,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.nms.NMSHandler; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.*; import com.denizenscript.denizencore.objects.core.DurationTag; @@ -66,8 +66,8 @@ else if (arg.matchesPrefix("fade_out") scriptEntry.addObject("fade_out", arg.asType(DurationTag.class)); } else if (arg.matchesPrefix("targets", "target") - && arg.matchesArgumentList(dPlayer.class)) { - scriptEntry.addObject("targets", arg.asType(ListTag.class).filter(dPlayer.class, scriptEntry)); + && arg.matchesArgumentList(PlayerTag.class)) { + scriptEntry.addObject("targets", arg.asType(ListTag.class).filter(PlayerTag.class, scriptEntry)); } } @@ -90,7 +90,7 @@ public void execute(ScriptEntry scriptEntry) { DurationTag fade_in = scriptEntry.getdObject("fade_in"); DurationTag stay = scriptEntry.getdObject("stay"); DurationTag fade_out = scriptEntry.getdObject("fade_out"); - List targets = (List) scriptEntry.getObject("targets"); + List targets = (List) scriptEntry.getObject("targets"); if (scriptEntry.dbCallShouldDebug()) { @@ -104,7 +104,7 @@ public void execute(ScriptEntry scriptEntry) { } - for (dPlayer player : targets) { + for (PlayerTag player : targets) { if (player.isValid() && player.isOnline()) { NMSHandler.getInstance().getPacketHelper().showTitle(player.getPlayerEntity(), title != null ? title.asString() : "", diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ToastCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ToastCommand.java index ace7d13f4c..7945945052 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ToastCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ToastCommand.java @@ -6,8 +6,8 @@ import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.interfaces.AdvancementHelper; import com.denizenscript.denizen.nms.util.Advancement; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -64,13 +64,13 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException if (!scriptEntry.hasObject("targets") && arg.matchesPrefix("target", "targets", "t") - && arg.matchesArgumentList(dPlayer.class)) { - scriptEntry.addObject("targets", arg.asType(ListTag.class).filter(dPlayer.class, scriptEntry)); + && arg.matchesArgumentList(PlayerTag.class)) { + scriptEntry.addObject("targets", arg.asType(ListTag.class).filter(PlayerTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("icon") && arg.matchesPrefix("icon", "i") - && arg.matchesArgumentType(dItem.class)) { - scriptEntry.addObject("icon", arg.asType(dItem.class)); + && arg.matchesArgumentType(ItemTag.class)) { + scriptEntry.addObject("icon", arg.asType(ItemTag.class)); } else if (!scriptEntry.hasObject("frame") && arg.matchesPrefix("frame", "f") @@ -103,7 +103,7 @@ else if (!scriptEntry.hasObject("text")) { } } - scriptEntry.defaultObject("icon", new dItem(Material.AIR)); + scriptEntry.defaultObject("icon", new ItemTag(Material.AIR)); scriptEntry.defaultObject("frame", new ElementTag("TASK")); scriptEntry.defaultObject("background", new ElementTag("textures/gui/advancements/backgrounds/adventure.png")); } @@ -114,8 +114,8 @@ public void execute(ScriptEntry scriptEntry) { ElementTag text = scriptEntry.getElement("text"); ElementTag frame = scriptEntry.getElement("frame"); ElementTag background = scriptEntry.getElement("background"); - dItem icon = scriptEntry.getdObject("icon"); - final List targets = (List) scriptEntry.getObject("targets"); + ItemTag icon = scriptEntry.getdObject("icon"); + final List targets = (List) scriptEntry.getObject("targets"); if (scriptEntry.dbCallShouldDebug()) { Debug.report(scriptEntry, name, text.debug() + frame.debug() + icon.debug() @@ -138,7 +138,7 @@ public void execute(ScriptEntry scriptEntry) { final AdvancementHelper advancementHelper = NMSHandler.getInstance().getAdvancementHelper(); - for (dPlayer target : targets) { + for (PlayerTag target : targets) { Player player = target.getPlayerEntity(); if (player != null) { advancementHelper.grant(advancement, player); 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 4b3a6d001c..a89e503187 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 @@ -4,7 +4,7 @@ import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.flags.FlagManager; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -139,7 +139,7 @@ else if (type == AnnounceType.TO_OPS) { } else if (type == AnnounceType.TO_FLAGGED) { for (Player player : Bukkit.getOnlinePlayers()) { - if (FlagManager.playerHasFlag(dPlayer.mirrorBukkitPlayer(player), flag.asString())) { + if (FlagManager.playerHasFlag(PlayerTag.mirrorBukkitPlayer(player), flag.asString())) { player.sendMessage(message); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/BanCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/BanCommand.java index 0ac8d7db04..a4259e4da1 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/BanCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/BanCommand.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.scripts.commands.server; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.*; import com.denizenscript.denizencore.objects.core.DurationTag; @@ -33,11 +33,11 @@ public class BanCommand extends AbstractCommand { // source: Sets the source of the ban. Defaults to "(Unknown)". // // @Tags - // - // - // - // - // + // + // + // + // + // // ]> // ].expiration> // ].reason> @@ -96,8 +96,8 @@ else if (!scriptEntry.hasObject("addresses") && arg.matchesPrefix("addresses", " scriptEntry.addObject("addresses", arg.asType(ListTag.class)); } else if (!scriptEntry.hasObject("targets") && (arg.matchesPrefix("targets", "target") - || arg.matchesArgumentList(dPlayer.class))) { - scriptEntry.addObject("targets", arg.asType(ListTag.class).filter(dPlayer.class, scriptEntry)); + || arg.matchesArgumentList(PlayerTag.class))) { + scriptEntry.addObject("targets", arg.asType(ListTag.class).filter(PlayerTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("reason") && arg.matchesPrefix("reason")) { scriptEntry.addObject("reason", arg.asElement()); @@ -122,7 +122,7 @@ else if (!scriptEntry.hasObject("source") && arg.matchesPrefix("source")) { throw new IllegalArgumentException("Invalid action specified."); } - if ((!scriptEntry.hasObject("targets") || ((List) scriptEntry.getObject("targets")).isEmpty()) + if ((!scriptEntry.hasObject("targets") || ((List) scriptEntry.getObject("targets")).isEmpty()) && (!scriptEntry.hasObject("addresses") || ((List) scriptEntry.getObject("addresses")).isEmpty())) { throw new IllegalArgumentException("Must specify a valid target or address!"); } @@ -132,7 +132,7 @@ else if (!scriptEntry.hasObject("source") && arg.matchesPrefix("source")) { @Override public void execute(ScriptEntry scriptEntry) { ElementTag action = scriptEntry.getElement("action"); - List targets = (List) scriptEntry.getObject("targets"); + List targets = (List) scriptEntry.getObject("targets"); ListTag addresses = (ListTag) scriptEntry.getObject("addresses"); ElementTag reason = scriptEntry.getElement("reason"); DurationTag duration = scriptEntry.getdObject("duration"); @@ -158,7 +158,7 @@ public void execute(ScriptEntry scriptEntry) { switch (banAction) { case ADD: if (targets != null) { - for (dPlayer player : targets) { + for (PlayerTag player : targets) { if (player.isValid()) { Bukkit.getBanList(BanList.Type.NAME).addBan(player.getName(), reason.toString(), expiration, source.toString()); if (player.isOnline()) { @@ -176,7 +176,7 @@ public void execute(ScriptEntry scriptEntry) { case REMOVE: if (targets != null) { - for (dPlayer player : targets) { + for (PlayerTag player : targets) { if (player.isValid()) { if (player.getOfflinePlayer().isBanned()) { Bukkit.getBanList(BanList.Type.NAME).pardon(player.getName()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/BossBarCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/BossBarCommand.java index c92a8d9073..cfcdd16250 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/BossBarCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/BossBarCommand.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.BukkitScriptEntryData; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -104,7 +104,7 @@ else if (!scriptEntry.hasObject("action") } else if (!scriptEntry.hasObject("players") && arg.matchesPrefix("players") - && arg.matchesArgumentList(dPlayer.class)) { + && arg.matchesArgumentList(PlayerTag.class)) { scriptEntry.addObject("players", arg.asType(ListTag.class)); } else if (!scriptEntry.hasObject("id")) { @@ -168,7 +168,7 @@ public void execute(ScriptEntry scriptEntry) { return; } String barTitle = title != null ? title.asString() : ""; - List barPlayers = players.filter(dPlayer.class, scriptEntry); + List barPlayers = players.filter(PlayerTag.class, scriptEntry); double barProgress = progress != null ? progress.asDouble() : 1D; BarColor barColor = color != null ? BarColor.valueOf(color.asString().toUpperCase()) : BarColor.WHITE; BarStyle barStyle = style != null ? BarStyle.valueOf(style.asString().toUpperCase()) : BarStyle.SOLID; @@ -180,7 +180,7 @@ public void execute(ScriptEntry scriptEntry) { } BossBar bossBar = Bukkit.createBossBar(barTitle, barColor, barStyle, barFlags); bossBar.setProgress(barProgress); - for (dPlayer player : barPlayers) { + for (PlayerTag player : barPlayers) { if (!player.isOnline()) { Debug.echoError("Player must be online to show a BossBar to them!"); continue; @@ -210,7 +210,7 @@ public void execute(ScriptEntry scriptEntry) { bossBar1.setStyle(BarStyle.valueOf(style.asString().toUpperCase())); } if (players != null) { - for (dPlayer player : players.filter(dPlayer.class, scriptEntry)) { + for (PlayerTag player : players.filter(PlayerTag.class, scriptEntry)) { bossBar1.addPlayer(player.getPlayerEntity()); } } @@ -223,7 +223,7 @@ public void execute(ScriptEntry scriptEntry) { } if (players != null) { BossBar bar = bossBarMap.get(idString); - for (dPlayer player : players.filter(dPlayer.class, scriptEntry)) { + for (PlayerTag player : players.filter(PlayerTag.class, scriptEntry)) { bar.removePlayer(player.getPlayerEntity()); } break; diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/ScoreboardCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/ScoreboardCommand.java index cd5cf4f684..b1e9d633c0 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/ScoreboardCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/ScoreboardCommand.java @@ -3,7 +3,7 @@ import com.denizenscript.denizen.utilities.FakeOfflinePlayer; import com.denizenscript.denizen.utilities.ScoreboardHelper; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -134,8 +134,8 @@ else if (!scriptEntry.hasObject("displayslot") scriptEntry.addObject("displayslot", arg.asElement()); } else if (!scriptEntry.hasObject("viewers") - && arg.matchesArgumentList(dPlayer.class)) { - scriptEntry.addObject("viewers", arg.asType(ListTag.class).filter(dPlayer.class, scriptEntry)); + && arg.matchesArgumentList(PlayerTag.class)) { + scriptEntry.addObject("viewers", arg.asType(ListTag.class).filter(PlayerTag.class, scriptEntry)); } else { arg.reportUnhandled(); @@ -149,7 +149,7 @@ else if (!scriptEntry.hasObject("viewers") } public static OfflinePlayer getOfflinePlayer(String name) { - if (dPlayer.playerNameIsValid(name)) { + if (PlayerTag.playerNameIsValid(name)) { return Bukkit.getOfflinePlayer(name); } else { @@ -162,7 +162,7 @@ public static OfflinePlayer getOfflinePlayer(String name) { public void execute(final ScriptEntry scriptEntry) { // Get objects - List viewers = (List) scriptEntry.getObject("viewers"); + List viewers = (List) scriptEntry.getObject("viewers"); ListTag lines = scriptEntry.hasObject("lines") ? ListTag.valueOf(scriptEntry.getElement("lines").asString()) : new ListTag(); @@ -314,7 +314,7 @@ else if (viewers == null) { } if (viewers != null) { - for (dPlayer viewer : viewers) { + for (PlayerTag viewer : viewers) { // Add viewers for this scoreboard if (act.equals(Action.ADD)) { // If this isn't the main scoreboard, add this viewer diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/AnimateChestCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/AnimateChestCommand.java index 4443a36a87..9ba23588a0 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/AnimateChestCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/AnimateChestCommand.java @@ -4,8 +4,8 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.interfaces.PacketHelper; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -73,8 +73,8 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException scriptEntry.addObject("action", arg.asElement()); } else if (!scriptEntry.hasObject("location") - && arg.matchesArgumentType(dLocation.class)) { - scriptEntry.addObject("location", arg.asType(dLocation.class)); + && arg.matchesArgumentType(LocationTag.class)) { + scriptEntry.addObject("location", arg.asType(LocationTag.class)); } else if (!scriptEntry.hasObject("sound") && arg.matchesPrefix("sound") @@ -82,8 +82,8 @@ else if (!scriptEntry.hasObject("sound") scriptEntry.addObject("sound", arg.asElement()); } else if (!scriptEntry.hasObject("players") - && arg.matchesArgumentList(dPlayer.class)) { - scriptEntry.addObject("players", arg.asType(ListTag.class).filter(dPlayer.class, scriptEntry)); + && arg.matchesArgumentList(PlayerTag.class)) { + scriptEntry.addObject("players", arg.asType(ListTag.class).filter(PlayerTag.class, scriptEntry)); } else { arg.reportUnhandled(); @@ -117,10 +117,10 @@ else if (!scriptEntry.hasObject("players") @Override public void execute(ScriptEntry scriptEntry) { - dLocation location = (dLocation) scriptEntry.getObject("location"); + LocationTag location = (LocationTag) scriptEntry.getObject("location"); ElementTag action = scriptEntry.getElement("action"); ElementTag sound = scriptEntry.getElement("sound"); - List players = (List) scriptEntry.getObject("players"); + List players = (List) scriptEntry.getObject("players"); if (scriptEntry.dbCallShouldDebug()) { Debug.report(scriptEntry, getName(), location.debug() @@ -134,7 +134,7 @@ public void execute(ScriptEntry scriptEntry) { switch (ChestAction.valueOf(action.asString().toUpperCase())) { case OPEN: - for (dPlayer player : players) { + for (PlayerTag player : players) { Player ent = player.getPlayerEntity(); if (sound.asBoolean()) { NMSHandler.getInstance().getSoundHelper().playSound(ent, location, @@ -145,7 +145,7 @@ public void execute(ScriptEntry scriptEntry) { break; case CLOSE: - for (dPlayer player : players) { + for (PlayerTag player : players) { Player ent = player.getPlayerEntity(); if (sound.asBoolean()) { NMSHandler.getInstance().getSoundHelper().playSound(ent, location, diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/ChunkLoadCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/ChunkLoadCommand.java index 6993baa4ad..166a0833d6 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/ChunkLoadCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/ChunkLoadCommand.java @@ -6,8 +6,8 @@ import com.denizenscript.denizen.Denizen; import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.NMSVersion; -import com.denizenscript.denizen.objects.dChunk; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.ChunkTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.DurationTag; @@ -43,8 +43,8 @@ public class ChunkLoadCommand extends AbstractCommand implements Listener { // other than activity that requires a nearby player. // // @Tags - // - // + // + // // // @Usage // Use to load a chunk. @@ -86,16 +86,16 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException && !scriptEntry.hasObject("action")) { scriptEntry.addObject("action", new ElementTag(arg.getValue().toUpperCase())); if (arg.getValue().equalsIgnoreCase("removeall")) { - scriptEntry.addObject("location", new dLocation(Bukkit.getWorlds().get(0), 0, 0, 0)); + scriptEntry.addObject("location", new LocationTag(Bukkit.getWorlds().get(0), 0, 0, 0)); } } - else if (arg.matchesArgumentType(dChunk.class) + else if (arg.matchesArgumentType(ChunkTag.class) && !scriptEntry.hasObject("location")) { - scriptEntry.addObject("location", arg.asType(dChunk.class).getCenter()); + scriptEntry.addObject("location", arg.asType(ChunkTag.class).getCenter()); } - else if (arg.matchesArgumentType(dLocation.class) + else if (arg.matchesArgumentType(LocationTag.class) && !scriptEntry.hasObject("location")) { - scriptEntry.addObject("location", arg.asType(dLocation.class)); + scriptEntry.addObject("location", arg.asType(LocationTag.class)); } else if (arg.matchesArgumentType(DurationTag.class) && !scriptEntry.hasObject("duration")) { @@ -123,7 +123,7 @@ else if (arg.matchesArgumentType(DurationTag.class) public void execute(ScriptEntry scriptEntry) { // Get objects ElementTag action = scriptEntry.getElement("action"); - dLocation chunkloc = (dLocation) scriptEntry.getObject("location"); + LocationTag chunkloc = (LocationTag) scriptEntry.getObject("location"); DurationTag length = (DurationTag) scriptEntry.getObject("duration"); if (scriptEntry.dbCallShouldDebug()) { @@ -181,7 +181,7 @@ public void run() { Debug.echoDebug(scriptEntry, "...allowing unloading of all stored chunks"); if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_14_R1)) { for (String chunkStr : chunkDelays.keySet()) { - dChunk loopChunk = dChunk.valueOf(chunkStr); + ChunkTag loopChunk = ChunkTag.valueOf(chunkStr); loopChunk.getChunk().setForceLoaded(false); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/CopyBlockCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/CopyBlockCommand.java index e3f7946835..a8a53acb01 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/CopyBlockCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/CopyBlockCommand.java @@ -3,8 +3,8 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.interfaces.BlockData; -import com.denizenscript.denizen.objects.dCuboid; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.CuboidTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -34,7 +34,7 @@ public class CopyBlockCommand extends AbstractCommand { // This effectively moves the block to the target location. // // @Tags - // + // // // @Usage // Use to copy the block the player is looking at to their current location @@ -51,22 +51,22 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { // CopyBlock can move a single 'location' ... - if (arg.matchesArgumentType(dLocation.class) + if (arg.matchesArgumentType(LocationTag.class) && !scriptEntry.hasObject("location") && !arg.matchesPrefix("t", "to")) { - scriptEntry.addObject("location", arg.asType(dLocation.class)); + scriptEntry.addObject("location", arg.asType(LocationTag.class)); } // ... or and entire cuboid ... - else if (arg.matchesArgumentType(dCuboid.class) + else if (arg.matchesArgumentType(CuboidTag.class) && !scriptEntry.hasObject("cuboid")) { - scriptEntry.addObject("cuboid", arg.asType(dCuboid.class)); + scriptEntry.addObject("cuboid", arg.asType(CuboidTag.class)); } // ... to a location. - else if (arg.matchesArgumentType(dLocation.class) + else if (arg.matchesArgumentType(LocationTag.class) && arg.matchesPrefix("t", "to")) { - scriptEntry.addObject("destination", arg.asType(dLocation.class)); + scriptEntry.addObject("destination", arg.asType(LocationTag.class)); } else if (arg.matches("remove_original")) { scriptEntry.addObject("remove", new ElementTag(true)); @@ -92,9 +92,9 @@ else if (arg.matches("remove_original")) { @Override public void execute(ScriptEntry scriptEntry) { - dLocation copy_location = (dLocation) scriptEntry.getObject("location"); - dLocation destination = (dLocation) scriptEntry.getObject("destination"); - dCuboid copy_cuboid = (dCuboid) scriptEntry.getObject("cuboid"); + LocationTag copy_location = (LocationTag) scriptEntry.getObject("location"); + LocationTag destination = (LocationTag) scriptEntry.getObject("destination"); + CuboidTag copy_cuboid = (CuboidTag) scriptEntry.getObject("cuboid"); ElementTag remove_original = (ElementTag) scriptEntry.getObject("remove"); if (scriptEntry.dbCallShouldDebug()) { @@ -116,14 +116,14 @@ else if (copy_cuboid != null) { for (Location loc : locations) { Block source = loc.getBlock(); - BlockState sourceState = dLocation.getBlockStateFor(source); + BlockState sourceState = LocationTag.getBlockStateFor(source); Block update = destination.getBlock(); // TODO: 1.13 - confirm this works BlockData blockData = NMSHandler.getInstance().getBlockHelper().getBlockData(source); blockData.setBlock(update, false); - BlockState updateState = dLocation.getBlockStateFor(update); + BlockState updateState = LocationTag.getBlockStateFor(update); // Note: only a BlockState, not a Block, is actually an instance // of InventoryHolder diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/DropCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/DropCommand.java index 92b7ab454f..d1f2e6845a 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/DropCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/DropCommand.java @@ -3,9 +3,9 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizencore.objects.*; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.core.DurationTag; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -40,7 +40,7 @@ public class DropCommand extends AbstractCommand { // You can also add 'delay:' to set the pickup delay of the item. // // @Tags - // + // // returns a list of entities that were dropped. // // @Usage @@ -69,10 +69,10 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException if (!scriptEntry.hasObject("action") && !arg.matchesPrefix("qty") - && arg.matchesArgumentList(dItem.class)) { + && arg.matchesArgumentList(ItemTag.class)) { // Item arg scriptEntry.addObject("action", new ElementTag(Action.DROP_ITEM.toString()).setPrefix("action")); - scriptEntry.addObject("item", arg.asType(ListTag.class).filter(dItem.class, scriptEntry)); + scriptEntry.addObject("item", arg.asType(ListTag.class).filter(ItemTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("action") && arg.matches("experience", "exp", "xp")) @@ -81,16 +81,16 @@ else if (!scriptEntry.hasObject("action") scriptEntry.addObject("action", new ElementTag(Action.DROP_EXP.toString()).setPrefix("action")); } else if (!scriptEntry.hasObject("action") - && arg.matchesArgumentType(dEntity.class)) { + && arg.matchesArgumentType(EntityTag.class)) { // Entity arg scriptEntry.addObject("action", new ElementTag(Action.DROP_ENTITY.toString()).setPrefix("action")); - scriptEntry.addObject("entity", arg.asType(dEntity.class).setPrefix("entity")); + scriptEntry.addObject("entity", arg.asType(EntityTag.class).setPrefix("entity")); } else if (!scriptEntry.hasObject("location") - && arg.matchesArgumentType(dLocation.class)) + && arg.matchesArgumentType(LocationTag.class)) // Location arg { - scriptEntry.addObject("location", arg.asType(dLocation.class).setPrefix("location")); + scriptEntry.addObject("location", arg.asType(LocationTag.class).setPrefix("location")); } else if (!scriptEntry.hasObject("speed") && arg.matchesPrefix("speed") @@ -141,12 +141,12 @@ else if (!scriptEntry.hasObject("delay") && arg.matchesArgumentType(DurationTag. public void execute(ScriptEntry scriptEntry) { // Get objects - dLocation location = (dLocation) scriptEntry.getObject("location"); + LocationTag location = (LocationTag) scriptEntry.getObject("location"); ElementTag qty = scriptEntry.getElement("qty"); ElementTag action = scriptEntry.getElement("action"); ElementTag speed = scriptEntry.getElement("speed"); - List items = (List) scriptEntry.getObject("item"); - dEntity entity = (dEntity) scriptEntry.getObject("entity"); + List items = (List) scriptEntry.getObject("item"); + EntityTag entity = (EntityTag) scriptEntry.getObject("entity"); DurationTag delay = (DurationTag) scriptEntry.getObject("delay"); @@ -165,13 +165,13 @@ public void execute(ScriptEntry scriptEntry) { // Do the drop switch (Action.valueOf(action.asString())) { case DROP_EXP: - dEntity orb = new dEntity(location.getWorld().spawnEntity(location, EntityType.EXPERIENCE_ORB)); + EntityTag orb = new EntityTag(location.getWorld().spawnEntity(location, EntityType.EXPERIENCE_ORB)); ((ExperienceOrb) orb.getBukkitEntity()).setExperience(qty.asInt()); entityList.add(orb.toString()); break; case DROP_ITEM: - for (dItem item : items) { + for (ItemTag item : items) { if (item.getMaterial().getMaterial() == Material.AIR) { continue; } @@ -179,7 +179,7 @@ public void execute(ScriptEntry scriptEntry) { Debug.echoDebug(scriptEntry, "Cannot drop multiples of this item because it is Unique!"); } for (int x = 0; x < qty.asInt(); x++) { - dEntity e = new dEntity(location.getWorld().dropItem(location, item.getItemStack())); + EntityTag e = new EntityTag(location.getWorld().dropItem(location, item.getItemStack())); if (e.isValid()) { e.setVelocity(e.getVelocity().multiply(speed != null ? speed.asDouble() : 1d)); if (delay != null) { @@ -203,7 +203,7 @@ public void execute(ScriptEntry scriptEntry) { for (Mechanism mechanism : entity.getWaitingMechanisms()) { mechanisms.add(new Mechanism(new ElementTag(mechanism.getName()), mechanism.getValue())); } - dEntity ent = new dEntity(entity.getEntityType(), mechanisms); + EntityTag ent = new EntityTag(entity.getEntityType(), mechanisms); ent.spawnAt(location); entityList.add(ent.toString()); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/ExplodeCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/ExplodeCommand.java index 71600f15fe..f89bcb0590 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/ExplodeCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/ExplodeCommand.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -55,9 +55,9 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("location") - && arg.matchesArgumentType(dLocation.class)) { + && arg.matchesArgumentType(LocationTag.class)) { - scriptEntry.addObject("location", arg.asType(dLocation.class)); + scriptEntry.addObject("location", arg.asType(LocationTag.class)); } else if (!scriptEntry.hasObject("power") && arg.matchesPrimitive(ArgumentHelper.PrimitiveType.Float) @@ -95,7 +95,7 @@ else if (!scriptEntry.hasObject("fire") public void execute(final ScriptEntry scriptEntry) { // Get objects - final dLocation location = (dLocation) scriptEntry.getObject("location"); + final LocationTag location = (LocationTag) scriptEntry.getObject("location"); ElementTag power = (ElementTag) scriptEntry.getObject("power"); boolean breakblocks = scriptEntry.hasObject("breakblocks"); boolean fire = scriptEntry.hasObject("fire"); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/FireworkCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/FireworkCommand.java index da4ee9452e..5868df9e56 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/FireworkCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/FireworkCommand.java @@ -3,9 +3,9 @@ import com.denizenscript.denizen.utilities.Conversion; import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dColor; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.ColorTag; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -40,10 +40,10 @@ public class FireworkCommand extends AbstractCommand { // flicker option means the firework will explode with a flicker effect. // // @Tags - // - // - // - // returns a dEntity of the firework that was launched. + // + // + // + // returns a EntityTag of the firework that was launched. // // @Usage // Use to launch a star firework which explodes yellow and fades to white afterwards at the player's location @@ -69,8 +69,8 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("location") - && arg.matchesArgumentType(dLocation.class)) { - scriptEntry.addObject("location", arg.asType(dLocation.class)); + && arg.matchesArgumentType(LocationTag.class)) { + scriptEntry.addObject("location", arg.asType(LocationTag.class)); } else if (!scriptEntry.hasObject("type") && arg.matches("random")) { @@ -94,13 +94,13 @@ else if (!scriptEntry.hasObject("trail") } else if (!scriptEntry.hasObject("primary") && arg.matchesPrefix("primary") - && arg.matchesArgumentList(dColor.class)) { - scriptEntry.addObject("primary", arg.asType(ListTag.class).filter(dColor.class, scriptEntry)); + && arg.matchesArgumentList(ColorTag.class)) { + scriptEntry.addObject("primary", arg.asType(ListTag.class).filter(ColorTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("fade") && arg.matchesPrefix("fade") - && arg.matchesArgumentList(dColor.class)) { - scriptEntry.addObject("fade", arg.asType(ListTag.class).filter(dColor.class, scriptEntry)); + && arg.matchesArgumentList(ColorTag.class)) { + scriptEntry.addObject("fade", arg.asType(ListTag.class).filter(ColorTag.class, scriptEntry)); } else { arg.reportUnhandled(); @@ -114,7 +114,7 @@ else if (!scriptEntry.hasObject("fade") scriptEntry.defaultObject("type", new ElementTag("ball")); scriptEntry.defaultObject("power", new ElementTag(1)); - scriptEntry.defaultObject("primary", Arrays.asList(dColor.valueOf("yellow"))); + scriptEntry.defaultObject("primary", Arrays.asList(ColorTag.valueOf("yellow"))); } @SuppressWarnings("unchecked") @@ -122,16 +122,16 @@ else if (!scriptEntry.hasObject("fade") public void execute(final ScriptEntry scriptEntry) { // Get objects - final dLocation location = scriptEntry.hasObject("location") ? - (dLocation) scriptEntry.getObject("location") : + final LocationTag location = scriptEntry.hasObject("location") ? + (LocationTag) scriptEntry.getObject("location") : Utilities.getEntryNPC(scriptEntry).getLocation(); ElementTag type = (ElementTag) scriptEntry.getObject("type"); ElementTag power = (ElementTag) scriptEntry.getObject("power"); boolean flicker = scriptEntry.hasObject("flicker"); boolean trail = scriptEntry.hasObject("trail"); - List primary = (List) scriptEntry.getObject("primary"); - List fade = (List) scriptEntry.getObject("fade"); + List primary = (List) scriptEntry.getObject("primary"); + List fade = (List) scriptEntry.getObject("fade"); // Report to dB if (scriptEntry.dbCallShouldDebug()) { @@ -165,6 +165,6 @@ public void execute(final ScriptEntry scriptEntry) { fireworkMeta.addEffects(fireworkBuilder.build()); firework.setFireworkMeta(fireworkMeta); - scriptEntry.addObject("launched_firework", new dEntity(firework)); + scriptEntry.addObject("launched_firework", new EntityTag(firework)); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/GameRuleCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/GameRuleCommand.java index 05c5b9cf79..2adc5b610a 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/GameRuleCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/GameRuleCommand.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.scripts.commands.world; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dWorld; +import com.denizenscript.denizen.objects.WorldTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -41,8 +41,8 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("world") - && arg.matchesArgumentType(dWorld.class)) { - scriptEntry.addObject("world", arg.asType(dWorld.class)); + && arg.matchesArgumentType(WorldTag.class)) { + scriptEntry.addObject("world", arg.asType(WorldTag.class)); } else if (!scriptEntry.hasObject("gamerule")) { scriptEntry.addObject("gamerule", arg.asElement()); @@ -73,7 +73,7 @@ else if (!scriptEntry.hasObject("value")) { @Override public void execute(ScriptEntry scriptEntry) { // Fetch objects - dWorld world = scriptEntry.getdObject("world"); + WorldTag world = scriptEntry.getdObject("world"); ElementTag gamerule = scriptEntry.getElement("gamerule"); ElementTag value = scriptEntry.getElement("value"); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/LightCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/LightCommand.java index 390fb33d39..7bec5fdeff 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/LightCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/LightCommand.java @@ -3,7 +3,7 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.abstracts.BlockLight; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.DurationTag; @@ -29,8 +29,8 @@ public class LightCommand extends AbstractCommand { // WARNING: May cause lag spikes, use carefully. // // @Tags - // - // + // + // // // @Usage // Use to create a bright light at a noted location. @@ -47,8 +47,8 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("location") - && arg.matchesArgumentType(dLocation.class)) { - scriptEntry.addObject("location", arg.asType(dLocation.class)); + && arg.matchesArgumentType(LocationTag.class)) { + scriptEntry.addObject("location", arg.asType(LocationTag.class)); } else if (!scriptEntry.hasObject("light") && arg.matchesPrimitive(ArgumentHelper.PrimitiveType.Integer)) { @@ -77,7 +77,7 @@ else if (!scriptEntry.hasObject("duration") @Override public void execute(ScriptEntry scriptEntry) { - dLocation location = scriptEntry.getdObject("location"); + LocationTag location = scriptEntry.getdObject("location"); ElementTag light = scriptEntry.getElement("light"); ElementTag reset = scriptEntry.getElement("reset"); DurationTag duration = scriptEntry.getdObject("duration"); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/MidiCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/MidiCommand.java index 83c3973404..4b10db6cdc 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/MidiCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/MidiCommand.java @@ -5,8 +5,8 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.utilities.midi.MidiUtil; import com.denizenscript.denizen.utilities.midi.NoteBlockReceiver; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -64,12 +64,12 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException scriptEntry.addObject("cancel", ""); } else if (!scriptEntry.hasObject("location") && - arg.matchesArgumentType(dLocation.class)) { - scriptEntry.addObject("location", arg.asType(dLocation.class)); + arg.matchesArgumentType(LocationTag.class)) { + scriptEntry.addObject("location", arg.asType(LocationTag.class)); } else if (!scriptEntry.hasObject("entities") && - arg.matchesArgumentList(dEntity.class)) { - scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(dEntity.class, scriptEntry)); + arg.matchesArgumentList(EntityTag.class)) { + scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(EntityTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("volume") && arg.matchesPrimitive(ArgumentHelper.PrimitiveType.Double) && @@ -128,8 +128,8 @@ public void execute(final ScriptEntry scriptEntry) { return; } - List entities = (List) scriptEntry.getObject("entities"); - dLocation location = (dLocation) scriptEntry.getObject("location"); + List entities = (List) scriptEntry.getObject("entities"); + LocationTag location = (LocationTag) scriptEntry.getObject("location"); float tempo = scriptEntry.getElement("tempo").asFloat(); float volume = scriptEntry.getElement("volume").asFloat(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/ModifyBlockCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/ModifyBlockCommand.java index 20e9312321..3555ee136c 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/ModifyBlockCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/ModifyBlockCommand.java @@ -4,10 +4,10 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.interfaces.WorldHelper; -import com.denizenscript.denizen.objects.dCuboid; -import com.denizenscript.denizen.objects.dEllipsoid; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.CuboidTag; +import com.denizenscript.denizen.objects.EllipsoidTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.*; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -55,7 +55,7 @@ public class ModifyBlockCommand extends AbstractCommand implements Listener, Hol // This command is ~holdable. // // @Tags - // + // // // @Usage // Use to change the block a player is looking at to stone. @@ -85,23 +85,23 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { - if (arg.matchesArgumentType(dCuboid.class) + if (arg.matchesArgumentType(CuboidTag.class) && !scriptEntry.hasObject("locations") && !scriptEntry.hasObject("location_list")) { - scriptEntry.addObject("locations", arg.asType(dCuboid.class).getBlockLocations()); + scriptEntry.addObject("locations", arg.asType(CuboidTag.class).getBlockLocations()); } - else if (arg.matchesArgumentType(dEllipsoid.class) + else if (arg.matchesArgumentType(EllipsoidTag.class) && !scriptEntry.hasObject("locations") && !scriptEntry.hasObject("location_list")) { - scriptEntry.addObject("locations", arg.asType(dEllipsoid.class).getBlockLocations()); + scriptEntry.addObject("locations", arg.asType(EllipsoidTag.class).getBlockLocations()); } - else if (arg.matchesArgumentList(dLocation.class) + else if (arg.matchesArgumentList(LocationTag.class) && !scriptEntry.hasObject("locations") && !scriptEntry.hasObject("location_list")) { scriptEntry.addObject("location_list", arg.asType(ListTag.class)); } else if (!scriptEntry.hasObject("materials") - && arg.matchesArgumentList(dMaterial.class)) { + && arg.matchesArgumentList(MaterialTag.class)) { scriptEntry.addObject("materials", arg.asType(ListTag.class)); } else if (!scriptEntry.hasObject("radius") @@ -165,7 +165,7 @@ else if (!scriptEntry.hasObject("percents")) { public void execute(final ScriptEntry scriptEntry) { final ListTag materials = scriptEntry.getdObject("materials"); - final List locations = (List) scriptEntry.getObject("locations"); + final List locations = (List) scriptEntry.getObject("locations"); final ListTag location_list = scriptEntry.getdObject("location_list"); final ElementTag physics = scriptEntry.getElement("physics"); final ElementTag natural = scriptEntry.getElement("natural"); @@ -181,7 +181,7 @@ public void execute(final ScriptEntry scriptEntry) { percents = null; } - final List materialList = materials.filter(dMaterial.class, scriptEntry); + final List materialList = materials.filter(MaterialTag.class, scriptEntry); if (scriptEntry.dbCallShouldDebug()) { @@ -232,21 +232,21 @@ public void execute(final ScriptEntry scriptEntry) { @Override public void run() { long start = System.currentTimeMillis(); - dLocation loc; + LocationTag loc; if (locations != null) { loc = locations.get(0); } else { - loc = dLocation.valueOf(location_list.get(0)); + loc = LocationTag.valueOf(location_list.get(0)); } boolean was_static = preSetup(loc); while ((locations != null && locations.size() > index) || (location_list != null && location_list.size() > index)) { - dLocation nLoc; + LocationTag nLoc; if (locations != null) { nLoc = locations.get(index); } else { - nLoc = dLocation.valueOf(location_list.get(index)); + nLoc = LocationTag.valueOf(location_list.get(index)); } handleLocation(nLoc, index, materialList, doPhysics, isNatural, radius, height, depth, percs); index++; @@ -269,24 +269,24 @@ public void run() { }.runTaskTimer(DenizenAPI.getCurrentInstance(), 1, 1); } else { - dLocation loc; + LocationTag loc; if (locations != null) { loc = locations.get(0); } else { - loc = dLocation.valueOf(location_list.get(0)); + loc = LocationTag.valueOf(location_list.get(0)); } boolean was_static = preSetup(loc); int index = 0; if (locations != null) { for (ObjectTag obj : locations) { - handleLocation((dLocation) obj, index, materialList, doPhysics, isNatural, radius, height, depth, percentages); + handleLocation((LocationTag) obj, index, materialList, doPhysics, isNatural, radius, height, depth, percentages); index++; } } else { for (String str : location_list) { - handleLocation(dLocation.valueOf(str), index, materialList, doPhysics, isNatural, radius, height, depth, percentages); + handleLocation(LocationTag.valueOf(str), index, materialList, doPhysics, isNatural, radius, height, depth, percentages); index++; } } @@ -295,7 +295,7 @@ public void run() { } } - boolean preSetup(dLocation loc0) { + boolean preSetup(LocationTag loc0) { // Freeze the first world in the list. WorldHelper worldHelper = NMSHandler.getInstance().getWorldHelper(); World world = loc0.getWorld(); @@ -314,10 +314,10 @@ void postComplete(Location loc, boolean was_static) { no_physics = false; } - void handleLocation(dLocation location, int index, List materialList, boolean doPhysics, + void handleLocation(LocationTag location, int index, List materialList, boolean doPhysics, boolean isNatural, int radius, int height, int depth, List percents) { - dMaterial material; + MaterialTag material; if (percents == null) { material = materialList.get(index % materialList.size()); } @@ -371,7 +371,7 @@ void handleLocation(dLocation location, int index, List materialList, } } - void setBlock(Location location, dMaterial material, boolean physics, boolean natural) { + void setBlock(Location location, MaterialTag material, boolean physics, boolean natural) { if (physics) { for (int i = 0; i < block_physics.size(); i++) { if (compareloc(block_physics.get(i), location)) { @@ -384,7 +384,7 @@ void setBlock(Location location, dMaterial material, boolean physics, boolean na physitick = tick; } if (location.getY() < 0 || location.getY() > 255) { - Debug.echoError("Invalid modifyblock location: " + new dLocation(location).toString()); + Debug.echoError("Invalid modifyblock location: " + new LocationTag(location).toString()); return; } if (natural && material.getMaterial() == Material.AIR) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/PlayEffectCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/PlayEffectCommand.java index e60999d12a..259241c59d 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/PlayEffectCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/PlayEffectCommand.java @@ -60,7 +60,7 @@ public class PlayEffectCommand extends AbstractCommand { // If you do not have this prefix, the system will assume your command is older, and will apply the 1-block height offset. // // Some particles will require input to the "special_data" argument. The data input is unique per particle. - // - For REDSTONE particles, the input is of format: |, for example: "1.2|red". Color input is any valid dColor object. + // - For REDSTONE particles, the input is of format: |, for example: "1.2|red". Color input is any valid ColorTag object. // // @Tags // None @@ -75,7 +75,7 @@ public class PlayEffectCommand extends AbstractCommand { // // @Usage // Use to play some effects at spawn. - // - playeffect effect:FIREWORKS_SPARK at: visibility:100 quantity:375 data:0 offset:50.0 + // - playeffect effect:FIREWORKS_SPARK at: visibility:100 quantity:375 data:0 offset:50.0 // --> @Override @@ -87,12 +87,12 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("location") - && arg.matchesArgumentList(dLocation.class)) { + && arg.matchesArgumentList(LocationTag.class)) { if (arg.matchesOnePrefix("at")) { scriptEntry.addObject("no_offset", new ElementTag(true)); } - scriptEntry.addObject("location", arg.asType(ListTag.class).filter(dLocation.class, scriptEntry)); + scriptEntry.addObject("location", arg.asType(ListTag.class).filter(LocationTag.class, scriptEntry)); continue; } else if (!scriptEntry.hasObject("effect") && @@ -114,34 +114,34 @@ else if (arg.matches("random")) { else if (arg.startsWith("iconcrack_")) { // Allow iconcrack_[item] for item break effects (ex: iconcrack_stone) String shrunk = arg.getValue().substring("iconcrack_".length()); - dItem item = dItem.valueOf(shrunk, scriptEntry.entryData.getTagContext()); + ItemTag item = ItemTag.valueOf(shrunk, scriptEntry.entryData.getTagContext()); if (item != null) { scriptEntry.addObject("iconcrack", item); } else { - Debug.echoError("Invalid iconcrack_[item]. Must be a valid dItem!"); + Debug.echoError("Invalid iconcrack_[item]. Must be a valid ItemTag!"); } continue; } else if (arg.startsWith("blockcrack_")) { String shrunk = arg.getValue().substring("blockcrack_".length()); - dMaterial material = dMaterial.valueOf(shrunk); + MaterialTag material = MaterialTag.valueOf(shrunk); if (material != null) { scriptEntry.addObject("blockcrack", material); } else { - Debug.echoError("Invalid blockcrack_[item]. Must be a valid dMaterial!"); + Debug.echoError("Invalid blockcrack_[item]. Must be a valid MaterialTag!"); } continue; } else if (arg.startsWith("blockdust_")) { String shrunk = arg.getValue().substring("blockdust_".length()); - dMaterial material = dMaterial.valueOf(shrunk); + MaterialTag material = MaterialTag.valueOf(shrunk); if (material != null) { scriptEntry.addObject("blockdust", material); } else { - Debug.echoError("Invalid blockdust_[item]. Must be a valid dMaterial!"); + Debug.echoError("Invalid blockdust_[item]. Must be a valid MaterialTag!"); } continue; } @@ -180,19 +180,19 @@ else if (!scriptEntry.hasObject("offset") && arg.matchesPrefix("offset", "o")) { double offset = arg.asElement().asDouble(); - scriptEntry.addObject("offset", new dLocation(null, offset, offset, offset)); + scriptEntry.addObject("offset", new LocationTag(null, offset, offset, offset)); } else if (!scriptEntry.hasObject("offset") - && arg.matchesArgumentType(dLocation.class) + && arg.matchesArgumentType(LocationTag.class) && arg.matchesPrefix("offset", "o")) { - scriptEntry.addObject("offset", arg.asType(dLocation.class)); + scriptEntry.addObject("offset", arg.asType(LocationTag.class)); } else if (!scriptEntry.hasObject("targets") - && arg.matchesArgumentList(dPlayer.class) + && arg.matchesArgumentList(PlayerTag.class) && arg.matchesPrefix("targets", "target", "t")) { - scriptEntry.addObject("targets", arg.asType(ListTag.class).filter(dPlayer.class, scriptEntry)); + scriptEntry.addObject("targets", arg.asType(ListTag.class).filter(PlayerTag.class, scriptEntry)); } else { arg.reportUnhandled(); @@ -206,7 +206,7 @@ else if (!scriptEntry.hasObject("targets") scriptEntry.defaultObject("data", new ElementTag(0)); scriptEntry.defaultObject("radius", new ElementTag(15)); scriptEntry.defaultObject("qty", new ElementTag(1)); - scriptEntry.defaultObject("offset", new dLocation(null, 0.5, 0.5, 0.5)); + scriptEntry.defaultObject("offset", new LocationTag(null, 0.5, 0.5, 0.5)); // Check to make sure required arguments have been filled @@ -227,19 +227,19 @@ else if (!scriptEntry.hasObject("targets") public void execute(ScriptEntry scriptEntry) { // Extract objects from ScriptEntry - List locations = (List) scriptEntry.getObject("location"); - List targets = (List) scriptEntry.getObject("targets"); + List locations = (List) scriptEntry.getObject("location"); + List targets = (List) scriptEntry.getObject("targets"); Effect effect = (Effect) scriptEntry.getObject("effect"); Particle particleEffect = (Particle) scriptEntry.getObject("particleeffect"); - dItem iconcrack = scriptEntry.getdObject("iconcrack"); - dMaterial blockcrack = scriptEntry.getdObject("blockcrack"); - dMaterial blockdust = scriptEntry.getdObject("blockdust"); + ItemTag iconcrack = scriptEntry.getdObject("iconcrack"); + MaterialTag blockcrack = scriptEntry.getdObject("blockcrack"); + MaterialTag blockdust = scriptEntry.getdObject("blockdust"); ElementTag radius = scriptEntry.getElement("radius"); ElementTag data = scriptEntry.getElement("data"); ElementTag qty = scriptEntry.getElement("qty"); ElementTag no_offset = scriptEntry.getElement("no_offset"); boolean should_offset = no_offset == null || !no_offset.asBoolean(); - dLocation offset = scriptEntry.getdObject("offset"); + LocationTag offset = scriptEntry.getdObject("offset"); ElementTag special_data = scriptEntry.getElement("special_data"); // Report to dB @@ -259,17 +259,17 @@ public void execute(ScriptEntry scriptEntry) { (should_offset ? ArgumentHelper.debugObj("note", "Location will be offset 1 block-height upward (see documentation)") : "")); } - for (dLocation location : locations) { + for (LocationTag location : locations) { if (should_offset) { // Slightly increase the location's Y so effects don't seem to come out of the ground - location = new dLocation(location.clone().add(0, 1, 0)); + location = new LocationTag(location.clone().add(0, 1, 0)); } // Play the Bukkit effect the number of times specified if (effect != null) { for (int n = 0; n < qty.asInt(); n++) { if (targets != null) { - for (dPlayer player : targets) { + for (PlayerTag player : targets) { if (player.isValid() && player.isOnline()) { player.getPlayerEntity().playEffect(location, effect, data.asInt()); // TODO: 1.13 } @@ -296,7 +296,7 @@ else if (particleEffect != null) { } } else { - for (dPlayer player : targets) { + for (PlayerTag player : targets) { if (player.isValid() && player.isOnline()) { players.add(player.getPlayerEntity()); } @@ -319,7 +319,7 @@ else if (clazz == org.bukkit.Particle.DustOptions.class) { } else { float size = ArgumentHelper.getFloatFrom(dataList.get(0)); - dColor color = dColor.valueOf(dataList.get(1)); + ColorTag color = ColorTag.valueOf(dataList.get(1)); dataObject = new org.bukkit.Particle.DustOptions(color.getColor(), size); } } @@ -343,7 +343,7 @@ else if (clazz == org.bukkit.Particle.DustOptions.class) { } } else { - for (dPlayer player : targets) { + for (PlayerTag player : targets) { if (player.isValid() && player.isOnline()) { players.add(player.getPlayerEntity()); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/PlaySoundCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/PlaySoundCommand.java index 9fad6b4994..8bec30e93c 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/PlaySoundCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/PlaySoundCommand.java @@ -2,8 +2,8 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.nms.NMSHandler; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -66,13 +66,13 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException if (!scriptEntry.hasObject("locations") && !scriptEntry.hasObject("entities") - && arg.matchesArgumentList(dLocation.class)) { - scriptEntry.addObject("locations", arg.asType(ListTag.class).filter(dLocation.class, scriptEntry)); + && arg.matchesArgumentList(LocationTag.class)) { + scriptEntry.addObject("locations", arg.asType(ListTag.class).filter(LocationTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("locations") && !scriptEntry.hasObject("entities") - && arg.matchesArgumentList(dPlayer.class)) { - scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(dPlayer.class, scriptEntry)); + && arg.matchesArgumentList(PlayerTag.class)) { + scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(PlayerTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("volume") && arg.matchesPrimitive(ArgumentHelper.PrimitiveType.Double) @@ -120,8 +120,8 @@ else if (!scriptEntry.hasObject("sound_category") @Override public void execute(ScriptEntry scriptEntry) { - List locations = (List) scriptEntry.getObject("locations"); - List players = (List) scriptEntry.getObject("entities"); + List locations = (List) scriptEntry.getObject("locations"); + List players = (List) scriptEntry.getObject("entities"); ElementTag sound = scriptEntry.getElement("sound"); ElementTag volume = scriptEntry.getElement("volume"); ElementTag pitch = scriptEntry.getElement("pitch"); @@ -143,20 +143,20 @@ public void execute(ScriptEntry scriptEntry) { try { if (locations != null) { if (custom.asBoolean()) { - for (dLocation location : locations) { + for (LocationTag location : locations) { NMSHandler.getInstance().getSoundHelper().playSound(null, location, sound.asString(), volume.asFloat(), pitch.asFloat(), sound_category.asString()); } } else { - for (dLocation location : locations) { + for (LocationTag location : locations) { NMSHandler.getInstance().getSoundHelper().playSound(null, location, Sound.valueOf(sound.asString().toUpperCase()), volume.asFloat(), pitch.asFloat(), sound_category.asString()); } } } else { - for (dPlayer player : players) { + for (PlayerTag player : players) { if (custom.asBoolean()) { NMSHandler.getInstance().getSoundHelper().playSound(player.getPlayerEntity(), player.getLocation(), sound.asString(), volume.asFloat(), pitch.asFloat(), sound_category.asString()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/SchematicCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/SchematicCommand.java index 6b52d766bd..85db2320ee 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/SchematicCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/SchematicCommand.java @@ -5,9 +5,9 @@ import com.denizenscript.denizen.utilities.blocks.CuboidBlockSet; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.nms.interfaces.BlockData; -import com.denizenscript.denizen.objects.dCuboid; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.CuboidTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.*; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -131,12 +131,12 @@ else if (!scriptEntry.hasObject("angle") scriptEntry.addObject("angle", arg.asElement()); } else if (!scriptEntry.hasObject("location") - && arg.matchesArgumentType(dLocation.class)) { - scriptEntry.addObject("location", arg.asType(dLocation.class)); + && arg.matchesArgumentType(LocationTag.class)) { + scriptEntry.addObject("location", arg.asType(LocationTag.class)); } else if (!scriptEntry.hasObject("cuboid") - && arg.matchesArgumentType(dCuboid.class)) { - scriptEntry.addObject("cuboid", arg.asType(dCuboid.class)); + && arg.matchesArgumentType(CuboidTag.class)) { + scriptEntry.addObject("cuboid", arg.asType(CuboidTag.class)); } else if (!scriptEntry.hasObject("delayed") && arg.matches("delayed")) { @@ -170,8 +170,8 @@ public void execute(final ScriptEntry scriptEntry) { ElementTag filename = scriptEntry.getElement("filename"); ElementTag noair = scriptEntry.getElement("noair"); ElementTag delayed = scriptEntry.getElement("delayed"); - dLocation location = scriptEntry.getdObject("location"); - dCuboid cuboid = scriptEntry.getdObject("cuboid"); + LocationTag location = scriptEntry.getdObject("location"); + CuboidTag cuboid = scriptEntry.getdObject("cuboid"); if (scriptEntry.dbCallShouldDebug()) { @@ -446,15 +446,15 @@ public void schematicTags(ReplaceableTagEvent event) { // <--[tag] // @attribute ].block[]> - // @returns dMaterial + // @returns MaterialTag // @description // Returns the material for the block at the location in the schematic. // --> if (attribute.startsWith("block")) { - if (attribute.hasContext(1) && dLocation.matches(attribute.getContext(1))) { - dLocation location = dLocation.valueOf(attribute.getContext(1)); + if (attribute.hasContext(1) && LocationTag.matches(attribute.getContext(1))) { + LocationTag location = LocationTag.valueOf(attribute.getContext(1)); BlockData block = set.blockAt(location.getX(), location.getY(), location.getZ()); - event.setReplaced(new dMaterial(block) + event.setReplaced(new MaterialTag(block) .getAttribute(attribute.fulfill(1))); return; } @@ -462,12 +462,12 @@ public void schematicTags(ReplaceableTagEvent event) { // <--[tag] // @attribute ].origin> - // @returns dLocation + // @returns LocationTag // @description // Returns the origin location of the schematic. // --> if (attribute.startsWith("origin")) { - event.setReplaced(new dLocation(null, set.center_x, set.center_y, set.center_z) + event.setReplaced(new LocationTag(null, set.center_x, set.center_y, set.center_z) .getAttribute(attribute.fulfill(1))); return; } @@ -486,12 +486,12 @@ public void schematicTags(ReplaceableTagEvent event) { // <--[tag] // @attribute ].cuboid[]> - // @returns dCuboid + // @returns CuboidTag // @description // Returns a cuboid of where the schematic would be if it was pasted at an origin. // --> if (attribute.startsWith("cuboid") && attribute.hasContext(1)) { - dLocation origin = dLocation.valueOf(attribute.getContext(1)); + LocationTag origin = LocationTag.valueOf(attribute.getContext(1)); event.setReplaced(set.getCuboid(origin) .getAttribute(attribute.fulfill(1))); return; diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/SignCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/SignCommand.java index 69531f17c2..318d582b42 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/SignCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/SignCommand.java @@ -7,7 +7,7 @@ import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.NMSVersion; import com.denizenscript.denizen.nms.interfaces.BlockData; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -36,7 +36,7 @@ public class SignCommand extends AbstractCommand { // If there is not already a sign there, defaults to a sign_post. // // @Tags - // + // // // @Usage // Use to edit some text on a sign @@ -64,8 +64,8 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException scriptEntry.addObject("type", arg.asElement()); } else if (!scriptEntry.hasObject("location") - && arg.matchesArgumentType(dLocation.class)) { - scriptEntry.addObject("location", arg.asType(dLocation.class).setPrefix("location")); + && arg.matchesArgumentType(LocationTag.class)) { + scriptEntry.addObject("location", arg.asType(LocationTag.class).setPrefix("location")); } else if (!scriptEntry.hasObject("direction") && arg.matchesPrefix("direction", "dir")) { @@ -115,7 +115,7 @@ public void execute(final ScriptEntry scriptEntry) { String direction = scriptEntry.hasObject("direction") ? ((ElementTag) scriptEntry.getObject("direction")).asString() : null; ElementTag typeElement = scriptEntry.getElement("type"); ListTag text = (ListTag) scriptEntry.getObject("text"); - dLocation location = (dLocation) scriptEntry.getObject("location"); + LocationTag location = (LocationTag) scriptEntry.getObject("location"); // Report to dB if (scriptEntry.dbCallShouldDebug()) { @@ -142,7 +142,7 @@ public void execute(final ScriptEntry scriptEntry) { // TODO: 1.14 - allow new sign types? sign.setType(MaterialCompat.SIGN, false); if (direction != null) { - Utilities.setSignRotation(dLocation.getBlockStateFor(sign), direction); + Utilities.setSignRotation(LocationTag.getBlockStateFor(sign), direction); } } } @@ -156,7 +156,7 @@ else if (!MaterialCompat.isAnySign(sign.getType())) { setWallSign(sign, bf); } } - BlockState signState = dLocation.getBlockStateFor(sign); + BlockState signState = LocationTag.getBlockStateFor(sign); Utilities.setSignLines((Sign) signState, text.toArray(4)); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/StrikeCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/StrikeCommand.java index eab5b23a97..c4914c21dd 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/StrikeCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/StrikeCommand.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.scripts.commands.world; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -44,8 +44,8 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("location") - && arg.matchesArgumentType(dLocation.class)) { - scriptEntry.addObject("location", arg.asType(dLocation.class)); + && arg.matchesArgumentType(LocationTag.class)) { + scriptEntry.addObject("location", arg.asType(LocationTag.class)); } else if (arg.matches("no_damage") || arg.matches("nodamage")) { scriptEntry.addObject("damage", new ElementTag(false)); @@ -68,7 +68,7 @@ else if (arg.matches("no_damage") || arg.matches("nodamage")) { public void execute(ScriptEntry scriptEntry) { // Extract objects from ScriptEntry - dLocation location = (dLocation) scriptEntry.getObject("location"); + LocationTag location = (LocationTag) scriptEntry.getObject("location"); Boolean damage = scriptEntry.getElement("damage").asBoolean(); // Debugger diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/SwitchCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/SwitchCommand.java index c42e937fd6..ed4f8853b8 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/SwitchCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/SwitchCommand.java @@ -9,7 +9,7 @@ import com.denizenscript.denizen.nms.NMSVersion; import com.denizenscript.denizen.nms.abstracts.ModernBlockData; import com.denizenscript.denizen.nms.interfaces.BlockData; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.*; import com.denizenscript.denizencore.objects.core.DurationTag; @@ -44,7 +44,7 @@ public class SwitchCommand extends AbstractCommand { // Works on any interactable blocks. // // @Tags - // + // // // @Usage // At the player's location, switch the state of the block to on, no matter what state it was in before. @@ -69,7 +69,7 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("locations") && - arg.matchesArgumentList(dLocation.class)) { + arg.matchesArgumentList(LocationTag.class)) { scriptEntry.addObject("locations", arg.asType(ListTag.class)); } else if (!scriptEntry.hasObject("duration") && @@ -107,7 +107,7 @@ public void execute(final ScriptEntry scriptEntry) { + ArgumentHelper.debugObj("switchstate", switchState.name())); } - for (final dLocation interactLocation : interactLocations.filter(dLocation.class, scriptEntry)) { + for (final LocationTag interactLocation : interactLocations.filter(LocationTag.class, scriptEntry)) { switchBlock(scriptEntry, interactLocation, switchState, player); // If duration set, schedule a delayed task. diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/TimeCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/TimeCommand.java index e33c13c1cc..508e52ada3 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/TimeCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/TimeCommand.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dWorld; +import com.denizenscript.denizen.objects.WorldTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.DurationTag; @@ -29,8 +29,8 @@ public class TimeCommand extends AbstractCommand { // When that player logs off, their time will be reset to the global time. // // @Tags - // - // + // + // // // @Usage // Use to set the time in the NPC or Player's world. @@ -62,8 +62,8 @@ else if (!scriptEntry.hasObject("value") scriptEntry.addObject("value", arg.asType(DurationTag.class)); } else if (!scriptEntry.hasObject("world") - && arg.matchesArgumentType(dWorld.class)) { - scriptEntry.addObject("world", arg.asType(dWorld.class)); + && arg.matchesArgumentType(WorldTag.class)) { + scriptEntry.addObject("world", arg.asType(WorldTag.class)); } else { arg.reportUnhandled(); @@ -81,9 +81,9 @@ else if (!scriptEntry.hasObject("world") if (!scriptEntry.hasObject("world")) { scriptEntry.addObject("world", Utilities.entryHasNPC(scriptEntry) ? - new dWorld(Utilities.getEntryNPC(scriptEntry).getWorld()) : + new WorldTag(Utilities.getEntryNPC(scriptEntry).getWorld()) : (Utilities.entryHasPlayer(scriptEntry) ? - new dWorld(Utilities.getEntryPlayer(scriptEntry).getWorld()) : null)); + new WorldTag(Utilities.getEntryPlayer(scriptEntry).getWorld()) : null)); } scriptEntry.defaultObject("type", new ElementTag("GLOBAL")); @@ -97,7 +97,7 @@ else if (!scriptEntry.hasObject("world") public void execute(ScriptEntry scriptEntry) { // Fetch objects DurationTag value = (DurationTag) scriptEntry.getObject("value"); - dWorld world = (dWorld) scriptEntry.getObject("world"); + WorldTag world = (WorldTag) scriptEntry.getObject("world"); ElementTag type_element = scriptEntry.getElement("type"); Type type = Type.valueOf(type_element.asString().toUpperCase()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/WeatherCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/WeatherCommand.java index f76e23f5b1..8fdc80a87d 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/WeatherCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/WeatherCommand.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.utilities.Utilities; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dWorld; +import com.denizenscript.denizen.objects.WorldTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.Argument; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -28,12 +28,12 @@ public class WeatherCommand extends AbstractCommand { // Logging off will reset personal weather. // // @Tags - // - // - // - // - // - // + // + // + // + // + // + // // // @Usage // Makes the weather sunny @@ -63,8 +63,8 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException scriptEntry.addObject("type", Type.valueOf(arg.getValue().toUpperCase())); } else if (!scriptEntry.hasObject("world") - && arg.matchesArgumentType(dWorld.class)) { - scriptEntry.addObject("world", arg.asType(dWorld.class)); + && arg.matchesArgumentType(WorldTag.class)) { + scriptEntry.addObject("world", arg.asType(WorldTag.class)); } else if (!scriptEntry.hasObject("value") && arg.matchesEnum(Value.values())) { @@ -84,8 +84,8 @@ else if (!scriptEntry.hasObject("value") // If the world has not been specified, try to use the NPC's or player's // world, or default to "world" if necessary scriptEntry.defaultObject("world", - Utilities.entryHasNPC(scriptEntry) ? new dWorld(Utilities.getEntryNPC(scriptEntry).getWorld()) : null, - Utilities.entryHasPlayer(scriptEntry) ? new dWorld(Utilities.getEntryPlayer(scriptEntry).getWorld()) : null, + Utilities.entryHasNPC(scriptEntry) ? new WorldTag(Utilities.getEntryNPC(scriptEntry).getWorld()) : null, + Utilities.entryHasPlayer(scriptEntry) ? new WorldTag(Utilities.getEntryPlayer(scriptEntry).getWorld()) : null, Bukkit.getWorlds().get(0)); } @@ -94,7 +94,7 @@ public void execute(ScriptEntry scriptEntry) { // Fetch objects Value value = Value.valueOf(((ElementTag) scriptEntry.getObject("value")) .asString().toUpperCase()); - dWorld world = (dWorld) scriptEntry.getObject("world"); + WorldTag world = (WorldTag) scriptEntry.getObject("world"); Type type = scriptEntry.hasObject("type") ? (Type) scriptEntry.getObject("type") : Type.GLOBAL; diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/WorldBorderCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/WorldBorderCommand.java index 56e6f21b85..5c55bb5989 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/WorldBorderCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/WorldBorderCommand.java @@ -2,9 +2,9 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.nms.NMSHandler; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dPlayer; -import com.denizenscript.denizen.objects.dWorld; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.PlayerTag; +import com.denizenscript.denizen.objects.WorldTag; import com.denizenscript.denizencore.exceptions.InvalidArgumentsException; import com.denizenscript.denizencore.objects.*; import com.denizenscript.denizencore.objects.core.DurationTag; @@ -40,13 +40,13 @@ public class WorldBorderCommand extends AbstractCommand { // reset: Resets the world border to its vanilla defaults for a world, or to the current world border for players. // // @Tags - // - // - // - // - // - // - // + // + // + // + // + // + // + // // // @Usage // Use to set the size of a world border. @@ -67,9 +67,9 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) { if (!scriptEntry.hasObject("center") - && arg.matchesArgumentType(dLocation.class) + && arg.matchesArgumentType(LocationTag.class) && arg.matchesPrefix("center")) { - scriptEntry.addObject("center", arg.asType(dLocation.class)); + scriptEntry.addObject("center", arg.asType(LocationTag.class)); } else if (!scriptEntry.hasObject("damage") && arg.matchesPrimitive(ArgumentHelper.PrimitiveType.Double) @@ -107,12 +107,12 @@ else if (!scriptEntry.hasObject("warningtime") scriptEntry.addObject("warningtime", arg.asType(DurationTag.class)); } else if (!scriptEntry.hasObject("world") - && arg.matchesArgumentType(dWorld.class)) { - scriptEntry.addObject("world", arg.asType(dWorld.class)); + && arg.matchesArgumentType(WorldTag.class)) { + scriptEntry.addObject("world", arg.asType(WorldTag.class)); } else if (!scriptEntry.hasObject("players") - && arg.matchesArgumentList(dPlayer.class)) { - scriptEntry.addObject("players", arg.asType(ListTag.class).filter(dPlayer.class, scriptEntry)); + && arg.matchesArgumentList(PlayerTag.class)) { + scriptEntry.addObject("players", arg.asType(ListTag.class).filter(PlayerTag.class, scriptEntry)); } else if (!scriptEntry.hasObject("reset") && arg.matches("reset")) { @@ -145,9 +145,9 @@ else if (!scriptEntry.hasObject("reset") @Override public void execute(ScriptEntry scriptEntry) { - dWorld world = (dWorld) scriptEntry.getObject("world"); - List players = (List) scriptEntry.getObject("players"); - dLocation center = (dLocation) scriptEntry.getObject("center"); + WorldTag world = (WorldTag) scriptEntry.getObject("world"); + List players = (List) scriptEntry.getObject("players"); + LocationTag center = (LocationTag) scriptEntry.getObject("center"); ElementTag size = scriptEntry.getElement("size"); ElementTag currSize = scriptEntry.getElement("current_size"); ElementTag damage = scriptEntry.getElement("damage"); @@ -175,14 +175,14 @@ public void execute(ScriptEntry scriptEntry) { // Handle client-side world borders if (players != null) { if (reset.asBoolean()) { - for (dPlayer player : players) { + for (PlayerTag player : players) { NMSHandler.getInstance().getPacketHelper().resetWorldBorder(player.getPlayerEntity()); } return; } WorldBorder wb; - for (dPlayer player : players) { + for (PlayerTag player : players) { wb = player.getWorld().getWorldBorder(); NMSHandler.getInstance().getPacketHelper().setWorldBorder( player.getPlayerEntity(), diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/BookScriptContainer.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/BookScriptContainer.java index 92d4f2a08d..fdb776f431 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/BookScriptContainer.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/BookScriptContainer.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.scripts.containers.core; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.tags.BukkitTagContext; import com.denizenscript.denizen.utilities.MaterialCompat; import com.denizenscript.denizencore.objects.core.ScriptTag; @@ -21,8 +21,8 @@ public class BookScriptContainer extends ScriptContainer { // @group Script Container System // @description // Book script containers are similar to item script containers, except they are specifically - // for the book items. They work with with the dItem object, and can be fetched - // with the Object Fetcher by using the dItem constructor i@book_script_name + // for the book items. They work with with the ItemTag object, and can be fetched + // with the Object Fetcher by using the ItemTag constructor i@book_script_name // Example: - give i@my_book // // @@ -51,16 +51,16 @@ public BookScriptContainer(YamlConfiguration configurationSection, String script super(configurationSection, scriptContainerName); } - public dItem getBookFrom() { + public ItemTag getBookFrom() { return getBookFrom(null, null); } - public dItem getBookFrom(dPlayer player, dNPC npc) { - dItem stack = new dItem(Material.WRITTEN_BOOK); + public ItemTag getBookFrom(PlayerTag player, NPCTag npc) { + ItemTag stack = new ItemTag(Material.WRITTEN_BOOK); return writeBookTo(stack, player, npc); } - public dItem writeBookTo(dItem book, dPlayer player, dNPC npc) { + public ItemTag writeBookTo(ItemTag book, PlayerTag player, NPCTag npc) { // Get current ItemMeta from the book BookMeta bookInfo = (BookMeta) book.getItemStack().getItemMeta(); 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 86e128d6f1..6b4d2941c7 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 @@ -39,11 +39,11 @@ public BukkitWorldScriptHelper() { .registerEvents(this, DenizenAPI.getCurrentInstance()); } - public static String doEvents(List events, dNPC npc, dPlayer player, Map context) { + public static String doEvents(List events, NPCTag npc, PlayerTag player, Map context) { return doEvents(events, npc, player, context, false); } - public static String doEvents(List events, dNPC npc, dPlayer player, Map context, boolean useids) { + public static String doEvents(List events, NPCTag npc, PlayerTag player, Map context, boolean useids) { List determ; if (useids) { determ = OldEventManager.doEvents(events, new BukkitScriptEntryData(player, npc), context, true); @@ -121,7 +121,7 @@ public void timeEvent() { hour = hour - 24; } - dWorld currentWorld = new dWorld(world); + WorldTag currentWorld = new WorldTag(world); if (!current_time.containsKey(currentWorld.identifySimple()) || current_time.get(currentWorld.identifySimple()) != hour) { @@ -157,7 +157,7 @@ public void timeEvent() { // A max-size stack of the clicked item is put on the cursor. // COLLECT_TO_CURSOR // The inventory is searched for the same material, and they are put on the cursor up to - // m@material.max_stack_size. + // MaterialTag.max_stack_size. // DROP_ALL_CURSOR // The entire cursor item is dropped. // DROP_ALL_SLOT @@ -208,9 +208,9 @@ public void timeEvent() { // // @Triggers when a player clicks in an inventory. // @Context - // returns the dItem the player has clicked on. - // returns the dInventory (the 'top' inventory, regardless of which slot was clicked). - // returns the dInventory that was clicked in. + // returns the ItemTag the player has clicked on. + // returns the InventoryTag (the 'top' inventory, regardless of which slot was clicked). + // returns the InventoryTag that was clicked in. // returns the item the Player is clicking with. // returns an ElementTag with the name of the click type. Click type list: <@link url http://bit.ly/2IjY198> // returns an ElementTag with the name of the slot type that was clicked. @@ -222,7 +222,7 @@ public void timeEvent() { // // @Determine // "CANCELLED" to stop the player from clicking. - // dItem to set the current item for the event. + // ItemTag to set the current item for the event. // // --> @EventHandler @@ -231,11 +231,11 @@ public void inventoryClickEvent(InventoryClickEvent event) { // TODO: make this a script event... Map context = new HashMap<>(); - dItem item = new dItem(Material.AIR); - dItem holding; + ItemTag item = new ItemTag(Material.AIR); + ItemTag holding; - dInventory inventory = dInventory.mirrorBukkitInventory(event.getInventory()); - final dPlayer player = dEntity.getPlayerFrom(event.getWhoClicked()); + InventoryTag inventory = InventoryTag.mirrorBukkitInventory(event.getInventory()); + final PlayerTag player = EntityTag.getPlayerFrom(event.getWhoClicked()); String type = event.getInventory().getType().name(); String click = event.getClick().name(); String slotType = event.getSlotType().name(); @@ -259,7 +259,7 @@ public void inventoryClickEvent(InventoryClickEvent event) { } if (event.getCursor() != null) { - holding = new dItem(event.getCursor()); + holding = new ItemTag(event.getCursor()); context.put("cursor_item", holding); events.add(interaction + "in inventory with " + holding.identifySimple()); @@ -283,7 +283,7 @@ public void inventoryClickEvent(InventoryClickEvent event) { } if (event.getCurrentItem() != null) { - item = new dItem(event.getCurrentItem()); + item = new ItemTag(event.getCurrentItem()); events.add("player clicks " + item.identifySimple() + " in inventory"); @@ -321,7 +321,7 @@ public void inventoryClickEvent(InventoryClickEvent event) { } if (event.getCursor() != null) { - holding = new dItem(event.getCursor()); + holding = new ItemTag(event.getCursor()); final String[] itemStrings = new String[] { item.identifySimple(), @@ -361,7 +361,7 @@ public void inventoryClickEvent(InventoryClickEvent event) { context.put("slot", new ElementTag(event.getSlot() + 1)); context.put("raw_slot", new ElementTag(event.getRawSlot() + 1)); if (event.getClickedInventory() != null) { - context.put("clicked_inventory", dInventory.mirrorBukkitInventory(event.getClickedInventory())); + context.put("clicked_inventory", InventoryTag.mirrorBukkitInventory(event.getClickedInventory())); } context.put("is_shift_click", new ElementTag(event.isShiftClick())); context.put("action", new ElementTag(event.getAction().name())); @@ -382,10 +382,10 @@ public void run() { } }.runTaskLater(DenizenAPI.getCurrentInstance(), 1); } - else if (dItem.matches(determination)) { - dItem dit = dItem.valueOf(determination, player, null); + else if (ItemTag.matches(determination)) { + ItemTag dit = ItemTag.valueOf(determination, player, null); if (dit == null) { - Debug.echoError("Invalid dItem: " + dit); + Debug.echoError("Invalid ItemTag: " + dit); } else { event.setCurrentItem(dit.getItemStack()); @@ -399,7 +399,7 @@ else if (dItem.matches(determination)) { @EventHandler(priority = EventPriority.MONITOR) public void onPlayerJoins(PlayerJoinEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } if (ScoreboardHelper.viewerMap.containsKey(event.getPlayer().getName())) { @@ -428,11 +428,11 @@ public void run() { @EventHandler(priority = EventPriority.MONITOR) public void playerLogin(PlayerLoginEvent event) { - if (dEntity.isNPC(event.getPlayer())) { + if (EntityTag.isNPC(event.getPlayer())) { return; } - dPlayer.notePlayer(event.getPlayer()); + PlayerTag.notePlayer(event.getPlayer()); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/CommandScriptContainer.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/CommandScriptContainer.java index 28c7559b20..b41d5984c1 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/CommandScriptContainer.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/CommandScriptContainer.java @@ -2,8 +2,8 @@ import com.denizenscript.denizen.utilities.DenizenCommand; import com.denizenscript.denizen.BukkitScriptEntryData; -import com.denizenscript.denizen.objects.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.tags.BukkitTagContext; import com.denizenscript.denizencore.events.OldEventManager; import com.denizenscript.denizencore.objects.core.ListTag; @@ -106,7 +106,7 @@ public class CommandScriptContainer extends ScriptContainer { // # returns whether the server is running the command (a player if false). // # returns the command alias being used. // # returns the command block's location (if the command was run from one). - // # returns the dEntity of the command minecart (if the command was run from one). + // # returns the EntityTag of the command minecart (if the command was run from one). // script: // - if !>: // - narrate "You do not have permission for that command." @@ -153,7 +153,7 @@ public String getPermissionMessage() { return getString("PERMISSION MESSAGE"); } - public ScriptQueue runCommandScript(dPlayer player, dNPC npc, Map context) { + public ScriptQueue runCommandScript(PlayerTag player, NPCTag npc, Map context) { ScriptQueue queue = new InstantQueue(getName()).addEntries(getBaseEntries( new BukkitScriptEntryData(player, npc))); if (context != null) { @@ -165,7 +165,7 @@ public ScriptQueue runCommandScript(dPlayer player, dNPC npc, Map context) { + public boolean runAllowedHelpProcedure(PlayerTag player, NPCTag npc, Map context) { List entries = getEntries(new BukkitScriptEntryData(player, npc), "ALLOWED HELP"); ScriptQueue queue = new InstantQueue(getName()).addEntries(entries); @@ -178,7 +178,7 @@ public boolean runAllowedHelpProcedure(dPlayer player, dNPC npc, Map 0 && queue.determinations.get(0).equalsIgnoreCase("true"); } - public List runTabCompleteProcedure(dPlayer player, dNPC npc, Map context) { + public List runTabCompleteProcedure(PlayerTag player, NPCTag npc, Map context) { List entries = getEntries(new BukkitScriptEntryData(player, npc), "TAB COMPLETE"); ScriptQueue queue = new InstantQueue(getName()).addEntries(entries); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/EconomyScriptContainer.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/EconomyScriptContainer.java index 4bc1b49da9..718e9993f8 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/EconomyScriptContainer.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/EconomyScriptContainer.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.BukkitScriptEntryData; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.tags.BukkitTagContext; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.ArgumentHelper; @@ -33,7 +33,7 @@ public class EconomyScriptContainer extends ScriptContainer { // Economy script containers // // Economy script containers provide a Vault economy, which can be used in scripts by - // <@link tag p@player.money> and <@link mechanism dPlayer.money> + // <@link tag PlayerTag.money> and <@link mechanism PlayerTag.money> // and as well by any other plugin that relies on economy functionality (such as shop plugins). // // Note that vault economy bank systems are not currently supported. @@ -96,12 +96,12 @@ public String autoTag(String value, OfflinePlayer player) { if (value == null) { return null; } - return TagManager.tag(value, new BukkitTagContext(player == null ? null : new dPlayer(player), + return TagManager.tag(value, new BukkitTagContext(player == null ? null : new PlayerTag(player), null, false, null, backingScript.shouldDebug(), new ScriptTag(backingScript))); } public String runSubScript(String pathName, OfflinePlayer player, double amount) { - List entries = backingScript.getEntries(new BukkitScriptEntryData(new dPlayer(player), null), pathName); + List entries = backingScript.getEntries(new BukkitScriptEntryData(new PlayerTag(player), null), pathName); InstantQueue queue = new InstantQueue(backingScript.getName()); queue.addEntries(entries); queue.addDefinition("amount", new ElementTag(amount)); 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 7a17d83879..058bcd4b22 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 @@ -1,9 +1,9 @@ package com.denizenscript.denizen.scripts.containers.core; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.tags.BukkitTagContext; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; @@ -23,8 +23,8 @@ public class EntityScriptContainer extends ScriptContainer { // @group Script Container System // @description // Entity script containers are an easy way to pre-define custom entities for use within scripts. Entity - // scripts work with the dEntity object, and can be fetched with the Object Fetcher by using the - // dEntity constructor e@EntityScriptName. Example: - spawn e@MyEntity + // scripts work with the EntityTag object, and can be fetched with the Object Fetcher by using the + // EntityTag constructor e@EntityScriptName. Example: - spawn e@MyEntity // // The following is the format for the container. Except for the 'entity_type' key (and the dScript // required 'type' key), all other keys are optional. @@ -33,16 +33,16 @@ public class EntityScriptContainer extends ScriptContainer { // // // # The name of the entity script is the same name that you can use to construct a new - // # dEntity based on this entity script. For example, an entity script named 'space zombie' + // # EntityTag based on this entity script. For example, an entity script named 'space zombie' // # can be referred to as 'e@space zombie'. // Entity_Script_Name: // // type: entity // - // # Must be a valid dEntity (EG e@zombie or e@pig[age=baby]) See 'dEntity' for more information. + // # Must be a valid EntityTag (EG e@zombie or e@pig[age=baby]) See 'dEntity' for more information. // entity_type: e@base_entity // - // # Samples of mechanisms to use (any valid dEntity mechanisms may be listed like this): + // # Samples of mechanisms to use (any valid EntityTag mechanisms may be listed like this): // // # Whether the entity has the default AI // has_ai: true/false @@ -59,17 +59,17 @@ public EntityScriptContainer(YamlConfiguration configurationSection, String scri super(configurationSection, scriptContainerName); } - public dEntity getEntityFrom() { + public EntityTag getEntityFrom() { return getEntityFrom(null, null); } - public dEntity getEntityFrom(dPlayer player, dNPC npc) { - dEntity entity = null; + public EntityTag getEntityFrom(PlayerTag player, NPCTag npc) { + EntityTag entity = null; try { if (contains("ENTITY_TYPE")) { String entityType = TagManager.tag((getString("ENTITY_TYPE", "")), new BukkitTagContext (player, npc, false, null, shouldDebug(), new ScriptTag(this))); - entity = dEntity.valueOf(entityType); + entity = EntityTag.valueOf(entityType); } else { throw new Exception("Missing entity_type argument!"); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/EntityScriptHelper.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/EntityScriptHelper.java index 3b02277fa3..3e8f174184 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/EntityScriptHelper.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/EntityScriptHelper.java @@ -8,7 +8,7 @@ import com.denizenscript.denizen.flags.FlagManager; import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.NMSVersion; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.objects.properties.entity.EntityBoundingBox; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.core.ScriptTag; @@ -43,12 +43,12 @@ public EntityScriptHelper() { @EventHandler(priority = EventPriority.MONITOR) public void onEntityDeath(EntityDeathEvent event) { Entity entity = event.getEntity(); - dEntity.rememberEntity(entity); - EntityDespawnScriptEvent.instance.entity = new dEntity(entity); + EntityTag.rememberEntity(entity); + EntityDespawnScriptEvent.instance.entity = new EntityTag(entity); EntityDespawnScriptEvent.instance.cause = new ElementTag("DEATH"); EntityDespawnScriptEvent.instance.cancelled = false; EntityDespawnScriptEvent.instance.fire(); - dEntity.forgetEntity(entity); + EntityTag.forgetEntity(entity); unlinkEntity(event.getEntity()); } @@ -89,12 +89,12 @@ public void onChunkUnload(ChunkUnloadEvent event) { // CraftBukkit: https://github.com/Bukkit/CraftBukkit/pull/1386 for (Entity ent : event.getChunk().getEntities()) { if (!(ent instanceof LivingEntity) || ((LivingEntity) ent).getRemoveWhenFarAway()) { - dEntity.rememberEntity(ent); - EntityDespawnScriptEvent.instance.entity = new dEntity(ent); + EntityTag.rememberEntity(ent); + EntityDespawnScriptEvent.instance.entity = new EntityTag(ent); EntityDespawnScriptEvent.instance.cause = new ElementTag("CHUNK_UNLOAD"); EntityDespawnScriptEvent.instance.cancelled = false; EntityDespawnScriptEvent.instance.fire(); - dEntity.forgetEntity(ent); + EntityTag.forgetEntity(ent); unlinkEntity(ent); } } @@ -201,7 +201,7 @@ public static void unlinkEntity(final Entity ent) { @Override public void run() { entities.remove(ent.getUniqueId()); - FlagManager.clearEntityFlags(new dEntity(ent)); + FlagManager.clearEntityFlags(new EntityTag(ent)); EntityBoundingBox.remove(ent.getUniqueId()); } }, 5); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/FormatScriptContainer.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/FormatScriptContainer.java index 23c98234ca..20c42ba643 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/FormatScriptContainer.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/FormatScriptContainer.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.scripts.containers.core; import com.denizenscript.denizen.BukkitScriptEntryData; -import com.denizenscript.denizen.objects.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.tags.BukkitTagContext; import com.denizenscript.denizencore.objects.core.ScriptTag; import com.denizenscript.denizencore.scripts.ScriptEntry; @@ -27,13 +27,13 @@ public String getFormattedText(ScriptEntry entry) { ((BukkitScriptEntryData) entry.entryData).getPlayer()); } - public String getFormattedText(String textToReplace, dNPC npc, dPlayer player) { + public String getFormattedText(String textToReplace, NPCTag npc, PlayerTag player) { String text = getFormat().replace("", String.valueOf((char) 0x00)).replace("", String.valueOf((char) 0x04)); return TagManager.tag(text, new BukkitTagContext(player, npc, false, null, shouldDebug(), new ScriptTag(this))) .replace("%", "%%").replace(String.valueOf((char) 0x00), "%2$s").replace(String.valueOf((char) 0x04), "%1$s"); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/InteractScriptContainer.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/InteractScriptContainer.java index 0064014c8f..a9233a3646 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/InteractScriptContainer.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/InteractScriptContainer.java @@ -3,8 +3,8 @@ import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.BukkitScriptEntryData; -import com.denizenscript.denizen.objects.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.scripts.triggers.AbstractTrigger; import com.denizenscript.denizencore.scripts.ScriptEntry; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; @@ -210,12 +210,12 @@ public boolean containsTriggerInStep(String step, Class getEntriesFor(Class trigger, - dPlayer player, dNPC npc, String id) { + PlayerTag player, NPCTag npc, String id) { return getEntriesFor(trigger, player, npc, id, false); } public List getEntriesFor(Class trigger, - dPlayer player, dNPC npc, String id, boolean quiet) { + PlayerTag player, NPCTag npc, String id, boolean quiet) { // Get the trigger name String triggerName = DenizenAPI.getCurrentInstance() .getTriggerRegistry().get(trigger).getName().toUpperCase(); @@ -274,7 +274,7 @@ public List getEntriesFor(Class trigger, */ public Map getIdMapFor(Class trigger, - dPlayer player) { + PlayerTag player) { // Get the trigger name String triggerName = DenizenAPI.getCurrentInstance() .getTriggerRegistry().get(trigger).getName().toUpperCase(); @@ -306,7 +306,7 @@ public Map getIdMapFor(Class trigger, } public String getTriggerOptionFor(Class trigger, - dPlayer player, String id, String option) { + PlayerTag player, String id, String option) { // Get the trigger name String triggerName = DenizenAPI.getCurrentInstance() .getTriggerRegistry().get(trigger).getName().toUpperCase(); @@ -317,7 +317,7 @@ public String getTriggerOptionFor(Class trigger, } public boolean hasTriggerOptionFor(Class trigger, - dPlayer player, String id, String option) { + PlayerTag player, String id, String option) { // Get the trigger name String triggerName = DenizenAPI.getCurrentInstance() .getTriggerRegistry().get(trigger).getName().toUpperCase(); 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 baa74da1a1..78bc5a2f20 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 @@ -2,8 +2,8 @@ import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.scripts.commands.core.CooldownCommand; import com.denizenscript.denizen.scripts.triggers.AbstractTrigger; import com.denizenscript.denizencore.scripts.ScriptRegistry; @@ -25,7 +25,7 @@ public class InteractScriptHelper { * @param trigger the class of the trigger being used * @return the highest priority InteractScriptContainer that meets requirements, if any. */ - public static InteractScriptContainer getInteractScript(dNPC npc, dPlayer player, + public static InteractScriptContainer getInteractScript(NPCTag npc, PlayerTag player, Class trigger) { // If no trigger, npc or player specified, return null. // These objects are required to progress any further. @@ -217,7 +217,7 @@ else if (interactableScripts.isEmpty()) { * @param scriptName the name of the interact script container to check * @return the current, or default, step name */ - public static String getCurrentStep(dPlayer player, String scriptName) { + public static String getCurrentStep(PlayerTag player, String scriptName) { if (scriptName == null) { return null; } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/InventoryScriptContainer.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/InventoryScriptContainer.java index 697bff31cd..432ac8c535 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/InventoryScriptContainer.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/InventoryScriptContainer.java @@ -2,10 +2,10 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.BukkitScriptEntryData; -import com.denizenscript.denizen.objects.dInventory; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.InventoryTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.tags.BukkitTagContext; import com.denizenscript.denizencore.objects.ArgumentHelper; import com.denizenscript.denizencore.objects.core.ListTag; @@ -29,8 +29,8 @@ public class InventoryScriptContainer extends ScriptContainer { // @group Script Container System // @description // Inventory script containers are an easy way to pre-define custom inventories for use within scripts. - // Inventory scripts work with the dInventory object, and can be fetched with the Object Fetcher by using the - // dInventory constructor in@inventory_script_name. + // Inventory scripts work with the InventoryTag object, and can be fetched with the Object Fetcher by using the + // InventoryTag constructor InventoryTag_script_name. // // Example: - inventory open d:in@MyInventoryScript // @@ -42,7 +42,7 @@ public class InventoryScriptContainer extends ScriptContainer { // // // # The name of the script is the same name that you can use to construct a new - // # dInventory based on this inventory script. For example, an inventory script named 'Super Cool Inventory' + // # InventoryTag based on this inventory script. For example, an inventory script named 'Super Cool Inventory' // # can be referred to as 'in@Super Cool Inventory'. // Inventory Script Name: // @@ -63,10 +63,10 @@ public class InventoryScriptContainer extends ScriptContainer { // # You can use definitions to define items to use in the slots. These are not like normal // # script definitions, and do not need %'s around them. // definitions: - // my item: i@item - // other item: i@item + // my item: ItemTag + // other item: ItemTag // - // # Procedural items can be used to specify a list of dItems for the empty slots to be filled with. + // # Procedural items can be used to specify a list of ItemTags for the empty slots to be filled with. // # Each item in the list represents the next available empty slot. // # When the inventory has no more empty slots, it will discard any remaining items in the list. // # A slot is considered empty when it has no value specified in the slots section. @@ -81,8 +81,8 @@ public class InventoryScriptContainer extends ScriptContainer { // # You can specify the items in the slots of the inventory. For empty spaces, simply put // # an empty "slot". Note the quotes around the entire lines. // slots: - // - "[] [] [] [my item] [i@item] [] [other item] [] []" - // - "[my item] [] [] [] [] [i@item] [i@item] [] []" + // - "[] [] [] [my item] [ItemTag] [] [other item] [] []" + // - "[my item] [] [] [] [] [ItemTag] [ItemTag] [] []" // - "[] [] [] [] [] [] [] [] [other item]" // // @@ -104,17 +104,17 @@ public InventoryType getInventoryType() { } } - public dInventory getInventoryFrom(dPlayer player, dNPC npc) { + public InventoryTag getInventoryFrom(PlayerTag player, NPCTag npc) { // TODO: Clean all this code! - dInventory inventory = null; + InventoryTag inventory = null; BukkitTagContext context = new BukkitTagContext(player, npc, false, null, shouldDebug(), new ScriptTag(this)); try { if (contains("INVENTORY")) { if (InventoryType.valueOf(getString("INVENTORY").toUpperCase()) != null) { - inventory = new dInventory(InventoryType.valueOf(getString("INVENTORY").toUpperCase())); + inventory = new InventoryTag(InventoryType.valueOf(getString("INVENTORY").toUpperCase())); if (contains("TITLE")) { inventory.setTitle(TagManager.tag(getString("TITLE"), context)); } @@ -144,7 +144,7 @@ public dInventory getInventoryFrom(dPlayer player, dNPC npc) { Debug.echoError("Inventory size must be a positive number! Inverting to " + size + "..."); } - inventory = new dInventory(size, contains("TITLE") ? TagManager.tag(getString("TITLE"), context) : "Chest"); + inventory = new InventoryTag(size, contains("TITLE") ? TagManager.tag(getString("TITLE"), context) : "Chest"); inventory.setIdentifiers("script", getName()); } } @@ -168,7 +168,7 @@ public dInventory getInventoryFrom(dPlayer player, dNPC npc) { String[] itemsInLine = items.substring(1, items.length() - 1).split("\\[?\\]?\\s+\\[", -1); for (String item : itemsInLine) { if (contains("DEFINITIONS." + item)) { - dItem def = dItem.valueOf(TagManager.tag(getString("DEFINITIONS." + item), context), player, npc); + ItemTag def = ItemTag.valueOf(TagManager.tag(getString("DEFINITIONS." + item), context), player, npc); if (def == null) { Debug.echoError("Invalid definition '" + item + "' in inventory script '" + getName() + "'" + "... Ignoring it and assuming \"AIR\""); @@ -178,9 +178,9 @@ public dInventory getInventoryFrom(dPlayer player, dNPC npc) { finalItems[itemsAdded] = def.getItemStack(); } } - else if (dItem.matches(item)) { + else if (ItemTag.matches(item)) { try { - finalItems[itemsAdded] = dItem.valueOf(item, player, npc).getItemStack(); + finalItems[itemsAdded] = ItemTag.valueOf(item, player, npc).getItemStack(); } catch (Exception ex) { Debug.echoError("Inventory script \"" + getName() + "\" has an invalid slot item: [" @@ -201,7 +201,7 @@ else if (dItem.matches(item)) { } if (inventory == null) { size = finalItems.length % 9 == 0 ? finalItems.length : (int) (Math.ceil(finalItems.length / 9.0) * 9); - inventory = new dInventory(size == 0 ? 9 : size, + inventory = new InventoryTag(size == 0 ? 9 : size, contains("TITLE") ? TagManager.tag(getString("TITLE"), context) : "Chest"); } inventory.setContents(finalItems); @@ -210,7 +210,7 @@ else if (dItem.matches(item)) { // TODO: Document this feature! if (inventory == null) { size = InventoryType.CHEST.getDefaultSize(); - inventory = new dInventory(size, contains("TITLE") ? TagManager.tag(getString("TITLE"), context) : "Chest"); + inventory = new InventoryTag(size, contains("TITLE") ? TagManager.tag(getString("TITLE"), context) : "Chest"); } List entries = getEntries(new BukkitScriptEntryData(player, npc), "PROCEDURAL ITEMS"); if (!entries.isEmpty()) { @@ -228,7 +228,7 @@ else if (dItem.matches(item)) { ListTag list = ListTag.getListFor(queue.determinations.getObject(0)); if (list != null) { int x = 0; - for (dItem item : list.filter(dItem.class, this)) { + for (ItemTag item : list.filter(ItemTag.class, this)) { while (x < filledSlots.length && filledSlots[x]) { x++; } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/InventoryScriptHelper.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/InventoryScriptHelper.java index 984052d9d7..46e04dd3cb 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/InventoryScriptHelper.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/InventoryScriptHelper.java @@ -4,7 +4,7 @@ import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.abstracts.ImprovedOfflinePlayer; import com.denizenscript.denizen.nms.interfaces.PlayerHelper; -import com.denizenscript.denizen.objects.dInventory; +import com.denizenscript.denizen.objects.InventoryTag; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.inventory.InventoryCloseEvent; @@ -20,7 +20,7 @@ public class InventoryScriptHelper implements Listener { public static Map inventory_scripts = new ConcurrentHashMap<>(8, 0.9f, 1); - public static Map notableInventories = new HashMap<>(); + public static Map notableInventories = new HashMap<>(); public static Map tempInventoryScripts = new HashMap<>(); public InventoryScriptHelper() { 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 d5d5ba2e80..d9b85db5c3 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 @@ -2,9 +2,9 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.utilities.nbt.LeatherColorer; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.tags.BukkitTagContext; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; @@ -30,21 +30,21 @@ public class ItemScriptContainer extends ScriptContainer { // @group Script Container System // @description // Item script containers are an easy way to pre-define custom items for use within scripts. Item - // scripts work with the dItem object, and can be fetched with the Object Fetcher by using the - // dItem constructor i@item_script_name. Example: - drop i@super_dooper_diamond + // scripts work with the ItemTag object, and can be fetched with the Object Fetcher by using the + // ItemTag constructor ItemTag_script_name. Example: - drop i@super_dooper_diamond // // The following is the format for the container. Except for the 'material' key (and the dScript // required 'type' key), all other keys are optional. // // // # The name of the item script is the same name that you can use to construct a new - // # dItem based on this item script. For example, an item script named 'sword of swiftness' + // # ItemTag based on this item script. For example, an item script named 'sword of swiftness' // # can be referred to as 'i@sword of swiftness'. // Item Script Name: // // type: item // - // # Must be a valid dItem (EG i@red_wool or i@potion,8226) See 'dItem' for more information. + // # Must be a valid ItemTag (EG i@red_wool or i@potion,8226) See 'dItem' for more information. // material: i@base_material // // # List any mechanisms you want to apply to the item within @@ -71,28 +71,28 @@ public class ItemScriptContainer extends ScriptContainer { // // # You can specify the items required to craft your item. For an empty slot, use i@air. // recipe: - // - i@item|i@item|i@item - // - i@item|i@item|i@item - // - i@item|i@item|i@item + // - ItemTag|ItemTag|ItemTag + // - ItemTag|ItemTag|ItemTag + // - ItemTag|ItemTag|ItemTag // // # You can specify a material that can be smelted into your item. // # Note: This can overwrite existing furnace recipes. // # If no_id is specified, only the material/data pair will be validated. // # This might misbehave with some smelting systems, as the Minecraft smelting logic may refuse // # To continue smelting items in some cases when the script validator gets in the way. - // furnace_recipe: i@item + // furnace_recipe: ItemTag // // # You can specify a list of materials that make up a shapeless recipe. // # Note: This can overwrite existing shapeless recipes. - // shapeless_recipe: i@item|... + // shapeless_recipe: ItemTag|... // // # Set to true to not store the scriptID on the item, treating it as an item dropped by any other plugin. // # NOTE: THIS IS NOT RECOMMENDED UNLESS YOU HAVE A SPECIFIC REASON TO USE IT. // no_id: true/false // - // # For colorable items, such as leather armor, you can specify a valid dColor to specify the item's appearance. + // # For colorable items, such as leather armor, you can specify a valid ColorTag to specify the item's appearance. // # See 'dColor' for more information. - // color: co@color + // color: ColorTag // // # If your material is a 'm@written_book', you can specify a book script to automatically scribe your item // # upon creation. See 'book script containers' for more information. @@ -102,11 +102,11 @@ public class ItemScriptContainer extends ScriptContainer { // --> // A map storing special recipes that use itemscripts as ingredients - public static Map> specialrecipesMap = new HashMap<>(); - public static Map> shapelessRecipesMap = new HashMap<>(); + public static Map> specialrecipesMap = new HashMap<>(); + public static Map> shapelessRecipesMap = new HashMap<>(); - dNPC npc = null; - dPlayer player = null; + NPCTag npc = null; + PlayerTag player = null; public boolean bound = false; String hash = ""; @@ -137,13 +137,13 @@ public ItemScriptContainer(YamlConfiguration configurationSection, String script } } - private dItem cleanReference; + private ItemTag cleanReference; - public dItem getCleanReference() { + public ItemTag getCleanReference() { if (cleanReference == null) { cleanReference = getItemFrom(); } - return new dItem(cleanReference.getItemStack().clone()); + return new ItemTag(cleanReference.getItemStack().clone()); } public String getHashID() { @@ -154,15 +154,15 @@ public void setHashID(String HashID) { hash = HashID; } - public dItem getItemFrom() { + public ItemTag getItemFrom() { return getItemFrom(null, null); } public static SlowWarning boundWarning = new SlowWarning("Item script 'bound' functionality has never been reliable and should not be used. Consider replicating the concept with world events."); - public dItem getItemFrom(dPlayer player, dNPC npc) { + public ItemTag getItemFrom(PlayerTag player, NPCTag npc) { // Try to use this script to make an item. - dItem stack = null; + ItemTag stack = null; try { boolean debug = true; if (contains("DEBUG")) { @@ -175,7 +175,7 @@ public dItem getItemFrom(dPlayer player, dNPC npc) { if (material.startsWith("m@")) { material = material.substring(2); } - stack = dItem.valueOf(material, this); + stack = ItemTag.valueOf(material, this); } // Make sure we're working with a valid base ItemStack @@ -275,11 +275,11 @@ public dItem getItemFrom(dPlayer player, dNPC npc) { return stack; } - public void setNPC(dNPC npc) { + public void setNPC(NPCTag npc) { this.npc = npc; } - public void setPlayer(dPlayer player) { + public void setPlayer(PlayerTag player) { this.player = player; } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/ItemScriptHelper.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/ItemScriptHelper.java index 66efd06b63..105bec5261 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/ItemScriptHelper.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/ItemScriptHelper.java @@ -6,8 +6,8 @@ import com.denizenscript.denizen.events.player.ItemRecipeFormedScriptEvent; import com.denizenscript.denizen.events.player.PlayerCraftsItemScriptEvent; import com.denizenscript.denizen.nms.NMSHandler; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.tags.BukkitTagContext; import com.denizenscript.denizencore.objects.core.ListTag; import com.denizenscript.denizencore.objects.core.ScriptTag; @@ -67,7 +67,7 @@ public void scriptReload(ScriptReloadEvent event) { } // Store every ingredient in a List - List ingredients = new ArrayList<>(); + List ingredients = new ArrayList<>(); boolean shouldRegister = true; recipeLoop: @@ -75,9 +75,9 @@ public void scriptReload(ScriptReloadEvent event) { String[] elements = recipeRow.split("\\|", 3); for (String element : elements) { - dItem ingredient = dItem.valueOf(element.replaceAll("[iImM]@", ""), container); + ItemTag ingredient = ItemTag.valueOf(element.replaceAll("[iImM]@", ""), container); if (ingredient == null) { - Debug.echoError("Invalid dItem ingredient, recipe will not be registered for item script '" + Debug.echoError("Invalid ItemTag ingredient, recipe will not be registered for item script '" + container.getName() + "': " + element); shouldRegister = false; break recipeLoop; @@ -101,13 +101,13 @@ public void scriptReload(ScriptReloadEvent event) { String list = TagManager.tag(string, new BukkitTagContext(container.player, container.npc, false, null, Debug.shouldDebug(container), new ScriptTag(container))); - List ingredients = new ArrayList<>(); + List ingredients = new ArrayList<>(); boolean shouldRegister = true; for (String element : ListTag.valueOf(list)) { - dItem ingredient = dItem.valueOf(element.replaceAll("[iImM]@", ""), container); + ItemTag ingredient = ItemTag.valueOf(element.replaceAll("[iImM]@", ""), container); if (ingredient == null) { - Debug.echoError("Invalid dItem ingredient, shapeless recipe will not be registered for item script '" + Debug.echoError("Invalid ItemTag ingredient, shapeless recipe will not be registered for item script '" + container.getName() + "': " + element); shouldRegister = false; break; @@ -121,7 +121,7 @@ public void scriptReload(ScriptReloadEvent event) { for (Map.Entry entry : furnace_to_register.entrySet()) { - dItem furnace_item = dItem.valueOf(entry.getValue(), entry.getKey()); + ItemTag furnace_item = ItemTag.valueOf(entry.getValue(), entry.getKey()); if (furnace_item == null) { Debug.echoError("Invalid item '" + entry.getValue() + "'"); continue; @@ -144,10 +144,10 @@ public void furnaceSmeltHandler(FurnaceSmeltEvent event) { ItemScriptContainer isc = getItemScriptContainer(event.getResult()); String inp = currentFurnaceRecipes.get(isc); if (inp != null) { - dItem itm = dItem.valueOf(inp, isc); + ItemTag itm = ItemTag.valueOf(inp, isc); if (itm != null) { itm.setAmount(1); - dItem src = new dItem(event.getSource().clone()); + ItemTag src = new ItemTag(event.getSource().clone()); src.setAmount(1); if (!itm.getFullString().equals(src.getFullString())) { List recipes = Bukkit.getServer().getRecipesFor(event.getSource()); @@ -186,8 +186,8 @@ public static ItemScriptContainer getItemScriptContainer(ItemStack item) { return null; } for (String itemLore : item.getItemMeta().getLore()) { - if (itemLore.startsWith(dItem.itemscriptIdentifier)) { - return item_scripts.get(itemLore.replace(dItem.itemscriptIdentifier, "")); + if (itemLore.startsWith(ItemTag.itemscriptIdentifier)) { + return item_scripts.get(itemLore.replace(ItemTag.itemscriptIdentifier, "")); } if (itemLore.startsWith(ItemScriptHashID)) { return item_scripts_by_hash_id.get(itemLore); @@ -249,7 +249,7 @@ public void specialRecipeClick(InventoryClickEvent event) { CraftingInventory inventory = (CraftingInventory) event.getInventory(); Player player = (Player) event.getWhoClicked(); - Map.Entry> recipeEntry = null; + Map.Entry> recipeEntry = null; if (slotType == SlotType.RESULT && inventory.getResult() != null && inventory.getResult().getData().getItemType() != Material.AIR) { @@ -269,18 +269,18 @@ public void specialRecipeClick(InventoryClickEvent event) { PlayerCraftsItemScriptEvent scriptEvent = PlayerCraftsItemScriptEvent.instance; scriptEvent.inventory = inventory; - scriptEvent.result = new dItem(inventory.getResult()); + scriptEvent.result = new ItemTag(inventory.getResult()); ListTag recipeList = new ListTag(); for (ItemStack item : inventory.getMatrix()) { if (item != null) { - recipeList.add(new dItem(item.clone()).identify()); + recipeList.add(new ItemTag(item.clone()).identify()); } else { - recipeList.add(new dItem(Material.AIR).identify()); + recipeList.add(new ItemTag(Material.AIR).identify()); } } scriptEvent.recipe = recipeList; - scriptEvent.player = dPlayer.mirrorBukkitPlayer(player); + scriptEvent.player = PlayerTag.mirrorBukkitPlayer(player); scriptEvent.resultChanged = false; scriptEvent.cancelled = false; scriptEvent.fire(); @@ -309,7 +309,7 @@ else if (scriptEvent.resultChanged) { } } - public void removeFromEachSlot(final CraftingInventory inventory, final List recipe, final Player player) { + public void removeFromEachSlot(final CraftingInventory inventory, final List recipe, final Player player) { // This cloning is a workaround for what seems to be a Spigot issue // Basically, after taking the crafted item, it randomly sets the recipe items // to twice their amount minus 2. I have no idea why. @@ -383,7 +383,7 @@ public boolean processSpecialRecipes(final CraftingInventory inventory, final Pl // Get the result of the special recipe that this matrix matches, // if any - dItem result1 = getSpecialRecipeResult(matrix1, player); + ItemTag result1 = getSpecialRecipeResult(matrix1, player); boolean returnme = result1 != null; @@ -401,17 +401,17 @@ public void run() { // Get the result of the special recipe that this matrix matches, // if any - dItem result = getSpecialRecipeResult(matrix, player); + ItemTag result = getSpecialRecipeResult(matrix, player); // Proceed only if the result was not null if (result != null) { ListTag recipeList = new ListTag(); for (ItemStack item : matrix) { if (item != null) { - recipeList.add(new dItem(item).identify()); + recipeList.add(new ItemTag(item).identify()); } else { - recipeList.add(new dItem(Material.AIR).identify()); + recipeList.add(new ItemTag(Material.AIR).identify()); } } @@ -419,7 +419,7 @@ public void run() { event.result = result; event.recipe = recipeList; event.inventory = inventory; - event.player = dPlayer.mirrorBukkitPlayer(player); + event.player = PlayerTag.mirrorBukkitPlayer(player); event.cancelled = false; event.resultChanged = false; event.fire(); @@ -440,19 +440,19 @@ public void run() { return returnme; } - public Map.Entry> getSpecialRecipeEntry(ItemStack[] matrix) { + public Map.Entry> getSpecialRecipeEntry(ItemStack[] matrix) { // Iterate through all the special recipes master: - for (Map.Entry> entry : + for (Map.Entry> entry : ItemScriptContainer.specialrecipesMap.entrySet()) { // Check if the two sets of items match each other for (int n = 0; n < 9; n++) { - // Use dItem.valueOf on the entry values to ensure + // Use ItemTag.valueOf on the entry values to ensure // correct comparison - dItem valueN = entry.getValue().get(n); - dItem matrixN = matrix.length <= n || matrix[n] == null ? new dItem(Material.AIR) : new dItem(matrix[n].clone()); + ItemTag valueN = entry.getValue().get(n); + ItemTag matrixN = matrix.length <= n || matrix[n] == null ? new ItemTag(Material.AIR) : new ItemTag(matrix[n].clone()); // If one's an item script and the other's not, it's a fail if (valueN.isItemscript() != matrixN.isItemscript()) { @@ -477,26 +477,26 @@ public Map.Entry> getSpecialRecipeEntry(ItemSta } } - // If all the items match, return the special recipe's dItem key + // If all the items match, return the special recipe's ItemTag key return entry; } // Forms a shaped recipe from a shapeless recipe primary: - for (Map.Entry> entry : + for (Map.Entry> entry : ItemScriptContainer.shapelessRecipesMap.entrySet()) { // Clone recipe & matrix so we can remove items from them List entryList = new ArrayList<>(); List matrixList = new ArrayList<>(); - for (dItem entryItem : entry.getValue()) { + for (ItemTag entryItem : entry.getValue()) { entryList.add(entryItem.getItemStack().clone()); } for (ItemStack itemStack : matrix) { matrixList.add(itemStack != null ? itemStack.clone() : new ItemStack(Material.AIR)); } - List shapedRecipe = new ArrayList<>(); + List shapedRecipe = new ArrayList<>(); ItemStack matrixItem; ItemStack entryItem; @@ -515,7 +515,7 @@ public Map.Entry> getSpecialRecipeEntry(ItemSta // If the items are similar & the matrix has enough, we have a match if (matrixItem.isSimilar(entryItem) && matrixItem.getAmount() >= entryItem.getAmount()) { - shapedRecipe.add(new dItem(entryItem)); + shapedRecipe.add(new ItemTag(entryItem)); mL.remove(); eL.remove(); matched = true; @@ -528,7 +528,7 @@ public Map.Entry> getSpecialRecipeEntry(ItemSta } } else { - shapedRecipe.add(new dItem(Material.AIR)); + shapedRecipe.add(new ItemTag(Material.AIR)); mL.remove(); } } @@ -547,11 +547,11 @@ public Map.Entry> getSpecialRecipeEntry(ItemSta } // Check if a CraftingInventory's crafting matrix matches a special - // recipe and return that recipe's dItem result if it does - public dItem getSpecialRecipeResult(ItemStack[] matrix, Player player) { - Map.Entry> recipeEntry = getSpecialRecipeEntry(matrix); + // recipe and return that recipe's ItemTag result if it does + public ItemTag getSpecialRecipeResult(ItemStack[] matrix, Player player) { + Map.Entry> recipeEntry = getSpecialRecipeEntry(matrix); if (recipeEntry != null) { - return recipeEntry.getKey().getItemFrom(dPlayer.mirrorBukkitPlayer(player), null); + return recipeEntry.getKey().getItemFrom(PlayerTag.mirrorBukkitPlayer(player), null); } return null; } @@ -568,14 +568,14 @@ public boolean emulateSpecialRecipeResultShiftClick(CraftingInventory inventory, } // Get the recipe entry for this matrix, if any - Map.Entry> recipeEntry = getSpecialRecipeEntry(matrix); + Map.Entry> recipeEntry = getSpecialRecipeEntry(matrix); // Proceed only if the result was not null if (recipeEntry != null) { - List recipe = recipeEntry.getValue(); - dItem result = recipeEntry.getKey().getItemFrom(dPlayer.mirrorBukkitPlayer(player), null); + List recipe = recipeEntry.getValue(); + ItemTag result = recipeEntry.getKey().getItemFrom(PlayerTag.mirrorBukkitPlayer(player), null); - // In a shift click, the amount of the resulting dItem should + // In a shift click, the amount of the resulting ItemTag should // be based on the amount of the least numerous ingredient multiple, // so track it int lowestAmount = 0; diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/AbstractTrigger.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/AbstractTrigger.java index 4bd98c789a..d477e4b537 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/AbstractTrigger.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/AbstractTrigger.java @@ -4,8 +4,8 @@ import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.npc.traits.TriggerTrait; -import com.denizenscript.denizen.objects.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.events.OldEventManager; import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.scripts.ScriptEntry; @@ -70,16 +70,16 @@ public AbstractTrigger activate() { } - public boolean parse(dNPC npc, dPlayer player, InteractScriptContainer script) { + public boolean parse(NPCTag npc, PlayerTag player, InteractScriptContainer script) { return parse(npc, player, script, null, null); } - public boolean parse(dNPC npc, dPlayer player, InteractScriptContainer script, String id) { + public boolean parse(NPCTag npc, PlayerTag player, InteractScriptContainer script, String id) { return parse(npc, player, script, id, null); } - public boolean parse(dNPC npc, dPlayer player, InteractScriptContainer script, String id, Map context) { + public boolean parse(NPCTag npc, PlayerTag player, InteractScriptContainer script, String id, Map context) { if (npc == null || player == null || script == null) { return false; } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/TriggerRegistry.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/TriggerRegistry.java index c1d4cd353c..9719e3dbb0 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/TriggerRegistry.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/TriggerRegistry.java @@ -4,7 +4,7 @@ import com.denizenscript.denizen.scripts.triggers.core.DamageTrigger; import com.denizenscript.denizen.scripts.triggers.core.ProximityTrigger; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.scripts.triggers.core.ClickTrigger; import net.citizensnpcs.api.npc.NPC; @@ -84,7 +84,7 @@ public enum CooldownType {NPC, PLAYER} * Not to be confused with Script Cool-downs. */ - public boolean checkCooldown(NPC npc, dPlayer player, AbstractTrigger triggerClass, CooldownType cooldownType) { + public boolean checkCooldown(NPC npc, PlayerTag player, AbstractTrigger triggerClass, CooldownType cooldownType) { switch (cooldownType) { case NPC: // Check npcCooldown @@ -117,7 +117,7 @@ else if (System.currentTimeMillis() > playerCooldown.get(player.getName() + "/" return false; } - public void setCooldown(NPC npc, dPlayer player, AbstractTrigger triggerClass, double seconds, CooldownType cooldownType) { + public void setCooldown(NPC npc, PlayerTag player, AbstractTrigger triggerClass, double seconds, CooldownType cooldownType) { Map triggerMap = new HashMap<>(); boolean noCooldown = seconds <= 0; diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/ChatTrigger.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/ChatTrigger.java index c9ebbf6f97..97f16fc3f7 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/ChatTrigger.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/ChatTrigger.java @@ -8,8 +8,8 @@ import com.denizenscript.denizen.Settings; import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.npc.traits.TriggerTrait; -import com.denizenscript.denizen.objects.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.scripts.triggers.AbstractTrigger; import com.denizenscript.denizen.tags.BukkitTagContext; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -111,8 +111,8 @@ public void onEnable() { public ChatContext process(Player player, String message) { // Check if there is an NPC within range of a player to chat to. - dNPC npc = Utilities.getClosestNPC_ChatTrigger(player.getLocation(), 25); - dPlayer denizenPlayer = dPlayer.mirrorBukkitPlayer(player); + NPCTag npc = Utilities.getClosestNPC_ChatTrigger(player.getLocation(), 25); + PlayerTag denizenPlayer = PlayerTag.mirrorBukkitPlayer(player); if (HyperDebug) { Debug.log("Processing chat trigger: valid npc? " + (npc != null)); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/ClickTrigger.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/ClickTrigger.java index 31471972b4..a9a07bad4f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/ClickTrigger.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/ClickTrigger.java @@ -4,9 +4,9 @@ import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.npc.traits.TriggerTrait; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.scripts.triggers.AbstractTrigger; import com.denizenscript.denizen.tags.BukkitTagContext; import com.denizenscript.denizencore.tags.TagManager; @@ -66,9 +66,9 @@ public void clickTrigger(NPCRightClickEvent event) { return; } - // The rest of the methods beyond this point require a dNPC object, which can easily be + // The rest of the methods beyond this point require a NPCTag object, which can easily be // obtained if a valid NPC object is available: - dNPC npc = DenizenAPI.getDenizenNPC(event.getNPC()); + NPCTag npc = DenizenAPI.getDenizenNPC(event.getNPC()); // Now, check if the 'click trigger' specifically is enabled. 'name' is inherited from the // super AbstractTrigger and contains the name of the trigger that was use in registration. @@ -77,7 +77,7 @@ public void clickTrigger(NPCRightClickEvent event) { } // We'll get the player too, since it makes reading the next few methods a bit easier: - dPlayer player = dPlayer.mirrorBukkitPlayer(event.getClicker()); + PlayerTag player = PlayerTag.mirrorBukkitPlayer(event.getClicker()); // Check availability based on the NPC's ENGAGED status and the trigger's COOLDOWN that is // provided (and adjustable) by the TriggerTrait. Just use .trigger(...)! @@ -130,7 +130,7 @@ public void clickTrigger(NPCRightClickEvent event) { (player, npc, false, null, false, null)); // Check if the item specified in the specified id's 'trigger:' key // matches the item that the player is holding. - dItem item = dItem.valueOf(entry_value, script); + ItemTag item = ItemTag.valueOf(entry_value, script); if (item == null) { Debug.echoError("Invalid click trigger in script '" + script.getName() + "' (null trigger item)!"); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/DamageTrigger.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/DamageTrigger.java index 273307ce60..499771d45f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/DamageTrigger.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/DamageTrigger.java @@ -4,10 +4,10 @@ import com.denizenscript.denizen.scripts.containers.core.InteractScriptHelper; import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.npc.traits.TriggerTrait; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dItem; -import com.denizenscript.denizen.objects.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.scripts.triggers.AbstractTrigger; import com.denizenscript.denizen.tags.BukkitTagContext; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -84,7 +84,7 @@ public void damageTrigger(EntityDamageByEntityEvent event) { return; } - dEntity damager = new dEntity(event.getDamager()); + EntityTag damager = new EntityTag(event.getDamager()); if (damager.isProjectile() && damager.hasShooter()) { damager = damager.getShooter(); @@ -93,10 +93,10 @@ public void damageTrigger(EntityDamageByEntityEvent event) { Map context = new HashMap<>(); context.put("damage", new ElementTag(event.getDamage())); - dPlayer dplayer = null; + PlayerTag dplayer = null; if (CitizensAPI.getNPCRegistry().isNPC(event.getEntity())) { - dNPC npc = DenizenAPI.getDenizenNPC(CitizensAPI.getNPCRegistry().getNPC(event.getEntity())); + NPCTag npc = DenizenAPI.getDenizenNPC(CitizensAPI.getNPCRegistry().getNPC(event.getEntity())); if (npc == null) { return; } @@ -159,7 +159,7 @@ public void damageTrigger(EntityDamageByEntityEvent event) { (dplayer, npc, false, null, false, null)); // Check if the item specified in the specified id's 'trigger:' key // matches the item that the player is holding. - if (dItem.valueOf(entry_value, script).comparesTo(dplayer.getPlayerEntity().getItemInHand()) >= 0) { + if (ItemTag.valueOf(entry_value, script).comparesTo(dplayer.getPlayerEntity().getItemInHand()) >= 0) { id = entry.getKey(); } } 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 89108ab4be..eb834c4b63 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 @@ -5,8 +5,8 @@ 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.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.scripts.triggers.AbstractTrigger; import com.denizenscript.denizencore.scripts.ScriptRegistry; import net.citizensnpcs.api.CitizensAPI; @@ -116,7 +116,7 @@ public void run() { if (!citizensNPC.hasTrait(TriggerTrait.class) || !citizensNPC.getTrait(TriggerTrait.class).isEnabled(name)) { continue; } - dNPC npc = new dNPC(citizensNPC); + NPCTag npc = new NPCTag(citizensNPC); TriggerTrait triggerTrait = npc.getTriggerTrait(); // Loop through all players @@ -141,7 +141,7 @@ && hasExitedProximityOf(bukkitPlayer, npc)) { } // Get the player - dPlayer player = dPlayer.mirrorBukkitPlayer(bukkitPlayer); + PlayerTag player = PlayerTag.mirrorBukkitPlayer(bukkitPlayer); // // Check to make sure the NPC has an assignment. If no assignment, a script doesn't need to be parsed, @@ -270,7 +270,7 @@ public void onDisable() { * @param npc the NPC * @return true if within maxProximityDistance in all directions */ - private boolean isCloseEnough(Player player, dNPC npc) { + private boolean isCloseEnough(Player player, NPCTag npc) { Location pLoc = player.getLocation(); Location nLoc = npc.getLocation(); if (Math.abs(pLoc.getX() - nLoc.getX()) > maxProximityDistance) { @@ -308,7 +308,7 @@ public void checkMaxProximities(ScriptReloadEvent event) { // // Ensures that a Player who has entered proximity of an NPC also fires Exit Proximity. // - private boolean hasExitedProximityOf(Player player, dNPC npc) { + private boolean hasExitedProximityOf(Player player, NPCTag npc) { // If Player hasn't entered proximity, it's not in the Map. Return true, must be exited. Set existing = proximityTracker.get(player.getUniqueId()); if (existing == null) { @@ -329,7 +329,7 @@ private boolean hasExitedProximityOf(Player player, dNPC npc) { * @param player the Player * @param npc the NPC */ - private void enterProximityOf(Player player, dNPC npc) { + private void enterProximityOf(Player player, NPCTag npc) { Set npcs = proximityTracker.get(player.getUniqueId()); if (npcs == null) { npcs = new HashSet<>(); @@ -345,7 +345,7 @@ private void enterProximityOf(Player player, dNPC npc) { * @param player the Player * @param npc the NPC */ - private void exitProximityOf(Player player, dNPC npc) { + private void exitProximityOf(Player player, NPCTag npc) { Set npcs = proximityTracker.get(player.getUniqueId()); if (npcs == null) { npcs = new HashSet<>(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/tags/BukkitTagContext.java b/plugin/src/main/java/com/denizenscript/denizen/tags/BukkitTagContext.java index 15ae808665..d786728bce 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/tags/BukkitTagContext.java +++ b/plugin/src/main/java/com/denizenscript/denizen/tags/BukkitTagContext.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.tags; -import com.denizenscript.denizen.objects.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.BukkitScriptEntryData; import com.denizenscript.denizencore.objects.core.ScriptTag; import com.denizenscript.denizencore.scripts.ScriptEntry; @@ -9,10 +9,10 @@ import com.denizenscript.denizencore.tags.TagContext; public class BukkitTagContext extends TagContext { - public final dPlayer player; - public final dNPC npc; + public final PlayerTag player; + public final NPCTag npc; - public BukkitTagContext(dPlayer player, dNPC npc, boolean instant, ScriptEntry entry, boolean debug, ScriptTag script) { + public BukkitTagContext(PlayerTag player, NPCTag npc, boolean instant, ScriptEntry entry, boolean debug, ScriptTag script) { super(instant, debug, entry, script); this.player = player; this.npc = npc; diff --git a/plugin/src/main/java/com/denizenscript/denizen/tags/core/BiomeTags.java b/plugin/src/main/java/com/denizenscript/denizen/tags/core/BiomeTags.java index 0ceb190325..66533aa1e0 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/tags/core/BiomeTags.java +++ b/plugin/src/main/java/com/denizenscript/denizen/tags/core/BiomeTags.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.tags.core; -import com.denizenscript.denizen.objects.dBiome; +import com.denizenscript.denizen.objects.BiomeTag; import com.denizenscript.denizencore.objects.TagRunnable; import com.denizenscript.denizencore.tags.Attribute; import com.denizenscript.denizencore.tags.ReplaceableTagEvent; @@ -24,10 +24,10 @@ public void biomeTags(ReplaceableTagEvent event) { return; } - dBiome biome = null; + BiomeTag biome = null; if (event.hasNameContext()) { - biome = dBiome.valueOf(event.getNameContext(), event.getAttributes().context); + biome = BiomeTag.valueOf(event.getNameContext(), event.getAttributes().context); } if (biome == null) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/tags/core/ChunkTags.java b/plugin/src/main/java/com/denizenscript/denizen/tags/core/ChunkTags.java index be1a1d5a02..7d292fdab7 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/tags/core/ChunkTags.java +++ b/plugin/src/main/java/com/denizenscript/denizen/tags/core/ChunkTags.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.tags.core; -import com.denizenscript.denizen.objects.dChunk; +import com.denizenscript.denizen.objects.ChunkTag; import com.denizenscript.denizencore.objects.TagRunnable; import com.denizenscript.denizencore.tags.Attribute; import com.denizenscript.denizencore.tags.ReplaceableTagEvent; @@ -24,10 +24,10 @@ public void chunkTags(ReplaceableTagEvent event) { return; } - dChunk chunk = null; + ChunkTag chunk = null; if (event.hasNameContext()) { - chunk = dChunk.valueOf(event.getNameContext(), event.getAttributes().context); + chunk = ChunkTag.valueOf(event.getNameContext(), event.getAttributes().context); } if (chunk == null) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/tags/core/ColorTags.java b/plugin/src/main/java/com/denizenscript/denizen/tags/core/ColorTags.java index d3cdb43a1a..0055306d06 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/tags/core/ColorTags.java +++ b/plugin/src/main/java/com/denizenscript/denizen/tags/core/ColorTags.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.tags.core; -import com.denizenscript.denizen.objects.dColor; +import com.denizenscript.denizen.objects.ColorTag; import com.denizenscript.denizencore.objects.TagRunnable; import com.denizenscript.denizencore.tags.Attribute; import com.denizenscript.denizencore.tags.ReplaceableTagEvent; @@ -24,10 +24,10 @@ public void colorTags(ReplaceableTagEvent event) { return; } - dColor color = null; + ColorTag color = null; if (event.hasNameContext()) { - color = dColor.valueOf(event.getNameContext(), event.getAttributes().context); + color = ColorTag.valueOf(event.getNameContext(), event.getAttributes().context); } if (color == null) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/tags/core/CuboidTags.java b/plugin/src/main/java/com/denizenscript/denizen/tags/core/CuboidTags.java index c1de20dbde..9657f326a0 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/tags/core/CuboidTags.java +++ b/plugin/src/main/java/com/denizenscript/denizen/tags/core/CuboidTags.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.tags.core; -import com.denizenscript.denizen.objects.dCuboid; +import com.denizenscript.denizen.objects.CuboidTag; import com.denizenscript.denizencore.objects.TagRunnable; import com.denizenscript.denizencore.tags.Attribute; import com.denizenscript.denizencore.tags.ReplaceableTagEvent; @@ -25,10 +25,10 @@ public void cuboidTags(ReplaceableTagEvent event) { return; } - dCuboid cuboid = null; + CuboidTag cuboid = null; if (event.hasNameContext()) { - cuboid = dCuboid.valueOf(event.getNameContext(), event.getAttributes().context); + cuboid = CuboidTag.valueOf(event.getNameContext(), event.getAttributes().context); } // Check if cuboid is null, return if it is diff --git a/plugin/src/main/java/com/denizenscript/denizen/tags/core/EllipsoidTags.java b/plugin/src/main/java/com/denizenscript/denizen/tags/core/EllipsoidTags.java index 92ceb00173..96df43e0e6 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/tags/core/EllipsoidTags.java +++ b/plugin/src/main/java/com/denizenscript/denizen/tags/core/EllipsoidTags.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.tags.core; -import com.denizenscript.denizen.objects.dEllipsoid; +import com.denizenscript.denizen.objects.EllipsoidTag; import com.denizenscript.denizencore.objects.TagRunnable; import com.denizenscript.denizencore.tags.Attribute; import com.denizenscript.denizencore.tags.ReplaceableTagEvent; @@ -24,10 +24,10 @@ public void ellipsoidTags(ReplaceableTagEvent event) { return; } - dEllipsoid ellipsoid = null; + EllipsoidTag ellipsoid = null; if (event.hasNameContext()) { - ellipsoid = dEllipsoid.valueOf(event.getNameContext(), event.getAttributes().context); + ellipsoid = EllipsoidTag.valueOf(event.getNameContext(), event.getAttributes().context); } if (ellipsoid == null) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/tags/core/EntityTags.java b/plugin/src/main/java/com/denizenscript/denizen/tags/core/EntityTags.java index 15e9f18df9..3f67ae9591 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/tags/core/EntityTags.java +++ b/plugin/src/main/java/com/denizenscript/denizen/tags/core/EntityTags.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.tags.core; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.TagRunnable; import com.denizenscript.denizencore.tags.Attribute; import com.denizenscript.denizencore.tags.ReplaceableTagEvent; @@ -28,10 +28,10 @@ public void entityTags(ReplaceableTagEvent event) { return; } - dEntity entity = null; + EntityTag entity = null; if (event.hasNameContext()) { - entity = dEntity.valueOf(event.getNameContext(), event.getAttributes().context); + entity = EntityTag.valueOf(event.getNameContext(), event.getAttributes().context); } if (entity == null) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/tags/core/InventoryTags.java b/plugin/src/main/java/com/denizenscript/denizen/tags/core/InventoryTags.java index d385b9c6b2..faf427755b 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/tags/core/InventoryTags.java +++ b/plugin/src/main/java/com/denizenscript/denizen/tags/core/InventoryTags.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.tags.core; -import com.denizenscript.denizen.objects.dInventory; +import com.denizenscript.denizen.objects.InventoryTag; import com.denizenscript.denizencore.objects.TagRunnable; import com.denizenscript.denizencore.tags.Attribute; import com.denizenscript.denizencore.tags.ReplaceableTagEvent; @@ -24,10 +24,10 @@ public void inventoryTags(ReplaceableTagEvent event) { return; } - dInventory inventory = null; + InventoryTag inventory = null; if (event.hasNameContext()) { - inventory = dInventory.valueOf(event.getNameContext(), event.getAttributes().context); + inventory = InventoryTag.valueOf(event.getNameContext(), event.getAttributes().context); } if (inventory == null) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/tags/core/ItemTags.java b/plugin/src/main/java/com/denizenscript/denizen/tags/core/ItemTags.java index 953437358d..e75e3bea60 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/tags/core/ItemTags.java +++ b/plugin/src/main/java/com/denizenscript/denizen/tags/core/ItemTags.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.tags.core; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.TagRunnable; import com.denizenscript.denizencore.tags.Attribute; import com.denizenscript.denizencore.tags.ReplaceableTagEvent; @@ -24,10 +24,10 @@ public void itemTags(ReplaceableTagEvent event) { return; } - dItem item = null; + ItemTag item = null; if (event.hasNameContext()) { - item = dItem.valueOf(event.getNameContext(), event.getAttributes().context); + item = ItemTag.valueOf(event.getNameContext(), event.getAttributes().context); } if (item == null) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/tags/core/LocationTags.java b/plugin/src/main/java/com/denizenscript/denizen/tags/core/LocationTags.java index a49b34f877..46a040610f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/tags/core/LocationTags.java +++ b/plugin/src/main/java/com/denizenscript/denizen/tags/core/LocationTags.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.tags.core; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizencore.objects.TagRunnable; import com.denizenscript.denizencore.tags.ReplaceableTagEvent; import com.denizenscript.denizencore.tags.TagManager; @@ -31,16 +31,16 @@ public void locationTags(ReplaceableTagEvent event) { } // Stage the location - dLocation loc = null; + LocationTag loc = null; // Check name context for a specified location, or check // the ScriptEntry for a 'location' context String context = event.getNameContext(); - if (event.hasNameContext() && dLocation.matches(context)) { - loc = dLocation.valueOf(context, event.getAttributes().context); + if (event.hasNameContext() && LocationTag.matches(context)) { + loc = LocationTag.valueOf(context, event.getAttributes().context); } else if (event.getScriptEntry().hasObject("location")) { - loc = (dLocation) event.getScriptEntry().getObject("location"); + loc = (LocationTag) event.getScriptEntry().getObject("location"); } // Check if location is null, return null if it is diff --git a/plugin/src/main/java/com/denizenscript/denizen/tags/core/MaterialTags.java b/plugin/src/main/java/com/denizenscript/denizen/tags/core/MaterialTags.java index 1fcda6295e..439a16379e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/tags/core/MaterialTags.java +++ b/plugin/src/main/java/com/denizenscript/denizen/tags/core/MaterialTags.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.tags.core; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizencore.objects.TagRunnable; import com.denizenscript.denizencore.tags.Attribute; import com.denizenscript.denizencore.tags.ReplaceableTagEvent; @@ -24,10 +24,10 @@ public void materialTags(ReplaceableTagEvent event) { return; } - dMaterial material = null; + MaterialTag material = null; if (event.hasNameContext()) { - material = dMaterial.valueOf(event.getNameContext(), event.getAttributes().context); + material = MaterialTag.valueOf(event.getNameContext(), event.getAttributes().context); } if (material == null) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/tags/core/NPCTags.java b/plugin/src/main/java/com/denizenscript/denizen/tags/core/NPCTags.java index 6ef125b3f1..5daff9642b 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/tags/core/NPCTags.java +++ b/plugin/src/main/java/com/denizenscript/denizen/tags/core/NPCTags.java @@ -1,9 +1,9 @@ package com.denizenscript.denizen.tags.core; import com.denizenscript.denizen.events.core.NPCNavigationSmartEvent; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.utilities.depends.Depends; @@ -58,15 +58,15 @@ public void npcTags(ReplaceableTagEvent event) { // Build a new attribute out of the raw_tag supplied in the script to be fulfilled Attribute attribute = event.getAttributes(); - // NPCTags require a... dNPC! - dNPC n = ((BukkitTagContext) event.getContext()).npc; + // NPCTags require a... NPCTag! + NPCTag n = ((BukkitTagContext) event.getContext()).npc; // Player tag may specify a new player in the portion of the tag. if (attribute.hasContext(1)) - // Check if this is a valid player and update the dPlayer object reference. + // Check if this is a valid player and update the PlayerTag object reference. { - if (dNPC.matches(attribute.getContext(1))) { - n = dNPC.valueOf(attribute.getContext(1), attribute.context); + if (NPCTag.matches(attribute.getContext(1))) { + n = NPCTag.valueOf(attribute.getContext(1), attribute.context); } else { if (!event.hasAlternative()) { @@ -93,7 +93,7 @@ public void npcTags(ReplaceableTagEvent event) { // Keep track of previous locations and fire navigation actions //// - public static Map previousLocations = new HashMap<>(); + public static Map previousLocations = new HashMap<>(); // <--[event] // @Events @@ -124,7 +124,7 @@ public void npcTags(ReplaceableTagEvent event) { @EventHandler public void navComplete(NavigationCompleteEvent event) { - dNPC npc = DenizenAPI.getDenizenNPC(event.getNPC()); + NPCTag npc = DenizenAPI.getDenizenNPC(event.getNPC()); // Do world script event 'On NPC Completes Navigation' if (NPCNavigationSmartEvent.IsActive()) { @@ -168,7 +168,7 @@ public void navComplete(NavigationCompleteEvent event) { // --> @EventHandler public void navBegin(NavigationBeginEvent event) { - dNPC npc = DenizenAPI.getDenizenNPC(event.getNPC()); + NPCTag npc = DenizenAPI.getDenizenNPC(event.getNPC()); // Do world script event 'On NPC Begins Navigation' if (NPCNavigationSmartEvent.IsActive()) { @@ -189,11 +189,11 @@ public void navBegin(NavigationBeginEvent event) { if (event.getNPC().getNavigator().getEntityTarget().isAggressive() && !entity.isDead()) { - dPlayer player = null; + PlayerTag player = null; // Check if the entity attacked by this NPC is a player if (entity instanceof Player) { - player = dPlayer.mirrorBukkitPlayer((Player) entity); + player = PlayerTag.mirrorBukkitPlayer((Player) entity); } // <--[action] @@ -229,7 +229,7 @@ public void navBegin(NavigationBeginEvent event) { // --> @EventHandler public void navCancel(NavigationCancelEvent event) { - dNPC npc = DenizenAPI.getDenizenNPC(event.getNPC()); + NPCTag npc = DenizenAPI.getDenizenNPC(event.getNPC()); if (NPCNavigationSmartEvent.IsActive()) { OldEventManager.doEvents(Arrays.asList @@ -276,7 +276,7 @@ public void navCancel(NavigationCancelEvent event) { @EventHandler public void navStuck(NavigationStuckEvent event) { - dNPC npc = DenizenAPI.getDenizenNPC(event.getNPC()); + NPCTag npc = DenizenAPI.getDenizenNPC(event.getNPC()); Map context = new HashMap<>(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/tags/core/PlayerTags.java b/plugin/src/main/java/com/denizenscript/denizen/tags/core/PlayerTags.java index f2a3069c6c..80386835e4 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/tags/core/PlayerTags.java +++ b/plugin/src/main/java/com/denizenscript/denizen/tags/core/PlayerTags.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.tags.core; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.Settings; @@ -87,12 +87,12 @@ public void playerTags(ReplaceableTagEvent event) { // Build a new attribute out of the raw_tag supplied in the script to be fulfilled Attribute attribute = event.getAttributes(); - // PlayerTags require a... dPlayer! - dPlayer p = ((BukkitTagContext) event.getContext()).player; + // PlayerTags require a... PlayerTag! + PlayerTag p = ((BukkitTagContext) event.getContext()).player; // Player tag may specify a new player in the portion of the tag. if (attribute.hasContext(1)) { - p = dPlayer.valueOf(attribute.getContext(1), attribute.context); + p = PlayerTag.valueOf(attribute.getContext(1), attribute.context); } if (p == null || !p.isValid()) { if (!event.hasAlternative()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/tags/core/PluginTags.java b/plugin/src/main/java/com/denizenscript/denizen/tags/core/PluginTags.java index d2e9ac4eec..3f081a793d 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/tags/core/PluginTags.java +++ b/plugin/src/main/java/com/denizenscript/denizen/tags/core/PluginTags.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.tags.core; -import com.denizenscript.denizen.objects.dPlugin; +import com.denizenscript.denizen.objects.PluginTag; import com.denizenscript.denizencore.objects.TagRunnable; import com.denizenscript.denizencore.tags.Attribute; import com.denizenscript.denizencore.tags.ReplaceableTagEvent; @@ -24,10 +24,10 @@ public void pluginTags(ReplaceableTagEvent event) { return; } - dPlugin plugin = null; + PluginTag plugin = null; if (event.hasNameContext()) { - plugin = dPlugin.valueOf(event.getNameContext(), event.getAttributes().context); + plugin = PluginTag.valueOf(event.getNameContext(), event.getAttributes().context); } if (plugin == null) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/tags/core/ServerTags.java b/plugin/src/main/java/com/denizenscript/denizen/tags/core/ServerTags.java index 0d2f30fc5f..e18812e25e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/tags/core/ServerTags.java +++ b/plugin/src/main/java/com/denizenscript/denizen/tags/core/ServerTags.java @@ -167,9 +167,9 @@ public void serverTag(ReplaceableTagEvent event) { // <--[tag] // @attribute ]> - // @returns dItem + // @returns ItemTag // @description - // Returns the dItem resultant from parsing Bukkit item serialization data (under subkey "item"). + // Returns the ItemTag resultant from parsing Bukkit item serialization data (under subkey "item"). // --> if (attribute.startsWith("parse_bukkit_item") && attribute.hasContext(1)) { @@ -178,7 +178,7 @@ public void serverTag(ReplaceableTagEvent event) { config.loadFromString(attribute.getContext(1)); ItemStack item = config.getItemStack("item"); if (item != null) { - event.setReplaced(new dItem(item).getAttribute(attribute.fulfill(1))); + event.setReplaced(new ItemTag(item).getAttribute(attribute.fulfill(1))); } } catch (Exception ex) { @@ -648,7 +648,7 @@ public void serverTag(ReplaceableTagEvent event) { // <--[tag] // @attribute ]> - // @returns ListTag(dScript) + // @returns ListTag(ScriptTag) // @description // Returns a list of all world scripts that will handle a given event name. // This tag will ignore ObjectTag identifiers (see <@link language dobject>). @@ -682,7 +682,7 @@ public void serverTag(ReplaceableTagEvent event) { // <--[tag] // @attribute - // @returns dNPC + // @returns NPCTag // @description // Returns the server's currently selected NPC. // --> @@ -693,14 +693,14 @@ public void serverTag(ReplaceableTagEvent event) { return; } else { - event.setReplaced(new dNPC(npc).getAttribute(attribute.fulfill(1))); + event.setReplaced(new NPCTag(npc).getAttribute(attribute.fulfill(1))); } return; } // <--[tag] // @attribute ]> - // @returns ListTag(dNPC) + // @returns ListTag(NPCTag) // @description // Returns a list of NPCs with a certain name. // --> @@ -708,7 +708,7 @@ public void serverTag(ReplaceableTagEvent event) { ListTag npcs = new ListTag(); for (NPC npc : CitizensAPI.getNPCRegistry()) { if (npc.getName().equalsIgnoreCase(attribute.getContext(1))) { - npcs.add(dNPC.mirrorCitizensNPC(npc).identify()); + npcs.add(NPCTag.mirrorCitizensNPC(npc).identify()); } } event.setReplaced(npcs.getAttribute(attribute.fulfill(1))); @@ -912,10 +912,10 @@ public void serverTag(ReplaceableTagEvent event) { // @attribute ].world[]> // @returns ElementTag // @description - // Returns an ElementTag of a group's chat prefix for the specified dWorld. + // Returns an ElementTag of a group's chat prefix for the specified WorldTag. // --> if (attribute.getAttribute(2).startsWith("world")) { - dWorld world = dWorld.valueOf(attribute.getContext(2)); + WorldTag world = WorldTag.valueOf(attribute.getContext(2)); if (world != null) { event.setReplaced(new ElementTag(Depends.chat.getGroupPrefix(world.getWorld(), group)) .getAttribute(attribute.fulfill(2))); @@ -953,10 +953,10 @@ public void serverTag(ReplaceableTagEvent event) { // @attribute ].world[]> // @returns ElementTag // @description - // Returns an ElementTag of a group's chat suffix for the specified dWorld. + // Returns an ElementTag of a group's chat suffix for the specified WorldTag. // --> if (attribute.getAttribute(2).startsWith("world")) { - dWorld world = dWorld.valueOf(attribute.getContext(2)); + WorldTag world = WorldTag.valueOf(attribute.getContext(2)); if (world != null) { event.setReplaced(new ElementTag(Depends.chat.getGroupSuffix(world.getWorld(), group)) .getAttribute(attribute.fulfill(2))); @@ -1002,7 +1002,7 @@ public void serverTag(ReplaceableTagEvent event) { // <--[tag] // @attribute - // @returns ListTag(dScript) + // @returns ListTag(ScriptTag) // @description // Gets a list of all scripts currently loaded into Denizen. // --> @@ -1017,7 +1017,7 @@ public void serverTag(ReplaceableTagEvent event) { // <--[tag] // @attribute ]> - // @returns dPlayer + // @returns PlayerTag // @description // Returns the online player that best matches the input name. // EG, in a group of 'bo', 'bob', and 'bobby'... input 'bob' returns p@bob, @@ -1037,7 +1037,7 @@ else if (CoreUtilities.toLowerCase(player.getName()).contains(matchInput) && mat } if (matchPlayer != null) { - event.setReplaced(new dPlayer(matchPlayer).getAttribute(attribute.fulfill(1))); + event.setReplaced(new PlayerTag(matchPlayer).getAttribute(attribute.fulfill(1))); } return; @@ -1045,7 +1045,7 @@ else if (CoreUtilities.toLowerCase(player.getName()).contains(matchInput) && mat // <--[tag] // @attribute ]> - // @returns dPlayer + // @returns PlayerTag // @description // Returns any player (online or offline) that best matches the input name. // EG, in a group of 'bo', 'bob', and 'bobby'... input 'bob' returns p@bob, @@ -1054,7 +1054,7 @@ else if (CoreUtilities.toLowerCase(player.getName()).contains(matchInput) && mat if (attribute.startsWith("match_offline_player") && attribute.hasContext(1)) { UUID matchPlayer = null; String matchInput = CoreUtilities.toLowerCase(attribute.getContext(1)); - for (Map.Entry entry : dPlayer.getAllPlayers().entrySet()) { + for (Map.Entry entry : PlayerTag.getAllPlayers().entrySet()) { if (CoreUtilities.toLowerCase(entry.getKey()).equals(matchInput)) { matchPlayer = entry.getValue(); break; @@ -1065,7 +1065,7 @@ else if (CoreUtilities.toLowerCase(entry.getKey()).contains(matchInput) && match } if (matchPlayer != null) { - event.setReplaced(new dPlayer(matchPlayer).getAttribute(attribute.fulfill(1))); + event.setReplaced(new PlayerTag(matchPlayer).getAttribute(attribute.fulfill(1))); } return; @@ -1073,7 +1073,7 @@ else if (CoreUtilities.toLowerCase(entry.getKey()).contains(matchInput) && match // <--[tag] // @attribute ]> - // @returns ListTag(dNPC) + // @returns ListTag(NPCTag) // @description // Returns a list of all NPCs assigned to a specified script. // --> @@ -1088,7 +1088,7 @@ else if (CoreUtilities.toLowerCase(entry.getKey()).contains(matchInput) && match for (NPC npc : CitizensAPI.getNPCRegistry()) { if (npc.hasTrait(AssignmentTrait.class) && npc.getTrait(AssignmentTrait.class).hasAssignment() && npc.getTrait(AssignmentTrait.class).getAssignment().getName().equalsIgnoreCase(script.getName())) { - npcs.add(dNPC.mirrorCitizensNPC(npc).identify()); + npcs.add(NPCTag.mirrorCitizensNPC(npc).identify()); } } event.setReplaced(npcs.getAttribute(attribute.fulfill(1))); @@ -1098,7 +1098,7 @@ else if (CoreUtilities.toLowerCase(entry.getKey()).contains(matchInput) && match // <--[tag] // @attribute ]> - // @returns ListTag(dPlayer) + // @returns ListTag(PlayerTag) // @description // Returns a list of all online players with a specified flag set. // --> @@ -1107,8 +1107,8 @@ else if (CoreUtilities.toLowerCase(entry.getKey()).contains(matchInput) && match String flag = attribute.getContext(1); ListTag players = new ListTag(); for (Player player : Bukkit.getOnlinePlayers()) { - if (DenizenAPI.getCurrentInstance().flagManager().getPlayerFlag(new dPlayer(player), flag).size() > 0) { - players.add(new dPlayer(player).identify()); + if (DenizenAPI.getCurrentInstance().flagManager().getPlayerFlag(new PlayerTag(player), flag).size() > 0) { + players.add(new PlayerTag(player).identify()); } } event.setReplaced(players.getAttribute(attribute.fulfill(1))); @@ -1117,7 +1117,7 @@ else if (CoreUtilities.toLowerCase(entry.getKey()).contains(matchInput) && match // <--[tag] // @attribute ]> - // @returns ListTag(dPlayer) + // @returns ListTag(PlayerTag) // @description // Returns a list of all players with a specified flag set. // --> @@ -1125,9 +1125,9 @@ else if (CoreUtilities.toLowerCase(entry.getKey()).contains(matchInput) && match && attribute.hasContext(1)) { String flag = attribute.getContext(1); ListTag players = new ListTag(); - for (Map.Entry entry : dPlayer.getAllPlayers().entrySet()) { - if (DenizenAPI.getCurrentInstance().flagManager().getPlayerFlag(new dPlayer(entry.getValue()), flag).size() > 0) { - players.add(new dPlayer(entry.getValue()).identify()); + for (Map.Entry entry : PlayerTag.getAllPlayers().entrySet()) { + if (DenizenAPI.getCurrentInstance().flagManager().getPlayerFlag(new PlayerTag(entry.getValue()), flag).size() > 0) { + players.add(new PlayerTag(entry.getValue()).identify()); } } event.setReplaced(players.getAttribute(attribute.fulfill(1))); @@ -1136,7 +1136,7 @@ else if (CoreUtilities.toLowerCase(entry.getKey()).contains(matchInput) && match // <--[tag] // @attribute ]> - // @returns ListTag(dNPC) + // @returns ListTag(NPCTag) // @description // Returns a list of all spawned NPCs with a specified flag set. // --> @@ -1145,7 +1145,7 @@ else if (CoreUtilities.toLowerCase(entry.getKey()).contains(matchInput) && match String flag = attribute.getContext(1); ListTag npcs = new ListTag(); for (NPC npc : CitizensAPI.getNPCRegistry()) { - dNPC dNpc = dNPC.mirrorCitizensNPC(npc); + NPCTag dNpc = NPCTag.mirrorCitizensNPC(npc); if (dNpc.isSpawned() && FlagManager.npcHasFlag(dNpc, flag)) { npcs.add(dNpc.identify()); } @@ -1156,7 +1156,7 @@ else if (CoreUtilities.toLowerCase(entry.getKey()).contains(matchInput) && match // <--[tag] // @attribute ]> - // @returns ListTag(dNPC) + // @returns ListTag(NPCTag) // @description // Returns a list of all NPCs with a specified flag set. // --> @@ -1165,7 +1165,7 @@ else if (CoreUtilities.toLowerCase(entry.getKey()).contains(matchInput) && match String flag = attribute.getContext(1); ListTag npcs = new ListTag(); for (NPC npc : CitizensAPI.getNPCRegistry()) { - dNPC dNpc = dNPC.mirrorCitizensNPC(npc); + NPCTag dNpc = NPCTag.mirrorCitizensNPC(npc); if (FlagManager.npcHasFlag(dNpc, flag)) { npcs.add(dNpc.identify()); } @@ -1176,14 +1176,14 @@ else if (CoreUtilities.toLowerCase(entry.getKey()).contains(matchInput) && match // <--[tag] // @attribute - // @returns ListTag(dNPC) + // @returns ListTag(NPCTag) // @description // Returns a list of all NPCs. // --> if (attribute.startsWith("list_npcs") && Depends.citizens != null) { ListTag npcs = new ListTag(); for (NPC npc : CitizensAPI.getNPCRegistry()) { - npcs.add(dNPC.mirrorCitizensNPC(npc).identify()); + npcs.add(NPCTag.mirrorCitizensNPC(npc).identify()); } event.setReplaced(npcs.getAttribute(attribute.fulfill(1))); return; @@ -1191,14 +1191,14 @@ else if (CoreUtilities.toLowerCase(entry.getKey()).contains(matchInput) && match // <--[tag] // @attribute - // @returns ListTag(dWorld) + // @returns ListTag(WorldTag) // @description // Returns a list of all worlds. // --> if (attribute.startsWith("list_worlds")) { ListTag worlds = new ListTag(); for (World world : Bukkit.getWorlds()) { - worlds.add(dWorld.mirrorBukkitWorld(world).identify()); + worlds.add(WorldTag.mirrorBukkitWorld(world).identify()); } event.setReplaced(worlds.getAttribute(attribute.fulfill(1))); return; @@ -1206,14 +1206,14 @@ else if (CoreUtilities.toLowerCase(entry.getKey()).contains(matchInput) && match // <--[tag] // @attribute - // @returns ListTag(dPlugin) + // @returns ListTag(PluginTag) // @description - // Gets a list of currently enabled dPlugins from the server. + // Gets a list of currently enabled PluginTags from the server. // --> if (attribute.startsWith("list_plugins")) { ListTag plugins = new ListTag(); for (Plugin plugin : Bukkit.getServer().getPluginManager().getPlugins()) { - plugins.add(new dPlugin(plugin).identify()); + plugins.add(new PluginTag(plugin).identify()); } event.setReplaced(plugins.getAttribute(attribute.fulfill(1))); return; @@ -1221,14 +1221,14 @@ else if (CoreUtilities.toLowerCase(entry.getKey()).contains(matchInput) && match // <--[tag] // @attribute - // @returns ListTag(dPlayer) + // @returns ListTag(PlayerTag) // @description // Returns a list of all players that have ever played on the server, online or not. // --> if (attribute.startsWith("list_players")) { ListTag players = new ListTag(); for (OfflinePlayer player : Bukkit.getOfflinePlayers()) { - players.add(dPlayer.mirrorBukkitPlayer(player).identify()); + players.add(PlayerTag.mirrorBukkitPlayer(player).identify()); } event.setReplaced(players.getAttribute(attribute.fulfill(1))); return; @@ -1236,14 +1236,14 @@ else if (CoreUtilities.toLowerCase(entry.getKey()).contains(matchInput) && match // <--[tag] // @attribute - // @returns ListTag(dPlayer) + // @returns ListTag(PlayerTag) // @description // Returns a list of all online players. // --> if (attribute.startsWith("list_online_players")) { ListTag players = new ListTag(); for (Player player : Bukkit.getOnlinePlayers()) { - players.add(dPlayer.mirrorBukkitPlayer(player).identify()); + players.add(PlayerTag.mirrorBukkitPlayer(player).identify()); } event.setReplaced(players.getAttribute(attribute.fulfill(1))); return; @@ -1251,7 +1251,7 @@ else if (CoreUtilities.toLowerCase(entry.getKey()).contains(matchInput) && match // <--[tag] // @attribute - // @returns ListTag(dPlayer) + // @returns ListTag(PlayerTag) // @description // Returns a list of all offline players. // --> @@ -1259,7 +1259,7 @@ else if (CoreUtilities.toLowerCase(entry.getKey()).contains(matchInput) && match ListTag players = new ListTag(); for (OfflinePlayer player : Bukkit.getOfflinePlayers()) { if (!player.isOnline()) { - players.add(dPlayer.mirrorBukkitPlayer(player).identify()); + players.add(PlayerTag.mirrorBukkitPlayer(player).identify()); } } event.setReplaced(players.getAttribute(attribute.fulfill(1))); @@ -1268,14 +1268,14 @@ else if (CoreUtilities.toLowerCase(entry.getKey()).contains(matchInput) && match // <--[tag] // @attribute - // @returns ListTag(dPlayer) + // @returns ListTag(PlayerTag) // @description // Returns a list of all banned players. // --> if (attribute.startsWith("list_banned_players")) { ListTag banned = new ListTag(); for (OfflinePlayer player : Bukkit.getBannedPlayers()) { - banned.add(dPlayer.mirrorBukkitPlayer(player).identify()); + banned.add(PlayerTag.mirrorBukkitPlayer(player).identify()); } event.setReplaced(banned.getAttribute(attribute.fulfill(1))); return; @@ -1374,14 +1374,14 @@ else if (attribute.startsWith("source")) { // <--[tag] // @attribute - // @returns ListTag(dPlayer) + // @returns ListTag(PlayerTag) // @description // Returns a list of all ops, online or not. // --> if (attribute.startsWith("list_ops")) { ListTag players = new ListTag(); for (OfflinePlayer player : Bukkit.getOperators()) { - players.add(dPlayer.mirrorBukkitPlayer(player).identify()); + players.add(PlayerTag.mirrorBukkitPlayer(player).identify()); } event.setReplaced(players.getAttribute(attribute.fulfill(1))); return; @@ -1389,7 +1389,7 @@ else if (attribute.startsWith("source")) { // <--[tag] // @attribute - // @returns ListTag(dPlayer) + // @returns ListTag(PlayerTag) // @description // Returns a list of all online ops. // --> @@ -1397,7 +1397,7 @@ else if (attribute.startsWith("source")) { ListTag players = new ListTag(); for (OfflinePlayer player : Bukkit.getOperators()) { if (player.isOnline()) { - players.add(dPlayer.mirrorBukkitPlayer(player).identify()); + players.add(PlayerTag.mirrorBukkitPlayer(player).identify()); } } event.setReplaced(players.getAttribute(attribute.fulfill(1))); @@ -1406,7 +1406,7 @@ else if (attribute.startsWith("source")) { // <--[tag] // @attribute - // @returns ListTag(dPlayer) + // @returns ListTag(PlayerTag) // @description // Returns a list of all offline ops. // --> @@ -1414,7 +1414,7 @@ else if (attribute.startsWith("source")) { ListTag players = new ListTag(); for (OfflinePlayer player : Bukkit.getOfflinePlayers()) { if (player.isOp() && !player.isOnline()) { - players.add(dPlayer.mirrorBukkitPlayer(player).identify()); + players.add(PlayerTag.mirrorBukkitPlayer(player).identify()); } } event.setReplaced(players.getAttribute(attribute.fulfill(1))); @@ -1440,7 +1440,7 @@ else if (attribute.startsWith("source")) { // --> else if (attribute.startsWith("entity_is_spawned") && attribute.hasContext(1)) { - dEntity ent = dEntity.valueOf(attribute.getContext(1), new BukkitTagContext(null, null, false, null, false, null)); + EntityTag ent = EntityTag.valueOf(attribute.getContext(1), new BukkitTagContext(null, null, false, null, false, null)); event.setReplaced(new ElementTag((ent != null && ent.isUnique() && ent.isSpawned()) ? "true" : "false") .getAttribute(attribute.fulfill(1))); } @@ -1453,7 +1453,7 @@ else if (attribute.startsWith("entity_is_spawned") // --> else if (attribute.startsWith("player_is_valid") && attribute.hasContext(1)) { - event.setReplaced(new ElementTag(dPlayer.playerNameIsValid(attribute.getContext(1))) + event.setReplaced(new ElementTag(PlayerTag.playerNameIsValid(attribute.getContext(1))) .getAttribute(attribute.fulfill(1))); } @@ -1465,7 +1465,7 @@ else if (attribute.startsWith("player_is_valid") // --> else if (attribute.startsWith("npc_is_valid") && attribute.hasContext(1)) { - dNPC npc = dNPC.valueOf(attribute.getContext(1), new BukkitTagContext(null, null, false, null, false, null)); + NPCTag npc = NPCTag.valueOf(attribute.getContext(1), new BukkitTagContext(null, null, false, null, false, null)); event.setReplaced(new ElementTag((npc != null && npc.isValid())) .getAttribute(attribute.fulfill(1))); } @@ -1520,7 +1520,7 @@ else if (attribute.startsWith("debug_enabled")) { // <--[tag] // @attribute ]> - // @returns ListTag(dPlugin) + // @returns ListTag(PluginTag) // @description // Returns a list of all plugins that handle a given Bukkit event. // Can specify by ScriptEvent name ("PlayerBreaksBlock"), or by full Bukkit class name ("org.bukkit.event.block.BlockBreakEvent"). @@ -1570,7 +1570,7 @@ public static ListTag getHandlerPluginList(Class eventClass) { HashSet deduplicationSet = new HashSet<>(); for (RegisteredListener listener : handlers.getRegisteredListeners()) { if (deduplicationSet.add(listener.getPlugin().getName())) { - result.addObject(new dPlugin(listener.getPlugin())); + result.addObject(new PluginTag(listener.getPlugin())); } } return result; diff --git a/plugin/src/main/java/com/denizenscript/denizen/tags/core/TradeTags.java b/plugin/src/main/java/com/denizenscript/denizen/tags/core/TradeTags.java index 6f9d83dd23..5e1d0e3b03 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/tags/core/TradeTags.java +++ b/plugin/src/main/java/com/denizenscript/denizen/tags/core/TradeTags.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.tags.core; -import com.denizenscript.denizen.objects.dTrade; +import com.denizenscript.denizen.objects.TradeTag; import com.denizenscript.denizencore.objects.TagRunnable; import com.denizenscript.denizencore.tags.Attribute; import com.denizenscript.denizencore.tags.ReplaceableTagEvent; @@ -24,10 +24,10 @@ public void tradeTags(ReplaceableTagEvent event) { return; } - dTrade trade = null; + TradeTag trade = null; if (event.hasNameContext()) { - trade = dTrade.valueOf(event.getNameContext(), event.getAttributes().context); + trade = TradeTag.valueOf(event.getNameContext(), event.getAttributes().context); } if (trade == null) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/tags/core/WorldTags.java b/plugin/src/main/java/com/denizenscript/denizen/tags/core/WorldTags.java index 777b59f026..feccba6bb1 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/tags/core/WorldTags.java +++ b/plugin/src/main/java/com/denizenscript/denizen/tags/core/WorldTags.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.tags.core; -import com.denizenscript.denizen.objects.dWorld; +import com.denizenscript.denizen.objects.WorldTag; import com.denizenscript.denizencore.objects.TagRunnable; import com.denizenscript.denizencore.tags.Attribute; import com.denizenscript.denizencore.tags.ReplaceableTagEvent; @@ -24,10 +24,10 @@ public void worldTags(ReplaceableTagEvent event) { return; } - dWorld world = null; + WorldTag world = null; if (event.hasNameContext()) { - world = dWorld.valueOf(event.getNameContext(), event.getAttributes().context); + world = WorldTag.valueOf(event.getNameContext(), event.getAttributes().context); } if (world == null) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/Conversion.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/Conversion.java index 3387eb808b..5075ecb1fe 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/Conversion.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/Conversion.java @@ -16,17 +16,17 @@ public class Conversion { /** - * Turn a list of dColors into a list of Colors. + * Turn a list of ColorTags into a list of Colors. * - * @param colors The list of dColors + * @param colors The list of ColorTags * @return The list of Colors */ - public static List convertColors(List colors) { + public static List convertColors(List colors) { List newList = new ArrayList<>(); - for (dColor color : colors) { + for (ColorTag color : colors) { newList.add(color.getColor()); } @@ -34,17 +34,17 @@ public static List convertColors(List colors) { } /** - * Turn a list of dItems into a list of ItemStacks. + * Turn a list of ItemTags into a list of ItemStacks. * - * @param items The list of dItems + * @param items The list of ItemTags * @return The list of ItemStacks */ - public static List convertItems(List items) { + public static List convertItems(List items) { List newList = new ArrayList<>(); - for (dItem item : items) { + for (ItemTag item : items) { newList.add(item.getItemStack()); } @@ -58,11 +58,11 @@ public static List convertItems(List items) { * @return The list of Entities */ - public static List convertEntities(List entities) { + public static List convertEntities(List entities) { List newList = new ArrayList<>(); - for (dEntity entity : entities) { + for (EntityTag entity : entities) { newList.add(entity.getBukkitEntity()); } @@ -70,40 +70,40 @@ public static List convertEntities(List entities) { } /** - * Gets a dInventory from an Object, which can be a - * dEntity, dLocation, dInventory, or a ListTag of dItems + * Gets a InventoryTag from an Object, which can be a + * EntityTag, LocationTag, InventoryTag, or a ListTag of ItemTags * * @param arg An argument to parse - * @return The dInventory retrieved by parsing the argument + * @return The InventoryTag retrieved by parsing the argument */ - public static AbstractMap.SimpleEntry getInventory(Argument arg, ScriptEntry scriptEntry) { + public static AbstractMap.SimpleEntry getInventory(Argument arg, ScriptEntry scriptEntry) { String string = arg.getValue(); - if (dInventory.matches(string)) { + if (InventoryTag.matches(string)) { BukkitScriptEntryData data = (BukkitScriptEntryData) scriptEntry.entryData; if (data != null) { - dInventory inv = dInventory.valueOf(string, data.getTagContext()); + InventoryTag inv = InventoryTag.valueOf(string, data.getTagContext()); return new AbstractMap.SimpleEntry<>(inv.getContents().length, inv); } else { - dInventory inv = dInventory.valueOf(string, null); + InventoryTag inv = InventoryTag.valueOf(string, null); return new AbstractMap.SimpleEntry<>(inv.getContents().length, inv); } } - else if (arg.matchesArgumentList(dItem.class)) { - List list = ListTag.valueOf(string).filter(dItem.class, scriptEntry); + else if (arg.matchesArgumentList(ItemTag.class)) { + List list = ListTag.valueOf(string).filter(ItemTag.class, scriptEntry); ItemStack[] items = convertItems(list).toArray(new ItemStack[list.size()]); - dInventory inventory = new dInventory(Math.max(dInventory.maxSlots, (items.length / 9) * 9 + 9)); + InventoryTag inventory = new InventoryTag(Math.max(InventoryTag.maxSlots, (items.length / 9) * 9 + 9)); inventory.setContents(items); return new AbstractMap.SimpleEntry<>(items.length, inventory); } - else if (dLocation.matches(string)) { - dInventory inv = dLocation.valueOf(string).getInventory(); + else if (LocationTag.matches(string)) { + InventoryTag inv = LocationTag.valueOf(string).getInventory(); return new AbstractMap.SimpleEntry<>(inv.getContents().length, inv); } - else if (dEntity.matches(string)) { - dInventory inv = dEntity.valueOf(string).getInventory(); + else if (EntityTag.matches(string)) { + InventoryTag inv = EntityTag.valueOf(string).getInventory(); return new AbstractMap.SimpleEntry<>(inv.getContents().length, inv); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/DenizenAPI.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/DenizenAPI.java index 60e0f02e9f..1aea2e4b13 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/DenizenAPI.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/DenizenAPI.java @@ -2,7 +2,7 @@ import com.denizenscript.denizen.Denizen; import com.denizenscript.denizen.npc.DenizenNPCHelper; -import com.denizenscript.denizen.objects.dNPC; +import com.denizenscript.denizen.objects.NPCTag; import net.citizensnpcs.api.npc.NPC; import org.bukkit.Bukkit; import org.bukkit.configuration.file.FileConfiguration; @@ -15,13 +15,13 @@ public class DenizenAPI { private static Denizen denizen; /** - * Returns a dNPC object when given a valid NPC. DenizenNPCs have some methods + * Returns a NPCTag object when given a valid NPC. DenizenNPCs have some methods * specific to Denizen functionality as well as easy access to the attached NPC and LivingEntity. * * @param npc the Citizens NPC - * @return a dNPC + * @return a NPCTag */ - public static dNPC getDenizenNPC(NPC npc) { + public static NPCTag getDenizenNPC(NPC npc) { return DenizenNPCHelper.getDenizen(npc); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/DenizenCommand.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/DenizenCommand.java index 20ab780151..0f205336e9 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/DenizenCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/DenizenCommand.java @@ -2,10 +2,10 @@ import com.denizenscript.denizen.utilities.depends.Depends; import com.denizenscript.denizencore.objects.*; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.scripts.containers.core.CommandScriptContainer; import com.denizenscript.denizen.tags.BukkitTagContext; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -51,12 +51,12 @@ public boolean canSeeHelp(CommandSender commandSender) { return false; } Map context = new HashMap<>(); - dPlayer player = null; - dNPC npc = null; + PlayerTag player = null; + NPCTag npc = null; if (commandSender instanceof Player) { Player pl = (Player) commandSender; - if (!dEntity.isNPC(pl)) { - player = dPlayer.mirrorBukkitPlayer(pl); + if (!EntityTag.isNPC(pl)) { + player = PlayerTag.mirrorBukkitPlayer(pl); } context.put("server", new ElementTag(false)); } @@ -78,21 +78,21 @@ public boolean testPermission(CommandSender target) { + "Please contact the server administrators if you believe that this is in error."); } else if (permissionMessage.length() != 0) { - dPlayer player = null; - dNPC npc = null; + PlayerTag player = null; + NPCTag npc = null; if (target instanceof Player) { Player pl = (Player) target; - if (dEntity.isCitizensNPC(pl)) { - npc = dNPC.fromEntity(pl); + if (EntityTag.isCitizensNPC(pl)) { + npc = NPCTag.fromEntity(pl); } else { - player = dPlayer.mirrorBukkitPlayer(pl); + player = PlayerTag.mirrorBukkitPlayer(pl); } } if (Depends.citizens != null && npc == null) { NPC citizen = CitizensAPI.getDefaultNPCSelector().getSelected(target); if (citizen != null) { - npc = dNPC.mirrorCitizensNPC(citizen); + npc = NPCTag.mirrorCitizensNPC(citizen); } } // is built into Bukkit... let's keep it here @@ -123,31 +123,31 @@ public boolean execute(CommandSender commandSender, String commandLabel, String[ context.put("args", new ListTag(args)); context.put("raw_args", new ElementTag(raw_args)); context.put("alias", new ElementTag(commandLabel)); - dPlayer player = null; - dNPC npc = null; + PlayerTag player = null; + NPCTag npc = null; if (commandSender instanceof Player) { Player pl = (Player) commandSender; - if (dEntity.isCitizensNPC(pl)) { - npc = dNPC.fromEntity(pl); + if (EntityTag.isCitizensNPC(pl)) { + npc = NPCTag.fromEntity(pl); } else { - player = dPlayer.mirrorBukkitPlayer(pl); + player = PlayerTag.mirrorBukkitPlayer(pl); } context.put("server", new ElementTag(false)); } else { context.put("server", new ElementTag(true)); if (commandSender instanceof BlockCommandSender) { - context.put("command_block_location", new dLocation(((BlockCommandSender) commandSender).getBlock().getLocation())); + context.put("command_block_location", new LocationTag(((BlockCommandSender) commandSender).getBlock().getLocation())); } else if (commandSender instanceof CommandMinecart) { - context.put("command_minecart", new dEntity((CommandMinecart) commandSender)); + context.put("command_minecart", new EntityTag((CommandMinecart) commandSender)); } } if (Depends.citizens != null && npc == null) { NPC citizen = CitizensAPI.getDefaultNPCSelector().getSelected(commandSender); if (citizen != null) { - npc = dNPC.mirrorCitizensNPC(citizen); + npc = NPCTag.mirrorCitizensNPC(citizen); } } script.runCommandScript(player, npc, context); @@ -177,15 +177,15 @@ public List tabComplete(CommandSender commandSender, String alias, Strin context.put("args", new ListTag(args)); context.put("raw_args", new ElementTag(raw_args)); context.put("alias", new ElementTag(alias)); - dPlayer player = null; - dNPC npc = null; + PlayerTag player = null; + NPCTag npc = null; if (commandSender instanceof Player) { Player pl = (Player) commandSender; - if (dEntity.isCitizensNPC(pl)) { - npc = dNPC.fromEntity(pl); + if (EntityTag.isCitizensNPC(pl)) { + npc = NPCTag.fromEntity(pl); } else { - player = dPlayer.mirrorBukkitPlayer(pl); + player = PlayerTag.mirrorBukkitPlayer(pl); } context.put("server", new ElementTag(false)); } @@ -195,7 +195,7 @@ public List tabComplete(CommandSender commandSender, String alias, Strin if (Depends.citizens != null && npc == null) { NPC citizen = CitizensAPI.getDefaultNPCSelector().getSelected(commandSender); if (citizen != null) { - npc = dNPC.mirrorCitizensNPC(citizen); + npc = NPCTag.mirrorCitizensNPC(citizen); } } return script.runTabCompleteProcedure(player, npc, context); diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/PathFinder.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/PathFinder.java index 84535202ce..27eeb29cf5 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/PathFinder.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/PathFinder.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.utilities; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.LocationTag; import net.citizensnpcs.api.astar.AStarMachine; import net.citizensnpcs.api.astar.pathfinder.*; import org.bukkit.Location; @@ -16,7 +16,7 @@ public class PathFinder { public static AStarMachine ASTAR = AStarMachine.createWithDefaultStorage(); - public static List getPath(Location start, Location dest) { + public static List getPath(Location start, Location dest) { VectorGoal goal = new VectorGoal(dest, 1); Path plan = (Path) ASTAR.runFully(goal, new VectorNode(goal, start, new ChunkBlockSource(start, 100), new MinecraftBlockExaminer()), @@ -25,10 +25,10 @@ public static List getPath(Location start, Location dest) { return new ArrayList<>(); } else { - List path = new ArrayList<>(); + List path = new ArrayList<>(); while (!plan.isComplete()) { Vector v = plan.getCurrentVector(); - path.add(new dLocation(start.getWorld(), v.getX(), v.getY(), v.getZ())); + path.add(new LocationTag(start.getWorld(), v.getX(), v.getY(), v.getZ())); plan.update(null); } return path; 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 284d1ae0e5..be0f58ca58 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/ScoreboardHelper.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/ScoreboardHelper.java @@ -3,7 +3,7 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizencore.objects.Argument; import com.google.common.base.Splitter; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.scripts.commands.server.ScoreboardCommand; import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; @@ -70,8 +70,8 @@ public static void _recallScoreboards() { // Iterate through viewers, store them in the viewerMap, // and make them see this scoreboard if they are online for (String viewer : viewerList) { - if (dPlayer.matches(viewer)) { - dPlayer player = dPlayer.valueOf(viewer); + if (PlayerTag.matches(viewer)) { + PlayerTag player = PlayerTag.valueOf(viewer); viewerMap.put(player.getName(), id); if (player.isOnline()) { 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 68120a8d9a..09e84b9cde 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/Utilities.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/Utilities.java @@ -7,8 +7,8 @@ import com.denizenscript.denizen.nms.NMSVersion; import com.denizenscript.denizen.nms.interfaces.BlockHelper; import com.denizenscript.denizen.npc.traits.TriggerTrait; -import com.denizenscript.denizen.objects.dNPC; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.NPCTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.tags.BukkitTagContext; import com.denizenscript.denizencore.scripts.ScriptEntry; import com.denizenscript.denizencore.tags.TagContext; @@ -173,7 +173,7 @@ public static String[] wrapWords(String text, int width) { * @param npc the npc being talked to * @param range the range, in blocks, that 'bystanders' will hear he chat */ - public static void talkToNPC(String message, dPlayer player, dNPC npc, double range) { + public static void talkToNPC(String message, PlayerTag player, NPCTag npc, double range) { String replacer = String.valueOf((char) 0x04); // Get formats from Settings, and fill in String talkFormat = Settings.chatToNpcFormat() @@ -231,7 +231,7 @@ public static boolean isBetween(double a, double b, double c) { * @return The closest NPC to the location, or null if no NPC was found * within the range specified. */ - public static dNPC getClosestNPC_ChatTrigger(Location location, int range) { + public static NPCTag getClosestNPC_ChatTrigger(Location location, int range) { NPC closestNPC = null; double closestDistance = Math.pow(range, 2); for (NPC npc : CitizensAPI.getNPCRegistry()) { @@ -246,7 +246,7 @@ public static dNPC getClosestNPC_ChatTrigger(Location location, int range) { closestDistance = npc.getStoredLocation().distanceSquared(location); } } - return new dNPC(closestNPC); + return new NPCTag(closestNPC); } @@ -513,11 +513,11 @@ public static boolean entryHasNPC(ScriptEntry entry) { return getEntryData(entry).hasNPC(); } - public static dPlayer getEntryPlayer(ScriptEntry entry) { + public static PlayerTag getEntryPlayer(ScriptEntry entry) { return getEntryData(entry).getPlayer(); } - public static dNPC getEntryNPC(ScriptEntry entry) { + public static NPCTag getEntryNPC(ScriptEntry entry) { return getEntryData(entry).getNPC(); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/blocks/CuboidBlockSet.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/blocks/CuboidBlockSet.java index abaa0dc5bc..66e3ccef9f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/blocks/CuboidBlockSet.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/blocks/CuboidBlockSet.java @@ -4,8 +4,8 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.interfaces.BlockData; -import com.denizenscript.denizen.objects.dCuboid; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.CuboidTag; +import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.scripts.commands.world.SchematicCommand; import com.denizenscript.denizen.utilities.DenizenAPI; import org.bukkit.Location; @@ -28,7 +28,7 @@ public class CuboidBlockSet implements BlockSet { public CuboidBlockSet() { } - public CuboidBlockSet(dCuboid cuboid, Location center) { + public CuboidBlockSet(CuboidTag cuboid, Location center) { Location low = cuboid.pairs.get(0).low; Location high = cuboid.pairs.get(0).high; x_width = (high.getX() - low.getX()) + 1; @@ -65,10 +65,10 @@ public List getBlocks() { return blocks; } - public dCuboid getCuboid(Location loc) { + public CuboidTag getCuboid(Location loc) { Location low = loc.clone().subtract(center_x, center_y, center_z); Location high = low.clone().add(x_width, y_length, z_height); - return new dCuboid(low, high); + return new CuboidTag(low, high); } public class IntHolder { @@ -295,7 +295,7 @@ else if (entry.getKey().equals("z")) { int index = y * width * length + z * width + x; BlockVector pt = new BlockVector(x, y, z); // TODO: 1.13 - move away from legacy IDs somehow? - dMaterial dMat = OldMaterialsHelper.getMaterialFrom(OldMaterialsHelper.getLegacyMaterial(blocks[index]), blockData[index]); + MaterialTag dMat = OldMaterialsHelper.getMaterialFrom(OldMaterialsHelper.getLegacyMaterial(blocks[index]), blockData[index]); BlockData block = dMat.getNmsBlockData(); if (tileEntitiesMap.containsKey(pt)) { CompoundTag otag = NMSHandler.getInstance().createCompoundTag(tileEntitiesMap.get(pt)); diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/blocks/FakeBlock.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/blocks/FakeBlock.java index 660087fc21..7d1f72dd03 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/blocks/FakeBlock.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/blocks/FakeBlock.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.utilities.blocks; -import com.denizenscript.denizen.objects.dLocation; -import com.denizenscript.denizen.objects.dMaterial; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.LocationTag; +import com.denizenscript.denizen.objects.MaterialTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizencore.objects.core.DurationTag; import org.bukkit.event.EventHandler; @@ -14,26 +14,26 @@ import java.util.*; /** - * Creates a temporary fake block and shows it to a dPlayer. + * Creates a temporary fake block and shows it to a PlayerTag. */ public class FakeBlock { - private final static Map> blocks = new HashMap<>(); - private final static Map blocksByLocation = new HashMap<>(); + private final static Map> blocks = new HashMap<>(); + private final static Map blocksByLocation = new HashMap<>(); - private final dPlayer player; - private final dLocation location; - private dMaterial material; + private final PlayerTag player; + private final LocationTag location; + private MaterialTag material; private long cancelTime = -1; private BukkitTask currentTask = null; - private FakeBlock(dPlayer player, dLocation location) { + private FakeBlock(PlayerTag player, LocationTag location) { this.player = player; this.location = location; } - public static void showFakeBlockTo(List players, dLocation location, dMaterial material, DurationTag duration) { - for (dPlayer player : players) { + public static void showFakeBlockTo(List players, LocationTag location, MaterialTag material, DurationTag duration) { + for (PlayerTag player : players) { if (!player.isOnline() || !player.isValid()) { continue; } @@ -41,7 +41,7 @@ public static void showFakeBlockTo(List players, dLocation location, dM if (!blocks.containsKey(uuid)) { blocks.put(uuid, new HashMap<>()); } - Map playerBlocks = blocks.get(uuid); + Map playerBlocks = blocks.get(uuid); if (!playerBlocks.containsKey(location)) { playerBlocks.put(location, new FakeBlock(player, location)); } @@ -49,16 +49,16 @@ public static void showFakeBlockTo(List players, dLocation location, dM } } - public static void stopShowingTo(List players, final dLocation location) { + public static void stopShowingTo(List players, final LocationTag location) { final List uuids = new ArrayList<>(); - for (dPlayer player : players) { + for (PlayerTag player : players) { if (!player.isOnline() || !player.isValid()) { continue; } UUID uuid = player.getPlayerEntity().getUniqueId(); uuids.add(uuid); if (blocks.containsKey(uuid)) { - Map playerBlocks = blocks.get(uuid); + Map playerBlocks = blocks.get(uuid); if (playerBlocks.containsKey(location)) { playerBlocks.get(location).cancelBlock(); } @@ -71,7 +71,7 @@ public void run() { if (uuids.contains(uuid)) { continue; } - Map playerBlocks = blocks.get(uuid); + Map playerBlocks = blocks.get(uuid); if (playerBlocks.containsKey(location)) { playerBlocks.get(location).updateBlock(); } @@ -80,7 +80,7 @@ public void run() { }.runTaskLater(DenizenAPI.getCurrentInstance(), 2); } - public static Map> getBlocks() { + public static Map> getBlocks() { return blocks; } @@ -102,7 +102,7 @@ public void updateBlock() { } } - private void updateBlock(dMaterial material, long ticks) { + private void updateBlock(MaterialTag material, long ticks) { if (currentTask != null) { currentTask.cancel(); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/blocks/OldMaterialsHelper.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/blocks/OldMaterialsHelper.java index b43f052703..955ad50a9b 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/blocks/OldMaterialsHelper.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/blocks/OldMaterialsHelper.java @@ -4,7 +4,7 @@ import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.NMSVersion; import com.denizenscript.denizen.nms.util.ReflectionHelper; -import com.denizenscript.denizen.objects.dMaterial; +import com.denizenscript.denizen.objects.MaterialTag; import org.bukkit.Bukkit; import org.bukkit.Material; @@ -18,13 +18,13 @@ public class OldMaterialsHelper { ///////////////// - // dMaterial Varieties + // MaterialTag Varieties /////////////// - // dMaterial 'extra materials' for making 'data variety' materials easier to work with. Register materials + // MaterialTag 'extra materials' for making 'data variety' materials easier to work with. Register materials // that aren't included in the bukkit Material enum here to make lookup easier. - public enum dMaterials { + public enum MaterialTags { WHITE_WOOL, ORANGE_WOOL, MAGENTA_WOOL, LIGHT_BLUE_WOOL, YELLOW_WOOL, LIME_WOOL, PINK_WOOL, GRAY_WOOL, LIGHT_GRAY_WOOL, CYAN_WOOL, PURPLE_WOOL, BLUE_WOOL, BROWN_WOOL, GREEN_WOOL, RED_WOOL, BLACK_WOOL, WHITE_CARPET, ORANGE_CARPET, MAGENTA_CARPET, LIGHT_BLUE_CARPET, @@ -81,393 +81,393 @@ public enum dMaterials { } // Colored Wool - public final static dMaterial WHITE_WOOL = getMaterialPre1_13("WOOL", 0, "WHITE_WOOL"); - public final static dMaterial ORANGE_WOOL = getMaterialPre1_13("WOOL", 1, "ORANGE_WOOL"); - public final static dMaterial MAGENTA_WOOL = getMaterialPre1_13("WOOL", 2, "MAGENTA_WOOL"); - public final static dMaterial LIGHT_BLUE_WOOL = getMaterialPre1_13("WOOL", 3, "LIGHT_BLUE_WOOL"); - public final static dMaterial YELLOW_WOOL = getMaterialPre1_13("WOOL", 4, "YELLOW_WOOL"); - public final static dMaterial LIME_WOOL = getMaterialPre1_13("WOOL", 5, "LIME_WOOL"); - public final static dMaterial PINK_WOOL = getMaterialPre1_13("WOOL", 6, "PINK_WOOL"); - public final static dMaterial GRAY_WOOL = getMaterialPre1_13("WOOL", 7, "GRAY_WOOL"); - public final static dMaterial LIGHT_GRAY_WOOL = getMaterialPre1_13("WOOL", 8, "LIGHT_GRAY_WOOL"); - public final static dMaterial CYAN_WOOL = getMaterialPre1_13("WOOL", 9, "CYAN_WOOL"); - public final static dMaterial PURPLE_WOOL = getMaterialPre1_13("WOOL", 10, "PURPLE_WOOL"); - public final static dMaterial BLUE_WOOL = getMaterialPre1_13("WOOL", 11, "BLUE_WOOL"); - public final static dMaterial BROWN_WOOL = getMaterialPre1_13("WOOL", 12, "BROWN_WOOL"); - public final static dMaterial GREEN_WOOL = getMaterialPre1_13("WOOL", 13, "GREEN_WOOL"); - public final static dMaterial RED_WOOL = getMaterialPre1_13("WOOL", 14, "RED_WOOL"); - public final static dMaterial BLACK_WOOL = getMaterialPre1_13("WOOL", 15, "BLACK_WOOL"); + public final static MaterialTag WHITE_WOOL = getMaterialPre1_13("WOOL", 0, "WHITE_WOOL"); + public final static MaterialTag ORANGE_WOOL = getMaterialPre1_13("WOOL", 1, "ORANGE_WOOL"); + public final static MaterialTag MAGENTA_WOOL = getMaterialPre1_13("WOOL", 2, "MAGENTA_WOOL"); + public final static MaterialTag LIGHT_BLUE_WOOL = getMaterialPre1_13("WOOL", 3, "LIGHT_BLUE_WOOL"); + public final static MaterialTag YELLOW_WOOL = getMaterialPre1_13("WOOL", 4, "YELLOW_WOOL"); + public final static MaterialTag LIME_WOOL = getMaterialPre1_13("WOOL", 5, "LIME_WOOL"); + public final static MaterialTag PINK_WOOL = getMaterialPre1_13("WOOL", 6, "PINK_WOOL"); + public final static MaterialTag GRAY_WOOL = getMaterialPre1_13("WOOL", 7, "GRAY_WOOL"); + public final static MaterialTag LIGHT_GRAY_WOOL = getMaterialPre1_13("WOOL", 8, "LIGHT_GRAY_WOOL"); + public final static MaterialTag CYAN_WOOL = getMaterialPre1_13("WOOL", 9, "CYAN_WOOL"); + public final static MaterialTag PURPLE_WOOL = getMaterialPre1_13("WOOL", 10, "PURPLE_WOOL"); + public final static MaterialTag BLUE_WOOL = getMaterialPre1_13("WOOL", 11, "BLUE_WOOL"); + public final static MaterialTag BROWN_WOOL = getMaterialPre1_13("WOOL", 12, "BROWN_WOOL"); + public final static MaterialTag GREEN_WOOL = getMaterialPre1_13("WOOL", 13, "GREEN_WOOL"); + public final static MaterialTag RED_WOOL = getMaterialPre1_13("WOOL", 14, "RED_WOOL"); + public final static MaterialTag BLACK_WOOL = getMaterialPre1_13("WOOL", 15, "BLACK_WOOL"); // Colored Carpets - public final static dMaterial WHITE_CARPET = getMaterialPre1_13("CARPET", 0, "WHITE_CARPET"); - public final static dMaterial ORANGE_CARPET = getMaterialPre1_13("CARPET", 1, "ORANGE_CARPET"); - public final static dMaterial MAGENTA_CARPET = getMaterialPre1_13("CARPET", 2, "MAGENTA_CARPET"); - public final static dMaterial LIGHT_BLUE_CARPET = getMaterialPre1_13("CARPET", 3, "LIGHT_BLUE_CARPET"); - public final static dMaterial YELLOW_CARPET = getMaterialPre1_13("CARPET", 4, "YELLOW_CARPET"); - public final static dMaterial LIME_CARPET = getMaterialPre1_13("CARPET", 5, "LIME_CARPET"); - public final static dMaterial PINK_CARPET = getMaterialPre1_13("CARPET", 6, "PINK_CARPET"); - public final static dMaterial GRAY_CARPET = getMaterialPre1_13("CARPET", 7, "GRAY_CARPET"); - public final static dMaterial LIGHT_GRAY_CARPET = getMaterialPre1_13("CARPET", 8, "LIGHT_GRAY_CARPET"); - public final static dMaterial CYAN_CARPET = getMaterialPre1_13("CARPET", 9, "CYAN_CARPET"); - public final static dMaterial PURPLE_CARPET = getMaterialPre1_13("CARPET", 10, "PURPLE_CARPET"); - public final static dMaterial BLUE_CARPET = getMaterialPre1_13("CARPET", 11, "BLUE_CARPET"); - public final static dMaterial BROWN_CARPET = getMaterialPre1_13("CARPET", 12, "BROWN_CARPET"); - public final static dMaterial GREEN_CARPET = getMaterialPre1_13("CARPET", 13, "GREEN_CARPET"); - public final static dMaterial RED_CARPET = getMaterialPre1_13("CARPET", 14, "RED_CARPET"); - public final static dMaterial BLACK_CARPET = getMaterialPre1_13("CARPET", 15, "BLACK_CARPET"); + public final static MaterialTag WHITE_CARPET = getMaterialPre1_13("CARPET", 0, "WHITE_CARPET"); + public final static MaterialTag ORANGE_CARPET = getMaterialPre1_13("CARPET", 1, "ORANGE_CARPET"); + public final static MaterialTag MAGENTA_CARPET = getMaterialPre1_13("CARPET", 2, "MAGENTA_CARPET"); + public final static MaterialTag LIGHT_BLUE_CARPET = getMaterialPre1_13("CARPET", 3, "LIGHT_BLUE_CARPET"); + public final static MaterialTag YELLOW_CARPET = getMaterialPre1_13("CARPET", 4, "YELLOW_CARPET"); + public final static MaterialTag LIME_CARPET = getMaterialPre1_13("CARPET", 5, "LIME_CARPET"); + public final static MaterialTag PINK_CARPET = getMaterialPre1_13("CARPET", 6, "PINK_CARPET"); + public final static MaterialTag GRAY_CARPET = getMaterialPre1_13("CARPET", 7, "GRAY_CARPET"); + public final static MaterialTag LIGHT_GRAY_CARPET = getMaterialPre1_13("CARPET", 8, "LIGHT_GRAY_CARPET"); + public final static MaterialTag CYAN_CARPET = getMaterialPre1_13("CARPET", 9, "CYAN_CARPET"); + public final static MaterialTag PURPLE_CARPET = getMaterialPre1_13("CARPET", 10, "PURPLE_CARPET"); + public final static MaterialTag BLUE_CARPET = getMaterialPre1_13("CARPET", 11, "BLUE_CARPET"); + public final static MaterialTag BROWN_CARPET = getMaterialPre1_13("CARPET", 12, "BROWN_CARPET"); + public final static MaterialTag GREEN_CARPET = getMaterialPre1_13("CARPET", 13, "GREEN_CARPET"); + public final static MaterialTag RED_CARPET = getMaterialPre1_13("CARPET", 14, "RED_CARPET"); + public final static MaterialTag BLACK_CARPET = getMaterialPre1_13("CARPET", 15, "BLACK_CARPET"); // Colored Clay - public final static dMaterial WHITE_CLAY = getMaterialPre1_13("STAINED_CLAY", 0, "WHITE_CLAY"); - public final static dMaterial ORANGE_CLAY = getMaterialPre1_13("STAINED_CLAY", 1, "ORANGE_CLAY"); - public final static dMaterial MAGENTA_CLAY = getMaterialPre1_13("STAINED_CLAY", 2, "MAGENTA_CLAY"); - public final static dMaterial LIGHT_BLUE_CLAY = getMaterialPre1_13("STAINED_CLAY", 3, "LIGHT_BLUE_CLAY"); - public final static dMaterial YELLOW_CLAY = getMaterialPre1_13("STAINED_CLAY", 4, "YELLOW_CLAY"); - public final static dMaterial LIME_CLAY = getMaterialPre1_13("STAINED_CLAY", 5, "LIME_CLAY"); - public final static dMaterial PINK_CLAY = getMaterialPre1_13("STAINED_CLAY", 6, "PINK_CLAY"); - public final static dMaterial GRAY_CLAY = getMaterialPre1_13("STAINED_CLAY", 7, "GRAY_CLAY"); - public final static dMaterial LIGHT_GRAY_CLAY = getMaterialPre1_13("STAINED_CLAY", 8, "LIGHT_GRAY_CLAY"); - public final static dMaterial CYAN_CLAY = getMaterialPre1_13("STAINED_CLAY", 9, "CYAN_CLAY"); - public final static dMaterial PURPLE_CLAY = getMaterialPre1_13("STAINED_CLAY", 10, "PURPLE_CLAY"); - public final static dMaterial BLUE_CLAY = getMaterialPre1_13("STAINED_CLAY", 11, "BLUE_CLAY"); - public final static dMaterial BROWN_CLAY = getMaterialPre1_13("STAINED_CLAY", 12, "BROWN_CLAY"); - public final static dMaterial GREEN_CLAY = getMaterialPre1_13("STAINED_CLAY", 13, "GREEN_CLAY"); - public final static dMaterial RED_CLAY = getMaterialPre1_13("STAINED_CLAY", 14, "RED_CLAY"); - public final static dMaterial BLACK_CLAY = getMaterialPre1_13("STAINED_CLAY", 15, "BLACK_CLAY"); + public final static MaterialTag WHITE_CLAY = getMaterialPre1_13("STAINED_CLAY", 0, "WHITE_CLAY"); + public final static MaterialTag ORANGE_CLAY = getMaterialPre1_13("STAINED_CLAY", 1, "ORANGE_CLAY"); + public final static MaterialTag MAGENTA_CLAY = getMaterialPre1_13("STAINED_CLAY", 2, "MAGENTA_CLAY"); + public final static MaterialTag LIGHT_BLUE_CLAY = getMaterialPre1_13("STAINED_CLAY", 3, "LIGHT_BLUE_CLAY"); + public final static MaterialTag YELLOW_CLAY = getMaterialPre1_13("STAINED_CLAY", 4, "YELLOW_CLAY"); + public final static MaterialTag LIME_CLAY = getMaterialPre1_13("STAINED_CLAY", 5, "LIME_CLAY"); + public final static MaterialTag PINK_CLAY = getMaterialPre1_13("STAINED_CLAY", 6, "PINK_CLAY"); + public final static MaterialTag GRAY_CLAY = getMaterialPre1_13("STAINED_CLAY", 7, "GRAY_CLAY"); + public final static MaterialTag LIGHT_GRAY_CLAY = getMaterialPre1_13("STAINED_CLAY", 8, "LIGHT_GRAY_CLAY"); + public final static MaterialTag CYAN_CLAY = getMaterialPre1_13("STAINED_CLAY", 9, "CYAN_CLAY"); + public final static MaterialTag PURPLE_CLAY = getMaterialPre1_13("STAINED_CLAY", 10, "PURPLE_CLAY"); + public final static MaterialTag BLUE_CLAY = getMaterialPre1_13("STAINED_CLAY", 11, "BLUE_CLAY"); + public final static MaterialTag BROWN_CLAY = getMaterialPre1_13("STAINED_CLAY", 12, "BROWN_CLAY"); + public final static MaterialTag GREEN_CLAY = getMaterialPre1_13("STAINED_CLAY", 13, "GREEN_CLAY"); + public final static MaterialTag RED_CLAY = getMaterialPre1_13("STAINED_CLAY", 14, "RED_CLAY"); + public final static MaterialTag BLACK_CLAY = getMaterialPre1_13("STAINED_CLAY", 15, "BLACK_CLAY"); // Stained Glass - public final static dMaterial WHITE_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 0, "WHITE_STAINED_GLASS"); - public final static dMaterial ORANGE_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 1, "ORANGE_STAINED_GLASS"); - public final static dMaterial MAGENTA_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 2, "MAGENTA_STAINED_GLASS"); - public final static dMaterial LIGHT_BLUE_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 3, "LIGHT_BLUE_STAINED_GLASS"); - public final static dMaterial YELLOW_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 4, "YELLOW_STAINED_GLASS"); - public final static dMaterial LIME_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 5, "LIME_STAINED_GLASS"); - public final static dMaterial PINK_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 6, "PINK_STAINED_GLASS"); - public final static dMaterial GRAY_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 7, "GRAY_STAINED_GLASS"); - public final static dMaterial LIGHT_GRAY_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 8, "LIGHT_GRAY_STAINED_GLASS"); - public final static dMaterial CYAN_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 9, "CYAN_STAINED_GLASS"); - public final static dMaterial PURPLE_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 10, "PURPLE_STAINED_GLASS"); - public final static dMaterial BLUE_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 11, "BLUE_STAINED_GLASS"); - public final static dMaterial BROWN_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 12, "BROWN_STAINED_GLASS"); - public final static dMaterial GREEN_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 13, "GREEN_STAINED_GLASS"); - public final static dMaterial RED_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 14, "RED_STAINED_GLASS"); - public final static dMaterial BLACK_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 15, "BLACK_STAINED_GLASS"); + public final static MaterialTag WHITE_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 0, "WHITE_STAINED_GLASS"); + public final static MaterialTag ORANGE_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 1, "ORANGE_STAINED_GLASS"); + public final static MaterialTag MAGENTA_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 2, "MAGENTA_STAINED_GLASS"); + public final static MaterialTag LIGHT_BLUE_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 3, "LIGHT_BLUE_STAINED_GLASS"); + public final static MaterialTag YELLOW_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 4, "YELLOW_STAINED_GLASS"); + public final static MaterialTag LIME_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 5, "LIME_STAINED_GLASS"); + public final static MaterialTag PINK_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 6, "PINK_STAINED_GLASS"); + public final static MaterialTag GRAY_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 7, "GRAY_STAINED_GLASS"); + public final static MaterialTag LIGHT_GRAY_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 8, "LIGHT_GRAY_STAINED_GLASS"); + public final static MaterialTag CYAN_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 9, "CYAN_STAINED_GLASS"); + public final static MaterialTag PURPLE_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 10, "PURPLE_STAINED_GLASS"); + public final static MaterialTag BLUE_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 11, "BLUE_STAINED_GLASS"); + public final static MaterialTag BROWN_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 12, "BROWN_STAINED_GLASS"); + public final static MaterialTag GREEN_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 13, "GREEN_STAINED_GLASS"); + public final static MaterialTag RED_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 14, "RED_STAINED_GLASS"); + public final static MaterialTag BLACK_STAINED_GLASS = getMaterialPre1_13("STAINED_GLASS", 15, "BLACK_STAINED_GLASS"); // Stained Glass Panes - public final static dMaterial WHITE_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 0, "WHITE_STAINED_GLASS_PANE"); - public final static dMaterial ORANGE_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 1, "ORANGE_STAINED_GLASS_PANE"); - public final static dMaterial MAGENTA_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 2, "MAGENTA_STAINED_GLASS_PANE"); - public final static dMaterial LIGHT_BLUE_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 3, "LIGHT_BLUE_STAINED_GLASS_PANE"); - public final static dMaterial YELLOW_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 4, "YELLOW_STAINED_GLASS_PANE"); - public final static dMaterial LIME_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 5, "LIME_STAINED_GLASS_PANE"); - public final static dMaterial PINK_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 6, "PINK_STAINED_GLASS_PANE"); - public final static dMaterial GRAY_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 7, "GRAY_STAINED_GLASS_PANE"); - public final static dMaterial LIGHT_GRAY_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 8, "LIGHT_GRAY_STAINED_GLASS_PANE"); - public final static dMaterial CYAN_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 9, "CYAN_STAINED_GLASS_PANE"); - public final static dMaterial PURPLE_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 10, "PURPLE_STAINED_GLASS_PANE"); - public final static dMaterial BLUE_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 11, "BLUE_STAINED_GLASS_PANE"); - public final static dMaterial BROWN_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 12, "BROWN_STAINED_GLASS_PANE"); - public final static dMaterial GREEN_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 13, "GREEN_STAINED_GLASS_PANE"); - public final static dMaterial RED_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 14, "RED_STAINED_GLASS_PANE"); - public final static dMaterial BLACK_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 15, "BLACK_STAINED_GLASS_PANE"); + public final static MaterialTag WHITE_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 0, "WHITE_STAINED_GLASS_PANE"); + public final static MaterialTag ORANGE_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 1, "ORANGE_STAINED_GLASS_PANE"); + public final static MaterialTag MAGENTA_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 2, "MAGENTA_STAINED_GLASS_PANE"); + public final static MaterialTag LIGHT_BLUE_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 3, "LIGHT_BLUE_STAINED_GLASS_PANE"); + public final static MaterialTag YELLOW_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 4, "YELLOW_STAINED_GLASS_PANE"); + public final static MaterialTag LIME_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 5, "LIME_STAINED_GLASS_PANE"); + public final static MaterialTag PINK_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 6, "PINK_STAINED_GLASS_PANE"); + public final static MaterialTag GRAY_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 7, "GRAY_STAINED_GLASS_PANE"); + public final static MaterialTag LIGHT_GRAY_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 8, "LIGHT_GRAY_STAINED_GLASS_PANE"); + public final static MaterialTag CYAN_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 9, "CYAN_STAINED_GLASS_PANE"); + public final static MaterialTag PURPLE_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 10, "PURPLE_STAINED_GLASS_PANE"); + public final static MaterialTag BLUE_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 11, "BLUE_STAINED_GLASS_PANE"); + public final static MaterialTag BROWN_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 12, "BROWN_STAINED_GLASS_PANE"); + public final static MaterialTag GREEN_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 13, "GREEN_STAINED_GLASS_PANE"); + public final static MaterialTag RED_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 14, "RED_STAINED_GLASS_PANE"); + public final static MaterialTag BLACK_STAINED_GLASS_PANE = getMaterialPre1_13("STAINED_GLASS_PANE", 15, "BLACK_STAINED_GLASS_PANE"); // Planks - public final static dMaterial OAK_PLANKS = getMaterialPre1_13("WOOD", 0, "OAK_PLANKS"); - public final static dMaterial SPRUCE_PLANKS = getMaterialPre1_13("WOOD", 1, "SPRUCE_PLANKS"); - public final static dMaterial BIRCH_PLANKS = getMaterialPre1_13("WOOD", 2, "BIRCH_PLANKS"); - public final static dMaterial JUNGLE_PLANKS = getMaterialPre1_13("WOOD", 3, "JUNGLE_PLANKS"); - public final static dMaterial ACACIA_PLANKS = getMaterialPre1_13("WOOD", 4, "ACACIA_PLANKS"); - public final static dMaterial DARKOAK_PLANKS = getMaterialPre1_13("WOOD", 5, "DARKOAK_PLANKS"); + public final static MaterialTag OAK_PLANKS = getMaterialPre1_13("WOOD", 0, "OAK_PLANKS"); + public final static MaterialTag SPRUCE_PLANKS = getMaterialPre1_13("WOOD", 1, "SPRUCE_PLANKS"); + public final static MaterialTag BIRCH_PLANKS = getMaterialPre1_13("WOOD", 2, "BIRCH_PLANKS"); + public final static MaterialTag JUNGLE_PLANKS = getMaterialPre1_13("WOOD", 3, "JUNGLE_PLANKS"); + public final static MaterialTag ACACIA_PLANKS = getMaterialPre1_13("WOOD", 4, "ACACIA_PLANKS"); + public final static MaterialTag DARKOAK_PLANKS = getMaterialPre1_13("WOOD", 5, "DARKOAK_PLANKS"); // Saplings - public final static dMaterial OAK_SAPLING = getMaterialPre1_13("SAPLING", 0, "OAK_SAPLING"); - public final static dMaterial SPRUCE_SAPLING = getMaterialPre1_13("SAPLING", 1, "SPRUCE_SAPLING"); - public final static dMaterial BIRCH_SAPLING = getMaterialPre1_13("SAPLING", 2, "BIRCH_SAPLING"); - public final static dMaterial JUNGLE_SAPLING = getMaterialPre1_13("SAPLING", 3, "JUNGLE_SAPLING"); - public final static dMaterial ACACIA_SAPLING = getMaterialPre1_13("SAPLING", 4, "ACACIA_SAPLING"); - public final static dMaterial DARKOAK_SAPLING = getMaterialPre1_13("SAPLING", 5, "DARKOAK_SAPLING"); + public final static MaterialTag OAK_SAPLING = getMaterialPre1_13("SAPLING", 0, "OAK_SAPLING"); + public final static MaterialTag SPRUCE_SAPLING = getMaterialPre1_13("SAPLING", 1, "SPRUCE_SAPLING"); + public final static MaterialTag BIRCH_SAPLING = getMaterialPre1_13("SAPLING", 2, "BIRCH_SAPLING"); + public final static MaterialTag JUNGLE_SAPLING = getMaterialPre1_13("SAPLING", 3, "JUNGLE_SAPLING"); + public final static MaterialTag ACACIA_SAPLING = getMaterialPre1_13("SAPLING", 4, "ACACIA_SAPLING"); + public final static MaterialTag DARKOAK_SAPLING = getMaterialPre1_13("SAPLING", 5, "DARKOAK_SAPLING"); // Leaves - public final static dMaterial OAK_LEAVES = getMaterialPre1_13("LEAVES", 0, "OAK_LEAVES"); - public final static dMaterial SPRUCE_LEAVES = getMaterialPre1_13("LEAVES", 1, "SPRUCE_LEAVES"); - public final static dMaterial BIRCH_LEAVES = getMaterialPre1_13("LEAVES", 2, "BIRCH_LEAVES"); - public final static dMaterial JUNGLE_LEAVES = getMaterialPre1_13("LEAVES", 3, "JUNGLE_LEAVES"); - public final static dMaterial ACACIA_LEAVES = getMaterialPre1_13("LEAVES_2", 0, "ACACIA_LEAVES"); - public final static dMaterial DARKOAK_LEAVES = getMaterialPre1_13("LEAVES_2", 1, "DARKOAK_LEAVES"); - public final static dMaterial PLACED_OAK_LEAVES = getMaterialPre1_13("LEAVES", 4, "PLACED_OAK_LEAVES"); - public final static dMaterial PLACED_SPRUCE_LEAVES = getMaterialPre1_13("LEAVES", 5, "PLACED_SPRUCE_LEAVES"); - public final static dMaterial PLACED_BIRCH_LEAVES = getMaterialPre1_13("LEAVES", 6, "PLACED_BIRCH_LEAVES"); - public final static dMaterial PLACED_JUNGLE_LEAVES = getMaterialPre1_13("LEAVES", 7, "PLACED_JUNGLE_LEAVES"); - public final static dMaterial PLACED_ACACIA_LEAVES = getMaterialPre1_13("LEAVES_2", 4, "PLACED_ACACIA_LEAVES"); - public final static dMaterial PLACED_DARKOAK_LEAVES = getMaterialPre1_13("LEAVES_2", 5, "PLACED_DARKOAK_LEAVES"); + public final static MaterialTag OAK_LEAVES = getMaterialPre1_13("LEAVES", 0, "OAK_LEAVES"); + public final static MaterialTag SPRUCE_LEAVES = getMaterialPre1_13("LEAVES", 1, "SPRUCE_LEAVES"); + public final static MaterialTag BIRCH_LEAVES = getMaterialPre1_13("LEAVES", 2, "BIRCH_LEAVES"); + public final static MaterialTag JUNGLE_LEAVES = getMaterialPre1_13("LEAVES", 3, "JUNGLE_LEAVES"); + public final static MaterialTag ACACIA_LEAVES = getMaterialPre1_13("LEAVES_2", 0, "ACACIA_LEAVES"); + public final static MaterialTag DARKOAK_LEAVES = getMaterialPre1_13("LEAVES_2", 1, "DARKOAK_LEAVES"); + public final static MaterialTag PLACED_OAK_LEAVES = getMaterialPre1_13("LEAVES", 4, "PLACED_OAK_LEAVES"); + public final static MaterialTag PLACED_SPRUCE_LEAVES = getMaterialPre1_13("LEAVES", 5, "PLACED_SPRUCE_LEAVES"); + public final static MaterialTag PLACED_BIRCH_LEAVES = getMaterialPre1_13("LEAVES", 6, "PLACED_BIRCH_LEAVES"); + public final static MaterialTag PLACED_JUNGLE_LEAVES = getMaterialPre1_13("LEAVES", 7, "PLACED_JUNGLE_LEAVES"); + public final static MaterialTag PLACED_ACACIA_LEAVES = getMaterialPre1_13("LEAVES_2", 4, "PLACED_ACACIA_LEAVES"); + public final static MaterialTag PLACED_DARKOAK_LEAVES = getMaterialPre1_13("LEAVES_2", 5, "PLACED_DARKOAK_LEAVES"); // Logs - public final static dMaterial OAK_LOG = getMaterialPre1_13("LOG", 0, "OAK_LOG"); - public final static dMaterial SPRUCE_LOG = getMaterialPre1_13("LOG", 1, "SPRUCE_LOG"); - public final static dMaterial BIRCH_LOG = getMaterialPre1_13("LOG", 2, "BIRCH_LOG"); - public final static dMaterial JUNGLE_LOG = getMaterialPre1_13("LOG", 3, "JUNGLE_LOG"); - public final static dMaterial ACACIA_LOG = getMaterialPre1_13("LOG_2", 0, "ACACIA_LOG"); - public final static dMaterial DARKOAK_LOG = getMaterialPre1_13("LOG_2", 1, "DARKOAK_LOG"); - public final static dMaterial OAK_LOG_EAST = getMaterialPre1_13("LOG", 4, "OAK_LOG_EAST"); - public final static dMaterial SPRUCE_LOG_EAST = getMaterialPre1_13("LOG", 5, "SPRUCE_LOG_EAST"); - public final static dMaterial BIRCH_LOG_EAST = getMaterialPre1_13("LOG", 6, "BIRCH_LOG_EAST"); - public final static dMaterial JUNGLE_LOG_EAST = getMaterialPre1_13("LOG", 7, "JUNGLE_LOG_EAST"); - public final static dMaterial ACACIA_LOG_EAST = getMaterialPre1_13("LOG_2", 4, "ACACIA_LOG_EAST"); - public final static dMaterial DARKOAK_LOG_EAST = getMaterialPre1_13("LOG_2", 5, "DARKOAK_LOG_EAST"); - public final static dMaterial OAK_LOG_NORTH = getMaterialPre1_13("LOG", 8, "OAK_LOG_NORTH"); - public final static dMaterial SPRUCE_LOG_NORTH = getMaterialPre1_13("LOG", 9, "SPRUCE_LOG_NORTH"); - public final static dMaterial BIRCH_LOG_NORTH = getMaterialPre1_13("LOG", 10, "BIRCH_LOG_NORTH"); - public final static dMaterial JUNGLE_LOG_NORTH = getMaterialPre1_13("LOG", 11, "JUNGLE_LOG_NORTH"); - public final static dMaterial ACACIA_LOG_NORTH = getMaterialPre1_13("LOG_2", 8, "ACACIA_LOG_NORTH"); - public final static dMaterial DARKOAK_LOG_NORTH = getMaterialPre1_13("LOG_2", 9, "DARKOAK_LOG_NORTH"); - public final static dMaterial OAK_LOG_BALL = getMaterialPre1_13("LOG", 12, "OAK_LOG_BALL"); - public final static dMaterial SPRUCE_LOG_BALL = getMaterialPre1_13("LOG", 13, "SPRUCE_LOG_BALL"); - public final static dMaterial BIRCH_LOG_BALL = getMaterialPre1_13("LOG", 14, "BIRCH_LOG_BALL"); - public final static dMaterial JUNGLE_LOG_BALL = getMaterialPre1_13("LOG", 15, "JUNGLE_LOG_BALL"); - public final static dMaterial ACACIA_LOG_BALL = getMaterialPre1_13("LOG_2", 12, "ACACIA_LOG_BALL"); - public final static dMaterial DARKOAK_LOG_BALL = getMaterialPre1_13("LOG_2", 13, "DARKOAK_LOG_BALL"); + public final static MaterialTag OAK_LOG = getMaterialPre1_13("LOG", 0, "OAK_LOG"); + public final static MaterialTag SPRUCE_LOG = getMaterialPre1_13("LOG", 1, "SPRUCE_LOG"); + public final static MaterialTag BIRCH_LOG = getMaterialPre1_13("LOG", 2, "BIRCH_LOG"); + public final static MaterialTag JUNGLE_LOG = getMaterialPre1_13("LOG", 3, "JUNGLE_LOG"); + public final static MaterialTag ACACIA_LOG = getMaterialPre1_13("LOG_2", 0, "ACACIA_LOG"); + public final static MaterialTag DARKOAK_LOG = getMaterialPre1_13("LOG_2", 1, "DARKOAK_LOG"); + public final static MaterialTag OAK_LOG_EAST = getMaterialPre1_13("LOG", 4, "OAK_LOG_EAST"); + public final static MaterialTag SPRUCE_LOG_EAST = getMaterialPre1_13("LOG", 5, "SPRUCE_LOG_EAST"); + public final static MaterialTag BIRCH_LOG_EAST = getMaterialPre1_13("LOG", 6, "BIRCH_LOG_EAST"); + public final static MaterialTag JUNGLE_LOG_EAST = getMaterialPre1_13("LOG", 7, "JUNGLE_LOG_EAST"); + public final static MaterialTag ACACIA_LOG_EAST = getMaterialPre1_13("LOG_2", 4, "ACACIA_LOG_EAST"); + public final static MaterialTag DARKOAK_LOG_EAST = getMaterialPre1_13("LOG_2", 5, "DARKOAK_LOG_EAST"); + public final static MaterialTag OAK_LOG_NORTH = getMaterialPre1_13("LOG", 8, "OAK_LOG_NORTH"); + public final static MaterialTag SPRUCE_LOG_NORTH = getMaterialPre1_13("LOG", 9, "SPRUCE_LOG_NORTH"); + public final static MaterialTag BIRCH_LOG_NORTH = getMaterialPre1_13("LOG", 10, "BIRCH_LOG_NORTH"); + public final static MaterialTag JUNGLE_LOG_NORTH = getMaterialPre1_13("LOG", 11, "JUNGLE_LOG_NORTH"); + public final static MaterialTag ACACIA_LOG_NORTH = getMaterialPre1_13("LOG_2", 8, "ACACIA_LOG_NORTH"); + public final static MaterialTag DARKOAK_LOG_NORTH = getMaterialPre1_13("LOG_2", 9, "DARKOAK_LOG_NORTH"); + public final static MaterialTag OAK_LOG_BALL = getMaterialPre1_13("LOG", 12, "OAK_LOG_BALL"); + public final static MaterialTag SPRUCE_LOG_BALL = getMaterialPre1_13("LOG", 13, "SPRUCE_LOG_BALL"); + public final static MaterialTag BIRCH_LOG_BALL = getMaterialPre1_13("LOG", 14, "BIRCH_LOG_BALL"); + public final static MaterialTag JUNGLE_LOG_BALL = getMaterialPre1_13("LOG", 15, "JUNGLE_LOG_BALL"); + public final static MaterialTag ACACIA_LOG_BALL = getMaterialPre1_13("LOG_2", 12, "ACACIA_LOG_BALL"); + public final static MaterialTag DARKOAK_LOG_BALL = getMaterialPre1_13("LOG_2", 13, "DARKOAK_LOG_BALL"); // Sandstone - public final static dMaterial CHISELED_SANDSTONE = getMaterialPre1_13("SANDSTONE", 1, "CHISELED_SANDSTONE"); - public final static dMaterial SMOOTH_SANDSTONE = getMaterialPre1_13("SANDSTONE", 2, "SMOOTH_SANDSTONE"); + public final static MaterialTag CHISELED_SANDSTONE = getMaterialPre1_13("SANDSTONE", 1, "CHISELED_SANDSTONE"); + public final static MaterialTag SMOOTH_SANDSTONE = getMaterialPre1_13("SANDSTONE", 2, "SMOOTH_SANDSTONE"); // Stone Bricks - public final static dMaterial STONE_BRICK = getMaterialPre1_13("SMOOTH_BRICK", 0, "STONE_BRICK"); - public final static dMaterial MOSSY_STONE_BRICK = getMaterialPre1_13("SMOOTH_BRICK", 1, "MOSSY_STONE_BRICK"); - public final static dMaterial CRACKED_STONE_BRICK = getMaterialPre1_13("SMOOTH_BRICK", 2, "CRACKED_STONE_BRICK"); - public final static dMaterial CHISELED_STONE_BRICK = getMaterialPre1_13("SMOOTH_BRICK", 3, "CHISELED_STONE_BRICK"); + public final static MaterialTag STONE_BRICK = getMaterialPre1_13("SMOOTH_BRICK", 0, "STONE_BRICK"); + public final static MaterialTag MOSSY_STONE_BRICK = getMaterialPre1_13("SMOOTH_BRICK", 1, "MOSSY_STONE_BRICK"); + public final static MaterialTag CRACKED_STONE_BRICK = getMaterialPre1_13("SMOOTH_BRICK", 2, "CRACKED_STONE_BRICK"); + public final static MaterialTag CHISELED_STONE_BRICK = getMaterialPre1_13("SMOOTH_BRICK", 3, "CHISELED_STONE_BRICK"); // Quartz Block - public final static dMaterial CHISELED_QUARTZ_BLOCK = getMaterialPre1_13("QUARTZ_BLOCK", 1, "CHISELED_QUARTZ_BLOCK"); - public final static dMaterial PILLAR_QUARTZ_BLOCK = getMaterialPre1_13("QUARTZ_BLOCK", 2, "PILLAR_QUARTZ_BLOCK"); - public final static dMaterial PILLAR_QUARTZ_BLOCK_EAST = getMaterialPre1_13("QUARTZ_BLOCK", 3, "PILLAR_QUARTZ_BLOCK_EAST"); - public final static dMaterial PILLAR_QUARTZ_BLOCK_NORTH = getMaterialPre1_13("QUARTZ_BLOCK", 4, "PILLAR_QUARTZ_BLOCK_NORTH"); + public final static MaterialTag CHISELED_QUARTZ_BLOCK = getMaterialPre1_13("QUARTZ_BLOCK", 1, "CHISELED_QUARTZ_BLOCK"); + public final static MaterialTag PILLAR_QUARTZ_BLOCK = getMaterialPre1_13("QUARTZ_BLOCK", 2, "PILLAR_QUARTZ_BLOCK"); + public final static MaterialTag PILLAR_QUARTZ_BLOCK_EAST = getMaterialPre1_13("QUARTZ_BLOCK", 3, "PILLAR_QUARTZ_BLOCK_EAST"); + public final static MaterialTag PILLAR_QUARTZ_BLOCK_NORTH = getMaterialPre1_13("QUARTZ_BLOCK", 4, "PILLAR_QUARTZ_BLOCK_NORTH"); // Colored Ink - public final static dMaterial INK = getMaterialPre1_13("INK_SACK", 0, "INK"); - public final static dMaterial RED_DYE = getMaterialPre1_13("INK_SACK", 1, "RED_DYE"); - public final static dMaterial GREEN_DYE = getMaterialPre1_13("INK_SACK", 2, "GREEN_DYE"); - public final static dMaterial COCOA_BEANS = getMaterialPre1_13("INK_SACK", 3, "COCOA_BEANS"); - public final static dMaterial LAPIS_LAZULI = getMaterialPre1_13("INK_SACK", 4, "LAPIS_LAZULI"); - public final static dMaterial PURPLE_DYE = getMaterialPre1_13("INK_SACK", 5, "PURPLE_DYE"); - public final static dMaterial CYAN_DYE = getMaterialPre1_13("INK_SACK", 6, "CYAN_DYE"); - public final static dMaterial LIGHT_GRAY_DYE = getMaterialPre1_13("INK_SACK", 7, "LIGHT_GRAY_DYE"); - public final static dMaterial GRAY_DYE = getMaterialPre1_13("INK_SACK", 8, "GRAY_DYE"); - public final static dMaterial PINK_DYE = getMaterialPre1_13("INK_SACK", 9, "PINK_DYE"); - public final static dMaterial LIME_DYE = getMaterialPre1_13("INK_SACK", 10, "LIME_DYE"); - public final static dMaterial YELLOW_DYE = getMaterialPre1_13("INK_SACK", 11, "YELLOW_DYE"); - public final static dMaterial LIGHT_BLUE_DYE = getMaterialPre1_13("INK_SACK", 12, "LIGHT_BLUE_DYE"); - public final static dMaterial MAGENTA_DYE = getMaterialPre1_13("INK_SACK", 13, "MAGENTA_DYE"); - public final static dMaterial ORANGE_DYE = getMaterialPre1_13("INK_SACK", 14, "ORANGE_DYE"); - public final static dMaterial BONE_MEAL = getMaterialPre1_13("INK_SACK", 15, "BONE_MEAL"); + public final static MaterialTag INK = getMaterialPre1_13("INK_SACK", 0, "INK"); + public final static MaterialTag RED_DYE = getMaterialPre1_13("INK_SACK", 1, "RED_DYE"); + public final static MaterialTag GREEN_DYE = getMaterialPre1_13("INK_SACK", 2, "GREEN_DYE"); + public final static MaterialTag COCOA_BEANS = getMaterialPre1_13("INK_SACK", 3, "COCOA_BEANS"); + public final static MaterialTag LAPIS_LAZULI = getMaterialPre1_13("INK_SACK", 4, "LAPIS_LAZULI"); + public final static MaterialTag PURPLE_DYE = getMaterialPre1_13("INK_SACK", 5, "PURPLE_DYE"); + public final static MaterialTag CYAN_DYE = getMaterialPre1_13("INK_SACK", 6, "CYAN_DYE"); + public final static MaterialTag LIGHT_GRAY_DYE = getMaterialPre1_13("INK_SACK", 7, "LIGHT_GRAY_DYE"); + public final static MaterialTag GRAY_DYE = getMaterialPre1_13("INK_SACK", 8, "GRAY_DYE"); + public final static MaterialTag PINK_DYE = getMaterialPre1_13("INK_SACK", 9, "PINK_DYE"); + public final static MaterialTag LIME_DYE = getMaterialPre1_13("INK_SACK", 10, "LIME_DYE"); + public final static MaterialTag YELLOW_DYE = getMaterialPre1_13("INK_SACK", 11, "YELLOW_DYE"); + public final static MaterialTag LIGHT_BLUE_DYE = getMaterialPre1_13("INK_SACK", 12, "LIGHT_BLUE_DYE"); + public final static MaterialTag MAGENTA_DYE = getMaterialPre1_13("INK_SACK", 13, "MAGENTA_DYE"); + public final static MaterialTag ORANGE_DYE = getMaterialPre1_13("INK_SACK", 14, "ORANGE_DYE"); + public final static MaterialTag BONE_MEAL = getMaterialPre1_13("INK_SACK", 15, "BONE_MEAL"); // Tall Grass - public final static dMaterial SHRUB = getMaterialPre1_13("LONG_GRASS", 0, "SHRUB"); - public final static dMaterial TALL_GRASS = getMaterialPre1_13("LONG_GRASS", 1, "TALL_GRASS"); - public final static dMaterial FERN = getMaterialPre1_13("LONG_GRASS", 2, "FERN"); + public final static MaterialTag SHRUB = getMaterialPre1_13("LONG_GRASS", 0, "SHRUB"); + public final static MaterialTag TALL_GRASS = getMaterialPre1_13("LONG_GRASS", 1, "TALL_GRASS"); + public final static MaterialTag FERN = getMaterialPre1_13("LONG_GRASS", 2, "FERN"); // Flowers - public final static dMaterial POPPY = getMaterialPre1_13("RED_ROSE", 0, "POPPY"); - public final static dMaterial BLUE_ORCHID = getMaterialPre1_13("RED_ROSE", 1, "BLUE_ORCHID"); - public final static dMaterial ALLIUM = getMaterialPre1_13("RED_ROSE", 2, "ALLIUM"); - public final static dMaterial AZURE_BLUET = getMaterialPre1_13("RED_ROSE", 3, "AZURE_BLUET"); - public final static dMaterial RED_TULIP = getMaterialPre1_13("RED_ROSE", 4, "RED_TULIP"); - public final static dMaterial ORANGE_TULIP = getMaterialPre1_13("RED_ROSE", 5, "ORANGE_TULIP"); - public final static dMaterial WHITE_TULIP = getMaterialPre1_13("RED_ROSE", 6, "WHITE_TULIP"); - public final static dMaterial PINK_TULIP = getMaterialPre1_13("RED_ROSE", 7, "PINK_TULIP"); - public final static dMaterial OXEYE_DAISY = getMaterialPre1_13("RED_ROSE", 8, "OXEYE_DAISY"); + public final static MaterialTag POPPY = getMaterialPre1_13("RED_ROSE", 0, "POPPY"); + public final static MaterialTag BLUE_ORCHID = getMaterialPre1_13("RED_ROSE", 1, "BLUE_ORCHID"); + public final static MaterialTag ALLIUM = getMaterialPre1_13("RED_ROSE", 2, "ALLIUM"); + public final static MaterialTag AZURE_BLUET = getMaterialPre1_13("RED_ROSE", 3, "AZURE_BLUET"); + public final static MaterialTag RED_TULIP = getMaterialPre1_13("RED_ROSE", 4, "RED_TULIP"); + public final static MaterialTag ORANGE_TULIP = getMaterialPre1_13("RED_ROSE", 5, "ORANGE_TULIP"); + public final static MaterialTag WHITE_TULIP = getMaterialPre1_13("RED_ROSE", 6, "WHITE_TULIP"); + public final static MaterialTag PINK_TULIP = getMaterialPre1_13("RED_ROSE", 7, "PINK_TULIP"); + public final static MaterialTag OXEYE_DAISY = getMaterialPre1_13("RED_ROSE", 8, "OXEYE_DAISY"); // Double-tall Plants - public final static dMaterial SUNFLOWER = getMaterialPre1_13("DOUBLE_PLANT", 0, "SUNFLOWER"); - public final static dMaterial LILAC = getMaterialPre1_13("DOUBLE_PLANT", 1, "LILAC"); - public final static dMaterial DOUBLE_TALLGRASS = getMaterialPre1_13("DOUBLE_PLANT", 2, "DOUBLE_TALLGRASS"); - public final static dMaterial LARGE_FERN = getMaterialPre1_13("DOUBLE_PLANT", 3, "LARGE_FERN"); - public final static dMaterial ROSE_BUSH = getMaterialPre1_13("DOUBLE_PLANT", 4, "ROSE_BUSH"); - public final static dMaterial PEONY = getMaterialPre1_13("DOUBLE_PLANT", 5, "PEONY"); - public final static dMaterial DOUBLEPLANT_TOP = getMaterialPre1_13("DOUBLE_PLANT", 8, "DOUBLEPLANT_TOP"); + public final static MaterialTag SUNFLOWER = getMaterialPre1_13("DOUBLE_PLANT", 0, "SUNFLOWER"); + public final static MaterialTag LILAC = getMaterialPre1_13("DOUBLE_PLANT", 1, "LILAC"); + public final static MaterialTag DOUBLE_TALLGRASS = getMaterialPre1_13("DOUBLE_PLANT", 2, "DOUBLE_TALLGRASS"); + public final static MaterialTag LARGE_FERN = getMaterialPre1_13("DOUBLE_PLANT", 3, "LARGE_FERN"); + public final static MaterialTag ROSE_BUSH = getMaterialPre1_13("DOUBLE_PLANT", 4, "ROSE_BUSH"); + public final static MaterialTag PEONY = getMaterialPre1_13("DOUBLE_PLANT", 5, "PEONY"); + public final static MaterialTag DOUBLEPLANT_TOP = getMaterialPre1_13("DOUBLE_PLANT", 8, "DOUBLEPLANT_TOP"); // Potted Plants - public final static dMaterial EMPTY_POT = getMaterialPre1_13("FLOWER_POT", 0, "EMPTY_POT"); - public final static dMaterial POTTED_POPPY = getMaterialPre1_13("FLOWER_POT", 1, "POTTED_POPPY"); - public final static dMaterial POTTED_DAISY = getMaterialPre1_13("FLOWER_POT", 2, "POTTED_DAISY"); - public final static dMaterial POTTED_OAK_SAPLING = getMaterialPre1_13("FLOWER_POT", 3, "POTTED_OAK_SAPLING"); - public final static dMaterial POTTED_SPRUCE_SAPLING = getMaterialPre1_13("FLOWER_POT", 4, "POTTED_SPRUCE_SAPLING"); - public final static dMaterial POTTED_BIRCH_SAPLING = getMaterialPre1_13("FLOWER_POT", 5, "POTTED_BIRCH_SAPLING"); - public final static dMaterial POTTED_JUNGLE_SAPLING = getMaterialPre1_13("FLOWER_POT", 6, "POTTED_JUNGLE_SAPLING"); - public final static dMaterial POTTED_RED_MUSHROOM = getMaterialPre1_13("FLOWER_POT", 7, "POTTED_RED_MUSHROOM"); - public final static dMaterial POTTED_BROWN_MUSHROOM = getMaterialPre1_13("FLOWER_POT", 8, "POTTED_BROWN_MUSHROOM"); - public final static dMaterial POTTED_CACTUS = getMaterialPre1_13("FLOWER_POT", 9, "POTTED_CACTUS"); - public final static dMaterial POTTED_SHRUB = getMaterialPre1_13("FLOWER_POT", 10, "POTTED_SHRUB"); - public final static dMaterial POTTED_FERN = getMaterialPre1_13("FLOWER_POT", 11, "POTTED_FERN"); - public final static dMaterial POTTED_ACACIA_SAPLING = getMaterialPre1_13("FLOWER_POT", 12, "POTTED_ACACIA_SAPLING"); - public final static dMaterial POTTED_DARKOAK_SAPLING = getMaterialPre1_13("FLOWER_POT", 13, "POTTED_DARKOAK_SAPLING"); + public final static MaterialTag EMPTY_POT = getMaterialPre1_13("FLOWER_POT", 0, "EMPTY_POT"); + public final static MaterialTag POTTED_POPPY = getMaterialPre1_13("FLOWER_POT", 1, "POTTED_POPPY"); + public final static MaterialTag POTTED_DAISY = getMaterialPre1_13("FLOWER_POT", 2, "POTTED_DAISY"); + public final static MaterialTag POTTED_OAK_SAPLING = getMaterialPre1_13("FLOWER_POT", 3, "POTTED_OAK_SAPLING"); + public final static MaterialTag POTTED_SPRUCE_SAPLING = getMaterialPre1_13("FLOWER_POT", 4, "POTTED_SPRUCE_SAPLING"); + public final static MaterialTag POTTED_BIRCH_SAPLING = getMaterialPre1_13("FLOWER_POT", 5, "POTTED_BIRCH_SAPLING"); + public final static MaterialTag POTTED_JUNGLE_SAPLING = getMaterialPre1_13("FLOWER_POT", 6, "POTTED_JUNGLE_SAPLING"); + public final static MaterialTag POTTED_RED_MUSHROOM = getMaterialPre1_13("FLOWER_POT", 7, "POTTED_RED_MUSHROOM"); + public final static MaterialTag POTTED_BROWN_MUSHROOM = getMaterialPre1_13("FLOWER_POT", 8, "POTTED_BROWN_MUSHROOM"); + public final static MaterialTag POTTED_CACTUS = getMaterialPre1_13("FLOWER_POT", 9, "POTTED_CACTUS"); + public final static MaterialTag POTTED_SHRUB = getMaterialPre1_13("FLOWER_POT", 10, "POTTED_SHRUB"); + public final static MaterialTag POTTED_FERN = getMaterialPre1_13("FLOWER_POT", 11, "POTTED_FERN"); + public final static MaterialTag POTTED_ACACIA_SAPLING = getMaterialPre1_13("FLOWER_POT", 12, "POTTED_ACACIA_SAPLING"); + public final static MaterialTag POTTED_DARKOAK_SAPLING = getMaterialPre1_13("FLOWER_POT", 13, "POTTED_DARKOAK_SAPLING"); // Steps - public final static dMaterial STONE_SLAB = getMaterialPre1_13("STEP", 0, "STONE_SLAB"); - public final static dMaterial SANDSTONE_SLAB = getMaterialPre1_13("STEP", 1, "SANDSTONE_SLAB"); - public final static dMaterial WOODEN_SLAB = getMaterialPre1_13("STEP", 2, "WOODEN_SLAB"); - public final static dMaterial COBBLESTONE_SLAB = getMaterialPre1_13("STEP", 3, "COBBLESTONE_SLAB"); - public final static dMaterial BRICKS_SLAB = getMaterialPre1_13("STEP", 4, "BRICKS_SLAB"); - public final static dMaterial STONEBRICKS_SLAB = getMaterialPre1_13("STEP", 5, "STONEBRICKS_SLAB"); - public final static dMaterial NETHERBRICK_SLAB = getMaterialPre1_13("STEP", 6, "NETHERBRICK_SLAB"); - public final static dMaterial QUARTZ_SLAB = getMaterialPre1_13("STEP", 7, "QUARTZ_SLAB"); - public final static dMaterial STONE_SLAB_UP = getMaterialPre1_13("STEP", 8, "STONE_SLAB_UP"); - public final static dMaterial SANDSTONE_SLAB_UP = getMaterialPre1_13("STEP", 9, "SANDSTONE_SLAB_UP"); - public final static dMaterial WOODEN_SLAB_UP = getMaterialPre1_13("STEP", 10, "WOODEN_SLAB_UP"); - public final static dMaterial COBBLESTONE_SLAB_UP = getMaterialPre1_13("STEP", 11, "COBBLESTONE_SLAB_UP"); - public final static dMaterial BRICKS_SLAB_UP = getMaterialPre1_13("STEP", 12, "BRICKS_SLAB_UP"); - public final static dMaterial STONEBRICKS_SLAB_UP = getMaterialPre1_13("STEP", 13, "STONEBRICKS_SLAB_UP"); - public final static dMaterial NETHERBRICK_SLAB_UP = getMaterialPre1_13("STEP", 14, "NETHERBRICK_SLAB_UP"); - public final static dMaterial QUARTZ_SLAB_UP = getMaterialPre1_13("STEP", 15, "QUARTZ_SLAB_UP"); + public final static MaterialTag STONE_SLAB = getMaterialPre1_13("STEP", 0, "STONE_SLAB"); + public final static MaterialTag SANDSTONE_SLAB = getMaterialPre1_13("STEP", 1, "SANDSTONE_SLAB"); + public final static MaterialTag WOODEN_SLAB = getMaterialPre1_13("STEP", 2, "WOODEN_SLAB"); + public final static MaterialTag COBBLESTONE_SLAB = getMaterialPre1_13("STEP", 3, "COBBLESTONE_SLAB"); + public final static MaterialTag BRICKS_SLAB = getMaterialPre1_13("STEP", 4, "BRICKS_SLAB"); + public final static MaterialTag STONEBRICKS_SLAB = getMaterialPre1_13("STEP", 5, "STONEBRICKS_SLAB"); + public final static MaterialTag NETHERBRICK_SLAB = getMaterialPre1_13("STEP", 6, "NETHERBRICK_SLAB"); + public final static MaterialTag QUARTZ_SLAB = getMaterialPre1_13("STEP", 7, "QUARTZ_SLAB"); + public final static MaterialTag STONE_SLAB_UP = getMaterialPre1_13("STEP", 8, "STONE_SLAB_UP"); + public final static MaterialTag SANDSTONE_SLAB_UP = getMaterialPre1_13("STEP", 9, "SANDSTONE_SLAB_UP"); + public final static MaterialTag WOODEN_SLAB_UP = getMaterialPre1_13("STEP", 10, "WOODEN_SLAB_UP"); + public final static MaterialTag COBBLESTONE_SLAB_UP = getMaterialPre1_13("STEP", 11, "COBBLESTONE_SLAB_UP"); + public final static MaterialTag BRICKS_SLAB_UP = getMaterialPre1_13("STEP", 12, "BRICKS_SLAB_UP"); + public final static MaterialTag STONEBRICKS_SLAB_UP = getMaterialPre1_13("STEP", 13, "STONEBRICKS_SLAB_UP"); + public final static MaterialTag NETHERBRICK_SLAB_UP = getMaterialPre1_13("STEP", 14, "NETHERBRICK_SLAB_UP"); + public final static MaterialTag QUARTZ_SLAB_UP = getMaterialPre1_13("STEP", 15, "QUARTZ_SLAB_UP"); // Wood Steps - public final static dMaterial OAK_WOOD_SLAB = getMaterialPre1_13("WOOD_STEP", 0, "OAK_WOOD_SLAB"); - public final static dMaterial SPRUCE_WOOD_SLAB = getMaterialPre1_13("WOOD_STEP", 1, "SPRUCE_WOOD_SLAB"); - public final static dMaterial BIRCH_WOOD_SLAB = getMaterialPre1_13("WOOD_STEP", 2, "BIRCH_WOOD_SLAB"); - public final static dMaterial JUNGLE_WOOD_SLAB = getMaterialPre1_13("WOOD_STEP", 3, "JUNGLE_WOOD_SLAB"); - public final static dMaterial ACACIA_WOOD_SLAB = getMaterialPre1_13("WOOD_STEP", 4, "ACACIA_WOOD_SLAB"); - public final static dMaterial DARKOAK_WOOD_SLAB = getMaterialPre1_13("WOOD_STEP", 5, "DARKOAK_WOOD_SLAB"); - public final static dMaterial OAK_WOOD_SLAB_UP = getMaterialPre1_13("WOOD_STEP", 8, "OAK_WOOD_SLAB_UP"); - public final static dMaterial SPRUCE_WOOD_SLAB_UP = getMaterialPre1_13("WOOD_STEP", 9, "SPRUCE_WOOD_SLAB_UP"); - public final static dMaterial BIRCH_WOOD_SLAB_UP = getMaterialPre1_13("WOOD_STEP", 10, "BIRCH_WOOD_SLAB_UP"); - public final static dMaterial JUNGLE_WOOD_SLAB_UP = getMaterialPre1_13("WOOD_STEP", 11, "JUNGLE_WOOD_SLAB_UP"); - public final static dMaterial ACACIA_WOOD_SLAB_UP = getMaterialPre1_13("WOOD_STEP", 12, "ACACIA_WOOD_SLAB_UP"); - public final static dMaterial DARKOAK_WOOD_SLAB_UP = getMaterialPre1_13("WOOD_STEP", 13, "DARKOAK_WOOD_SLAB_UP"); + public final static MaterialTag OAK_WOOD_SLAB = getMaterialPre1_13("WOOD_STEP", 0, "OAK_WOOD_SLAB"); + public final static MaterialTag SPRUCE_WOOD_SLAB = getMaterialPre1_13("WOOD_STEP", 1, "SPRUCE_WOOD_SLAB"); + public final static MaterialTag BIRCH_WOOD_SLAB = getMaterialPre1_13("WOOD_STEP", 2, "BIRCH_WOOD_SLAB"); + public final static MaterialTag JUNGLE_WOOD_SLAB = getMaterialPre1_13("WOOD_STEP", 3, "JUNGLE_WOOD_SLAB"); + public final static MaterialTag ACACIA_WOOD_SLAB = getMaterialPre1_13("WOOD_STEP", 4, "ACACIA_WOOD_SLAB"); + public final static MaterialTag DARKOAK_WOOD_SLAB = getMaterialPre1_13("WOOD_STEP", 5, "DARKOAK_WOOD_SLAB"); + public final static MaterialTag OAK_WOOD_SLAB_UP = getMaterialPre1_13("WOOD_STEP", 8, "OAK_WOOD_SLAB_UP"); + public final static MaterialTag SPRUCE_WOOD_SLAB_UP = getMaterialPre1_13("WOOD_STEP", 9, "SPRUCE_WOOD_SLAB_UP"); + public final static MaterialTag BIRCH_WOOD_SLAB_UP = getMaterialPre1_13("WOOD_STEP", 10, "BIRCH_WOOD_SLAB_UP"); + public final static MaterialTag JUNGLE_WOOD_SLAB_UP = getMaterialPre1_13("WOOD_STEP", 11, "JUNGLE_WOOD_SLAB_UP"); + public final static MaterialTag ACACIA_WOOD_SLAB_UP = getMaterialPre1_13("WOOD_STEP", 12, "ACACIA_WOOD_SLAB_UP"); + public final static MaterialTag DARKOAK_WOOD_SLAB_UP = getMaterialPre1_13("WOOD_STEP", 13, "DARKOAK_WOOD_SLAB_UP"); // Double Steps - public final static dMaterial STONE_DOUBLESLAB = getMaterialPre1_13("DOUBLE_STEP", 0, "STONE_DOUBLESLAB"); - public final static dMaterial SANDSTONE_DOUBLESLAB = getMaterialPre1_13("DOUBLE_STEP", 1, "SANDSTONE_DOUBLESLAB"); - public final static dMaterial WOODEN_DOUBLESLAB = getMaterialPre1_13("DOUBLE_STEP", 2, "WOODEN_DOUBLESLAB"); - public final static dMaterial COBBLESTONE_DOUBLESLAB = getMaterialPre1_13("DOUBLE_STEP", 3, "COBBLESTONE_DOUBLESLAB"); - public final static dMaterial BRICKS_DOUBLESLAB = getMaterialPre1_13("DOUBLE_STEP", 4, "BRICKS_DOUBLESLAB"); - public final static dMaterial STONEBRICKS_DOUBLESLAB = getMaterialPre1_13("DOUBLE_STEP", 5, "STONEBRICKS_DOUBLESLAB"); - public final static dMaterial NETHERBRICK_DOUBLESLAB = getMaterialPre1_13("DOUBLE_STEP", 6, "NETHERBRICK_DOUBLESLAB"); - public final static dMaterial QUARTZ_DOUBLESLAB = getMaterialPre1_13("DOUBLE_STEP", 7, "QUARTZ_DOUBLESLAB"); - public final static dMaterial STONE_SLABBALL = getMaterialPre1_13("DOUBLE_STEP", 8, "STONE_SLABBALL"); - public final static dMaterial SANDSTONE_SLABBALL = getMaterialPre1_13("DOUBLE_STEP", 9, "SANDSTONE_SLABBALL"); + public final static MaterialTag STONE_DOUBLESLAB = getMaterialPre1_13("DOUBLE_STEP", 0, "STONE_DOUBLESLAB"); + public final static MaterialTag SANDSTONE_DOUBLESLAB = getMaterialPre1_13("DOUBLE_STEP", 1, "SANDSTONE_DOUBLESLAB"); + public final static MaterialTag WOODEN_DOUBLESLAB = getMaterialPre1_13("DOUBLE_STEP", 2, "WOODEN_DOUBLESLAB"); + public final static MaterialTag COBBLESTONE_DOUBLESLAB = getMaterialPre1_13("DOUBLE_STEP", 3, "COBBLESTONE_DOUBLESLAB"); + public final static MaterialTag BRICKS_DOUBLESLAB = getMaterialPre1_13("DOUBLE_STEP", 4, "BRICKS_DOUBLESLAB"); + public final static MaterialTag STONEBRICKS_DOUBLESLAB = getMaterialPre1_13("DOUBLE_STEP", 5, "STONEBRICKS_DOUBLESLAB"); + public final static MaterialTag NETHERBRICK_DOUBLESLAB = getMaterialPre1_13("DOUBLE_STEP", 6, "NETHERBRICK_DOUBLESLAB"); + public final static MaterialTag QUARTZ_DOUBLESLAB = getMaterialPre1_13("DOUBLE_STEP", 7, "QUARTZ_DOUBLESLAB"); + public final static MaterialTag STONE_SLABBALL = getMaterialPre1_13("DOUBLE_STEP", 8, "STONE_SLABBALL"); + public final static MaterialTag SANDSTONE_SLABBALL = getMaterialPre1_13("DOUBLE_STEP", 9, "SANDSTONE_SLABBALL"); // Wood Double Steps - public final static dMaterial OAK_WOOD_DOUBLESLAB = getMaterialPre1_13("WOOD_DOUBLE_STEP", 0, "OAK_WOOD_DOUBLESLAB"); - public final static dMaterial SPRUCE_WOOD_DOUBLESLAB = getMaterialPre1_13("WOOD_DOUBLE_STEP", 1, "SPRUCE_WOOD_DOUBLESLAB"); - public final static dMaterial BIRCH_WOOD_DOUBLESLAB = getMaterialPre1_13("WOOD_DOUBLE_STEP", 2, "BIRCH_WOOD_DOUBLESLAB"); - public final static dMaterial JUNGLE_WOOD_DOUBLESLAB = getMaterialPre1_13("WOOD_DOUBLE_STEP", 3, "JUNGLE_WOOD_DOUBLESLAB"); - public final static dMaterial ACACIA_WOOD_DOUBLESLAB = getMaterialPre1_13("WOOD_DOUBLE_STEP", 4, "ACACIA_WOOD_DOUBLESLAB"); - public final static dMaterial DARKOAK_WOOD_DOUBLESLAB = getMaterialPre1_13("WOOD_DOUBLE_STEP", 5, "DARKOAK_WOOD_DOUBLESLAB"); + public final static MaterialTag OAK_WOOD_DOUBLESLAB = getMaterialPre1_13("WOOD_DOUBLE_STEP", 0, "OAK_WOOD_DOUBLESLAB"); + public final static MaterialTag SPRUCE_WOOD_DOUBLESLAB = getMaterialPre1_13("WOOD_DOUBLE_STEP", 1, "SPRUCE_WOOD_DOUBLESLAB"); + public final static MaterialTag BIRCH_WOOD_DOUBLESLAB = getMaterialPre1_13("WOOD_DOUBLE_STEP", 2, "BIRCH_WOOD_DOUBLESLAB"); + public final static MaterialTag JUNGLE_WOOD_DOUBLESLAB = getMaterialPre1_13("WOOD_DOUBLE_STEP", 3, "JUNGLE_WOOD_DOUBLESLAB"); + public final static MaterialTag ACACIA_WOOD_DOUBLESLAB = getMaterialPre1_13("WOOD_DOUBLE_STEP", 4, "ACACIA_WOOD_DOUBLESLAB"); + public final static MaterialTag DARKOAK_WOOD_DOUBLESLAB = getMaterialPre1_13("WOOD_DOUBLE_STEP", 5, "DARKOAK_WOOD_DOUBLESLAB"); // Skull Items - public final static dMaterial SKELETON_SKULL = getMaterialPre1_13("SKULL_ITEM", 0, "SKELETON_SKULL"); - public final static dMaterial WITHERSKELETON_SKULL = getMaterialPre1_13("SKULL_ITEM", 1, "WITHERSKELETON_SKULL"); - public final static dMaterial ZOMBIE_SKULL = getMaterialPre1_13("SKULL_ITEM", 2, "ZOMBIE_SKULL"); - public final static dMaterial HUMAN_SKULL = getMaterialPre1_13("SKULL_ITEM", 3, "HUMAN_SKULL"); - public final static dMaterial CREEPER_SKULL = getMaterialPre1_13("SKULL_ITEM", 4, "CREEPER_SKULL"); + public final static MaterialTag SKELETON_SKULL = getMaterialPre1_13("SKULL_ITEM", 0, "SKELETON_SKULL"); + public final static MaterialTag WITHERSKELETON_SKULL = getMaterialPre1_13("SKULL_ITEM", 1, "WITHERSKELETON_SKULL"); + public final static MaterialTag ZOMBIE_SKULL = getMaterialPre1_13("SKULL_ITEM", 2, "ZOMBIE_SKULL"); + public final static MaterialTag HUMAN_SKULL = getMaterialPre1_13("SKULL_ITEM", 3, "HUMAN_SKULL"); + public final static MaterialTag CREEPER_SKULL = getMaterialPre1_13("SKULL_ITEM", 4, "CREEPER_SKULL"); // Monster Eggs - public final static dMaterial SKELETON_EGG = getMaterialPre1_13("MONSTER_EGG", 51, "SKELETON_EGG"); + public final static MaterialTag SKELETON_EGG = getMaterialPre1_13("MONSTER_EGG", 51, "SKELETON_EGG"); // Fish - public final static dMaterial COOKED_FISH = getMaterialPre1_13("COOKED_FISH", 0, "COOKED_FISH"); - public final static dMaterial COOKED_SALMON = getMaterialPre1_13("COOKED_FISH", 1, "COOKED_SALMON"); - public final static dMaterial COOKED_CLOWNFISH = getMaterialPre1_13("COOKED_FISH", 2, "COOKED_CLOWNFISH"); - public final static dMaterial COOKED_PUFFERFISH = getMaterialPre1_13("COOKED_FISH", 3, "COOKED_PUFFERFISH"); - public final static dMaterial RAW_FISH = getMaterialPre1_13("RAW_FISH", 0, "RAW_FISH"); - public final static dMaterial RAW_SALMON = getMaterialPre1_13("RAW_FISH", 1, "RAW_SALMON"); - public final static dMaterial RAW_CLOWNFISH = getMaterialPre1_13("RAW_FISH", 2, "RAW_CLOWNFISH"); - public final static dMaterial RAW_PUFFERFISH = getMaterialPre1_13("RAW_FISH", 3, "RAW_PUFFERFISH"); + public final static MaterialTag COOKED_FISH = getMaterialPre1_13("COOKED_FISH", 0, "COOKED_FISH"); + public final static MaterialTag COOKED_SALMON = getMaterialPre1_13("COOKED_FISH", 1, "COOKED_SALMON"); + public final static MaterialTag COOKED_CLOWNFISH = getMaterialPre1_13("COOKED_FISH", 2, "COOKED_CLOWNFISH"); + public final static MaterialTag COOKED_PUFFERFISH = getMaterialPre1_13("COOKED_FISH", 3, "COOKED_PUFFERFISH"); + public final static MaterialTag RAW_FISH = getMaterialPre1_13("RAW_FISH", 0, "RAW_FISH"); + public final static MaterialTag RAW_SALMON = getMaterialPre1_13("RAW_FISH", 1, "RAW_SALMON"); + public final static MaterialTag RAW_CLOWNFISH = getMaterialPre1_13("RAW_FISH", 2, "RAW_CLOWNFISH"); + public final static MaterialTag RAW_PUFFERFISH = getMaterialPre1_13("RAW_FISH", 3, "RAW_PUFFERFISH"); // One-Offs (Don't have their own group) - public final static dMaterial CHARCOAL = getMaterialPre1_13("COAL", 1, "CHARCOAL"); - public final static dMaterial RED_SAND = getMaterialPre1_13("SAND", 1, "RED_SAND"); - public final static dMaterial COARSE_DIRT = getMaterialPre1_13("DIRT", 1, "COARSE_DIRT"); - public final static dMaterial PODZOL = getMaterialPre1_13("DIRT", 2, "PODZOL"); - public final static dMaterial MOSSY_COBBLE_WALL = getMaterialPre1_13("COBBLE_WALL", 1, "MOSSY_COBBLE_WALL"); + public final static MaterialTag CHARCOAL = getMaterialPre1_13("COAL", 1, "CHARCOAL"); + public final static MaterialTag RED_SAND = getMaterialPre1_13("SAND", 1, "RED_SAND"); + public final static MaterialTag COARSE_DIRT = getMaterialPre1_13("DIRT", 1, "COARSE_DIRT"); + public final static MaterialTag PODZOL = getMaterialPre1_13("DIRT", 2, "PODZOL"); + public final static MaterialTag MOSSY_COBBLE_WALL = getMaterialPre1_13("COBBLE_WALL", 1, "MOSSY_COBBLE_WALL"); // Stone // GRANITE, POLISHED_GRANITE, DIORITE, POLISHED_DIORITE, ANDESITE, POLISHED_ADESITE - public final static dMaterial GRANITE = getMaterialPre1_13("STONE", 1, "GRANITE"); - public final static dMaterial POLISHED_GRANITE = getMaterialPre1_13("STONE", 2, "POLISHED_GRANITE"); - public final static dMaterial DIORITE = getMaterialPre1_13("STONE", 3, "DIORITE"); - public final static dMaterial POLISHED_DIORITE = getMaterialPre1_13("STONE", 4, "POLISHED_DIORITE"); - public final static dMaterial ANDESITE = getMaterialPre1_13("STONE", 5, "ANDESITE"); - public final static dMaterial POLISHED_ANDESITE = getMaterialPre1_13("STONE", 6, "POLISHED_ANDESITE"); + public final static MaterialTag GRANITE = getMaterialPre1_13("STONE", 1, "GRANITE"); + public final static MaterialTag POLISHED_GRANITE = getMaterialPre1_13("STONE", 2, "POLISHED_GRANITE"); + public final static MaterialTag DIORITE = getMaterialPre1_13("STONE", 3, "DIORITE"); + public final static MaterialTag POLISHED_DIORITE = getMaterialPre1_13("STONE", 4, "POLISHED_DIORITE"); + public final static MaterialTag ANDESITE = getMaterialPre1_13("STONE", 5, "ANDESITE"); + public final static MaterialTag POLISHED_ANDESITE = getMaterialPre1_13("STONE", 6, "POLISHED_ANDESITE"); // Bed - public final static dMaterial WHITE_BED = getMaterialPre1_13("BED", 0, "WHITE_BED"); - public final static dMaterial ORANGE_BED = getMaterialPre1_13("BED", 1, "ORANGE_BED"); - public final static dMaterial MAGENTA_BED = getMaterialPre1_13("BED", 2, "MAGENTA_BED"); - public final static dMaterial LIGHT_BLUE_BED = getMaterialPre1_13("BED", 3, "LIGHT_BLUE_BED"); - public final static dMaterial YELLOW_BED = getMaterialPre1_13("BED", 4, "YELLOW_BED"); - public final static dMaterial LIME_BED = getMaterialPre1_13("BED", 5, "LIME_BED"); - public final static dMaterial PINK_BED = getMaterialPre1_13("BED", 6, "PINK_BED"); - public final static dMaterial GRAY_BED = getMaterialPre1_13("BED", 7, "GRAY_BED"); - public final static dMaterial LIGHT_GRAY_BED = getMaterialPre1_13("BED", 8, "LIGHT_GRAY_BED"); - public final static dMaterial CYAN_BED = getMaterialPre1_13("BED", 9, "CYAN_BED"); - public final static dMaterial PURPLE_BED = getMaterialPre1_13("BED", 10, "PURPLE_BED"); - public final static dMaterial BLUE_BED = getMaterialPre1_13("BED", 11, "BLUE_BED"); - public final static dMaterial BROWN_BED = getMaterialPre1_13("BED", 12, "BROWN_BED"); - public final static dMaterial GREEN_BED = getMaterialPre1_13("BED", 13, "GREEN_BED"); - public final static dMaterial RED_BED = getMaterialPre1_13("BED", 14, "RED_BED"); - public final static dMaterial BLACK_BED = getMaterialPre1_13("BED", 15, "BLACK_BED"); + public final static MaterialTag WHITE_BED = getMaterialPre1_13("BED", 0, "WHITE_BED"); + public final static MaterialTag ORANGE_BED = getMaterialPre1_13("BED", 1, "ORANGE_BED"); + public final static MaterialTag MAGENTA_BED = getMaterialPre1_13("BED", 2, "MAGENTA_BED"); + public final static MaterialTag LIGHT_BLUE_BED = getMaterialPre1_13("BED", 3, "LIGHT_BLUE_BED"); + public final static MaterialTag YELLOW_BED = getMaterialPre1_13("BED", 4, "YELLOW_BED"); + public final static MaterialTag LIME_BED = getMaterialPre1_13("BED", 5, "LIME_BED"); + public final static MaterialTag PINK_BED = getMaterialPre1_13("BED", 6, "PINK_BED"); + public final static MaterialTag GRAY_BED = getMaterialPre1_13("BED", 7, "GRAY_BED"); + public final static MaterialTag LIGHT_GRAY_BED = getMaterialPre1_13("BED", 8, "LIGHT_GRAY_BED"); + public final static MaterialTag CYAN_BED = getMaterialPre1_13("BED", 9, "CYAN_BED"); + public final static MaterialTag PURPLE_BED = getMaterialPre1_13("BED", 10, "PURPLE_BED"); + public final static MaterialTag BLUE_BED = getMaterialPre1_13("BED", 11, "BLUE_BED"); + public final static MaterialTag BROWN_BED = getMaterialPre1_13("BED", 12, "BROWN_BED"); + public final static MaterialTag GREEN_BED = getMaterialPre1_13("BED", 13, "GREEN_BED"); + public final static MaterialTag RED_BED = getMaterialPre1_13("BED", 14, "RED_BED"); + public final static MaterialTag BLACK_BED = getMaterialPre1_13("BED", 15, "BLACK_BED"); // -- Version Specific -- // Concrete - public final static dMaterial WHITE_CONCRETE = getMaterial1_12("CONCRETE", 0, "WHITE_CONCRETE"); - public final static dMaterial ORANGE_CONCRETE = getMaterial1_12("CONCRETE", 1, "ORANGE_CONCRETE"); - public final static dMaterial MAGENTA_CONCRETE = getMaterial1_12("CONCRETE", 2, "MAGENTA_CONCRETE"); - public final static dMaterial LIGHT_BLUE_CONCRETE = getMaterial1_12("CONCRETE", 3, "LIGHT_BLUE_CONCRETE"); - public final static dMaterial YELLOW_CONCRETE = getMaterial1_12("CONCRETE", 4, "YELLOW_CONCRETE"); - public final static dMaterial LIME_CONCRETE = getMaterial1_12("CONCRETE", 5, "LIME_CONCRETE"); - public final static dMaterial PINK_CONCRETE = getMaterial1_12("CONCRETE", 6, "PINK_CONCRETE"); - public final static dMaterial GRAY_CONCRETE = getMaterial1_12("CONCRETE", 7, "GRAY_CONCRETE"); - public final static dMaterial LIGHT_GRAY_CONCRETE = getMaterial1_12("CONCRETE", 8, "LIGHT_GRAY_CONCRETE"); - public final static dMaterial CYAN_CONCRETE = getMaterial1_12("CONCRETE", 9, "CYAN_CONCRETE"); - public final static dMaterial PURPLE_CONCRETE = getMaterial1_12("CONCRETE", 10, "PURPLE_CONCRETE"); - public final static dMaterial BLUE_CONCRETE = getMaterial1_12("CONCRETE", 11, "BLUE_CONCRETE"); - public final static dMaterial BROWN_CONCRETE = getMaterial1_12("CONCRETE", 12, "BROWN_CONCRETE"); - public final static dMaterial GREEN_CONCRETE = getMaterial1_12("CONCRETE", 13, "GREEN_CONCRETE"); - public final static dMaterial RED_CONCRETE = getMaterial1_12("CONCRETE", 14, "RED_CONCRETE"); - public final static dMaterial BLACK_CONCRETE = getMaterial1_12("CONCRETE", 15, "BLACK_CONCRETE"); + public final static MaterialTag WHITE_CONCRETE = getMaterial1_12("CONCRETE", 0, "WHITE_CONCRETE"); + public final static MaterialTag ORANGE_CONCRETE = getMaterial1_12("CONCRETE", 1, "ORANGE_CONCRETE"); + public final static MaterialTag MAGENTA_CONCRETE = getMaterial1_12("CONCRETE", 2, "MAGENTA_CONCRETE"); + public final static MaterialTag LIGHT_BLUE_CONCRETE = getMaterial1_12("CONCRETE", 3, "LIGHT_BLUE_CONCRETE"); + public final static MaterialTag YELLOW_CONCRETE = getMaterial1_12("CONCRETE", 4, "YELLOW_CONCRETE"); + public final static MaterialTag LIME_CONCRETE = getMaterial1_12("CONCRETE", 5, "LIME_CONCRETE"); + public final static MaterialTag PINK_CONCRETE = getMaterial1_12("CONCRETE", 6, "PINK_CONCRETE"); + public final static MaterialTag GRAY_CONCRETE = getMaterial1_12("CONCRETE", 7, "GRAY_CONCRETE"); + public final static MaterialTag LIGHT_GRAY_CONCRETE = getMaterial1_12("CONCRETE", 8, "LIGHT_GRAY_CONCRETE"); + public final static MaterialTag CYAN_CONCRETE = getMaterial1_12("CONCRETE", 9, "CYAN_CONCRETE"); + public final static MaterialTag PURPLE_CONCRETE = getMaterial1_12("CONCRETE", 10, "PURPLE_CONCRETE"); + public final static MaterialTag BLUE_CONCRETE = getMaterial1_12("CONCRETE", 11, "BLUE_CONCRETE"); + public final static MaterialTag BROWN_CONCRETE = getMaterial1_12("CONCRETE", 12, "BROWN_CONCRETE"); + public final static MaterialTag GREEN_CONCRETE = getMaterial1_12("CONCRETE", 13, "GREEN_CONCRETE"); + public final static MaterialTag RED_CONCRETE = getMaterial1_12("CONCRETE", 14, "RED_CONCRETE"); + public final static MaterialTag BLACK_CONCRETE = getMaterial1_12("CONCRETE", 15, "BLACK_CONCRETE"); // Concrete Powder - public final static dMaterial WHITE_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 0, "WHITE_CONCRETE_POWDER"); - public final static dMaterial ORANGE_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 1, "ORANGE_CONCRETE_POWDER"); - public final static dMaterial MAGENTA_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 2, "MAGENTA_CONCRETE_POWDER"); - public final static dMaterial LIGHT_BLUE_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 3, "LIGHT_BLUE_CONCRETE_POWDER"); - public final static dMaterial YELLOW_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 4, "YELLOW_CONCRETE_POWDER"); - public final static dMaterial LIME_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 5, "LIME_CONCRETE_POWDER"); - public final static dMaterial PINK_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 6, "PINK_CONCRETE_POWDER"); - public final static dMaterial GRAY_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 7, "GRAY_CONCRETE_POWDER"); - public final static dMaterial LIGHT_GRAY_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 8, "LIGHT_GRAY_CONCRETE_POWDER"); - public final static dMaterial CYAN_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 9, "CYAN_CONCRETE_POWDER"); - public final static dMaterial PURPLE_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 10, "PURPLE_CONCRETE_POWDER"); - public final static dMaterial BLUE_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 11, "BLUE_CONCRETE_POWDER"); - public final static dMaterial BROWN_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 12, "BROWN_CONCRETE_POWDER"); - public final static dMaterial GREEN_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 13, "GREEN_CONCRETE_POWDER"); - public final static dMaterial RED_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 14, "RED_CONCRETE_POWDER"); - public final static dMaterial BLACK_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 15, "BLACK_CONCRETE_POWDER"); + public final static MaterialTag WHITE_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 0, "WHITE_CONCRETE_POWDER"); + public final static MaterialTag ORANGE_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 1, "ORANGE_CONCRETE_POWDER"); + public final static MaterialTag MAGENTA_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 2, "MAGENTA_CONCRETE_POWDER"); + public final static MaterialTag LIGHT_BLUE_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 3, "LIGHT_BLUE_CONCRETE_POWDER"); + public final static MaterialTag YELLOW_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 4, "YELLOW_CONCRETE_POWDER"); + public final static MaterialTag LIME_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 5, "LIME_CONCRETE_POWDER"); + public final static MaterialTag PINK_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 6, "PINK_CONCRETE_POWDER"); + public final static MaterialTag GRAY_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 7, "GRAY_CONCRETE_POWDER"); + public final static MaterialTag LIGHT_GRAY_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 8, "LIGHT_GRAY_CONCRETE_POWDER"); + public final static MaterialTag CYAN_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 9, "CYAN_CONCRETE_POWDER"); + public final static MaterialTag PURPLE_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 10, "PURPLE_CONCRETE_POWDER"); + public final static MaterialTag BLUE_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 11, "BLUE_CONCRETE_POWDER"); + public final static MaterialTag BROWN_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 12, "BROWN_CONCRETE_POWDER"); + public final static MaterialTag GREEN_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 13, "GREEN_CONCRETE_POWDER"); + public final static MaterialTag RED_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 14, "RED_CONCRETE_POWDER"); + public final static MaterialTag BLACK_CONCRETE_POWDER = getMaterial1_12("CONCRETE_POWDER", 15, "BLACK_CONCRETE_POWDER"); // Version checks for version-specific materials - public static dMaterial getMaterial1_12(String material, int data, String name) { + public static MaterialTag getMaterial1_12(String material, int data, String name) { if (NMSHandler.getVersion() == NMSVersion.v1_12_R1) { - return new dMaterial(Material.valueOf(material), data).forceIdentifyAs(name); + return new MaterialTag(Material.valueOf(material), data).forceIdentifyAs(name); } else if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13_R2)) { if (all_dMaterials == null) { all_dMaterials = new HashMap<>(); } - all_dMaterials.put(name, new dMaterial(getBukkitMaterial(material), data)); + all_dMaterials.put(name, new MaterialTag(getBukkitMaterial(material), data)); } return null; } - public static dMaterial getMaterialPre1_13(String material, int data, String name) { + public static MaterialTag getMaterialPre1_13(String material, int data, String name) { if (NMSHandler.getVersion().isAtMost(NMSVersion.v1_12_R1)) { - return new dMaterial(Material.valueOf(material), data).forceIdentifyAs(name); + return new MaterialTag(Material.valueOf(material), data).forceIdentifyAs(name); } else { if (all_dMaterials == null) { all_dMaterials = new HashMap<>(); } - all_dMaterials.put(name, new dMaterial(getBukkitMaterial(material), data)); + all_dMaterials.put(name, new MaterialTag(getBukkitMaterial(material), data)); } return null; } @@ -504,22 +504,22 @@ public static Material getLegacyMaterial(int id) { return MATERIAL_BY_LEGACY_ID.get(id); } - public static Map> material_varieties = new HashMap<>(); + public static Map> material_varieties = new HashMap<>(); - public static Map all_dMaterials; + public static Map all_dMaterials; /** - * Registers a dMaterial as a 'variety'. Upon construction of a dMaterial, this + * Registers a MaterialTag as a 'variety'. Upon construction of a MaterialTag, this * registry will be checked to see if a variety can be used instead of the traditional * enum/data format. *

- * dMaterials in this list should probably 'forceIdentifyAs'. + * MaterialTags in this list should probably 'forceIdentifyAs'. * - * @param material the dMaterial variety - * @return the dMaterial registered + * @param material the MaterialTag variety + * @return the MaterialTag registered */ - public static dMaterial registerVariety(dMaterial material) { - Map entry; + public static MaterialTag registerVariety(MaterialTag material) { + Map entry; // Get any existing entries for the Material, or make a new HashMap for entries. if (material_varieties.containsKey(material.getMaterial())) { entry = material_varieties.get(material.getMaterial()); @@ -529,7 +529,7 @@ public static dMaterial registerVariety(dMaterial material) { } // Put in new entry entry.put((int) material.getData(), material); - // Return the dMaterial + // Return the MaterialTag material_varieties.put(material.getMaterial(), entry); if (all_dMaterials == null) { all_dMaterials = new HashMap<>(); @@ -543,10 +543,10 @@ public static void _initialize() { if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13_R2)) { return; } - for (dMaterials material : dMaterials.values()) { + for (MaterialTags material : MaterialTags.values()) { try { Field field = OldMaterialsHelper.class.getField(material.name()); - dMaterial mat = (dMaterial) field.get(null); + MaterialTag mat = (MaterialTag) field.get(null); if (mat != null) { registerVariety(mat); } @@ -558,25 +558,25 @@ public static void _initialize() { } /** - * Gets a dMaterial from a bukkit Material. + * Gets a MaterialTag from a bukkit Material. * * @param material the bukkit Material - * @return a dMaterial representation of the Material + * @return a MaterialTag representation of the Material */ - public static dMaterial getMaterialFrom(Material material) { + public static MaterialTag getMaterialFrom(Material material) { return getMaterialFrom(material, 0); } /** - * Gets a dMaterial from a Bukkit Material/Data. dMaterials can identify + * Gets a MaterialTag from a Bukkit Material/Data. MaterialTags can identify * as something more straight-forward than the traditional material,data format. - * Example: wool,1 would return the ORANGE_WOOL dMaterial. + * Example: wool,1 would return the ORANGE_WOOL MaterialTag. * * @param material the base Bukkit material * @param data the datavalue to use - * @return a dMaterial representation of the input Bukkit material + * @return a MaterialTag representation of the input Bukkit material */ - public static dMaterial getMaterialFrom(Material material, int data) { + public static MaterialTag getMaterialFrom(Material material, int data) { if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13_R2)) { if (data != 0) { // upvert old data valued materials @@ -588,11 +588,11 @@ public static dMaterial getMaterialFrom(Material material, int data) { if (material.isLegacy()) { material = Bukkit.getUnsafe().fromLegacy(material); } - return new dMaterial(material); + return new MaterialTag(material); } if (material_varieties.containsKey(material) && material_varieties.get(material).containsKey(data)) { return material_varieties.get(material).get(data); } - return new dMaterial(material, data); + return new MaterialTag(material, data); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/debugging/DebugSubmit.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/debugging/DebugSubmit.java index 499f877885..a30b4c062b 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/debugging/DebugSubmit.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/debugging/DebugSubmit.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.utilities.debugging; import com.denizenscript.denizen.Denizen; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizencore.DenizenCore; import com.denizenscript.denizencore.objects.core.DurationTag; @@ -89,7 +89,7 @@ public void run() { + "\nActive Plugins (" + pluginCount + "): " + pluginlist.substring(0, pluginlist.length() - 2) + "\nLoaded Worlds (" + worldCount + "): " + worldlist.substring(0, worldlist.length() - 2) + "\nOnline Players (" + playerCount + "): " + playerlist.substring(0, playerlist.length() - 2) - + "\nOffline Players: " + (dPlayer.getAllPlayers().size() - playerCount) + + "\nOffline Players: " + (PlayerTag.getAllPlayers().size() - playerCount) + "\nMode: " + (Bukkit.getServer().getOnlineMode() ? "online" : "offline") + (bungee ? " (BungeeCoord)" : "") + "\n\n") + recording) .getBytes(StandardCharsets.UTF_8)); diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/entity/DenizenEntityType.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/entity/DenizenEntityType.java index 2217b59b49..faacf5b46f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/entity/DenizenEntityType.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/entity/DenizenEntityType.java @@ -6,7 +6,7 @@ import com.denizenscript.denizen.nms.enums.CustomEntityType; import com.denizenscript.denizen.nms.interfaces.CustomEntity; import com.denizenscript.denizen.nms.interfaces.CustomEntityHelper; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ItemTag; import com.denizenscript.denizencore.objects.Mechanism; import com.denizenscript.denizencore.utilities.CoreUtilities; import org.bukkit.Location; @@ -83,8 +83,8 @@ public Entity spawnNewEntity(Location location, ArrayList mechanisms, if (name.equals("DROPPED_ITEM")) { ItemStack itemStack = new ItemStack(Material.STONE); for (Mechanism mechanism : mechanisms) { - if (mechanism.matches("item") && mechanism.requireObject(dItem.class)) { - itemStack = mechanism.valueAsType(dItem.class).getItemStack(); + if (mechanism.matches("item") && mechanism.requireObject(ItemTag.class)) { + itemStack = mechanism.valueAsType(ItemTag.class).getItemStack(); break; } } @@ -119,8 +119,8 @@ else if (mechanism.matches("skin")) { case ITEM_PROJECTILE: ItemStack itemStack = new ItemStack(Material.STONE); for (Mechanism mechanism : mechanisms) { - if (mechanism.matches("item") && mechanism.requireObject(dItem.class)) { - itemStack = mechanism.valueAsType(dItem.class).getItemStack(); + if (mechanism.matches("item") && mechanism.requireObject(ItemTag.class)) { + itemStack = mechanism.valueAsType(ItemTag.class).getItemStack(); } } return customEntityHelper.spawnItemProjectile(location, itemStack); diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/entity/LlamaHelper.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/entity/LlamaHelper.java index dac1e6e00a..4c24f55f6a 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/entity/LlamaHelper.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/entity/LlamaHelper.java @@ -1,15 +1,15 @@ package com.denizenscript.denizen.utilities.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import org.bukkit.entity.Llama; public class LlamaHelper { - public static String llamaColorName(dEntity entity) { + public static String llamaColorName(EntityTag entity) { return ((Llama) entity.getBukkitEntity()).getColor().name(); } - public static void setLlamaColor(dEntity entity, String color) { + public static void setLlamaColor(EntityTag entity, String color) { ((Llama) entity.getBukkitEntity()).setColor(Llama.Color.valueOf(color.toUpperCase())); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/entity/ParrotHelper.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/entity/ParrotHelper.java index 3da2770d7b..7334cea969 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/entity/ParrotHelper.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/entity/ParrotHelper.java @@ -1,16 +1,16 @@ package com.denizenscript.denizen.utilities.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizencore.objects.Mechanism; import org.bukkit.entity.Parrot; public class ParrotHelper { - public static String parrotColor(dEntity colored) { + public static String parrotColor(EntityTag colored) { return ((Parrot) colored.getBukkitEntity()).getVariant().name(); } - public static void setParrotColor(dEntity colored, Mechanism mechanism) { + public static void setParrotColor(EntityTag colored, Mechanism mechanism) { if (mechanism.getValue().matchesEnum(Parrot.Variant.values())) { ((Parrot) colored.getBukkitEntity()) .setVariant(Parrot.Variant.valueOf(mechanism.getValue().asString().toUpperCase())); diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/entity/ShulkerHelper.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/entity/ShulkerHelper.java index 6c9b085b92..3528b78f19 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/entity/ShulkerHelper.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/entity/ShulkerHelper.java @@ -1,16 +1,16 @@ package com.denizenscript.denizen.utilities.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import org.bukkit.DyeColor; import org.bukkit.entity.Shulker; public class ShulkerHelper { - public static DyeColor getColor(dEntity shulker) { + public static DyeColor getColor(EntityTag shulker) { return ((Shulker) shulker.getBukkitEntity()).getColor(); } - public static void setColor(dEntity shulker, DyeColor color) { + public static void setColor(EntityTag shulker, DyeColor color) { ((Shulker) shulker.getBukkitEntity()).setColor(color); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/entity/SpawnEntityHelper.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/entity/SpawnEntityHelper.java index 5965209b8e..6cebf5a673 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/entity/SpawnEntityHelper.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/entity/SpawnEntityHelper.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.utilities.entity; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.scripts.containers.core.EntityScriptHelper; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.objects.Mechanism; @@ -25,9 +25,9 @@ public void accept(Entity bukkitEntity) { if (scriptName != null) { EntityScriptHelper.setEntityScript(bukkitEntity, scriptName); } - dEntity entity = new dEntity(bukkitEntity); + EntityTag entity = new EntityTag(bukkitEntity); for (Mechanism mechanism : new ArrayList<>(mechanisms)) { - if (dEntity.earlyValidMechanisms.contains(CoreUtilities.toLowerCase(mechanism.getName()))) { + if (EntityTag.earlyValidMechanisms.contains(CoreUtilities.toLowerCase(mechanism.getName()))) { entity.safeAdjust(new Mechanism(new ElementTag(mechanism.getName()), mechanism.getValue(), mechanism.context)); mechanisms.remove(mechanism); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/DenizenMapRenderer.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/DenizenMapRenderer.java index 59329ed9bc..e00357dcbf 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/DenizenMapRenderer.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/DenizenMapRenderer.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.utilities.maps; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizencore.utilities.debugging.Debug; import org.bukkit.entity.Player; @@ -89,7 +89,7 @@ public void render(MapView mapView, MapCanvas mapCanvas, Player player) { } } UUID uuid = player.getUniqueId(); - dPlayer p = dPlayer.mirrorBukkitPlayer(player); + PlayerTag p = PlayerTag.mirrorBukkitPlayer(player); for (MapObject object : mapObjects) { if (autoUpdate) { object.lastMap = mapView; diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/MapAnimatedImage.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/MapAnimatedImage.java index 8f21a0115e..daf4fd2cb2 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/MapAnimatedImage.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/MapAnimatedImage.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.utilities.maps; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import org.bukkit.map.MapCanvas; import org.bukkit.map.MapView; @@ -17,7 +17,7 @@ public MapAnimatedImage(String xTag, String yTag, String visibilityTag, boolean } @Override - public void render(MapView mapView, MapCanvas mapCanvas, dPlayer player, UUID uuid) { + public void render(MapView mapView, MapCanvas mapCanvas, PlayerTag player, UUID uuid) { super.render(mapView, mapCanvas, player, uuid); if (observer == null) { observer = new AnimationObserver(this); diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/MapCursor.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/MapCursor.java index f0e45fbc93..cdc44c93d5 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/MapCursor.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/MapCursor.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.utilities.maps; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.objects.ArgumentHelper; import org.bukkit.map.MapCanvas; import org.bukkit.map.MapView; @@ -21,11 +21,11 @@ public MapCursor(String xTag, String yTag, String visibilityTag, boolean debug, this.typeTag = typeTag; } - public byte getDirection(dPlayer player) { + public byte getDirection(PlayerTag player) { return yawToDirection(ArgumentHelper.getDoubleFrom(tag(directionTag, player))); } - public org.bukkit.map.MapCursor.Type getType(dPlayer player) { + public org.bukkit.map.MapCursor.Type getType(PlayerTag player) { return org.bukkit.map.MapCursor.Type.valueOf(tag(typeTag, player).toUpperCase()); } @@ -34,7 +34,7 @@ private byte yawToDirection(double yaw) { } @Override - public void update(dPlayer player, UUID uuid) { + public void update(PlayerTag player, UUID uuid) { super.update(player, uuid); if (cursors.containsKey(uuid)) { org.bukkit.map.MapCursor cursor = cursors.get(uuid); @@ -56,7 +56,7 @@ public Map getSaveData() { } @Override - public void render(MapView mapView, MapCanvas mapCanvas, dPlayer player, UUID uuid) { + public void render(MapView mapView, MapCanvas mapCanvas, PlayerTag player, UUID uuid) { org.bukkit.map.MapCursor cursor = new org.bukkit.map.MapCursor((byte) getX(player, uuid), (byte) getY(player, uuid), getDirection(player), getType(player).getValue(), isVisibleTo(player, uuid)); diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/MapDot.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/MapDot.java index 8e48659952..e5625e35b4 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/MapDot.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/MapDot.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.utilities.maps; -import com.denizenscript.denizen.objects.dColor; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.ColorTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizencore.objects.ArgumentHelper; import org.bukkit.Color; import org.bukkit.map.MapCanvas; @@ -32,11 +32,11 @@ public Map getSaveData() { } @Override - public void render(MapView mapView, MapCanvas mapCanvas, dPlayer player, UUID uuid) { + public void render(MapView mapView, MapCanvas mapCanvas, PlayerTag player, UUID uuid) { int baseX = getX(player, uuid); int baseY = getY(player, uuid); int radius = (int) ArgumentHelper.getDoubleFrom(tag(radiusTag, player)); - Color color = dColor.valueOf(tag(colorTag, player)).getColor(); + Color color = ColorTag.valueOf(tag(colorTag, player)).getColor(); for (int x = -radius; x < radius; x++) { int finalX = baseX + x; if (finalX >= 128) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/MapImage.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/MapImage.java index ed3ad3b9ca..51b21fea55 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/MapImage.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/MapImage.java @@ -1,7 +1,7 @@ package com.denizenscript.denizen.utilities.maps; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import org.bukkit.map.MapCanvas; import org.bukkit.map.MapPalette; import org.bukkit.map.MapView; @@ -59,7 +59,7 @@ public Map getSaveData() { } @Override - public void render(MapView mapView, MapCanvas mapCanvas, dPlayer player, UUID uuid) { + public void render(MapView mapView, MapCanvas mapCanvas, PlayerTag player, UUID uuid) { if (actualFile == null) { String file = fileTag; actualFile = DenizenMapManager.getActualFile(file); 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 8afa2343de..eedcd1ad6d 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 @@ -1,6 +1,6 @@ package com.denizenscript.denizen.utilities.maps; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.tags.BukkitTagContext; import com.denizenscript.denizencore.objects.ArgumentHelper; import com.denizenscript.denizencore.tags.TagManager; @@ -32,13 +32,13 @@ public MapObject(String xTag, String yTag, String visibilityTag, boolean debug) this.debug = debug; } - public void update(dPlayer player, UUID uuid) { + public void update(PlayerTag player, UUID uuid) { currentX.put(uuid, getX(player, uuid)); currentY.put(uuid, getY(player, uuid)); currentVisibility.put(uuid, ArgumentHelper.getBooleanFrom(tag(visibilityTag, player))); } - public int getX(dPlayer player, UUID uuid) { + public int getX(PlayerTag player, UUID uuid) { //if (!currentX.containsKey(uuid)) { int x = (int) ArgumentHelper.getDoubleFrom(tag(xTag, player)); currentX.put(uuid, x); @@ -51,7 +51,7 @@ public int getX(dPlayer player, UUID uuid) { return x; } - public int getY(dPlayer player, UUID uuid) { + public int getY(PlayerTag player, UUID uuid) { //if (!currentY.containsKey(uuid)) { int y = (int) ArgumentHelper.getDoubleFrom(tag(yTag, player)); currentY.put(uuid, y); @@ -64,14 +64,14 @@ public int getY(dPlayer player, UUID uuid) { return y; } - public boolean isVisibleTo(dPlayer player, UUID uuid) { + public boolean isVisibleTo(PlayerTag player, UUID uuid) { if (!currentVisibility.containsKey(uuid)) { currentVisibility.put(uuid, tag(visibilityTag, player).equalsIgnoreCase("true")); } return currentVisibility.get(uuid); } - protected String tag(String arg, dPlayer player) { + protected String tag(String arg, PlayerTag player) { // Short, reusable TagManager call return TagManager.tag(arg, new BukkitTagContext(player, player.getSelectedNPC(), false, null, debug, null)); } @@ -86,6 +86,6 @@ public Map getSaveData() { return data; } - public abstract void render(MapView mapView, MapCanvas mapCanvas, dPlayer player, UUID uuid); + public abstract void render(MapView mapView, MapCanvas mapCanvas, PlayerTag player, UUID uuid); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/MapText.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/MapText.java index c5d0e5bdb3..3b36ea4afd 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/MapText.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/maps/MapText.java @@ -1,6 +1,6 @@ package com.denizenscript.denizen.utilities.maps; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.PlayerTag; import org.bukkit.map.MapCanvas; import org.bukkit.map.MapView; import org.bukkit.map.MinecraftFont; @@ -20,12 +20,12 @@ public MapText(String xTag, String yTag, String visibilityTag, boolean debug, St } @Override - public void update(dPlayer player, UUID uuid) { + public void update(PlayerTag player, UUID uuid) { super.update(player, uuid); playerTexts.put(uuid, tag(textTag, player)); } - public String getText(dPlayer player) { + public String getText(PlayerTag player) { return playerTexts.get(player.getPlayerEntity().getUniqueId()); } @@ -42,7 +42,7 @@ public Map getSaveData() { } @Override - public void render(MapView mapView, MapCanvas mapCanvas, dPlayer player, UUID uuid) { + public void render(MapView mapView, MapCanvas mapCanvas, PlayerTag player, UUID uuid) { if (!playerTexts.containsKey(uuid)) { playerTexts.put(uuid, tag(textTag, player)); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/midi/MidiUtil.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/midi/MidiUtil.java index bb329f33c8..2578dc4e5b 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/midi/MidiUtil.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/midi/MidiUtil.java @@ -1,8 +1,8 @@ package com.denizenscript.denizen.utilities.midi; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import javax.sound.midi.InvalidMidiDataException; import javax.sound.midi.MidiSystem; @@ -40,13 +40,13 @@ public static void startSequencer(File file, float tempo, NoteBlockReceiver rece sequencer.start(); } - public static NoteBlockReceiver playMidi(File file, float tempo, float volume, List entities) { + public static NoteBlockReceiver playMidi(File file, float tempo, float volume, List entities) { try { NoteBlockReceiver receiver = new NoteBlockReceiver(entities, entities.get(0).getUUID().toString()); receiver.VOLUME_RANGE = volume; // If there is already a midi file being played for one of the entities, // stop playing it - for (dEntity entity : entities) { + for (EntityTag entity : entities) { stopMidi(entity.getUUID().toString()); } receivers.put(entities.get(0).getUUID().toString(), receiver); @@ -59,7 +59,7 @@ public static NoteBlockReceiver playMidi(File file, float tempo, float volume, L } } - public static NoteBlockReceiver playMidi(File file, float tempo, float volume, dLocation location) { + public static NoteBlockReceiver playMidi(File file, float tempo, float volume, LocationTag location) { try { NoteBlockReceiver receiver = new NoteBlockReceiver(location, location.identify()); receiver.VOLUME_RANGE = volume; @@ -82,8 +82,8 @@ public static void stopMidi(String object) { } } - public static void stopMidi(List entities) { - for (dEntity entity : entities) { + public static void stopMidi(List entities) { + for (EntityTag entity : entities) { stopMidi(entity.getUUID().toString()); } } 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 7d65b1b53b..fdd74418ed 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 @@ -3,8 +3,8 @@ import com.google.common.collect.Maps; import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.interfaces.SoundHelper; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dLocation; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.LocationTag; import com.denizenscript.denizen.utilities.DenizenAPI; import com.denizenscript.denizencore.utilities.debugging.Debug; import org.bukkit.Bukkit; @@ -23,21 +23,21 @@ public class NoteBlockReceiver implements Receiver, MetaEventListener { public float VOLUME_RANGE = 10.0f; - private List entities; - private dLocation location; + private List entities; + private LocationTag location; private Map channelPatches; public String key = null; public Sequencer sequencer; public boolean closing = false; - public NoteBlockReceiver(List entities, String _Key) throws InvalidMidiDataException, IOException { + public NoteBlockReceiver(List entities, String _Key) throws InvalidMidiDataException, IOException { this.entities = entities; this.location = null; this.channelPatches = Maps.newHashMap(); this.key = _Key; } - public NoteBlockReceiver(dLocation location, String _Key) throws InvalidMidiDataException, IOException { + public NoteBlockReceiver(LocationTag location, String _Key) throws InvalidMidiDataException, IOException { this.entities = null; this.location = location; this.channelPatches = Maps.newHashMap(); @@ -121,7 +121,7 @@ public void playNote(ShortMessage message) { } else if (entities != null && !entities.isEmpty()) { for (int i = 0; i < entities.size(); i++) { - dEntity entity = entities.get(i); + EntityTag entity = entities.get(i); if (entity.isSpawned()) { if (entity.isPlayer()) { NMSHandler.getInstance().getSoundHelper().playSound(entity.getPlayer(), entity.getLocation(), instrument, volume, pitch, "RECORDS"); diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/nbt/LeatherColorer.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/nbt/LeatherColorer.java index 9f5c39be12..112a058c3b 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/nbt/LeatherColorer.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/nbt/LeatherColorer.java @@ -1,23 +1,23 @@ package com.denizenscript.denizen.utilities.nbt; import com.denizenscript.denizen.utilities.debugging.Debug; -import com.denizenscript.denizen.objects.dColor; -import com.denizenscript.denizen.objects.dItem; +import com.denizenscript.denizen.objects.ColorTag; +import com.denizenscript.denizen.objects.ItemTag; import org.bukkit.inventory.meta.LeatherArmorMeta; public class LeatherColorer { - public static void colorArmor(dItem item, String colorArg) { + public static void colorArmor(ItemTag item, String colorArg) { if (item == null) { return; } - if (dColor.matches(colorArg)) { + if (ColorTag.matches(colorArg)) { try { LeatherArmorMeta meta = (LeatherArmorMeta) item.getItemStack().getItemMeta(); - meta.setColor(dColor.valueOf(colorArg).getColor()); + meta.setColor(ColorTag.valueOf(colorArg).getColor()); item.getItemStack().setItemMeta(meta); } catch (Exception e) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/packets/DenizenPacketHandler.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/packets/DenizenPacketHandler.java index ac07a766d0..6f57d9a118 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/packets/DenizenPacketHandler.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/packets/DenizenPacketHandler.java @@ -8,8 +8,8 @@ import com.denizenscript.denizen.nms.NMSHandler; import com.denizenscript.denizen.nms.util.TradeOffer; import com.denizenscript.denizen.nms.util.jnbt.StringTag; -import com.denizenscript.denizen.objects.dEntity; -import com.denizenscript.denizen.objects.dPlayer; +import com.denizenscript.denizen.objects.EntityTag; +import com.denizenscript.denizen.objects.PlayerTag; import com.denizenscript.denizen.scripts.commands.player.GlowCommand; import com.denizenscript.denizen.scripts.commands.server.ExecuteCommand; import com.denizenscript.denizen.scripts.containers.core.ItemScriptHelper; @@ -38,7 +38,7 @@ public void run() { ResourcePackStatusScriptEvent event = ResourcePackStatusScriptEvent.instance; // TODO: get hash on server?... last sent hash? event.hash = new Element(hash); event.status = new ElementTag(resourcePackStatus.getStatus()); - event.player = dPlayer.mirrorBukkitPlayer(player); + event.player = PlayerTag.mirrorBukkitPlayer(player); event.fire(); } }); @@ -52,8 +52,8 @@ public boolean receivePacket(final Player player, final PacketInSteerVehicle ste @Override public Boolean call() throws Exception { PlayerSteersEntityScriptEvent event = PlayerSteersEntityScriptEvent.instance; - event.player = dPlayer.mirrorBukkitPlayer(player); - event.entity = player.isInsideVehicle() ? new dEntity(player.getVehicle()) : null; + event.player = PlayerTag.mirrorBukkitPlayer(player); + event.entity = player.isInsideVehicle() ? new EntityTag(player.getVehicle()) : null; event.sideways = new ElementTag(steerVehicle.getLeftwardInput()); event.forward = new ElementTag(steerVehicle.getForwardInput()); event.jump = new ElementTag(steerVehicle.getJumpInput()); @@ -91,7 +91,7 @@ public Boolean call() throws Exception { event.system = new ElementTag(pos == 1); event.messageModified = false; event.rawJsonModified = false; - event.player = dPlayer.mirrorBukkitPlayer(player); + event.player = PlayerTag.mirrorBukkitPlayer(player); event.cancelled = false; event.fire(); if (event.messageModified) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/world/DenizenWorldAccess.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/world/DenizenWorldAccess.java index 5d27d95185..85807ff144 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/world/DenizenWorldAccess.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/world/DenizenWorldAccess.java @@ -3,7 +3,7 @@ import com.denizenscript.denizen.utilities.debugging.Debug; import com.denizenscript.denizen.events.entity.EntityDespawnScriptEvent; import com.denizenscript.denizen.nms.interfaces.WorldAccess; -import com.denizenscript.denizen.objects.dEntity; +import com.denizenscript.denizen.objects.EntityTag; import com.denizenscript.denizen.scripts.commands.player.GlowCommand; import com.denizenscript.denizen.scripts.containers.core.EntityScriptHelper; import com.denizenscript.denizencore.objects.core.ElementTag; @@ -18,18 +18,18 @@ public void despawn(Entity entity) { if (entity instanceof LivingEntity) { GlowCommand.unGlow((LivingEntity) entity); } - if (dEntity.isCitizensNPC(entity)) { + if (EntityTag.isCitizensNPC(entity)) { return; } if (entity instanceof LivingEntity && !((LivingEntity) entity).getRemoveWhenFarAway()) { return; } - dEntity.rememberEntity(entity); - EntityDespawnScriptEvent.instance.entity = new dEntity(entity); + EntityTag.rememberEntity(entity); + EntityDespawnScriptEvent.instance.entity = new EntityTag(entity); EntityDespawnScriptEvent.instance.cause = new ElementTag("OTHER"); EntityDespawnScriptEvent.instance.cancelled = false; EntityDespawnScriptEvent.instance.fire(); - dEntity.forgetEntity(entity); + EntityTag.forgetEntity(entity); } catch (Exception e) { Debug.echoError(e);