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:
Tobias Ottenweller 2013-05-17 21:54:15 +02:00
commit 987de39bf9
9 changed files with 33 additions and 17 deletions

View File

@ -1,3 +1,6 @@
## 2.1.2
* Fixed a bug where players got teleported one block beside the real portal.
* Fixed a bug where gates with no location caused multiple exceptions.
## 2.1.1
* Made the list command more reliable.
* Error messages will be displayed less frequent.

View File

@ -1,5 +1,5 @@
name: Craft Inc. Gates
version: 2.1.1
version: 2.1.2
description: A plugin to create gates for fast traveling.
softdepend: [Vault]
author: tomco, s1m0ne

View File

@ -5,7 +5,7 @@
<groupId>de.craftinc</groupId>
<artifactId>CraftIncGates</artifactId>
<packaging>jar</packaging>
<version>2.1.1</version>
<version>2.1.2</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

View File

@ -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>>();

View File

@ -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);
}

View File

@ -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));
}
}

View File

@ -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");
}
}

View File

@ -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) {

View File

@ -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;
}