Program: 174864
Project: 174864
Buggy source:
@EventHandler public void onPlayerInteractEvent(final PlayerInteractEvent event){
  Player player=event.getPlayer();
  Block block=event.getBlock();
  if (player.getName().equals(plugin.set)) {
switch (plugin.status) {
case 0:
      plugin.pos1=event.getBlock().getLocation();
    player.sendTitle(TextFormat.GOLD + "String_Node_Str");
  player.setSubtitle(TextFormat.RED + "String_Node_Str" + event.getBlock().x+ "String_Node_Str"+ event.getBlock().y+ "String_Node_Str"+ event.getBlock().z);
plugin.status++;
break;
case 1:
if (plugin.pos1.getLevel().getFolderName().equals(event.getBlock().getLevel().getFolderName())) {
if (plugin.pos1.x == block.x) {
if (Math.abs(plugin.pos1.y - block.y) == 4 && Math.abs(plugin.pos1.z - block.z) == 3) {
  plugin.pos2=block.getLocation();
  int x1=(int)plugin.pos1.x;
  int y1;
  if (plugin.pos1.y > plugin.pos2.y) {
    y1=(int)plugin.pos2.y;
  }
 else {
    y1=(int)plugin.pos1.y;
  }
  int z1;
  if (plugin.pos1.z > plugin.pos2.z) {
    z1=(int)plugin.pos2.z;
  }
 else {
    z1=(int)plugin.pos1.z;
  }
  HashMap<Integer,HashMap<Integer,Position>> line;
  line=wtLine(x1,y1,z1,block.getLevel(),true);
  plugin.line=line;
  plugin.status++;
  wtBlock(line,player.getLevel());
  player.sendTitle(TextFormat.GOLD + "String_Node_Str");
  player.setSubtitle(TextFormat.RED + "String_Node_Str" + event.getBlock().x+ "String_Node_Str"+ event.getBlock().y+ "String_Node_Str"+ event.getBlock().z);
}
 else {
  plugin.status=0;
  player.sendMessage(TextFormat.RED + "String_Node_Str");
}
}
 else if (plugin.pos1.z == block.z) {
if (Math.abs(plugin.pos1.y - block.y) == 4 && Math.abs(plugin.pos1.x - block.x) == 3) {
  plugin.pos2=block.getLocation();
  int z1=(int)plugin.pos1.z;
  int y1;
  if (plugin.pos1.y > plugin.pos2.y) {
    y1=(int)plugin.pos2.y;
  }
 else {
    y1=(int)plugin.pos1.y;
  }
  int x1;
  if (plugin.pos1.x > plugin.pos2.x) {
    x1=(int)plugin.pos2.x;
  }
 else {
    x1=(int)plugin.pos1.x;
  }
  HashMap<Integer,HashMap<Integer,Position>> line;
  line=wtLine(x1,y1,z1,block.getLevel(),false);
  plugin.line=line;
  plugin.status++;
  wtBlock(line,player.getLevel());
  player.sendTitle(TextFormat.GOLD + "String_Node_Str");
  player.setSubtitle(TextFormat.RED + "String_Node_Str" + event.getBlock().x+ "String_Node_Str"+ event.getBlock().y+ "String_Node_Str"+ event.getBlock().z);
}
 else {
  plugin.status=0;
  player.sendMessage(TextFormat.RED + "String_Node_Str");
}
}
 else {
plugin.status=0;
player.sendMessage(TextFormat.RED + "String_Node_Str");
}
}
 else {
plugin.status=0;
player.sendMessage(TextFormat.RED + "String_Node_Str");
}
break;
case 2:
if (block.getId() == 63 || block.getId() == 68 || block.getId() == 323) {
plugin.start=block.getLocation();
BlockEntity blockEntity=block.getLevel().getBlockEntity(block.getLocation());
BlockEntitySign sign=new BlockEntitySign(blockEntity.chunk,blockEntity.namedTag);
sign.setText(TextFormat.GOLD + "String_Node_Str",TextFormat.GREEN + "String_Node_Str",TextFormat.AQUA + "String_Node_Str",TextFormat.WHITE + "String_Node_Str");
plugin.status++;
player.sendTitle(TextFormat.GOLD + "String_Node_Str");
}
 else {
player.sendMessage(TextFormat.RED + "String_Node_Str");
}
break;
case 3:
if (block.getId() == 63 || block.getId() == 68 || block.getId() == 323) {
plugin.top=block.getLocation();
BlockEntity blockEntity=block.getLevel().getBlockEntity(block.getLocation());
BlockEntitySign sign=new BlockEntitySign(blockEntity.chunk,blockEntity.namedTag);
sign.setText(TextFormat.GOLD + "String_Node_Str",TextFormat.YELLOW + "String_Node_Str",TextFormat.AQUA + "String_Node_Str",TextFormat.WHITE + "String_Node_Str");
plugin.status++;
plugin.set="String_Node_Str";
plugin.saveData();
player.sendTitle(TextFormat.GOLD + "String_Node_Str");
}
 else {
player.sendMessage(TextFormat.RED + "String_Node_Str");
}
break;
}
event.setCancelled();
}
 else if (plugin.player != null) {
if (plugin.status == 0) {
return;
}
if (player.getName().equals(plugin.player)) {
if (plugin.line.get(0).get(0).level.getFolderName().equals(block.getLevel().getFolderName()) && plugin.line.get(0).get(0).x <= block.x && plugin.line.get(0).get(0).y <= block.y && plugin.line.get(0).get(0).z <= block.z && plugin.line.get(4).get(3).x >= block.x && plugin.line.get(4).get(3).y >= block.y && plugin.line.get(4).get(3).z >= block.z) {
if (block.y == plugin.line.get(0).get(0).y) {
if (block.getId() == 35 && block.getDamage() == 0) {
for (Map.Entry<Integer,HashMap<Integer,Position>> entry : plugin.line.entrySet()) {
for (Map.Entry<Integer,Position> entry1 : entry.getValue().entrySet()) {
player.getLevel().setBlock(entry1.getValue(),Block.get(35,14));
}
}
plugin.player=null;
plugin.game=0;
plugin.StartTime=0;
player.sendTitle("String_Node_Str");
BlockEntity blockEntity=plugin.line.get(0).get(0).getLevel().getBlockEntity(plugin.start);
BlockEntitySign sign=new BlockEntitySign(blockEntity.chunk,blockEntity.namedTag);
sign.setText(TextFormat.GOLD + "String_Node_Str",TextFormat.GREEN + "String_Node_Str",TextFormat.AQUA + "String_Node_Str",TextFormat.WHITE + "String_Node_Str");
}
 else if (block.getId() == 35 && block.getDamage() == 15) {
if (plugin.game == 50) {
long nanotime=System.nanoTime() - plugin.StartTime;
BigDecimal b=new BigDecimal(((double)nanotime / 1000000000));
double gametime=b.setScale(8,BigDecimal.ROUND_HALF_UP).doubleValue();
player.sendTitle(TextFormat.GREEN + "String_Node_Str" + (float)gametime);
if (gametime < plugin.first) {
BlockEntity blockEntity=plugin.top.getLevel().getBlockEntity(plugin.top);
BlockEntitySign sign=new BlockEntitySign(blockEntity.chunk,blockEntity.namedTag);
sign.setText(TextFormat.GOLD + "String_Node_Str",TextFormat.YELLOW + player.getName(),TextFormat.AQUA + "String_Node_Str" + (float)gametime,TextFormat.WHITE + "String_Node_Str");
plugin.getServer().broadcastMessage(TextFormat.GOLD + "String_Node_Str" + player.getName()+ "String_Node_Str");
}
plugin.player=null;
BlockEntity blockEntity=plugin.line.get(0).get(0).getLevel().getBlockEntity(plugin.start);
BlockEntitySign sign=new BlockEntitySign(blockEntity.chunk,blockEntity.namedTag);
sign.setText(TextFormat.GOLD + "String_Node_Str",TextFormat.GREEN + "String_Node_Str",TextFormat.AQUA + "String_Node_Str",TextFormat.WHITE + "String_Node_Str");
ChangeBlock(plugin.game,player.getLevel());
plugin.game=0;
CheckGameTimeout.time=0;
}
 else {
CheckGameTimeout.time=0;
ChangeBlock(plugin.game,player.getLevel());
plugin.game++;
}
}
}
}
 else if (block.getX() == plugin.start.x && block.getY() == plugin.start.y && block.getZ() == plugin.start.z && block.getLevel().getFolderName().equals(plugin.start.level.getFolderName())) {
player.sendMessage(TextFormat.RED + "String_Node_Str");
plugin.player=null;
plugin.game=0;
plugin.StartTime=0;
BlockEntity blockEntity=plugin.line.get(0).get(0).getLevel().getBlockEntity(plugin.start);
BlockEntitySign sign=new BlockEntitySign(blockEntity.chunk,blockEntity.namedTag);
sign.setText(TextFormat.GOLD + "String_Node_Str",TextFormat.GREEN + "String_Node_Str",TextFormat.AQUA + "String_Node_Str",TextFormat.WHITE + "String_Node_Str");
wtBlock(plugin.line,player.getLevel());
}
}
 else if (block.getX() == plugin.start.x && block.getY() == plugin.start.y && block.getZ() == plugin.start.z && block.getLevel().getFolderName().equals(plugin.start.level.getFolderName())) {
player.sendMessage(TextFormat.YELLOW + "String_Node_Str");
}
}
 else if (plugin.status != 0 && block.getX() == plugin.start.x && block.getY() == plugin.start.y && block.getZ() == plugin.start.z && block.getLevel().getFolderName().equals(plugin.start.level.getFolderName())) {
plugin.player=player.getName();
CheckGameTimeout.time=0;
BlockEntity blockEntity=plugin.line.get(0).get(0).getLevel().getBlockEntity(plugin.start);
BlockEntitySign sign=new BlockEntitySign(blockEntity.chunk,blockEntity.namedTag);
sign.setText(TextFormat.GOLD + "String_Node_Str",TextFormat.RED + "String_Node_Str",TextFormat.AQUA + "String_Node_Str" + player.getName(),TextFormat.WHITE + "String_Node_Str");
player.sendTitle(TextFormat.YELLOW + "String_Node_Str");
ChangeBlock(0,player.getLevel());
plugin.game++;
}
}

