Added permissions option.
This commit is contained in:
parent
cbd5e3524f
commit
0a8f6b94bb
@ -28,3 +28,4 @@ max-chair-width: 3
|
|||||||
sign-check: false
|
sign-check: false
|
||||||
distance: 2
|
distance: 2
|
||||||
sitting-height: 0.7
|
sitting-height: 0.7
|
||||||
|
permissions: true
|
@ -13,7 +13,7 @@ public class Chairs extends JavaPlugin {
|
|||||||
|
|
||||||
public List<Material> allowedBlocks = new ArrayList<Material>();
|
public List<Material> allowedBlocks = new ArrayList<Material>();
|
||||||
public Material item;
|
public Material item;
|
||||||
public boolean sneaking, autorotate, signcheck;
|
public boolean sneaking, autorotate, signcheck, permissions;
|
||||||
public double sittingheight, distance;
|
public double sittingheight, distance;
|
||||||
public int maxchairwidth;
|
public int maxchairwidth;
|
||||||
private File pluginFolder;
|
private File pluginFolder;
|
||||||
@ -61,6 +61,7 @@ public class Chairs extends JavaPlugin {
|
|||||||
sittingheight = getConfig().getDouble("sitting-height");
|
sittingheight = getConfig().getDouble("sitting-height");
|
||||||
distance = getConfig().getDouble("distance");
|
distance = getConfig().getDouble("distance");
|
||||||
maxchairwidth = getConfig().getInt("max-chair-width");
|
maxchairwidth = getConfig().getInt("max-chair-width");
|
||||||
|
permissions = getConfig().getBoolean("permissions");
|
||||||
|
|
||||||
for (String type : getConfig().getStringList("allowed-blocks")) {
|
for (String type : getConfig().getStringList("allowed-blocks")) {
|
||||||
allowedBlocks.add(Material.getMaterial(type));
|
allowedBlocks.add(Material.getMaterial(type));
|
||||||
|
@ -53,9 +53,11 @@ public class EventListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Permissions Check
|
// Permissions Check
|
||||||
|
if (plugin.permissions) {
|
||||||
if (!player.hasPermission("chairs.sit")) {
|
if (!player.hasPermission("chairs.sit")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check if player is sitting.
|
// Check if player is sitting.
|
||||||
if (!player.isSneaking() && player.getVehicle() != null) {
|
if (!player.isSneaking() && player.getVehicle() != null) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
name: Chairs
|
name: Chairs
|
||||||
version: 1.5a
|
version: 1.5b
|
||||||
description: Let players sit on stairs and slabs.
|
description: Let players sit on stairs and slabs.
|
||||||
author: spoothie
|
authors: spoothie, cnaude
|
||||||
main: net.spoothie.chairs.Chairs
|
main: net.spoothie.chairs.Chairs
|
||||||
commands:
|
commands:
|
||||||
chairs:
|
chairs:
|
||||||
|
Loading…
Reference in New Issue
Block a user