From 84907dd3a29bee73e67643ea92edfe2c4111dbd0 Mon Sep 17 00:00:00 2001 From: Richard Date: Sun, 29 Nov 2015 01:42:11 -0200 Subject: [PATCH] More fixes (can't have optional [] on types), experimental set effect... ... updated but still not working. --- plugin.yml | 2 +- src/me/TheBukor/SkStuff.java | 6 +++--- src/me/TheBukor/effects/EffExecuteWorldEdit.java | 9 +++++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/plugin.yml b/plugin.yml index fc753db..d5f9267 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,6 +1,6 @@ name: SkStuff author: TheBukor description: A Skript addon which adds extra functionalities such as NBT and extended WorldEdit support. -version: 1.2.1 +version: 1.2.2 main: me.TheBukor.SkStuff softdepend: [Skript] \ No newline at end of file diff --git a/src/me/TheBukor/SkStuff.java b/src/me/TheBukor/SkStuff.java index ce04656..fbd75a9 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, "[nbt] compound[s]").name("NBT Tag Compound").parser(new Parser() { + Classes.registerClass(new ClassInfo(NBTTagCompound.class, "compound").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, "[nbt] compound[s]").name("NBT Tag Compound").parser(new Parser() { + Classes.registerClass(new ClassInfo(net.minecraft.server.v1_8_R2.NBTTagCompound.class, "compound").name("NBT Tag Compound").parser(new Parser() { @Override public String getVariableNamePattern() { @@ -134,7 +134,7 @@ public class SkStuff extends JavaPlugin { Skript.registerExpression(ExprNBTv1_8_R3.class, net.minecraft.server.v1_8_R3.NBTTagCompound.class, ExpressionType.PROPERTY, "nbt[[ ]tag[s]] of %entity/block/itemstack%", "%entity/block/itemstack%'s nbt[[ ]tag[s]]"); Skript.registerExpression(ExprItemNBTv1_8_R3.class, ItemStack.class, ExpressionType.SIMPLE, "%itemstack% with [custom] nbt[[ ]tag[s]] %string%"); Skript.registerExpression(ExprTagOfv1_8_R3.class, Object.class, ExpressionType.SIMPLE, "[nbt[ ]]tag %string% of [nbt [compound]] %compound%"); - Classes.registerClass(new ClassInfo(net.minecraft.server.v1_8_R3.NBTTagCompound.class, "[nbt] compound[s]").name("NBT Compound").parser(new Parser() { + Classes.registerClass(new ClassInfo(net.minecraft.server.v1_8_R3.NBTTagCompound.class, "compound").name("NBT Compound").parser(new Parser() { @Override public String getVariableNamePattern() { diff --git a/src/me/TheBukor/effects/EffExecuteWorldEdit.java b/src/me/TheBukor/effects/EffExecuteWorldEdit.java index 3446d55..9d9e549 100644 --- a/src/me/TheBukor/effects/EffExecuteWorldEdit.java +++ b/src/me/TheBukor/effects/EffExecuteWorldEdit.java @@ -12,6 +12,7 @@ import com.sk89q.worldedit.IncompleteRegionException; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.bukkit.WorldEditPlugin; +import com.sk89q.worldedit.world.World; import ch.njol.skript.lang.Effect; import ch.njol.skript.lang.Expression; @@ -44,12 +45,16 @@ public class EffExecuteWorldEdit extends Effect { Player p = player.getSingle(e); ItemStack b = block.getSingle(e); Integer limit = blockLimit.getSingle(e); + if (limit == null) limit = we.getWorldEdit().getConfiguration().defaultChangeLimit; if (we.getSelection(p) != null) { if (b.getType().isBlock()) { try { EditSession session = we.createEditSession(p); - session.setBlockChangeLimit(limit != null ? limit : 4096); - session.setBlocks(we.getSession(p).getRegion(), new BaseBlock(b.getTypeId())); + p.sendMessage(Boolean.toString(session.isQueueEnabled())); + session.enableQueue(); + session.setBlockChangeLimit(limit); + session.setBlocks(we.getSession(p).getSelection((World) we.wrapPlayer(p).getWorld()), new BaseBlock(b.getTypeId(), b.getDurability())); + we.getSession(p).remember(session); } catch (MaxChangedBlocksException | IncompleteRegionException ex) { return; }