diff --git a/bukkit/src/main/java/com/boydti/fawe/bukkit/v0/BukkitQueue_0.java b/bukkit/src/main/java/com/boydti/fawe/bukkit/v0/BukkitQueue_0.java index 1963b949..049caf1e 100644 --- a/bukkit/src/main/java/com/boydti/fawe/bukkit/v0/BukkitQueue_0.java +++ b/bukkit/src/main/java/com/boydti/fawe/bukkit/v0/BukkitQueue_0.java @@ -237,21 +237,21 @@ public abstract class BukkitQueue_0 extends NMSMa } @Override - public void sendBlockUpdate(Map> blockMap, FawePlayer... players) { + public void sendBlockUpdate(Map> blockMap, FawePlayer... players) { for (FawePlayer player : players) { Player bukkitPlayer = ((BukkitPlayer) player).parent; World world = bukkitPlayer.getWorld(); - for (Map.Entry> entry : blockMap.entrySet()) { + for (Map.Entry> entry : blockMap.entrySet()) { long chunkHash = entry.getKey(); int cx = MathMan.unpairIntX(chunkHash); int cz = MathMan.unpairIntY(chunkHash); - Map blocks = entry.getValue(); - for (Map.Entry blockEntry : blocks.entrySet()) { + Map blocks = entry.getValue(); + for (Map.Entry blockEntry : blocks.entrySet()) { short blockHash = blockEntry.getKey(); int x = (blockHash >> 12 & 0xF) + (cx << 4); int y = (blockHash & 0xFF); int z = (blockHash >> 8 & 0xF) + (cz << 4); - short combined = blockEntry.getValue(); + char combined = blockEntry.getValue(); int id = FaweCache.getId(combined); byte data = (byte) FaweCache.getData(combined); Location loc = new Location(world, x, y, z); diff --git a/core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAQueue.java b/core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAQueue.java index d780fd01..a7ff2228 100644 --- a/core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAQueue.java +++ b/core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAQueue.java @@ -331,7 +331,7 @@ public class MCAQueue extends NMSMappedFaweQueue> blockMap, FawePlayer... players) { + public void sendBlockUpdate(Map> blockMap, FawePlayer... players) { if (parent != null) { parentNMS.sendBlockUpdate(blockMap, players); } diff --git a/core/src/main/java/com/boydti/fawe/object/FaweQueue.java b/core/src/main/java/com/boydti/fawe/object/FaweQueue.java index d2e3a7d2..7f3fd055 100644 --- a/core/src/main/java/com/boydti/fawe/object/FaweQueue.java +++ b/core/src/main/java/com/boydti/fawe/object/FaweQueue.java @@ -245,7 +245,7 @@ public abstract class FaweQueue { return count; } - public abstract void sendBlockUpdate(Map> blockMap, FawePlayer... players); + public abstract void sendBlockUpdate(Map> blockMap, FawePlayer... players); @Deprecated public boolean next() { diff --git a/core/src/main/java/com/boydti/fawe/util/DelegateFaweQueue.java b/core/src/main/java/com/boydti/fawe/util/DelegateFaweQueue.java index 901ce9a4..881ad679 100644 --- a/core/src/main/java/com/boydti/fawe/util/DelegateFaweQueue.java +++ b/core/src/main/java/com/boydti/fawe/util/DelegateFaweQueue.java @@ -169,7 +169,7 @@ public class DelegateFaweQueue extends FaweQueue { } @Override - public void sendBlockUpdate(Map> blockMap, FawePlayer... players) { + public void sendBlockUpdate(Map> blockMap, FawePlayer... players) { parent.sendBlockUpdate(blockMap, players); } diff --git a/core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java b/core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java index 2ed350df..253a84a5 100644 --- a/core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java +++ b/core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java @@ -140,6 +140,23 @@ public class BundledBlockData { valuesEntry.getValue().setDirection(dirs[index]); index += increment; } + } else if (entry.legacyId == 69) { + dir = entry.states.get("facing"); + Vector[] dirs = new Vector[]{ + new Vector(0, -1, 0), + new Vector(1, 0, 0), + new Vector(-1, 0, 0), + new Vector(0, 0, 1), + new Vector(0, 0, -1), + new Vector(0, 1, 0), + new Vector(0, 1, 0), + new Vector(0, -1, 0)}; + int len = dir.values.size(); + int index = 0; + for (Map.Entry valuesEntry : dir.values.entrySet()) { + valuesEntry.getValue().setDirection(dirs[index]); + index ++; + } } } } diff --git a/forge110/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java b/forge110/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java index bd45b378..2a5098eb 100644 --- a/forge110/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java +++ b/forge110/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java @@ -104,11 +104,11 @@ public class ForgeQueue_All extends NMSMappedFaweQueue> blockMap, FawePlayer... players) { - for (Map.Entry> chunkEntry : blockMap.entrySet()) { + public void sendBlockUpdate(Map> blockMap, FawePlayer... players) { + for (Map.Entry> chunkEntry : blockMap.entrySet()) { try { long chunkHash = chunkEntry.getKey(); - Map blocks = chunkEntry.getValue(); + Map blocks = chunkEntry.getValue(); SPacketMultiBlockChange packet = new SPacketMultiBlockChange(); int cx = MathMan.unpairIntX(chunkHash); int cz = MathMan.unpairIntY(chunkHash); @@ -117,7 +117,7 @@ public class ForgeQueue_All extends NMSMappedFaweQueue blockEntry : blocks.entrySet()) { + for (Map.Entry blockEntry : blocks.entrySet()) { buffer.writeShort(blockEntry.getKey()); buffer.writeVarIntToBuffer(blockEntry.getValue()); } diff --git a/forge111/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java b/forge111/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java index 22ddeaa7..d716beea 100644 --- a/forge111/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java +++ b/forge111/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java @@ -89,11 +89,11 @@ public class ForgeQueue_All extends NMSMappedFaweQueue> blockMap, FawePlayer... players) { - for (Map.Entry> chunkEntry : blockMap.entrySet()) { + public void sendBlockUpdate(Map> blockMap, FawePlayer... players) { + for (Map.Entry> chunkEntry : blockMap.entrySet()) { try { long chunkHash = chunkEntry.getKey(); - Map blocks = chunkEntry.getValue(); + Map blocks = chunkEntry.getValue(); SPacketMultiBlockChange packet = new SPacketMultiBlockChange(); int cx = MathMan.unpairIntX(chunkHash); int cz = MathMan.unpairIntY(chunkHash); @@ -102,7 +102,7 @@ public class ForgeQueue_All extends NMSMappedFaweQueue blockEntry : blocks.entrySet()) { + for (Map.Entry blockEntry : blocks.entrySet()) { buffer.writeShort(blockEntry.getKey()); buffer.writeVarInt(blockEntry.getValue()); } diff --git a/forge1710/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java b/forge1710/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java index e0961f5d..96aa5fdc 100644 --- a/forge1710/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java +++ b/forge1710/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java @@ -290,11 +290,11 @@ public class ForgeQueue_All extends NMSMappedFaweQueue> blockMap, FawePlayer... players) { - for (Map.Entry> chunkEntry : blockMap.entrySet()) { + public void sendBlockUpdate(Map> blockMap, FawePlayer... players) { + for (Map.Entry> chunkEntry : blockMap.entrySet()) { try { long chunkHash = chunkEntry.getKey(); - Map blocks = chunkEntry.getValue(); + Map blocks = chunkEntry.getValue(); S22PacketMultiBlockChange packet = new S22PacketMultiBlockChange(); int cx = MathMan.unpairIntX(chunkHash); int cz = MathMan.unpairIntY(chunkHash); @@ -303,7 +303,7 @@ public class ForgeQueue_All extends NMSMappedFaweQueue blockEntry : blocks.entrySet()) { + for (Map.Entry blockEntry : blocks.entrySet()) { buffer.writeShort(blockEntry.getKey()); buffer.writeVarIntToBuffer(blockEntry.getValue()); } diff --git a/forge189/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java b/forge189/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java index 9f4505d7..57e0d10f 100644 --- a/forge189/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java +++ b/forge189/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java @@ -204,11 +204,11 @@ public class ForgeQueue_All extends NMSMappedFaweQueue> blockMap, FawePlayer... players) { - for (Map.Entry> chunkEntry : blockMap.entrySet()) { + public void sendBlockUpdate(Map> blockMap, FawePlayer... players) { + for (Map.Entry> chunkEntry : blockMap.entrySet()) { try { long chunkHash = chunkEntry.getKey(); - Map blocks = chunkEntry.getValue(); + Map blocks = chunkEntry.getValue(); S22PacketMultiBlockChange packet = new S22PacketMultiBlockChange(); int cx = MathMan.unpairIntX(chunkHash); int cz = MathMan.unpairIntY(chunkHash); @@ -217,7 +217,7 @@ public class ForgeQueue_All extends NMSMappedFaweQueue blockEntry : blocks.entrySet()) { + for (Map.Entry blockEntry : blocks.entrySet()) { buffer.writeShort(blockEntry.getKey()); buffer.writeVarIntToBuffer(blockEntry.getValue()); } diff --git a/forge194/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java b/forge194/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java index af8e74ef..e135438b 100644 --- a/forge194/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java +++ b/forge194/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java @@ -242,11 +242,11 @@ public class ForgeQueue_All extends NMSMappedFaweQueue> blockMap, FawePlayer... players) { - for (Map.Entry> chunkEntry : blockMap.entrySet()) { + public void sendBlockUpdate(Map> blockMap, FawePlayer... players) { + for (Map.Entry> chunkEntry : blockMap.entrySet()) { try { long chunkHash = chunkEntry.getKey(); - Map blocks = chunkEntry.getValue(); + Map blocks = chunkEntry.getValue(); SPacketMultiBlockChange packet = new SPacketMultiBlockChange(); int cx = MathMan.unpairIntX(chunkHash); int cz = MathMan.unpairIntY(chunkHash); @@ -255,7 +255,7 @@ public class ForgeQueue_All extends NMSMappedFaweQueue blockEntry : blocks.entrySet()) { + for (Map.Entry blockEntry : blocks.entrySet()) { buffer.writeShort(blockEntry.getKey()); buffer.writeVarIntToBuffer(blockEntry.getValue()); } diff --git a/nukkit/src/main/java/com/boydti/fawe/nukkit/optimization/queue/NukkitQueue.java b/nukkit/src/main/java/com/boydti/fawe/nukkit/optimization/queue/NukkitQueue.java index e28b95db..e04870fd 100644 --- a/nukkit/src/main/java/com/boydti/fawe/nukkit/optimization/queue/NukkitQueue.java +++ b/nukkit/src/main/java/com/boydti/fawe/nukkit/optimization/queue/NukkitQueue.java @@ -124,15 +124,15 @@ public class NukkitQueue extends NMSMappedFaweQueue> blockMap, FawePlayer... players) { + public void sendBlockUpdate(Map> blockMap, FawePlayer... players) { ArrayList blocks = new ArrayList(); - for (Map.Entry> entry : blockMap.entrySet()) { + for (Map.Entry> entry : blockMap.entrySet()) { long chunkHash = entry.getKey(); int cx = MathMan.unpairIntX(chunkHash); int cz = MathMan.unpairIntY(chunkHash); - Map ids = entry.getValue(); - for (Map.Entry blockEntry : ids.entrySet()) { - short combined = blockEntry.getValue(); + Map ids = entry.getValue(); + for (Map.Entry blockEntry : ids.entrySet()) { + char combined = blockEntry.getValue(); int id = FaweCache.getId(combined); int data = FaweCache.getData(combined); Block block = Block.get(id, data);