diff --git a/bukkit/src/main/java/com/boydti/fawe/bukkit/v0/BukkitQueue_All.java b/bukkit/src/main/java/com/boydti/fawe/bukkit/v0/BukkitQueue_All.java index 67a3f4f7..ebc4a51e 100644 --- a/bukkit/src/main/java/com/boydti/fawe/bukkit/v0/BukkitQueue_All.java +++ b/bukkit/src/main/java/com/boydti/fawe/bukkit/v0/BukkitQueue_All.java @@ -137,7 +137,6 @@ public class BukkitQueue_All extends BukkitQueue_0 map = new Long2ObjectOpenHashMap() { - @Override - public Object put(long l, Object o) { - synchronized (this) { - return super.put(l, o); - } - } - - @Override - public synchronized Object put(Long aLong, Object o) { - return super.put(aLong, o); - } - }; -// map = new ConcurrentHashMap<>(); - long start = System.currentTimeMillis(); - for (int j = 0; j < 50000; j++) { - for (long i = 0; i < 256; i++) { - map.put(i, i); - } - map.clear(); - } - System.out.println(System.currentTimeMillis() - start); - System.out.println(map.size()); - } - public static boolean physicsFreeze = false; public static boolean itemFreeze = false; diff --git a/core/src/main/java/com/sk89q/worldedit/EditSession.java b/core/src/main/java/com/sk89q/worldedit/EditSession.java index 480c5922..d6a04365 100644 --- a/core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -1576,7 +1576,7 @@ public class EditSession extends AbstractWorld implements HasFaweQueue, Lighting public int setBlocks(final Region region, final BaseBlock block) throws MaxChangedBlocksException { checkNotNull(region); checkNotNull(block); - if (canBypassAll(region, false, true)) { + if (canBypassAll(region, false, true) && !block.hasNbtData()) { return changes = queue.setBlocks((CuboidRegion) region, block.getId(), block.getData()); } Iterator iter = region.iterator(); diff --git a/core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java b/core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java index 8682db64..5b32708b 100644 --- a/core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java +++ b/core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java @@ -27,6 +27,7 @@ import com.boydti.fawe.object.FawePlayer; import com.boydti.fawe.object.FaweQueue; import com.boydti.fawe.util.MathMan; import com.boydti.fawe.util.SetQueue; +import com.sk89q.jnbt.CompoundTag; import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; @@ -37,6 +38,7 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; +import com.sk89q.worldedit.WorldVector; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.function.GroundFunction; @@ -153,6 +155,25 @@ public class RegionCommands { BBC.UPDATED_LIGHTING_SELECTION.send(fp, count); } + @Command( + aliases = { "/nbtinfo", "/nbt" }, + desc = "View nbt info for a block" + ) + @CommandPermissions("worldedit.nbtinfo") + public void nbtinfo(Player player, EditSession editSession) { + WorldVector pos = player.getBlockTrace(128); + if (pos == null) { + BBC.NO_BLOCK.send(player); + return; + } + CompoundTag nbt = editSession.getBlock(pos).getNbtData(); + if (nbt != null) { + player.print(nbt.getValue().toString()); + } else { + BBC.NO_BLOCK.send(player); + } + } + @Command( aliases = { "/setblocklight", "/setlight" }, desc = "Set block lighting in a selection", diff --git a/core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java b/core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java index 9f496f6e..13b34237 100644 --- a/core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java +++ b/core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java @@ -342,6 +342,7 @@ public class DefaultBlockParser extends InputParser { text[2] = blockAndExtraData.length > 3 ? blockAndExtraData[3] : ""; text[3] = blockAndExtraData.length > 4 ? blockAndExtraData[4] : ""; return new SignBlock(blockType.getID(), data, text); + case CHEST: case END_GATEWAY: case END_PORTAL: return new BaseBlock(blockId, data, new CompoundTag(new HashMap()));