Skip to content

Commit

Permalink
update to new core
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Feb 15, 2020
1 parent 24a97eb commit 3317682
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 15 deletions.
Expand Up @@ -6,7 +6,6 @@
import com.denizenscript.denizen.utilities.Utilities;
import com.denizenscript.denizencore.exceptions.InvalidArgumentsException;
import com.denizenscript.denizencore.objects.core.ElementTag;
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.JobsJobTag;
Expand Down Expand Up @@ -65,7 +64,7 @@ else if (!scriptEntry.hasObject("job")
}

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

Expand Down
Expand Up @@ -13,7 +13,6 @@
import com.denizenscript.denizen.utilities.debugging.Debug;
import com.denizenscript.denizencore.exceptions.InvalidArgumentsException;
import com.denizenscript.denizencore.objects.core.ElementTag;
import com.denizenscript.denizencore.objects.ArgumentHelper;
import com.denizenscript.denizencore.scripts.ScriptEntry;
import com.denizenscript.denizencore.scripts.commands.AbstractCommand;

Expand Down Expand Up @@ -88,7 +87,7 @@ else if (!scriptEntry.hasObject("skill")

else if (!scriptEntry.hasObject("quantity")
&& arg.matchesPrefix("q", "qty", "quantity")
&& arg.matchesPrimitive(ArgumentHelper.PrimitiveType.Double)) {
&& arg.matchesFloat()) {
scriptEntry.addObject("quantity", arg.asElement());
}

Expand Down
Expand Up @@ -5,7 +5,6 @@
import com.denizenscript.denizen.objects.LocationTag;
import com.denizenscript.denizencore.exceptions.InvalidArgumentsException;
import com.denizenscript.denizencore.objects.core.ElementTag;
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.Debug;
Expand Down Expand Up @@ -47,7 +46,7 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException

else if (!scriptEntry.hasObject("level")
&& arg.matchesPrefix("level", "l")
&& arg.matchesPrimitive(ArgumentHelper.PrimitiveType.Integer)) {
&& arg.matchesInteger()) {
scriptEntry.addObject("level", arg.asElement());
}

Expand Down
@@ -1,7 +1,6 @@
package com.denizenscript.depenizen.bukkit.commands.quests;

import com.denizenscript.denizencore.objects.Argument;
import com.denizenscript.denizencore.objects.ArgumentHelper;

import me.blackvein.quests.Quest;
import me.blackvein.quests.Quester;
Expand Down Expand Up @@ -72,17 +71,17 @@ else if (!scriptEntry.hasObject("quest")
}
else if (!scriptEntry.hasObject("stage")
&& arg.matchesPrefix("stage")
&& arg.matchesPrimitive(ArgumentHelper.PrimitiveType.Integer)) {
&& arg.matchesInteger()) {
scriptEntry.addObject("stage", arg.asElement());
}
else if (!scriptEntry.hasObject("points")
&& arg.matchesPrefix("points")
&& arg.matchesPrimitive(ArgumentHelper.PrimitiveType.Integer)) {
&& arg.matchesInteger()) {
scriptEntry.addObject("points", arg.asElement());
}
else if (!scriptEntry.hasObject("override_checks")
&& arg.matchesPrefix("override_checks")
&& arg.matchesPrimitive(ArgumentHelper.PrimitiveType.Boolean)) {
&& arg.matchesBoolean()) {
scriptEntry.addObject("override_checks", arg.asElement());
}
else {
Expand Down
Expand Up @@ -107,7 +107,7 @@ public boolean applyDetermination(ScriptPath path, ObjectTag determinationObj) {
if (isDefaultDetermination(determinationObj)) {
String determination = determinationObj.toString();
Argument arg = new Argument(determination);
if (arg.matchesPrefix("currency") && arg.matchesPrimitive(ArgumentHelper.PrimitiveType.Double)) {
if (arg.matchesPrefix("currency") && arg.matchesFloat()) {
currency = new ElementTag(determination);
return true;
}
Expand Down
Expand Up @@ -13,8 +13,6 @@
import com.denizenscript.denizencore.tags.Attribute;
import com.denizenscript.denizencore.tags.TagContext;

import java.util.regex.Matcher;

public class JobsJobTag implements ObjectTag {

// <--[language]
Expand Down Expand Up @@ -60,8 +58,7 @@ public static JobsJobTag valueOf(String string, TagContext context) {

JobsJobTag job = null;

Matcher m = ObjectFetcher.DESCRIBED_PATTERN.matcher(string);
if (m.matches()) {
if (ObjectFetcher.isObjectWithProperties(string)) {
return ObjectFetcher.getObjectFrom(JobsJobTag.class, string, context);
}
return new JobsJobTag(Jobs.getJob(string.replace("job@", "")));
Expand Down

0 comments on commit 3317682

Please sign in to comment.