Implemented BlockState.update(boolean), signs should now work, cleaned up some code a little

This commit is contained in:
Dinnerbone
2011-01-08 01:22:17 +00:00
parent c9efe94545
commit d374bff8d0
7 changed files with 157 additions and 121 deletions

View File

@@ -4,6 +4,7 @@ package org.bukkit.craftbukkit;
import org.bukkit.*;
import org.bukkit.block.BlockState;
import org.bukkit.craftbukkit.block.CraftBlockState;
import org.bukkit.craftbukkit.block.CraftSign;
public class CraftBlock implements Block {
private final CraftWorld world;
@@ -253,6 +254,15 @@ public class CraftBlock implements Block {
}
public BlockState getState() {
return new CraftBlockState(world, x, y, z, type, data);
Material material = getType();
switch (material) {
case Sign:
case SignPost:
case WallSign:
return new CraftSign(this);
default:
return new CraftBlockState(this);
}
}
}