Bugfix: do not let the location command fail if previous location was invalid.
This commit is contained in:
parent
e88e03ed42
commit
b50a2b27d3
@ -60,11 +60,22 @@ public class CommandLocation extends BaseLocationCommand
|
||||
|
||||
try
|
||||
{
|
||||
boolean gateOpen = gate.isOpen();
|
||||
|
||||
if (gateOpen) {
|
||||
gate.setOpen(false);
|
||||
}
|
||||
|
||||
Location oldLocation = gate.getLocation();
|
||||
Set<Location> oldGateBlockLocations = gate.getGateBlockLocations();
|
||||
Set<Block> oldFrameBlocks = gate.getGateFrameBlocks();
|
||||
|
||||
gate.setLocation(playerLocation);
|
||||
|
||||
if (gateOpen) {
|
||||
gate.setOpen(true);
|
||||
}
|
||||
|
||||
Plugin.getPlugin().getGatesManager().handleGateLocationChange(gate, oldLocation, oldGateBlockLocations, oldFrameBlocks);
|
||||
|
||||
sendMessage(ChatColor.GREEN + "The location of '" + gate.getId() + "' is now at your current location.");
|
||||
|
Loading…
x
Reference in New Issue
Block a user