Merge branch 'master' of github.com:craftinc/craftinc-gates into development
Conflicts: pom.xml src/de/craftinc/gates/BaseGate.java src/de/craftinc/gates/commands/BaseCommand.java src/de/craftinc/gates/commands/CommandCreate.java src/de/craftinc/gates/commands/CommandList.java
This commit is contained in:
@ -300,8 +300,10 @@ public class Gate implements ConfigurationSerializable
|
||||
retVal.put(exitYawKey, exit.getYaw());
|
||||
}
|
||||
|
||||
retVal.put(locationPitchKey, location.getPitch());
|
||||
retVal.put(locationYawKey, location.getYaw());
|
||||
if (location != null) {
|
||||
retVal.put(locationPitchKey, location.getPitch());
|
||||
retVal.put(locationYawKey, location.getYaw());
|
||||
}
|
||||
|
||||
List<Map<String, Object>> serializedGateBlocks = new ArrayList<Map<String, Object>>();
|
||||
|
||||
|
@ -206,17 +206,23 @@ public abstract class BaseCommand
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
boolean permAtLocation;
|
||||
|
||||
if (this.gate.getLocation() == null) {
|
||||
permAtLocation = true;
|
||||
}
|
||||
else {
|
||||
boolean permAtLocation = Plugin.getPermission().has(this.gate.getLocation().getWorld(), p.getName(), this.requiredPermission);
|
||||
}
|
||||
|
||||
|
||||
boolean permAtExit;
|
||||
|
||||
if (this.gate.getExit() == null)
|
||||
{
|
||||
if (this.gate.getExit() == null) {
|
||||
permAtExit = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
permAtExit = Plugin.getPermission().has(this.gate.getExit().getWorld(), p.getName(), this.requiredPermission);
|
||||
}
|
||||
|
||||
|
@ -56,9 +56,9 @@ public class CommandCreate extends BaseLocationCommand
|
||||
}
|
||||
catch (Exception e) {}
|
||||
}
|
||||
else {
|
||||
sendMessage(ChatColor.GREEN + "Gate with id \"" + id + "\" was created.");
|
||||
sendMessage("Now you should build a frame and:");
|
||||
else
|
||||
{
|
||||
sendMessage("Now you should build a frame and execute:");
|
||||
sendMessage(new CommandSetLocation().getUsageTemplate(true, true));
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ public class CommandInfo extends BaseCommand
|
||||
|
||||
requiredParameters.add("id");
|
||||
|
||||
helpDescription = "Prints detailed informations about a certain gate.";
|
||||
helpDescription = "Print detailed informations about a certain gate.";
|
||||
|
||||
requiredPermission = Plugin.permissionInfo;
|
||||
|
||||
@ -49,12 +49,12 @@ public class CommandInfo extends BaseCommand
|
||||
if (gate.getLocation() != null)
|
||||
sendMessage(ChatColor.DARK_AQUA + "from: " + ChatColor.AQUA + "( " + gate.getLocation().getBlockX() + " | " + gate.getLocation().getBlockY() + " | " + gate.getLocation().getBlockZ() + " ) in " + gate.getLocation().getWorld().getName());
|
||||
else
|
||||
sendMessage(ChatColor.DARK_AQUA + "NOTE: this gate has no 'from' location");
|
||||
sendMessage(ChatColor.DARK_AQUA + "NOTE: this gate has no location");
|
||||
|
||||
if (gate.getExit() != null)
|
||||
sendMessage(ChatColor.DARK_AQUA + "to: " + ChatColor.AQUA + "( " + gate.getExit().getBlockX() + " | " + gate.getExit().getBlockY() + " | " + gate.getExit().getBlockZ() + " ) in " + gate.getExit().getWorld().getName());
|
||||
else
|
||||
sendMessage(ChatColor.DARK_AQUA + "NOTE: this gate has no 'to' location");
|
||||
sendMessage(ChatColor.DARK_AQUA + "NOTE: this gate has no exit");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -144,10 +144,12 @@ public class CommandList extends BaseCommand
|
||||
|
||||
for (Gate gate : gatesCopy) {
|
||||
|
||||
if (gate.getLocation() != null) {
|
||||
boolean permissionAtGateLocation = Plugin.getPermission().has(gate.getLocation().getWorld(), p.getName(), this.requiredPermission);
|
||||
if (!permissionAtGateLocation) {
|
||||
gates.remove(gate);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (gate.getExit() != null) {
|
||||
|
@ -52,10 +52,13 @@ public class GateUtil
|
||||
}
|
||||
|
||||
// Check if the gate is open and useable
|
||||
if (g.getLocation() == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
World gateWorld = g.getLocation().getWorld();
|
||||
|
||||
if (!g.isOpen() || !gateWorld.equals(playerWorld))
|
||||
{
|
||||
if (!g.isOpen() || !gateWorld.equals(playerWorld)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user