} else if (BBSettings.blockPlace && pi.getWatched()) {
int x;
int y;
int z;
int type;
PlacedBlock dataBlock;
World world;
Block block = event.getClickedBlock();
plugin.closeChestIfOpen(pi);
if(block.getState() instanceof Chest) {
Chest chest = ((Chest)block.getState());
// OH SHI-
BBUsersTable.getInstance().userOpenedChest(player.getName(),chest,chest.getInventory().getContents());
return;
}
switch (event.getMaterial()) {
//TODO Door logging
case LAVA_BUCKET:
x = event.getClickedBlock().getX() + event.getBlockFace().getModX();
y = event.getClickedBlock().getY() + event.getBlockFace().getModY();
z = event.getClickedBlock().getZ() + event.getBlockFace().getModZ();
type = Material.LAVA.getId();
world = event.getClickedBlock().getWorld();
dataBlock = new PlacedBlock(event.getPlayer().getName(), world.getName(), x, y, z, type, (byte) 0);
LavaFlowLogger.log(new Location(world, x, y, z), event.getPlayer().getName());
dataBlock.send();
break;
case WATER_BUCKET:
x = event.getClickedBlock().getX() + event.getBlockFace().getModX();
y = event.getClickedBlock().getY() + event.getBlockFace().getModY();
z = event.getClickedBlock().getZ() + event.getBlockFace().getModZ();
type = Material.WATER.getId();
world = event.getClickedBlock().getWorld();
dataBlock = new PlacedBlock(event.getPlayer().getName(), world.getName(), x, y, z, type, (byte) 0);
dataBlock.send();
break;
case SIGN:
x = event.getClickedBlock().getX() + event.getBlockFace().getModX();
y = event.getClickedBlock().getY() + event.getBlockFace().getModY();
z = event.getClickedBlock().getZ() + event.getBlockFace().getModZ();
world = event.getClickedBlock().getWorld();
int data = 0;
switch (event.getBlockFace()) {
case UP:
type = Material.SIGN_POST.getId();
break;
case NORTH:
data = 4;
type = Material.WALL_SIGN.getId();
break;
case SOUTH:
data = 5;
type = Material.WALL_SIGN.getId();
break;
case EAST:
data = 2;
type = Material.WALL_SIGN.getId();
break;
case WEST:
data = 3;
type = Material.WALL_SIGN.getId();
break;
default:
type = Material.SIGN.getId();
}
dataBlock = new PlacedBlock(event.getPlayer().getName(), world.getName(), x, y, z, type, (byte) data);
dataBlock.send();
break;
case BUCKET:
BrokenBlock dataBlock2;
world = event.getClickedBlock().getWorld();
switch (event.getClickedBlock().getType()) {