Skip to content

Commit

Permalink
Fix some weirdness
Browse files Browse the repository at this point in the history
- give command debugging wrong
- functions defined wrong
- util script minor messups
- durability mech failing to adjust material data
  • Loading branch information
mcmonkey4eva committed Oct 19, 2014
1 parent 0470b48 commit 24bbf3c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
Expand Up @@ -88,6 +88,7 @@ public void adjust(Mechanism mechanism) {
// -->

if (mechanism.matches("durability") && mechanism.requireInteger()) {
item.getItemStack().getData().setData((byte)mechanism.getValue().asInt());
item.setDurability((short) mechanism.getValue().asInt());
}
}
Expand Down
Expand Up @@ -114,7 +114,7 @@ public static void addYamlScriptContainer(net.aufdemrand.denizencore.utilities.Y
* @param yaml_script the FileConfiguration containing the script
*
*/
public static void removeYamlScriptContainer(FileConfiguration yaml_script) {
public static void removeYamlScriptContainer(YamlConfiguration yaml_script) {
outside_scripts.remove(yaml_script);
DenizenCore.reloadScripts();
}
Expand Down
Expand Up @@ -47,7 +47,7 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException
&& arg.matchesPrefix("q", "qty", "quantity")
&& arg.matchesPrimitive(aH.PrimitiveType.Double)) {
scriptEntry.addObject("qty", arg.asElement());
scriptEntry.addObject("set_quantity", Element.TRUE);
scriptEntry.addObject("set_quantity", new Element(true));
}

else if (!scriptEntry.hasObject("type")
Expand All @@ -60,16 +60,17 @@ else if (!scriptEntry.hasObject("type")

else if (!scriptEntry.hasObject("engrave")
&& arg.matches("engrave"))
scriptEntry.addObject("engrave", Element.TRUE);
scriptEntry.addObject("engrave", new Element(true));

else if (!scriptEntry.hasObject("unlimit_stack_size")
&& arg.matches("unlimit_stack_size"))
scriptEntry.addObject("unlimit_stack_size", Element.TRUE);
scriptEntry.addObject("unlimit_stack_size", new Element(true));

else if (!scriptEntry.hasObject("items")
&& !scriptEntry.hasObject("type")
&& arg.matchesArgumentList(dItem.class))
&& arg.matchesArgumentList(dItem.class)) {
scriptEntry.addObject("items", dList.valueOf(arg.raw_value.replace("item:", "")).filter(dItem.class, scriptEntry));
}

else if (!scriptEntry.hasObject("inventory")
&& arg.matchesPrefix("t", "to")
Expand All @@ -81,11 +82,14 @@ else if (!scriptEntry.hasObject("slot")
&& arg.matchesPrimitive(aH.PrimitiveType.Integer))
scriptEntry.addObject("slot", arg.asElement());

else
arg.reportUnhandled();

}

scriptEntry.defaultObject("type", Type.ITEM)
.defaultObject("engrave", Element.FALSE)
.defaultObject("unlimit_stack_size", Element.FALSE)
.defaultObject("engrave", new Element(false))
.defaultObject("unlimit_stack_size", new Element(false))
.defaultObject("qty", new Element(1))
.defaultObject("slot", new Element(1));

Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/util.dscript
Expand Up @@ -5,7 +5,7 @@ _util_dtime_command:
type: command
name: dtime
description: (Deprecated) Changes the server time.
usage: /dtime <time>
usage: /dtime <&lt>time<&gt>
allowed help:
- determine <player.is_op>
script:
Expand Down Expand Up @@ -76,7 +76,7 @@ Load Tester:
type: command
name: testload
description: Tests server load.
usage: /testload <power>
usage: /testload <&lt>power<&gt>
allowed help:
- determine <player.is_op>
script:
Expand Down Expand Up @@ -117,5 +117,5 @@ Load Tester:
- determine fulfilled


test:
- flag server stress_test_counter:++
test:
- flag server stress_test_counter:++

0 comments on commit 24bbf3c

Please sign in to comment.