mirror of
https://github.com/trainerlord/WorldSystem.git
synced 2024-12-02 13:23:21 +01:00
Added in config contact_auth option. WorldPlayer is now on WorldConfig
This commit is contained in:
parent
ce19aad211
commit
c22c9b78db
@ -34,6 +34,11 @@ language: en
|
|||||||
# Prefix which will be shown before each message
|
# Prefix which will be shown before each message
|
||||||
prefix: '&8[&3WorldSystem&8] &6'
|
prefix: '&8[&3WorldSystem&8] &6'
|
||||||
|
|
||||||
|
# Whether WorldSystem should contact the Mojang authserver
|
||||||
|
# If not, some unknown playernames will not be displayed
|
||||||
|
# eg. in the gui or in /ws info
|
||||||
|
contact_authserver: true
|
||||||
|
|
||||||
# Options for the LagSystem:
|
# Options for the LagSystem:
|
||||||
# period_in_seconds - how often will be checked for entities in seconds
|
# period_in_seconds - how often will be checked for entities in seconds
|
||||||
# entities_per_world - maximal allowed entities per world
|
# entities_per_world - maximal allowed entities per world
|
||||||
|
@ -34,6 +34,11 @@ language: en
|
|||||||
# Prefix which will be shown before each message
|
# Prefix which will be shown before each message
|
||||||
prefix: '&8[&3WorldSystem&8] &6'
|
prefix: '&8[&3WorldSystem&8] &6'
|
||||||
|
|
||||||
|
# Whether WorldSystem should contact the Mojang authserver
|
||||||
|
# If not, some unknown playernames will not be displayed
|
||||||
|
# eg. in the gui or in /ws info
|
||||||
|
contact_authserver: true
|
||||||
|
|
||||||
# Options for the LagSystem:
|
# Options for the LagSystem:
|
||||||
# period_in_seconds - how often will be checked for entities in seconds
|
# period_in_seconds - how often will be checked for entities in seconds
|
||||||
# entities_per_world - maximal allowed entities per world
|
# entities_per_world - maximal allowed entities per world
|
||||||
|
@ -10,7 +10,7 @@ import org.bukkit.entity.Player;
|
|||||||
import de.butzlabben.world.WorldSystem;
|
import de.butzlabben.world.WorldSystem;
|
||||||
import de.butzlabben.world.config.DependenceConfig;
|
import de.butzlabben.world.config.DependenceConfig;
|
||||||
import de.butzlabben.world.config.MessageConfig;
|
import de.butzlabben.world.config.MessageConfig;
|
||||||
import de.butzlabben.world.config.WorldConfig2;
|
import de.butzlabben.world.config.WorldConfig;
|
||||||
import de.butzlabben.world.wrapper.WorldPlayer;
|
import de.butzlabben.world.wrapper.WorldPlayer;
|
||||||
|
|
||||||
public class WSToggleBuildCommand implements CommandExecutor {
|
public class WSToggleBuildCommand implements CommandExecutor {
|
||||||
@ -32,7 +32,8 @@ public class WSToggleBuildCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
OfflinePlayer a = Bukkit.getOfflinePlayer(args[1]);
|
OfflinePlayer a = Bukkit.getOfflinePlayer(args[1]);
|
||||||
if (!WorldConfig2.isMember(a, dc.getWorldname())) {
|
WorldConfig wc = WorldConfig.getWorldConfig(dc.getWorldname());
|
||||||
|
if (wc.isMember(a.getUniqueId())) {
|
||||||
p.sendMessage(MessageConfig.getNoMemberOwn());
|
p.sendMessage(MessageConfig.getNoMemberOwn());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ import org.bukkit.entity.Player;
|
|||||||
import de.butzlabben.world.WorldSystem;
|
import de.butzlabben.world.WorldSystem;
|
||||||
import de.butzlabben.world.config.DependenceConfig;
|
import de.butzlabben.world.config.DependenceConfig;
|
||||||
import de.butzlabben.world.config.MessageConfig;
|
import de.butzlabben.world.config.MessageConfig;
|
||||||
import de.butzlabben.world.config.WorldConfig2;
|
import de.butzlabben.world.config.WorldConfig;
|
||||||
import de.butzlabben.world.wrapper.WorldPlayer;
|
import de.butzlabben.world.wrapper.WorldPlayer;
|
||||||
|
|
||||||
public class WSToggleGMCommand implements CommandExecutor {
|
public class WSToggleGMCommand implements CommandExecutor {
|
||||||
@ -21,7 +21,8 @@ public class WSToggleGMCommand implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
Player p = (Player) cs;
|
Player p = (Player) cs;
|
||||||
if (args.length != 2) {
|
if (args.length != 2) {
|
||||||
p.sendMessage(MessageConfig.getWrongUsage().replaceAll("%usage", WorldSystem.getInstance().getCommand("ws togglegm").getUsage()));
|
p.sendMessage(MessageConfig.getWrongUsage().replaceAll("%usage",
|
||||||
|
WorldSystem.getInstance().getCommand("ws togglegm").getUsage()));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
DependenceConfig dc = new DependenceConfig(p);
|
DependenceConfig dc = new DependenceConfig(p);
|
||||||
@ -31,7 +32,8 @@ public class WSToggleGMCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
OfflinePlayer a = Bukkit.getOfflinePlayer(args[1]);
|
OfflinePlayer a = Bukkit.getOfflinePlayer(args[1]);
|
||||||
if (!WorldConfig2.isMember(a, dc.getWorldname())) {
|
WorldConfig wc = WorldConfig.getWorldConfig(dc.getWorldname());
|
||||||
|
if (wc.isMember(a.getUniqueId())) {
|
||||||
p.sendMessage(MessageConfig.getNoMemberOwn());
|
p.sendMessage(MessageConfig.getNoMemberOwn());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -44,4 +46,3 @@ public class WSToggleGMCommand implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import org.bukkit.entity.Player;
|
|||||||
import de.butzlabben.world.WorldSystem;
|
import de.butzlabben.world.WorldSystem;
|
||||||
import de.butzlabben.world.config.DependenceConfig;
|
import de.butzlabben.world.config.DependenceConfig;
|
||||||
import de.butzlabben.world.config.MessageConfig;
|
import de.butzlabben.world.config.MessageConfig;
|
||||||
import de.butzlabben.world.config.WorldConfig2;
|
import de.butzlabben.world.config.WorldConfig;
|
||||||
import de.butzlabben.world.wrapper.WorldPlayer;
|
import de.butzlabben.world.wrapper.WorldPlayer;
|
||||||
|
|
||||||
public class WSToggleTPCommand implements CommandExecutor {
|
public class WSToggleTPCommand implements CommandExecutor {
|
||||||
@ -32,7 +32,8 @@ public class WSToggleTPCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
OfflinePlayer a = Bukkit.getOfflinePlayer(args[1]);
|
OfflinePlayer a = Bukkit.getOfflinePlayer(args[1]);
|
||||||
if (!WorldConfig2.isMember(a, dc.getWorldname())) {
|
WorldConfig wc = WorldConfig.getWorldConfig(dc.getWorldname());
|
||||||
|
if (wc.isMember(a.getUniqueId())) {
|
||||||
p.sendMessage(MessageConfig.getNoMemberOwn());
|
p.sendMessage(MessageConfig.getNoMemberOwn());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ public class PluginConfig {
|
|||||||
YamlConfiguration cfg = getConfig();
|
YamlConfiguration cfg = getConfig();
|
||||||
if (false == (cfg.isString("worldfolder") && cfg.isString("worldsource") && cfg.isInt("unloadingtime")
|
if (false == (cfg.isString("worldfolder") && cfg.isString("worldsource") && cfg.isInt("unloadingtime")
|
||||||
&& cfg.isBoolean("survival") && cfg.isString("language") && cfg.isString("prefix")
|
&& cfg.isBoolean("survival") && cfg.isString("language") && cfg.isString("prefix")
|
||||||
&& cfg.isInt("request_expires") && cfg.isBoolean("need_confirm") &&
|
&& cfg.isInt("request_expires") && cfg.isBoolean("need_confirm") && cfg.isBoolean("contact_authserver") &&
|
||||||
|
|
||||||
cfg.isInt("lagsystem.period_in_seconds") && cfg.isInt("lagsystem.entities_per_world")
|
cfg.isInt("lagsystem.period_in_seconds") && cfg.isInt("lagsystem.entities_per_world")
|
||||||
&& cfg.isBoolean("lagsystem.garbagecollector.use")
|
&& cfg.isBoolean("lagsystem.garbagecollector.use")
|
||||||
@ -196,4 +196,7 @@ public class PluginConfig {
|
|||||||
return getConfig().getBoolean("need_confirm", true);
|
return getConfig().getBoolean("need_confirm", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean contact_auth() {
|
||||||
|
return getConfig().getBoolean("contact_authserver", true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -400,7 +400,6 @@ public class WorldConfig {
|
|||||||
fire = cfg.getBoolean("Settings.Fire", true);
|
fire = cfg.getBoolean("Settings.Fire", true);
|
||||||
|
|
||||||
if (membersOldFormatted(cfg)) {
|
if (membersOldFormatted(cfg)) {
|
||||||
System.out.println("sfdjkl");
|
|
||||||
for (String s : cfg.getConfigurationSection("Members").getKeys(false)) {
|
for (String s : cfg.getConfigurationSection("Members").getKeys(false)) {
|
||||||
HashSet<WorldPerm> perms = new HashSet<>();
|
HashSet<WorldPerm> perms = new HashSet<>();
|
||||||
perms.add(WorldPerm.MEMBER);
|
perms.add(WorldPerm.MEMBER);
|
||||||
|
@ -3,6 +3,7 @@ package de.butzlabben.world.wrapper;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
@ -12,6 +13,7 @@ import org.bukkit.World.Environment;
|
|||||||
import org.bukkit.WorldCreator;
|
import org.bukkit.WorldCreator;
|
||||||
import org.bukkit.WorldType;
|
import org.bukkit.WorldType;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
|
|
||||||
import de.butzlabben.event.WorldCreateEvent;
|
import de.butzlabben.event.WorldCreateEvent;
|
||||||
@ -22,7 +24,6 @@ import de.butzlabben.world.config.DependenceConfig;
|
|||||||
import de.butzlabben.world.config.MessageConfig;
|
import de.butzlabben.world.config.MessageConfig;
|
||||||
import de.butzlabben.world.config.PluginConfig;
|
import de.butzlabben.world.config.PluginConfig;
|
||||||
import de.butzlabben.world.config.WorldConfig;
|
import de.butzlabben.world.config.WorldConfig;
|
||||||
import de.butzlabben.world.config.WorldConfig2;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represents a systemworld, loaded or not
|
* This class represents a systemworld, loaded or not
|
||||||
|
@ -10,7 +10,7 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
|
|
||||||
import de.butzlabben.world.config.PluginConfig;
|
import de.butzlabben.world.config.WorldConfig;
|
||||||
|
|
||||||
public class WorldPlayer {
|
public class WorldPlayer {
|
||||||
|
|
||||||
@ -30,24 +30,20 @@ public class WorldPlayer {
|
|||||||
*/
|
*/
|
||||||
public boolean toggleBuild() {
|
public boolean toggleBuild() {
|
||||||
Preconditions.checkArgument(isOnSystemWorld(), "player must be for this on a systemworld");
|
Preconditions.checkArgument(isOnSystemWorld(), "player must be for this on a systemworld");
|
||||||
File file = new File(Bukkit.getWorldContainer(), worldname + "/worldconfig.yml");
|
|
||||||
if (!file.exists()) {
|
WorldConfig wc = WorldConfig.getWorldConfig(worldname);
|
||||||
file = new File(PluginConfig.getWorlddir() + "/" + worldname + "/worldconfig.yml");
|
if (!wc.isMember(p.getUniqueId()))
|
||||||
}
|
|
||||||
YamlConfiguration cfg = YamlConfiguration.loadConfiguration(file);
|
|
||||||
String uuid = p.getUniqueId().toString();
|
|
||||||
if (cfg.getString("Members." + uuid + ".PlayerUUID") == null)
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
boolean teleport = cfg.getBoolean("Members." + uuid + ".Permissions.CanBuild");
|
boolean build = wc.canBuild(p.getUniqueId());
|
||||||
teleport = !teleport;
|
build = !build;
|
||||||
cfg.set("Members." + uuid + ".Permissions.CanBuild", teleport);
|
wc.setBuild(p.getUniqueId(), build);
|
||||||
try {
|
try {
|
||||||
cfg.save(file);
|
wc.save();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return teleport;
|
return build;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -55,11 +51,8 @@ public class WorldPlayer {
|
|||||||
*/
|
*/
|
||||||
public boolean canBuild() {
|
public boolean canBuild() {
|
||||||
Preconditions.checkArgument(isOnSystemWorld(), "player must be for this on a systemworld");
|
Preconditions.checkArgument(isOnSystemWorld(), "player must be for this on a systemworld");
|
||||||
File file = new File(Bukkit.getWorldContainer(), worldname + "/worldconfig.yml");
|
WorldConfig wc = WorldConfig.getWorldConfig(worldname);
|
||||||
YamlConfiguration cfg = YamlConfiguration.loadConfiguration(file);
|
return wc.canBuild(p.getUniqueId());
|
||||||
String uuid = p.getUniqueId().toString();
|
|
||||||
boolean b = cfg.getBoolean("Members." + uuid + ".Permissions.CanBuild");
|
|
||||||
return b;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -68,20 +61,16 @@ public class WorldPlayer {
|
|||||||
*/
|
*/
|
||||||
public boolean toggleTeleport() {
|
public boolean toggleTeleport() {
|
||||||
Preconditions.checkArgument(isOnSystemWorld(), "player must be for this on a systemworld");
|
Preconditions.checkArgument(isOnSystemWorld(), "player must be for this on a systemworld");
|
||||||
File file = new File(Bukkit.getWorldContainer(), worldname + "/worldconfig.yml");
|
|
||||||
if (!file.exists()) {
|
WorldConfig wc = WorldConfig.getWorldConfig(worldname);
|
||||||
file = new File(PluginConfig.getWorlddir() + "/" + worldname + "/worldconfig.yml");
|
if (!wc.isMember(p.getUniqueId()))
|
||||||
}
|
|
||||||
YamlConfiguration cfg = YamlConfiguration.loadConfiguration(file);
|
|
||||||
String uuid = p.getUniqueId().toString();
|
|
||||||
if (cfg.getString("Members." + uuid + ".PlayerUUID") == null)
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
boolean teleport = cfg.getBoolean("Members." + uuid + ".Permissions.CanTP");
|
boolean teleport = wc.canTeleport(p.getUniqueId());
|
||||||
teleport = !teleport;
|
teleport = !teleport;
|
||||||
cfg.set("Members." + uuid + ".Permissions.CanTP", teleport);
|
wc.setTeleport(p.getUniqueId(), teleport);
|
||||||
try {
|
try {
|
||||||
cfg.save(file);
|
wc.save();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -93,11 +82,8 @@ public class WorldPlayer {
|
|||||||
*/
|
*/
|
||||||
public boolean canTeleport() {
|
public boolean canTeleport() {
|
||||||
Preconditions.checkArgument(isOnSystemWorld(), "player must be for this on a systemworld");
|
Preconditions.checkArgument(isOnSystemWorld(), "player must be for this on a systemworld");
|
||||||
File file = new File(Bukkit.getWorldContainer(), worldname + "/worldconfig.yml");
|
WorldConfig wc = WorldConfig.getWorldConfig(worldname);
|
||||||
YamlConfiguration cfg = YamlConfiguration.loadConfiguration(file);
|
return wc.canTeleport(p.getUniqueId());
|
||||||
String uuid = p.getUniqueId().toString();
|
|
||||||
boolean b = cfg.getBoolean("Members." + uuid + ".Permissions.CanTP");
|
|
||||||
return b;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -106,20 +92,17 @@ public class WorldPlayer {
|
|||||||
*/
|
*/
|
||||||
public boolean toggleGamemode() {
|
public boolean toggleGamemode() {
|
||||||
Preconditions.checkArgument(isOnSystemWorld(), "player must be for this on a systemworld");
|
Preconditions.checkArgument(isOnSystemWorld(), "player must be for this on a systemworld");
|
||||||
File file = new File(Bukkit.getWorldContainer(), worldname + "/worldconfig.yml");
|
|
||||||
if (!file.exists()) {
|
|
||||||
file = new File(PluginConfig.getWorlddir() + "/" + worldname + "/worldconfig.yml");
|
WorldConfig wc = WorldConfig.getWorldConfig(worldname);
|
||||||
}
|
if (!wc.isMember(p.getUniqueId()))
|
||||||
YamlConfiguration cfg = YamlConfiguration.loadConfiguration(file);
|
|
||||||
String uuid = p.getUniqueId().toString();
|
|
||||||
if (cfg.getString("Members." + uuid + ".PlayerUUID") == null)
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
boolean changeGamemode = cfg.getBoolean("Members." + uuid + ".Permissions.ChangeGM");
|
boolean changeGamemode = wc.canGamemode(p.getUniqueId());
|
||||||
changeGamemode = !changeGamemode;
|
changeGamemode = !changeGamemode;
|
||||||
cfg.set("Members." + uuid + ".Permissions.ChangeGM", changeGamemode);
|
wc.setGamemode(p.getUniqueId(), changeGamemode);
|
||||||
try {
|
try {
|
||||||
cfg.save(file);
|
wc.save();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -131,11 +114,8 @@ public class WorldPlayer {
|
|||||||
*/
|
*/
|
||||||
public boolean canChangeGamemode() {
|
public boolean canChangeGamemode() {
|
||||||
Preconditions.checkArgument(isOnSystemWorld(), "player must be for this on a systemworld");
|
Preconditions.checkArgument(isOnSystemWorld(), "player must be for this on a systemworld");
|
||||||
File file = new File(Bukkit.getWorldContainer(), worldname + "/worldconfig.yml");
|
WorldConfig wc = WorldConfig.getWorldConfig(worldname);
|
||||||
YamlConfiguration cfg = YamlConfiguration.loadConfiguration(file);
|
return wc.canGamemode(p.getUniqueId());
|
||||||
String uuid = p.getUniqueId().toString();
|
|
||||||
boolean b = cfg.getBoolean("Members." + uuid + ".Permissions.ChangeGM");
|
|
||||||
return b;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -143,22 +123,9 @@ public class WorldPlayer {
|
|||||||
*/
|
*/
|
||||||
public boolean isMember() {
|
public boolean isMember() {
|
||||||
Preconditions.checkArgument(isOnSystemWorld(), "player must be for this on a systemworld");
|
Preconditions.checkArgument(isOnSystemWorld(), "player must be for this on a systemworld");
|
||||||
File worldconfig = new File(Bukkit.getWorldContainer(), worldname + "/worldconfig.yml");
|
|
||||||
if (!worldconfig.exists()) {
|
WorldConfig wc = WorldConfig.getWorldConfig(worldname);
|
||||||
worldconfig = new File(PluginConfig.getWorlddir() + "/" + worldname + "/worldconfig.yml");
|
return wc.isMember(p.getUniqueId());
|
||||||
}
|
|
||||||
YamlConfiguration cfg = YamlConfiguration.loadConfiguration(worldconfig);
|
|
||||||
String uuid = p.getUniqueId().toString();
|
|
||||||
if (uuid.equals(cfg.getString("Members." + uuid + ".PlayerUUID"))) {
|
|
||||||
cfg.set("Members." + uuid + ".Actualname", p.getName());
|
|
||||||
try {
|
|
||||||
cfg.save(worldconfig);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorldPlayer(OfflinePlayer p, String worldname) {
|
public WorldPlayer(OfflinePlayer p, String worldname) {
|
||||||
@ -197,20 +164,8 @@ public class WorldPlayer {
|
|||||||
* @return if he ist the owner
|
* @return if he ist the owner
|
||||||
*/
|
*/
|
||||||
public boolean isOwnerofWorld() {
|
public boolean isOwnerofWorld() {
|
||||||
File worldconfig = new File(Bukkit.getWorldContainer(), worldname + "/worldconfig.yml");
|
WorldConfig wc = WorldConfig.getWorldConfig(worldname);
|
||||||
YamlConfiguration cfg = YamlConfiguration.loadConfiguration(worldconfig);
|
return wc.getOwner().equals(p.getUniqueId());
|
||||||
if (p.getUniqueId().toString().equals(cfg.getString("Informations.Owner.PlayerUUID"))) {
|
|
||||||
String playerName = p.getName();
|
|
||||||
cfg.set("Informations.Owner.Actualname", playerName);
|
|
||||||
try {
|
|
||||||
cfg.save(worldconfig);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -218,16 +173,8 @@ public class WorldPlayer {
|
|||||||
* @return worldname if he is the owner of the specified world
|
* @return worldname if he is the owner of the specified world
|
||||||
*/
|
*/
|
||||||
public boolean isMemberofWorld(String worldname) {
|
public boolean isMemberofWorld(String worldname) {
|
||||||
File worldconfig = new File(Bukkit.getWorldContainer(), worldname + "/worldconfig.yml");
|
WorldConfig wc = WorldConfig.getWorldConfig(worldname);
|
||||||
if (!worldconfig.exists()) {
|
return wc.isMember(p.getUniqueId());
|
||||||
worldconfig = new File(PluginConfig.getWorlddir() + "/" + worldname + "/worldconfig.yml");
|
|
||||||
}
|
|
||||||
YamlConfiguration cfg = YamlConfiguration.loadConfiguration(worldconfig);
|
|
||||||
String uuid = p.getUniqueId().toString();
|
|
||||||
if (uuid.equals(cfg.getString("Members." + uuid + ".PlayerUUID"))) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user