From 6d28eb011152af08bc1c52a554bb0efd5ab527c4 Mon Sep 17 00:00:00 2001 From: Dinnerbone Date: Wed, 29 Dec 2010 01:07:57 +0000 Subject: [PATCH] Made Block.setType/Block.setData functional --- src/org/bukkit/craftbukkit/CraftBlock.java | 10 ++++++---- src/org/bukkit/craftbukkit/CraftWorld.java | 4 ++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/org/bukkit/craftbukkit/CraftBlock.java b/src/org/bukkit/craftbukkit/CraftBlock.java index 8da650899b..351f4a7bea 100644 --- a/src/org/bukkit/craftbukkit/CraftBlock.java +++ b/src/org/bukkit/craftbukkit/CraftBlock.java @@ -4,22 +4,22 @@ package org.bukkit.craftbukkit; import org.bukkit.*; public class CraftBlock implements Block { - private final World world; - private final Chunk chunk; + private final CraftWorld world; + private final CraftChunk chunk; private final int x; private final int y; private final int z; protected int type; protected byte data; - protected CraftBlock(final World world, final int x, final int y, final int z, final int type, final byte data) { + protected CraftBlock(final CraftWorld world, final int x, final int y, final int z, final int type, final byte data) { this.world = world; this.x = x; this.y = y; this.z = z; this.type = type; this.data = data; - this.chunk = world.getChunkAt(x << 4, z << 4); + this.chunk = (CraftChunk)world.getChunkAt(x << 4, z << 4); } /** @@ -74,6 +74,7 @@ public class CraftBlock implements Block { */ public void setData(final byte data) { this.data = data; + world.getHandle().c(x, y, z, data); } /** @@ -92,6 +93,7 @@ public class CraftBlock implements Block { */ public void setType(final int type) { this.type = type; + world.getHandle().d(x, y, z, type); } /** diff --git a/src/org/bukkit/craftbukkit/CraftWorld.java b/src/org/bukkit/craftbukkit/CraftWorld.java index ec7298aad4..f8f5a40e09 100644 --- a/src/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/org/bukkit/craftbukkit/CraftWorld.java @@ -66,6 +66,10 @@ public class CraftWorld implements World { return block; } + public WorldServer getHandle() { + return world; + } + private final class ChunkCoordinate { public final int x; public final int z;