Compare commits
8 Commits
version2.0
...
version2.0
Author | SHA1 | Date | |
---|---|---|---|
ca982f5ba9 | |||
bf1f2bcff2 | |||
936619a1b5 | |||
8e7b180fbe | |||
56d0b8bf1c | |||
0f6f05b045 | |||
13b97d2c78 | |||
304009d978 |
@ -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
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
name: Craft Inc. Gates
|
||||
version: 2.0.0
|
||||
version: 2.0.1a
|
||||
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.
|
||||
|
@ -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,16 @@ 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 (map.containsKey(exitPitchKey)) {
|
||||
exit.setPitch(((Double)map.get(exitPitchKey)).floatValue());
|
||||
exit.setYaw(((Double)map.get(exitYawKey)).floatValue());
|
||||
}
|
||||
|
||||
if (map.containsKey(locationPitchKey)) {
|
||||
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 +130,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) {
|
||||
|
@ -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(),
|
||||
|
Reference in New Issue
Block a user