Added 'stargate.world.*' permission
Added 'stargate.network.*' permission Added 'networkfilter' option Added 'worldfilter' option
This commit is contained in:
parent
e3f550d43d
commit
bae416cac7
29
README
29
README
@ -3,10 +3,8 @@
|
|||||||
=============
|
=============
|
||||||
This is a port of the Stargate plugin from hMod.
|
This is a port of the Stargate plugin from hMod.
|
||||||
Create gates that allow for instant-teleportation between large distances. Gates can be always-open, or triggered, they can be hidden, or accessible to everybody, they can share a network, or they can be split into clusters.
|
Create gates that allow for instant-teleportation between large distances. Gates can be always-open, or triggered, they can be hidden, or accessible to everybody, they can share a network, or they can be split into clusters.
|
||||||
This port will import your existing locations.dat file from the hMod Stargate plugin, as well as any custom .gate files you had!
|
This port will import your existing locations.dat file from the hMod Stargate plugin!
|
||||||
iConomy support added back in, only costs are create, destroy and use. No permission bypasses.
|
iConomy support added back in, only costs are create, destroy and use.
|
||||||
|
|
||||||
This version of Stargate is still heavily under development. There are going to be issues for a while yet.
|
|
||||||
|
|
||||||
=============
|
=============
|
||||||
Known Issues
|
Known Issues
|
||||||
@ -25,6 +23,8 @@ Known Issues
|
|||||||
- stargate.hidden - Allow this player/group to see all hidden stargates.
|
- stargate.hidden - Allow this player/group to see all hidden stargates.
|
||||||
- stargate.private - Allow this player/group to use all private stargates.
|
- stargate.private - Allow this player/group to use all private stargates.
|
||||||
- stargate.free - This player/group is not charged to use gates even if the gate has a cost.
|
- stargate.free - This player/group is not charged to use gates even if the gate has a cost.
|
||||||
|
- stargate.world.{worldname} - Allow this user/group access to gates on the world {worldname}
|
||||||
|
- stargate.network.{networkname} - Allow this user/group access to the network {networkname}
|
||||||
|
|
||||||
=============
|
=============
|
||||||
Instructions
|
Instructions
|
||||||
@ -35,20 +35,19 @@ Building a gate:
|
|||||||
O O - Place a sign on either of these two blocks of Obsidian.
|
O O - Place a sign on either of these two blocks of Obsidian.
|
||||||
O O
|
O O
|
||||||
OO
|
OO
|
||||||
- Type a name on the first line on the sign, it must be less than 12 characters long.
|
|
||||||
- Type a set destination name on the second line if desired.
|
|
||||||
- Type a network name on the third line if desired.
|
|
||||||
- Type any options on the 4th line if desired.
|
|
||||||
|
|
||||||
Sign Layout:
|
Sign Layout:
|
||||||
- Line 1: Gate Name (Max 12 characters)
|
- Line 1: Gate Name (Max 12 characters)
|
||||||
- Line 2: Destination Name [Optional] (Max 12 characters, used for fixed-gates only)
|
- Line 2: Destination Name [Optional] (Max 12 characters, used for fixed-gates only)
|
||||||
- Line 3: Network name [Optional] (Max 12 characters)
|
- Line 3: Network name [Optional] (Max 12 characters)
|
||||||
- Line 4: Options [Optional] ('A' for always-on fixed gate, 'H' for hidden networked gate)
|
- Line 4: Options [Optional] ('A' for always-on fixed gate, 'H' for hidden networked gate, 'P' for a private gate, 'F' for a free gate)
|
||||||
|
|
||||||
|
Options:
|
||||||
|
The options are the single letter, not the word. So to make a private hidden gate, your 4th line would be 'PH'.
|
||||||
|
|
||||||
Using a gate:
|
Using a gate:
|
||||||
- Right click the sign to choose a destination.
|
- Right click the sign to choose a destination.
|
||||||
- Right/left click the button to open up a portal.
|
- Right click the button to open up a portal.
|
||||||
- Step through.
|
- Step through.
|
||||||
|
|
||||||
Fixed gates:
|
Fixed gates:
|
||||||
@ -61,11 +60,12 @@ Gate networks:
|
|||||||
- Gates are all part of a network, by default this is "central".
|
- Gates are all part of a network, by default this is "central".
|
||||||
- You can specify (and create) your own network on the third line of the sign when making a new gate.
|
- You can specify (and create) your own network on the third line of the sign when making a new gate.
|
||||||
- Gates on one network will not see gates on the second network, and vice versa.
|
- Gates on one network will not see gates on the second network, and vice versa.
|
||||||
|
- Gates on different worlds, but in the same network, will see eachother.
|
||||||
|
|
||||||
Hidden Gates:
|
Hidden Gates:
|
||||||
- Hidden gates are like normal gates, but only show on the destination list of other gates under certain conditions.
|
- Hidden gates are like normal gates, but only show on the destination list of other gates under certain conditions.
|
||||||
- A hidden gate is only visible to the creator of the gate, or somebody with the stargate.hidden permission.
|
- A hidden gate is only visible to the creator of the gate, or somebody with the stargate.hidden permission.
|
||||||
- Set the 4th line of the stargate sign to "H" to make it a hidden gate.
|
- Set the 4th line of the stargate sign to 'H' to make it a hidden gate.
|
||||||
|
|
||||||
==============
|
==============
|
||||||
Configuration
|
Configuration
|
||||||
@ -85,10 +85,17 @@ createcost - The cost to create a stargate
|
|||||||
destroycost - The cost to destroy a stargate (Can be negative for a "refund"
|
destroycost - The cost to destroy a stargate (Can be negative for a "refund"
|
||||||
usecost - The cost to use a stargate
|
usecost - The cost to use a stargate
|
||||||
not-enough-money-message - The message displayed if a player lacks money to do something
|
not-enough-money-message - The message displayed if a player lacks money to do something
|
||||||
|
networkfilter - Whether or not to disallow users access to a network if they don't have the 'stargate.network.{networkname}' permission.
|
||||||
|
worldfilter - Whether or not to disallow users access to a network if they don't have the 'stargate.world.{worldname}' permission.
|
||||||
|
|
||||||
=============
|
=============
|
||||||
Changes
|
Changes
|
||||||
=============
|
=============
|
||||||
|
[Version 0.3.5]
|
||||||
|
- Added 'stargate.world.*' permissions
|
||||||
|
- Added 'stargate.network.*' permissions
|
||||||
|
- Added 'networkfilter' config option
|
||||||
|
- Added 'worldfilter' config option
|
||||||
[Version 0.3.4]
|
[Version 0.3.4]
|
||||||
- Added 'stargate.free' permission
|
- Added 'stargate.free' permission
|
||||||
- Added iConomy cost into .gate files
|
- Added iConomy cost into .gate files
|
||||||
|
@ -348,13 +348,17 @@ public class Portal {
|
|||||||
drawSign();
|
drawSign();
|
||||||
Stargate.activeList.add(this);
|
Stargate.activeList.add(this);
|
||||||
activePlayer = player;
|
activePlayer = player;
|
||||||
|
if (Stargate.worldFilter) Stargate.log.info("[Stargate] Filtering by world");
|
||||||
for (String dest : allPortalsNet.get(getNetwork().toLowerCase())) {
|
for (String dest : allPortalsNet.get(getNetwork().toLowerCase())) {
|
||||||
Portal portal = getByName(dest, getNetwork());
|
Portal portal = getByName(dest, getNetwork());
|
||||||
// Not fixed, not this portal, and visible to this player.
|
// Check if this player can access the dest world
|
||||||
if ( (!portal.isFixed()) &&
|
if (Stargate.worldFilter && !Stargate.hasPerm(player, "stargate.world." + portal.topLeft.getWorld().getName(), player.isOp())) continue;
|
||||||
(!dest.equalsIgnoreCase(getName())) && // Not this portal
|
// Check if dest is this portal
|
||||||
(!portal.isHidden() || Stargate.hasPerm(player, "stargate.hidden", player.isOp()) || portal.getOwner().equals(player.getName()))
|
if (dest.equalsIgnoreCase(getName())) continue;
|
||||||
) {
|
// Check if dest is a fixed gate
|
||||||
|
if (portal.isFixed()) continue;
|
||||||
|
// Visible to this player.
|
||||||
|
if (!portal.isHidden() || Stargate.hasPerm(player, "stargate.hidden", player.isOp()) || portal.getOwner().equals(player.getName())) {
|
||||||
destinations.add(portal.getName());
|
destinations.add(portal.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,6 +78,8 @@ public class Stargate extends JavaPlugin {
|
|||||||
private static String blockMsg = "Destination Blocked";
|
private static String blockMsg = "Destination Blocked";
|
||||||
private static String defNetwork = "central";
|
private static String defNetwork = "central";
|
||||||
private static boolean destroyExplosion = false;
|
private static boolean destroyExplosion = false;
|
||||||
|
public static boolean networkFilter = false;
|
||||||
|
public static boolean worldFilter = false;
|
||||||
private static int activeLimit = 10;
|
private static int activeLimit = 10;
|
||||||
private static int openLimit = 10;
|
private static int openLimit = 10;
|
||||||
|
|
||||||
@ -148,6 +150,8 @@ public class Stargate extends JavaPlugin {
|
|||||||
blockMsg = config.getString("other-side-blocked-message", blockMsg);
|
blockMsg = config.getString("other-side-blocked-message", blockMsg);
|
||||||
defNetwork = config.getString("default-gate-network", defNetwork).trim();
|
defNetwork = config.getString("default-gate-network", defNetwork).trim();
|
||||||
destroyExplosion = config.getBoolean("destroyexplosion", destroyExplosion);
|
destroyExplosion = config.getBoolean("destroyexplosion", destroyExplosion);
|
||||||
|
networkFilter = config.getBoolean("networkfilter", networkFilter);
|
||||||
|
worldFilter = config.getBoolean("worldfilter", worldFilter);
|
||||||
// iConomy
|
// iConomy
|
||||||
iConomyHandler.useiConomy = config.getBoolean("useiconomy", iConomyHandler.useiConomy);
|
iConomyHandler.useiConomy = config.getBoolean("useiconomy", iConomyHandler.useiConomy);
|
||||||
iConomyHandler.createCost = config.getInt("createcost", iConomyHandler.createCost);
|
iConomyHandler.createCost = config.getInt("createcost", iConomyHandler.createCost);
|
||||||
@ -169,6 +173,8 @@ public class Stargate extends JavaPlugin {
|
|||||||
config.setProperty("other-side-blocked-message", blockMsg);
|
config.setProperty("other-side-blocked-message", blockMsg);
|
||||||
config.setProperty("default-gate-network", defNetwork);
|
config.setProperty("default-gate-network", defNetwork);
|
||||||
config.setProperty("destroyexplosion", destroyExplosion);
|
config.setProperty("destroyexplosion", destroyExplosion);
|
||||||
|
config.setProperty("networkfilter", networkFilter);
|
||||||
|
config.setProperty("worldfilter", worldFilter);
|
||||||
// iConomy
|
// iConomy
|
||||||
config.setProperty("useiconomy", iConomyHandler.useiConomy);
|
config.setProperty("useiconomy", iConomyHandler.useiConomy);
|
||||||
config.setProperty("createcost", iConomyHandler.createCost);
|
config.setProperty("createcost", iConomyHandler.createCost);
|
||||||
@ -371,14 +377,16 @@ public class Stargate extends JavaPlugin {
|
|||||||
Portal portal = Portal.getByBlock(block);
|
Portal portal = Portal.getByBlock(block);
|
||||||
// Cycle through a stargates locations
|
// Cycle through a stargates locations
|
||||||
if (portal != null) {
|
if (portal != null) {
|
||||||
if (hasPerm(player, "stargate.use", true)) {
|
if (!hasPerm(player, "stargate.use", true) ||
|
||||||
if ((!portal.isOpen()) && (!portal.isFixed())) {
|
(networkFilter && !hasPerm(player, "stargate.network." + portal.getNetwork(), player.isOp()))) {
|
||||||
portal.cycleDestination(player);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!denyMsg.isEmpty()) {
|
if (!denyMsg.isEmpty()) {
|
||||||
player.sendMessage(denyMsg);
|
player.sendMessage(denyMsg);
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((!portal.isOpen()) && (!portal.isFixed())) {
|
||||||
|
portal.cycleDestination(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: Stargate
|
name: Stargate
|
||||||
main: net.TheDgtl.Stargate.Stargate
|
main: net.TheDgtl.Stargate.Stargate
|
||||||
version: 0.3.4
|
version: 0.3.5
|
||||||
description: Stargate mod for Bukkit
|
description: Stargate mod for Bukkit
|
||||||
author: Drakia
|
author: Drakia
|
||||||
website: http://www.thedgtl.net
|
website: http://www.thedgtl.net
|
Loading…
Reference in New Issue
Block a user