From 561a620bdc6d2b39f1421a88770ebfdff5e44a64 Mon Sep 17 00:00:00 2001 From: Richard Date: Sat, 28 Nov 2015 21:52:34 -0200 Subject: [PATCH] A few fixes, whoops. --- src/me/TheBukor/SkStuff.java | 5 ++--- src/me/TheBukor/enums/WorldEditOperations.java | 16 ---------------- .../expressions/ExprHeightOfSchematic.java | 4 ++-- .../expressions/ExprLengthOfSchematic.java | 4 ++-- .../expressions/ExprVolumeOfSchematic.java | 4 ++-- .../expressions/ExprWidthOfSchematic.java | 4 ++-- 6 files changed, 10 insertions(+), 27 deletions(-) delete mode 100644 src/me/TheBukor/enums/WorldEditOperations.java diff --git a/src/me/TheBukor/SkStuff.java b/src/me/TheBukor/SkStuff.java index 637909c..ce04656 100644 --- a/src/me/TheBukor/SkStuff.java +++ b/src/me/TheBukor/SkStuff.java @@ -56,7 +56,7 @@ public class SkStuff extends JavaPlugin { Skript.registerExpression(ExprNBTv1_8_R1.class, NBTTagCompound.class, ExpressionType.PROPERTY, "nbt[[ ]tag[s]] of %entity/block/itemstack%", "%entity/block/itemstack%'s nbt[[ ]tag[s]]"); Skript.registerExpression(ExprItemNBTv1_8_R1.class, ItemStack.class, ExpressionType.SIMPLE, "%itemstack% with [custom] nbt[[ ]tag[s]] %string%"); Skript.registerExpression(ExprTagOfv1_8_R1.class, Object.class, ExpressionType.SIMPLE, "[nbt[ ]]tag %string% of [nbt [compound]] %compound%"); - Classes.registerClass(new ClassInfo(NBTTagCompound.class, "compound").name("NBT Tag Compound").parser(new Parser() { + Classes.registerClass(new ClassInfo(NBTTagCompound.class, "[nbt] compound[s]").name("NBT Tag Compound").parser(new Parser() { @Override public String getVariableNamePattern() { @@ -93,7 +93,7 @@ public class SkStuff extends JavaPlugin { Skript.registerExpression(ExprNBTv1_8_R2.class, net.minecraft.server.v1_8_R2.NBTTagCompound.class, ExpressionType.PROPERTY, "nbt[[ ]tag[s]] of %entity/block/itemstack%", "%entity/block/itemstack%'s nbt[[ ]tag[s]]"); Skript.registerExpression(ExprItemNBTv1_8_R2.class, ItemStack.class, ExpressionType.SIMPLE, "%itemstack% with [custom] nbt[[ ]tag[s]] %string%"); Skript.registerExpression(ExprTagOfv1_8_R2.class, Object.class, ExpressionType.SIMPLE, "[nbt[ ]]tag %string% of [nbt [compound]] %compound%"); - Classes.registerClass(new ClassInfo(net.minecraft.server.v1_8_R2.NBTTagCompound.class, "compound").name("NBT Tag Compound").parser(new Parser() { + Classes.registerClass(new ClassInfo(net.minecraft.server.v1_8_R2.NBTTagCompound.class, "[nbt] compound[s]").name("NBT Tag Compound").parser(new Parser() { @Override public String getVariableNamePattern() { @@ -173,7 +173,6 @@ public class SkStuff extends JavaPlugin { condAmount += 1; evtAmount += 1; exprAmount += 12; - typeAmount += 1; Skript.registerCondition(CondSelectionContains.class, "[(world[ ]edit|we)] selection of %player% (contains|has) %location%", "%player%'s [(world[ ]edit|we)] selection (contains|has) %location%", "[(world[ ]edit|we)] selection of %player% does(n't| not) (contain|have) %location%", "%player%'s [(world[ ]edit|we)] selection does(n't| not) (contain|have) %location%"); Skript.registerEffect(EffExecuteWorldEdit.class, "make %player% execute (world[ ]edit|we) [operation] set (using|with) %itemstack% [[with] limit [of] %integer% [blocks]]", "execute %player% (world[ ]edit|we) [operation] set (using|with) %itemstack% [[with] limit [of] %integer% [blocks]"); Skript.registerExpression(ExprSelectionOfPlayer.class, Location.class, ExpressionType.PROPERTY, "[(world[ ]edit|we)] selection of %player%", "%player%'s [(world[ ]edit|we)] selection"); diff --git a/src/me/TheBukor/enums/WorldEditOperations.java b/src/me/TheBukor/enums/WorldEditOperations.java deleted file mode 100644 index efe2a04..0000000 --- a/src/me/TheBukor/enums/WorldEditOperations.java +++ /dev/null @@ -1,16 +0,0 @@ -package me.TheBukor.enums; - -public enum WorldEditOperations { - SET("set"), - WALLS("walls"); - - private final String id; - - WorldEditOperations(String id) { - this.id = id; - } - - public String getId() { - return id; - } -} diff --git a/src/me/TheBukor/expressions/ExprHeightOfSchematic.java b/src/me/TheBukor/expressions/ExprHeightOfSchematic.java index d5d2a10..b1bd987 100644 --- a/src/me/TheBukor/expressions/ExprHeightOfSchematic.java +++ b/src/me/TheBukor/expressions/ExprHeightOfSchematic.java @@ -44,13 +44,13 @@ public class ExprHeightOfSchematic extends SimpleExpression { @Override public String toString(@Nullable Event e, boolean arg1) { - return "the height of the schematic " + schematic.toString(e, false); + return "the height of the schematic " + schematic.toString(e, false) + " in the folder " + new String(folder.getSingle(e) != null ? folder.toString(e, false) : "plugins/WorldEdit/schematics"); } @Override @Nullable protected Integer[] get(Event e) { - String f = (folder.getSingle(e) != null) ? folder.getSingle(e) : "plugins/WorldEdit/"; + String f = (folder.getSingle(e) != null) ? folder.getSingle(e) : "plugins/WorldEdit/schematics/"; String schem = schematic.getSingle(e); File schemFile = new File((f.endsWith("/")) ? f : f + "/" + new String(schem.endsWith(".schematic") ? schem : schem + ".schematic")); Integer h = null; diff --git a/src/me/TheBukor/expressions/ExprLengthOfSchematic.java b/src/me/TheBukor/expressions/ExprLengthOfSchematic.java index 914f0e7..87295da 100644 --- a/src/me/TheBukor/expressions/ExprLengthOfSchematic.java +++ b/src/me/TheBukor/expressions/ExprLengthOfSchematic.java @@ -44,13 +44,13 @@ public class ExprLengthOfSchematic extends SimpleExpression { @Override public String toString(@Nullable Event e, boolean arg1) { - return "the length of the schematic " + schematic.toString(e, false); + return "the length of the schematic " + schematic.toString(e, false) + " in the folder " + new String(folder.getSingle(e) != null ? folder.toString(e, false) : "plugins/WorldEdit/schematics"); } @Override @Nullable protected Integer[] get(Event e) { - String f = (folder.getSingle(e) != null) ? folder.getSingle(e) : "plugins/WorldEdit/"; + String f = (folder.getSingle(e) != null) ? folder.getSingle(e) : "plugins/WorldEdit/schematics/"; String schem = schematic.getSingle(e); File schemFile = new File((f.endsWith("/")) ? f : f + "/" + new String(schem.endsWith(".schematic") ? schem : schem + ".schematic")); Integer l = null; diff --git a/src/me/TheBukor/expressions/ExprVolumeOfSchematic.java b/src/me/TheBukor/expressions/ExprVolumeOfSchematic.java index 71f0101..532eac1 100644 --- a/src/me/TheBukor/expressions/ExprVolumeOfSchematic.java +++ b/src/me/TheBukor/expressions/ExprVolumeOfSchematic.java @@ -44,13 +44,13 @@ public class ExprVolumeOfSchematic extends SimpleExpression { @Override public String toString(@Nullable Event e, boolean arg1) { - return "the volume of the schematic " + schematic.toString(e, false); + return "the volume of the schematic " + schematic.toString(e, false) + " in the folder " + new String(folder.getSingle(e) != null ? folder.toString(e, false) : "plugins/WorldEdit/schematics"); } @Override @Nullable protected Integer[] get(Event e) { - String f = (folder.getSingle(e) != null) ? folder.getSingle(e) : "plugins/WorldEdit/"; + String f = (folder.getSingle(e) != null) ? folder.getSingle(e) : "plugins/WorldEdit/schematics/"; String schem = schematic.getSingle(e); File schemFile = new File((f.endsWith("/")) ? f : f + "/" + new String(schem.endsWith(".schematic") ? schem : schem + ".schematic")); Integer w = 0; diff --git a/src/me/TheBukor/expressions/ExprWidthOfSchematic.java b/src/me/TheBukor/expressions/ExprWidthOfSchematic.java index 38c52ea..a1ec7c0 100644 --- a/src/me/TheBukor/expressions/ExprWidthOfSchematic.java +++ b/src/me/TheBukor/expressions/ExprWidthOfSchematic.java @@ -44,13 +44,13 @@ public class ExprWidthOfSchematic extends SimpleExpression { @Override public String toString(@Nullable Event e, boolean arg1) { - return "the width of the schematic " + schematic.toString(e, false); + return "the width of the schematic " + schematic.toString(e, false) + " in the folder " + new String(folder.getSingle(e) != null ? folder.toString(e, false) : "plugins/WorldEdit/schematics"); } @Override @Nullable protected Integer[] get(Event e) { - String f = (folder.getSingle(e) != null) ? folder.getSingle(e) : "plugins/WorldEdit/"; + String f = (folder.getSingle(e) != null) ? folder.getSingle(e) : "plugins/WorldEdit/schematics/"; String schem = schematic.getSingle(e); File schemFile = new File((f.endsWith("/")) ? f : f + "/" + new String(schem.endsWith(".schematic") ? schem : schem + ".schematic")); Integer w = null;