Added some prints for debugging.

This commit is contained in:
Tobias Ottenweller 2013-06-23 18:07:18 +02:00
parent afe693d491
commit 09b9c65ef6
6 changed files with 14 additions and 9 deletions

View File

@ -306,6 +306,10 @@ public class GatesManager
protected void addGateByLocations(final Gate g)
{
if (g.getGateBlockLocations().isEmpty()) {
System.out.println("gate has no block locations!");
}
for (Location l : g.getGateBlockLocations()) {
SimpleLocation sl = new SimpleLocation(l);
gatesByLocation.put(sl, g);

View File

@ -73,5 +73,7 @@ public class CommandInfo extends BaseCommand
gate.getExit().getWorld().getName());
else
sendMessage(ChatColor.DARK_AQUA + "NOTE: this gate has no exit");
System.out.println("frame: " + gate.getGateFrameBlocks());
}
}

View File

@ -77,6 +77,7 @@ public class CommandLocation extends BaseLocationCommand
}
Plugin.getPlugin().getGatesManager().handleGateLocationChange(gate, oldLocation, oldGateBlockLocations, oldFrameBlocks);
GateBlockChangeSender.updateGateBlocks(gate);
sendMessage(ChatColor.GREEN + "The location of '" + gate.getId() + "' is now at your current location.");
}
@ -86,8 +87,6 @@ public class CommandLocation extends BaseLocationCommand
Plugin.log(Level.WARNING, e.getMessage());
e.printStackTrace();
}
GateBlockChangeSender.updateGateBlocks(gate);
}
}

View File

@ -58,7 +58,6 @@ public class CommandNew extends BaseLocationCommand
}
gate = new Gate(id);
gatesManager.handleNewGate(gate);
sendMessage(ChatColor.GREEN + "Gate with id '" + id + "' was created.");
@ -77,6 +76,8 @@ public class CommandNew extends BaseLocationCommand
sendMessage("Now you should build a frame and execute:");
sendMessage(new CommandLocation().getUsageTemplate(true, true));
}
gatesManager.handleNewGate(gate);
}
}

View File

@ -45,14 +45,12 @@ public class CommandOpen extends BaseCommand
public void perform()
{
try
{
try {
gate.setOpen(true);
GateBlockChangeSender.updateGateBlocks(gate);
sendMessage(ChatColor.GREEN + "The gate was opened.");
}
catch (Exception e)
{
catch (Exception e) {
sendMessage(ChatColor.RED + e.getMessage());
}
}

View File

@ -48,7 +48,6 @@ public class PlayerMoveListener implements Listener
GateBlockChangeSender.updateGateBlocks(event.getPlayer(), event.getTo());
}
GatesManager gateManager = Plugin.getPlugin().getGatesManager();
Gate gateAtLocation = gateManager.getGateAtLocation(event.getTo());
@ -60,6 +59,8 @@ public class PlayerMoveListener implements Listener
return;
}
System.out.println("player: " + event.getPlayer() + " location: " + event.getTo());
// Check for permission
if (!hasPermission(event.getPlayer(), gateAtLocation)