Updated to CraftBukkit 1.9
This commit is contained in:
@@ -45,12 +45,8 @@ import com.lishid.openinv.listeners.OpenInvEntityListener;
|
||||
import com.lishid.openinv.listeners.OpenInvInventoryListener;
|
||||
import com.lishid.openinv.listeners.OpenInvPlayerListener;
|
||||
|
||||
/**
|
||||
* Open other player's inventory
|
||||
*
|
||||
* @author lishid
|
||||
*/
|
||||
public class OpenInv extends JavaPlugin {
|
||||
|
||||
public static final Map<UUID, SpecialPlayerInventory> inventories = new HashMap<UUID, SpecialPlayerInventory>();
|
||||
public static final Map<UUID, SpecialEnderChest> enderChests = new HashMap<UUID, SpecialEnderChest>();
|
||||
|
||||
@@ -114,11 +110,11 @@ public class OpenInv extends JavaPlugin {
|
||||
|
||||
public static Object getFromConfig(String path, Object defaultValue) {
|
||||
Object val = mainPlugin.getConfig().get(path);
|
||||
|
||||
if (val == null) {
|
||||
mainPlugin.getConfig().set(path, defaultValue);
|
||||
return defaultValue;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
@@ -216,12 +212,15 @@ public class OpenInv extends JavaPlugin {
|
||||
public static boolean hasPermission(Permissible player, String permission) {
|
||||
String[] parts = permission.split("\\.");
|
||||
String perm = "";
|
||||
|
||||
for (int i = 0; i < parts.length; i++) {
|
||||
if (player.hasPermission(perm + "*")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
perm += parts[i] + ".";
|
||||
}
|
||||
|
||||
return player.hasPermission(permission);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user