From e890eb1a79bdd2c0f119c7e8e52c8fd683585df6 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Mon, 7 Mar 2011 13:45:15 -0500 Subject: [PATCH] Add non updating type/data sets By: Tahg --- .../bukkit/craftbukkit/block/CraftBlock.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java index 0c0804958e..8eb95d05a1 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -90,6 +90,14 @@ public class CraftBlock implements Block { chunk.getHandle().d.c(x, y, z, data); } + public void setData(final byte data, boolean applyPhysics) { + if(applyPhysics) { + chunk.getHandle().d.c(x, y, z, data); + } else { + chunk.getHandle().d.d(x, y, z, data); + } + } + /** * Gets the metadata for this block * @@ -117,6 +125,22 @@ public class CraftBlock implements Block { public boolean setTypeId(final int type) { return chunk.getHandle().d.e(x, y, z, type); } + + public boolean setTypeId(final int type, final boolean applyPhysics) { + if(applyPhysics) { + return setTypeId(type); + } else { + return chunk.getHandle().d.setTypeId(x, y, z, type); + } + } + + public boolean setTypeIdAndData(final int type, final byte data, final boolean applyPhysics) { + if(applyPhysics) { + return chunk.getHandle().d.b(x, y, z, type, data); + } else { + return chunk.getHandle().d.setTypeIdAndData(x, y, z, type, data); + } + } /** * Gets the type of this block