Fixed version (ground truth):
@EventHandler public void onPlayerInteractEvent(final PlayerInteractEvent event){
  Player player=event.getPlayer();
  Block block=event.getBlock();
  if (player.getName().equals(plugin.set)) {
switch (plugin.status) {
case 0:
      plugin.pos1=event.getBlock().getLocation();
    player.sendTitle(TextFormat.GOLD + "String_Node_Str");
  player.setSubtitle(TextFormat.RED + "String_Node_Str" + event.getBlock().x+ "String_Node_Str"+ event.getBlock().y+ "String_Node_Str"+ event.getBlock().z);
plugin.status++;
break;
case 1:
if (plugin.pos1.getLevel().getFolderName().equals(event.getBlock().getLevel().getFolderName())) {
if (plugin.pos1.x == block.x) {
if (Math.abs(plugin.pos1.y - block.y) == 4 && Math.abs(plugin.pos1.z - block.z) == 3) {
  plugin.pos2=block.getLocation();
  int x1=(int)plugin.pos1.x;
  int y1;
  if (plugin.pos1.y > plugin.pos2.y) {
    y1=(int)plugin.pos2.y;
  }
 else {
    y1=(int)plugin.pos1.y;
  }
  int z1;
  if (plugin.pos1.z > plugin.pos2.z) {
    z1=(int)plugin.pos2.z;
  }
 else {
    z1=(int)plugin.pos1.z;
  }
  HashMap<Integer,HashMap<Integer,Position>> line;
  line=wtLine(x1,y1,z1,block.getLevel(),true);
  plugin.line=line;
  plugin.status++;
  wtBlock(line,player.getLevel());
  player.sendTitle(TextFormat.GOLD + "String_Node_Str");
  player.setSubtitle(TextFormat.RED + "String_Node_Str" + event.getBlock().x+ "String_Node_Str"+ event.getBlock().y+ "String_Node_Str"+ event.getBlock().z);
}
 else {
  plugin.status=0;
  player.sendMessage(TextFormat.RED + "String_Node_Str");
}
}
 else if (plugin.pos1.z == block.z) {
if (Math.abs(plugin.pos1.y - block.y) == 4 && Math.abs(plugin.pos1.x - block.x) == 3) {
  plugin.pos2=block.getLocation();
  int z1=(int)plugin.pos1.z;
  int y1;
  if (plugin.pos1.y > plugin.pos2.y) {
    y1=(int)plugin.pos2.y;
  }
 else {
    y1=(int)plugin.pos1.y;
  }
  int x1;
  if (plugin.pos1.x > plugin.pos2.x) {
    x1=(int)plugin.pos2.x;
  }
 else {
    x1=(int)plugin.pos1.x;
  }
  HashMap<Integer,HashMap<Integer,Position>> line;
  line=wtLine(x1,y1,z1,block.getLevel(),false);
  plugin.line=line;
  plugin.status++;
  wtBlock(line,player.getLevel());
  player.sendTitle(TextFormat.GOLD + "String_Node_Str");
  player.setSubtitle(TextFormat.RED + "String_Node_Str" + event.getBlock().x+ "String_Node_Str"+ event.getBlock().y+ "String_Node_Str"+ event.getBlock().z);
}
 else {
  plugin.status=0;
  player.sendMessage(TextFormat.RED + "String_Node_Str");
}
}
 else {
plugin.status=0;
player.sendMessage(TextFormat.RED + "String_Node_Str");
}
}
 else {
plugin.status=0;
player.sendMessage(TextFormat.RED + "String_Node_Str");
}
break;
case 2:
if (block.getId() == 63 || block.getId() == 68 || block.getId() == 323) {
plugin.start=block.getLocation();
BlockEntity blockEntity=block.getLevel().getBlockEntity(block.getLocation());
BlockEntitySign sign=new BlockEntitySign(blockEntity.chunk,blockEntity.namedTag);
sign.setText(TextFormat.GOLD + "String_Node_Str",TextFormat.GREEN + "String_Node_Str",TextFormat.AQUA + "String_Node_Str",TextFormat.WHITE + "String_Node_Str");
plugin.status++;
player.sendTitle(TextFormat.GOLD + "String_Node_Str");
}
 else {
player.sendMessage(TextFormat.RED + "String_Node_Str");
}
break;
case 3:
if (block.getId() == 63 || block.getId() == 68 || block.getId() == 323) {
plugin.top=block.getLocation();
BlockEntity blockEntity=block.getLevel().getBlockEntity(block.getLocation());
BlockEntitySign sign=new BlockEntitySign(blockEntity.chunk,blockEntity.namedTag);
sign.setText(TextFormat.GOLD + "String_Node_Str",TextFormat.YELLOW + "String_Node_Str",TextFormat.AQUA + "String_Node_Str",TextFormat.WHITE + "String_Node_Str");
plugin.status++;
plugin.set="String_Node_Str";
plugin.saveData();
player.sendTitle(TextFormat.GOLD + "String_Node_Str");
}
 else {
player.sendMessage(TextFormat.RED + "String_Node_Str");
}
break;
}
event.setCancelled();
}
 else if (plugin.player != null) {
if (plugin.status == 0) {
return;
}
if (player.getName().equals(plugin.player)) {
if (plugin.line.get(0).get(0).level.getFolderName().equals(block.getLevel().getFolderName()) && plugin.line.get(0).get(0).x <= block.x && plugin.line.get(0).get(0).y <= block.y && plugin.line.get(0).get(0).z <= block.z && plugin.line.get(4).get(3).x >= block.x && plugin.line.get(4).get(3).y >= block.y && plugin.line.get(4).get(3).z >= block.z) {
if (block.y == plugin.line.get(0).get(0).y) {
if (block.getId() == 35 && block.getDamage() == 0) {
for (Map.Entry<Integer,HashMap<Integer,Position>> entry : plugin.line.entrySet()) {
for (Map.Entry<Integer,Position> entry1 : entry.getValue().entrySet()) {
player.getLevel().setBlock(entry1.getValue(),Block.get(35,14));
}
}
plugin.player=null;
plugin.game=0;
plugin.StartTime=0;
player.sendTitle("String_Node_Str");
BlockEntity blockEntity=plugin.line.get(0).get(0).getLevel().getBlockEntity(plugin.start);
BlockEntitySign sign=new BlockEntitySign(blockEntity.chunk,blockEntity.namedTag);
sign.setText(TextFormat.GOLD + "String_Node_Str",TextFormat.GREEN + "String_Node_Str",TextFormat.AQUA + "String_Node_Str",TextFormat.WHITE + "String_Node_Str");
}
 else if (block.getId() == 35 && block.getDamage() == 15) {
if (plugin.game == 49) {
long nanotime=System.nanoTime() - plugin.StartTime;
BigDecimal b=new BigDecimal(((double)nanotime / 1000000000));
double gametime=b.setScale(8,BigDecimal.ROUND_HALF_UP).doubleValue();
player.sendTitle(TextFormat.GREEN + "String_Node_Str" + (float)gametime);
if (gametime < plugin.first) {
BlockEntity blockEntity=plugin.top.getLevel().getBlockEntity(plugin.top);
BlockEntitySign sign=new BlockEntitySign(blockEntity.chunk,blockEntity.namedTag);
sign.setText(TextFormat.GOLD + "String_Node_Str",TextFormat.YELLOW + player.getName(),TextFormat.AQUA + "String_Node_Str" + (float)gametime,TextFormat.WHITE + "String_Node_Str");
plugin.getServer().broadcastMessage(TextFormat.GOLD + "String_Node_Str" + player.getName()+ "String_Node_Str");
}
plugin.player=null;
BlockEntity blockEntity=plugin.line.get(0).get(0).getLevel().getBlockEntity(plugin.start);
BlockEntitySign sign=new BlockEntitySign(blockEntity.chunk,blockEntity.namedTag);
sign.setText(TextFormat.GOLD + "String_Node_Str",TextFormat.GREEN + "String_Node_Str",TextFormat.AQUA + "String_Node_Str",TextFormat.WHITE + "String_Node_Str");
ChangeBlock(plugin.game,player.getLevel());
plugin.game=0;
CheckGameTimeout.time=0;
}
 else {
CheckGameTimeout.time=0;
ChangeBlock(plugin.game,player.getLevel());
plugin.game++;
}
}
}
}
 else if (block.getX() == plugin.start.x && block.getY() == plugin.start.y && block.getZ() == plugin.start.z && block.getLevel().getFolderName().equals(plugin.start.level.getFolderName())) {
player.sendMessage(TextFormat.RED + "String_Node_Str");
plugin.player=null;
plugin.game=0;
plugin.StartTime=0;
BlockEntity blockEntity=plugin.line.get(0).get(0).getLevel().getBlockEntity(plugin.start);
BlockEntitySign sign=new BlockEntitySign(blockEntity.chunk,blockEntity.namedTag);
sign.setText(TextFormat.GOLD + "String_Node_Str",TextFormat.GREEN + "String_Node_Str",TextFormat.AQUA + "String_Node_Str",TextFormat.WHITE + "String_Node_Str");
wtBlock(plugin.line,player.getLevel());
}
}
 else if (block.getX() == plugin.start.x && block.getY() == plugin.start.y && block.getZ() == plugin.start.z && block.getLevel().getFolderName().equals(plugin.start.level.getFolderName())) {
player.sendMessage(TextFormat.YELLOW + "String_Node_Str");
}
}
 else if (plugin.status != 0 && block.getX() == plugin.start.x && block.getY() == plugin.start.y && block.getZ() == plugin.start.z && block.getLevel().getFolderName().equals(plugin.start.level.getFolderName())) {
plugin.player=player.getName();
CheckGameTimeout.time=0;
BlockEntity blockEntity=plugin.line.get(0).get(0).getLevel().getBlockEntity(plugin.start);
BlockEntitySign sign=new BlockEntitySign(blockEntity.chunk,blockEntity.namedTag);
sign.setText(TextFormat.GOLD + "String_Node_Str",TextFormat.RED + "String_Node_Str",TextFormat.AQUA + "String_Node_Str" + player.getName(),TextFormat.WHITE + "String_Node_Str");
player.sendTitle(TextFormat.YELLOW + "String_Node_Str");
ChangeBlock(0,player.getLevel());
plugin.game++;
}
}