Skip to content

Commit

Permalink
update for core class name changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jul 13, 2019
1 parent 6d1029c commit 6ad5941
Show file tree
Hide file tree
Showing 34 changed files with 141 additions and 129 deletions.
Expand Up @@ -11,7 +11,7 @@
import com.denizenscript.denizencore.tags.ReplaceableTagEvent;
import com.denizenscript.denizencore.tags.TagManager;
import com.denizenscript.denizencore.utilities.CoreUtilities;
import com.denizenscript.denizencore.utilities.debugging.dB;
import com.denizenscript.denizencore.utilities.debugging.Debug;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;

Expand All @@ -20,7 +20,7 @@ public class PlaceholderAPIBridge extends Bridge {
@Override
public void init() {
if (!new PlaceholderHook().register()) {
dB.echoError("Failed to register placeholder for identifier 'denizen'!" +
Debug.echoError("Failed to register placeholder for identifier 'denizen'!" +
" Denizen PlaceholderAPI placeholders will not function.");
}
TagManager.registerTagHandler(new TagRunnable.RootForm() {
Expand All @@ -42,7 +42,7 @@ public void tagEvent(ReplaceableTagEvent event) {
// -->
String placeholder = CoreUtilities.toLowerCase(attribute.getContext(1));
if (placeholder.startsWith("denizen_")) {
dB.echoError("Cannot use <placeholder[]> tags with 'denizen' prefix!");
Debug.echoError("Cannot use <placeholder[]> tags with 'denizen' prefix!");
return;
}
Player player = ((BukkitTagContext) event.getContext()).player != null ?
Expand Down
@@ -1,16 +1,17 @@
package com.denizenscript.depenizen.bukkit.commands.bossshop;

import com.denizenscript.denizencore.objects.Argument;
import com.denizenscript.depenizen.bukkit.bridges.BossShopBridge;
import com.denizenscript.denizen.objects.dPlayer;
import com.denizenscript.denizen.utilities.Utilities;
import com.denizenscript.denizencore.exceptions.InvalidArgumentsException;
import com.denizenscript.denizencore.objects.Element;
import com.denizenscript.denizencore.objects.aH;
import com.denizenscript.denizencore.objects.ArgumentHelper;
import com.denizenscript.denizencore.scripts.ScriptEntry;
import com.denizenscript.denizencore.scripts.commands.AbstractCommand;
import org.black_ixx.bossshop.BossShop;
import org.black_ixx.bossshop.core.BSShop;
import com.denizenscript.denizencore.utilities.debugging.dB;
import com.denizenscript.denizencore.utilities.debugging.Debug;

public class BossShopCommand extends AbstractCommand {
// <--[command]
Expand Down Expand Up @@ -43,7 +44,7 @@ public class BossShopCommand extends AbstractCommand {
@Override
public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {

for (aH.Argument arg : aH.interpret(scriptEntry.getArguments())) {
for (Argument arg : ArgumentHelper.interpret(scriptEntry.getArguments())) {

if (!scriptEntry.hasObject("target")
&& arg.matchesPrefix("target")) {
Expand Down Expand Up @@ -82,24 +83,24 @@ public void execute(ScriptEntry scriptEntry) {
Element dshop = scriptEntry.getdObject("shop");

// Report to dB
dB.report(scriptEntry, getName(),
Debug.report(scriptEntry, getName(),
(target != null ? target.debug() : "")
+ (dshop != null ? dshop.debug() : ""));

if (target == null) {
dB.echoError(scriptEntry.getResidingQueue(), "Target not found!");
Debug.echoError(scriptEntry.getResidingQueue(), "Target not found!");
return;
}

if (dshop == null) {
dB.echoError(scriptEntry.getResidingQueue(), "Shop not Specified!");
Debug.echoError(scriptEntry.getResidingQueue(), "Shop not Specified!");
return;
}

BossShop bs = (BossShop) BossShopBridge.instance.plugin;
BSShop shop = bs.getAPI().getShop(dshop.asString());
if (shop == null) {
dB.echoError(scriptEntry.getResidingQueue(), "Shop not found!");
Debug.echoError(scriptEntry.getResidingQueue(), "Shop not found!");
return;
}

Expand Down
@@ -1,13 +1,15 @@
package com.denizenscript.depenizen.bukkit.commands.bungee;

import com.denizenscript.denizencore.objects.Argument;
import com.denizenscript.denizencore.utilities.debugging.Debug;
import com.denizenscript.depenizen.bukkit.bungee.BungeeBridge;
import com.denizenscript.depenizen.bukkit.bungee.packets.out.KeepAlivePacketOut;
import com.denizenscript.depenizen.bukkit.bungee.packets.out.RedirectPacketOut;
import com.denizenscript.depenizen.bukkit.bungee.packets.out.redirectable.RunCommandsPacketOut;
import com.denizenscript.denizen.utilities.Utilities;
import com.denizenscript.denizen.utilities.debugging.dB;
import com.denizenscript.denizencore.exceptions.InvalidArgumentsException;
import com.denizenscript.denizencore.objects.aH;
import com.denizenscript.denizencore.objects.ArgumentHelper;
import com.denizenscript.denizencore.objects.dList;
import com.denizenscript.denizencore.objects.dObject;
import com.denizenscript.denizencore.scripts.ScriptEntry;
Expand Down Expand Up @@ -50,7 +52,7 @@ public void onEnable() {

@Override
public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {
for (aH.Argument arg : aH.interpretArguments(scriptEntry.aHArgs)) {
for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) {
if (!scriptEntry.hasObject("servers")) {
scriptEntry.addObject("servers", arg.asType(dList.class));
}
Expand Down Expand Up @@ -79,12 +81,12 @@ public void execute(ScriptEntry scriptEntry) {
}
List<BracedCommand.BracedData> bdlist = (List<BracedData>) scriptEntry.getObject("braces");
if (bdlist == null || bdlist.isEmpty()) {
com.denizenscript.denizencore.utilities.debugging.dB.echoError(scriptEntry.getResidingQueue(), "Empty braces (internal)!");
Debug.echoError(scriptEntry.getResidingQueue(), "Empty braces (internal)!");
return;
}
List<ScriptEntry> bracedCommandsList = bdlist.get(0).value;
if (bracedCommandsList == null || bracedCommandsList.isEmpty()) {
com.denizenscript.denizencore.utilities.debugging.dB.echoError(scriptEntry.getResidingQueue(), "Empty braces!");
Debug.echoError(scriptEntry.getResidingQueue(), "Empty braces!");
return;
}
StringBuilder toSend = new StringBuilder();
Expand Down
@@ -1,12 +1,13 @@
package com.denizenscript.depenizen.bukkit.commands.bungee;

import com.denizenscript.denizencore.objects.Argument;
import com.denizenscript.depenizen.bukkit.bungee.BungeeBridge;
import com.denizenscript.depenizen.bukkit.bungee.packets.out.ExecuteCommandPacketOut;
import com.denizenscript.depenizen.bukkit.bungee.packets.out.KeepAlivePacketOut;
import com.denizenscript.denizen.utilities.debugging.dB;
import com.denizenscript.denizencore.exceptions.InvalidArgumentsException;
import com.denizenscript.denizencore.objects.Element;
import com.denizenscript.denizencore.objects.aH;
import com.denizenscript.denizencore.objects.ArgumentHelper;
import com.denizenscript.denizencore.scripts.ScriptEntry;
import com.denizenscript.denizencore.scripts.commands.AbstractCommand;

Expand Down Expand Up @@ -34,7 +35,7 @@ public class BungeeExecuteCommand extends AbstractCommand {

@Override
public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {
for (aH.Argument arg : aH.interpretArguments(scriptEntry.aHArgs)) {
for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) {
if (!scriptEntry.hasObject("command")) {
scriptEntry.addObject("command", arg.asElement());
}
Expand Down
@@ -1,5 +1,6 @@
package com.denizenscript.depenizen.bukkit.commands.bungee;

import com.denizenscript.denizencore.objects.Argument;
import com.denizenscript.depenizen.bukkit.bungee.BungeeBridge;
import com.denizenscript.depenizen.bukkit.bungee.packets.out.KeepAlivePacketOut;
import com.denizenscript.depenizen.bukkit.bungee.packets.out.RedirectPacketOut;
Expand All @@ -8,7 +9,7 @@
import com.denizenscript.denizen.utilities.debugging.dB;
import com.denizenscript.denizencore.exceptions.InvalidArgumentsException;
import com.denizenscript.denizencore.objects.Element;
import com.denizenscript.denizencore.objects.aH;
import com.denizenscript.denizencore.objects.ArgumentHelper;
import com.denizenscript.denizencore.objects.dList;
import com.denizenscript.denizencore.scripts.ScriptEntry;
import com.denizenscript.denizencore.scripts.commands.AbstractCommand;
Expand Down Expand Up @@ -39,7 +40,7 @@ public class BungeeRunCommand extends AbstractCommand {

@Override
public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {
for (aH.Argument arg : aH.interpretArguments(scriptEntry.aHArgs)) {
for (Argument arg : ArgumentHelper.interpretArguments(scriptEntry.aHArgs)) {
if (!scriptEntry.hasObject("def")
&& arg.matchesPrefix("def")) {
scriptEntry.addObject("def", arg.asElement());
Expand Down
Expand Up @@ -12,7 +12,7 @@
import com.denizenscript.denizencore.scripts.commands.AbstractCommand;
import com.denizenscript.denizencore.scripts.commands.Holdable;
import com.denizenscript.denizencore.tags.TagManager;
import com.denizenscript.denizencore.utilities.debugging.dB;
import com.denizenscript.denizencore.utilities.debugging.Debug;

import java.util.HashMap;
import java.util.Map;
Expand Down Expand Up @@ -63,7 +63,7 @@ else if (!scriptEntry.hasObject("tag")) {
scriptEntry.addObject("tag", new Element(arg));
}
else {
dB.echoError('\'' + arg + "' is an unknown argument!");
Debug.echoError('\'' + arg + "' is an unknown argument!");
}
}
if (!scriptEntry.hasObject("tag")) {
Expand Down Expand Up @@ -95,10 +95,10 @@ public void execute(ScriptEntry scriptEntry) {
Element tag = scriptEntry.getElement("tag");
Element server = scriptEntry.getElement("server");
if (scriptEntry.dbCallShouldDebug()) {
dB.report(scriptEntry, getName(), tag.debug() + server.debug());
Debug.report(scriptEntry, getName(), tag.debug() + server.debug());
}
if (!BungeeBridge.instance.connected) {
dB.echoError("Cannot BungeeTag: bungee is not connected!");
Debug.echoError("Cannot BungeeTag: bungee is not connected!");
scriptEntry.setFinished(true);
return;
}
Expand Down
@@ -1,5 +1,6 @@
package com.denizenscript.depenizen.bukkit.commands.effectlib;

import com.denizenscript.denizencore.objects.Argument;
import com.denizenscript.depenizen.bukkit.bridges.EffectLibBridge;
import de.slikey.effectlib.EffectManager;
import de.slikey.effectlib.effect.ArcEffect;
Expand All @@ -10,10 +11,10 @@
import com.denizenscript.denizen.utilities.Utilities;
import com.denizenscript.denizencore.exceptions.InvalidArgumentsException;
import com.denizenscript.denizencore.objects.Duration;
import com.denizenscript.denizencore.objects.aH;
import com.denizenscript.denizencore.objects.ArgumentHelper;
import com.denizenscript.denizencore.scripts.ScriptEntry;
import com.denizenscript.denizencore.scripts.commands.AbstractCommand;
import com.denizenscript.denizencore.utilities.debugging.dB;
import com.denizenscript.denizencore.utilities.debugging.Debug;
import org.bukkit.Location;

public class EffectLibCommand extends AbstractCommand {
Expand Down Expand Up @@ -54,7 +55,7 @@ private enum Action {
@Override
public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {

for (aH.Argument arg : aH.interpret(scriptEntry.getArguments())) {
for (Argument arg : ArgumentHelper.interpret(scriptEntry.getArguments())) {

if (!scriptEntry.hasObject("target")
&& arg.matchesPrefix("target")) {
Expand Down Expand Up @@ -107,21 +108,21 @@ public void execute(final ScriptEntry scriptEntry) {
dLocation location = (dLocation) scriptEntry.getObject("location");

// Report to dB
dB.report(scriptEntry, getName(), (target != null ? target.debug() : "")
Debug.report(scriptEntry, getName(), (target != null ? target.debug() : "")
+ (action != null ? action.toString() : "")
+ (duration != null ? duration.debug() : "")
+ (location != null ? location.debug() : ""));

if (target == null && location == null) {
dB.echoError(scriptEntry.getResidingQueue(), "Target not found!");
Debug.echoError(scriptEntry.getResidingQueue(), "Target not found!");
return;
}
if (action == null) {
dB.echoError(scriptEntry.getResidingQueue(), "Effect type not specified!");
Debug.echoError(scriptEntry.getResidingQueue(), "Effect type not specified!");
return;
}
if (duration == null) {
dB.echoError(scriptEntry.getResidingQueue(), "Duration not specified!");
Debug.echoError(scriptEntry.getResidingQueue(), "Duration not specified!");
return;
}

Expand Down Expand Up @@ -201,7 +202,7 @@ public void run() {
}

default: {
dB.echoError(scriptEntry.getResidingQueue(), "Effect type not found!");
Debug.echoError(scriptEntry.getResidingQueue(), "Effect type not found!");
}

}
Expand Down
@@ -1,12 +1,13 @@
package com.denizenscript.depenizen.bukkit.commands.jobs;

import com.denizenscript.denizencore.objects.Argument;
import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.container.JobsPlayer;
import com.denizenscript.denizen.BukkitScriptEntryData;
import com.denizenscript.denizen.utilities.Utilities;
import com.denizenscript.denizencore.exceptions.InvalidArgumentsException;
import com.denizenscript.denizencore.objects.Element;
import com.denizenscript.denizencore.objects.aH;
import com.denizenscript.denizencore.objects.ArgumentHelper;
import com.denizenscript.denizencore.scripts.ScriptEntry;
import com.denizenscript.denizencore.scripts.commands.AbstractCommand;
import com.denizenscript.depenizen.bukkit.objects.jobs.JobsJob;
Expand Down Expand Up @@ -52,7 +53,7 @@ public JobsCommand() {
public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {

// Iterate through arguments
for (aH.Argument arg : aH.interpret(scriptEntry.getArguments())) {
for (Argument arg : ArgumentHelper.interpret(scriptEntry.getArguments())) {

if (!scriptEntry.hasObject("action")
&& arg.matchesEnum(Action.values())) {
Expand All @@ -65,7 +66,7 @@ else if (!scriptEntry.hasObject("job")
}

else if (!scriptEntry.hasObject("number")
&& arg.matchesPrimitive(aH.PrimitiveType.Integer)) {
&& arg.matchesPrimitive(ArgumentHelper.PrimitiveType.Integer)) {
scriptEntry.addObject("number", new Element(arg.getValue()));
}

Expand Down
@@ -1,15 +1,16 @@
package com.denizenscript.depenizen.bukkit.commands.libsdisguises;

import com.denizenscript.denizencore.objects.Argument;
import me.libraryaddict.disguise.DisguiseAPI;
import me.libraryaddict.disguise.disguisetypes.*;
import com.denizenscript.denizen.objects.dEntity;
import com.denizenscript.denizen.utilities.Utilities;
import com.denizenscript.denizencore.exceptions.InvalidArgumentsException;
import com.denizenscript.denizencore.objects.Element;
import com.denizenscript.denizencore.objects.aH;
import com.denizenscript.denizencore.objects.ArgumentHelper;
import com.denizenscript.denizencore.scripts.ScriptEntry;
import com.denizenscript.denizencore.scripts.commands.AbstractCommand;
import com.denizenscript.denizencore.utilities.debugging.dB;
import com.denizenscript.denizencore.utilities.debugging.Debug;

public class DisguiseCommand extends AbstractCommand {
// <--[command]
Expand Down Expand Up @@ -76,7 +77,7 @@ private enum Action {REMOVE, MOB, PLAYER, MISC}
@Override
public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {

for (aH.Argument arg : aH.interpret(scriptEntry.getArguments())) {
for (Argument arg : ArgumentHelper.interpret(scriptEntry.getArguments())) {

if (!scriptEntry.hasObject("target")
&& arg.matchesPrefix("target")) {
Expand Down Expand Up @@ -167,7 +168,7 @@ public void execute(ScriptEntry scriptEntry) {
Element self = scriptEntry.getdObject("self");

// Report to dB
dB.report(scriptEntry, getName(), action.debug()
Debug.report(scriptEntry, getName(), action.debug()
+ (target != null ? target.debug() : "")
+ (type != null ? type.debug() : "")
+ (name != null ? name.debug() : "")
Expand All @@ -176,12 +177,12 @@ public void execute(ScriptEntry scriptEntry) {
+ (baby != null ? baby.debug() : ""));

if (target == null) {
dB.echoError(scriptEntry.getResidingQueue(), "Target not found!");
Debug.echoError(scriptEntry.getResidingQueue(), "Target not found!");
return;
}

if (baby == null) {
dB.echoError(scriptEntry.getResidingQueue(), "Baby not specified!");
Debug.echoError(scriptEntry.getResidingQueue(), "Baby not specified!");
return;
}

Expand All @@ -191,7 +192,7 @@ public void execute(ScriptEntry scriptEntry) {

else if (action.asString().equalsIgnoreCase("mob")) {
if (type == null) {
dB.echoError(scriptEntry.getResidingQueue(), "Entity not specified!");
Debug.echoError(scriptEntry.getResidingQueue(), "Entity not specified!");
return;
}
MobDisguise mobDisguise = new MobDisguise(DisguiseType.valueOf(type.toString().toUpperCase()), !baby.asBoolean());
Expand All @@ -210,7 +211,7 @@ else if (action.asString().equalsIgnoreCase("mob")) {

else if (action.asString().equalsIgnoreCase("player")) {
if (name == null) {
dB.echoError(scriptEntry.getResidingQueue(), "Name not specified!");
Debug.echoError(scriptEntry.getResidingQueue(), "Name not specified!");
return;
}
PlayerDisguise playerDisguise = new PlayerDisguise(name.toString());
Expand All @@ -224,15 +225,15 @@ else if (action.asString().equalsIgnoreCase("player")) {

else if (action.asString().equalsIgnoreCase("misc")) {
if (type == null) {
dB.echoError(scriptEntry.getResidingQueue(), "Entity not specified!");
Debug.echoError(scriptEntry.getResidingQueue(), "Entity not specified!");
return;
}
if (id == null) {
dB.echoError(scriptEntry.getResidingQueue(), "ID not specified!");
Debug.echoError(scriptEntry.getResidingQueue(), "ID not specified!");
return;
}
if (data == null) {
dB.echoError(scriptEntry.getResidingQueue(), "Data not specified!");
Debug.echoError(scriptEntry.getResidingQueue(), "Data not specified!");
return;
}
MiscDisguise miscDisguise = new MiscDisguise(DisguiseType.valueOf(type.toString().toUpperCase()), id.asInt(), data.asInt());
Expand Down

0 comments on commit 6ad5941

Please sign in to comment.