This commit is contained in:
Sauilitired 2015-07-18 10:47:35 +02:00
parent 757e502b14
commit 9bd019399a
3 changed files with 12 additions and 1 deletions

View File

@ -106,6 +106,7 @@ public enum C {
WORLDEDIT_RESTRICTED("$1Your WorldEdit is now restricted.", "WorldEdit Masks"), WORLDEDIT_RESTRICTED("$1Your WorldEdit is now restricted.", "WorldEdit Masks"),
GAMEMODE_WAS_BYPASSED("$1You bypassed the gamemode ($2{gamemode}) $1set for this plot", "Gamemode"), GAMEMODE_WAS_BYPASSED("$1You bypassed the gamemode ($2{gamemode}) $1set for this plot", "Gamemode"),
HEIGHT_LIMIT("$1This plot world has a height limit of $2{limit}", "Height Limit"),
/* /*
* Records * Records
*/ */

View File

@ -1853,6 +1853,12 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
Block block = event.getBlockPlaced(); Block block = event.getBlockPlaced();
sendBlockChange(block.getLocation(), block.getType(), block.getData()); sendBlockChange(block.getLocation(), block.getType(), block.getData());
} }
int temporary;
if (!player.hasPermission("plots.admin.build.heightlimit") && loc.getY() >= (temporary = PS.get().getPlotWorld(world).MAX_BUILD_HEIGHT)) {
event.setCancelled(true);
MainUtil.sendMessage(pp, C.HEIGHT_LIMIT.s().replace("{limit}", "" + temporary));
return;
}
return; return;
} }
else if (!Permissions.hasPermission(pp, "plots.admin.build.road")) { else if (!Permissions.hasPermission(pp, "plots.admin.build.road")) {

View File

@ -60,6 +60,7 @@ public abstract class PlotWorld {
public final static boolean SPAWN_BREEDING_DEFAULT = false; public final static boolean SPAWN_BREEDING_DEFAULT = false;
public final static boolean WORLD_BORDER_DEFAULT = false; public final static boolean WORLD_BORDER_DEFAULT = false;
public final static int MAX_PLOT_MEMBERS_DEFAULT = 128; public final static int MAX_PLOT_MEMBERS_DEFAULT = 128;
public final static int MAX_BUILD_HEIGHT_DEFAULT = 256;
// are plot clusters enabled // are plot clusters enabled
// require claim in cluster // require claim in cluster
// TODO make this configurable // TODO make this configurable
@ -94,6 +95,7 @@ public abstract class PlotWorld {
public int TERRAIN = 0; public int TERRAIN = 0;
public boolean HOME_ALLOW_NONMEMBER; public boolean HOME_ALLOW_NONMEMBER;
public PlotLoc DEFAULT_HOME; public PlotLoc DEFAULT_HOME;
public int MAX_BUILD_HEIGHT;
public PlotWorld(final String worldname) { public PlotWorld(final String worldname) {
this.worldname = worldname; this.worldname = worldname;
@ -149,6 +151,7 @@ public abstract class PlotWorld {
this.SELL_PRICE = config.getDouble("economy.prices.sell"); this.SELL_PRICE = config.getDouble("economy.prices.sell");
this.PLOT_CHAT = config.getBoolean("chat.enabled"); this.PLOT_CHAT = config.getBoolean("chat.enabled");
this.WORLD_BORDER = config.getBoolean("world.border"); this.WORLD_BORDER = config.getBoolean("world.border");
this.MAX_BUILD_HEIGHT = config.getInt("world.max_height");
this.HOME_ALLOW_NONMEMBER = config.getBoolean("home.allow-nonmembers"); this.HOME_ALLOW_NONMEMBER = config.getBoolean("home.allow-nonmembers");
String homeDefault = config.getString("home.default"); String homeDefault = config.getString("home.default");
@ -229,6 +232,7 @@ public abstract class PlotWorld {
options.put("limits.max-members", PlotWorld.MAX_PLOT_MEMBERS_DEFAULT); options.put("limits.max-members", PlotWorld.MAX_PLOT_MEMBERS_DEFAULT);
options.put("home.default", "side"); options.put("home.default", "side");
options.put("home.allow-nonmembers", false); options.put("home.allow-nonmembers", false);
options.put("world.max_height", PlotWorld.MAX_BUILD_HEIGHT_DEFAULT);
if (Settings.ENABLE_CLUSTERS && (this.TYPE != 0)) { if (Settings.ENABLE_CLUSTERS && (this.TYPE != 0)) {
options.put("generator.terrain", this.TERRAIN); options.put("generator.terrain", this.TERRAIN);