6 Commits

4 changed files with 32 additions and 10 deletions

View File

@ -43,8 +43,8 @@ Nope. This plugin is very minimalistic and plain. Server operators manage the po
## Installing
1. Download the latest release: __[https://github.com/tomco/minecraft-craftinc-gates/downloads](https://github.com/tomco/minecraft-craftinc-gates/downloads)__
2. Put AncientGates.jar in the plugins folder.
1. Download the latest release: __[http://dev.bukkit.org/server-mods/craftinc-gates/files/](http://dev.bukkit.org/server-mods/craftinc-gates/files/)__
2. Put CraftIncGates.jar in the plugins folder.
## License

View File

@ -1,5 +1,5 @@
name: Craft Inc. Gates
version: 2.0.0
version: 2.0.1
description: A plugin to create gates for fast traveling.
author: tomco, s1m0ne
authors: [oloflarsson, locutus, DrAgonmoray, s1m0ne, tomco]
@ -23,6 +23,7 @@ permissions:
craftincgates.info:
description: Gives access to info and list commands.
craftincgates.use:
default: true
description: Allows you to use open gates.
craftincgates.manage:
description: Gives access to commands manipulating gates.

View File

@ -61,12 +61,16 @@ public class Gate extends BaseGate implements ConfigurationSerializable
/*
* INTERFACE: ConfigurationSerializable
*/
static String idKey = "id";
static String locationKey = "location";
static String gateBlocksKey = "gateBlocks";
static String exitKey = "exit";
static String isHiddenKey = "hidden";
static String isOpenKey = "open";
static protected String idKey = "id";
static protected String locationKey = "location";
static protected String gateBlocksKey = "gateBlocks";
static protected String exitKey = "exit";
static protected String isHiddenKey = "hidden";
static protected String isOpenKey = "open";
static protected String locationYawKey = "locationYaw";
static protected String locationPitchKey = "locationPitch";
static protected String exitYawKey = "exitYaw";
static protected String exitPitchKey = "exitPitch";
@SuppressWarnings("unchecked")
@ -80,6 +84,14 @@ public class Gate extends BaseGate implements ConfigurationSerializable
location = LocationSerializer.deserializeLocation((Map<String, Object>) map.get(locationKey));
exit = LocationSerializer.deserializeLocation((Map<String, Object>) map.get(exitKey));
if (exit != null) {
exit.setPitch(((Double)map.get(exitPitchKey)).floatValue());
exit.setYaw(((Double)map.get(exitYawKey)).floatValue());
}
location.setPitch(((Double)map.get(locationPitchKey)).floatValue());
location.setYaw(((Double)map.get(locationYawKey)).floatValue());
gateBlockLocations = new HashSet<Location>();
List<Map<String, Object>> serializedGateBlocks = (List<Map<String, Object>>)map.get(gateBlocksKey);
@ -116,6 +128,14 @@ public class Gate extends BaseGate implements ConfigurationSerializable
retVal.put(isHiddenKey, isHidden);
retVal.put(isOpenKey, isOpen);
if (exit != null) {
retVal.put(exitPitchKey, exit.getPitch());
retVal.put(exitYawKey, exit.getYaw());
}
retVal.put(locationPitchKey, location.getPitch());
retVal.put(locationYawKey, location.getYaw());
List<Map<String, Object>> serializedGateBlocks = new ArrayList<Map<String, Object>>();
for (Location l : gateBlockLocations) {

View File

@ -42,9 +42,10 @@ public class PluginPlayerListener extends BaseLocationListener implements Listen
checkChunkLoad(gateAtLocation.getLocation().getBlock());
Location gateExit = gateAtLocation.getExit();
Location gateLocation = gateAtLocation.getLocation();
Location playerLocation = event.getPlayer().getLocation();
Float newYaw = gateExit.getYaw() - gateExit.getYaw() + playerLocation.getYaw();
Float newYaw = gateExit.getYaw() - gateLocation.getYaw() + playerLocation.getYaw();
Location teleportToLocation = new Location( gateExit.getWorld(),
gateExit.getX(),