Skip to content
Snippets Groups Projects
Commit 1626c810 authored by Zandor Smith's avatar Zandor Smith :computer:
Browse files

Big bug... But it's funny! :P

parent f54864ab
No related branches found
No related tags found
No related merge requests found
......@@ -74,14 +74,18 @@ public class TorchLight extends JavaPlugin {
if (!player.getItemInHand().getType().equals(Material.TORCH)) {
if (playerState.get(player.getName()) != null) {
BlockState state = playerState.get(player.getName());
state.getLocation().getBlock().setType(state.getType());
state.getLocation().getBlock().setData(state.getData().getData());
if(state.getLocation().getBlock() != null) {
state.getLocation().getBlock().setType(state.getType());
state.getLocation().getBlock().setData(state.getData().getData());
}
}
playerState.put(player.getName(), null);
} else {
BlockState state = playerState.get(player.getName());
state.getLocation().getBlock().setType(state.getType());
state.getLocation().getBlock().setData(state.getData().getData());
if(state != null && state.getLocation().getBlock() != null) {
state.getLocation().getBlock().setType(state.getType());
state.getLocation().getBlock().setData(state.getData().getData());
}
Location location = new Location(player.getWorld(), player.getLocation().getX(), player.getLocation().getY() - 1, player.getLocation().getZ());
playerState.put(player.getName(), location.getBlock().getState());
location.getBlock().setType(Material.GLOWSTONE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment