Use sign with plot schematic
Tweak world unloading
This commit is contained in:
Jesse Boyd
2017-09-24 00:13:05 +10:00
parent 2360782234
commit 92f94ecedc
7 changed files with 98 additions and 12 deletions

View File

@ -119,7 +119,15 @@ public class BukkitUtil extends WorldUtil {
World world = getWorld(worldName);
Block block = world.getBlockAt(x, y, z);
// block.setType(Material.AIR);
block.setTypeIdAndData(Material.WALL_SIGN.getId(), (byte) 2, false);
Material type = block.getType();
if (type != Material.SIGN && type != Material.SIGN_POST) {
int data = 2;
if (world.getBlockAt(x, y, z + 1).getType().isSolid()) data = 2;
else if (world.getBlockAt(x + 1, y, z).getType().isSolid()) data = 4;
else if (world.getBlockAt(x, y, z - 1).getType().isSolid()) data = 3;
else if (world.getBlockAt(x - 1, y, z).getType().isSolid()) data = 5;
block.setTypeIdAndData(Material.WALL_SIGN.getId(), (byte) data, false);
}
BlockState blockstate = block.getState();
if (blockstate instanceof Sign) {
final Sign sign = (Sign) blockstate;