Fix reload command.

This commit is contained in:
cnaude 2013-06-27 21:44:07 -07:00
parent 2566addf8d
commit e659eca5be
3 changed files with 7 additions and 5 deletions

View File

@ -26,8 +26,8 @@ import org.bukkit.plugin.java.JavaPlugin;
public class Chairs extends JavaPlugin {
private static Chairs instance = null;
public static ChairEffects chairEffects;
public List<ChairBlock> allowedBlocks = new ArrayList<ChairBlock>();
public List<Material> validSigns = new ArrayList<Material>();
public List<ChairBlock> allowedBlocks;
public List<Material> validSigns;
public boolean sneaking, autoRotate, signCheck, permissions, notifyplayer, opsOverridePerms;
public boolean invertedStairCheck, seatOccupiedCheck, invertedStepCheck, perItemPerms, ignoreIfBlockInHand;
public boolean sitEffectsEnabled;
@ -57,7 +57,7 @@ public class Chairs extends JavaPlugin {
pluginFolder = getDataFolder();
configFile = new File(pluginFolder, "config.yml");
createConfig();
this.getConfig().options().copyDefaults(true);
getConfig().options().copyDefaults(true);
saveConfig();
loadConfig();
getServer().getPluginManager().registerEvents(new EventListener(this, ignoreList), this);
@ -149,6 +149,7 @@ public class Chairs extends JavaPlugin {
msgDisabled = ChatColor.translateAlternateColorCodes('&',getConfig().getString("messages.disabled"));
msgReloaded = ChatColor.translateAlternateColorCodes('&',getConfig().getString("messages.reloaded"));
allowedBlocks = new ArrayList<ChairBlock>();
for (String s : getConfig().getStringList("allowed-blocks")) {
String type;
double sh = sittingHeight;
@ -184,6 +185,7 @@ public class Chairs extends JavaPlugin {
}
}
validSigns = new ArrayList<Material>();
for (String type : getConfig().getStringList("valid-signs")) {
try {
if (type.matches("\\d+")) {

View File

@ -30,7 +30,7 @@ public class ChairsCommand implements CommandExecutor {
}
if (args[0].equalsIgnoreCase("reload")) {
if (sender.hasPermission("chairs.reload") || !(sender instanceof Player)) {
plugin.reloadConfig();
//plugin.reloadConfig();
plugin.loadConfig();
plugin.restartEffectsTask();
if (!plugin.msgReloaded.isEmpty()) {

View File

@ -1,5 +1,5 @@
name: Chairs
version: 2.1.3
version: 2.1.4
description: Let players sit on blocks.
website: http://dev.bukkit.org/bukkit-plugins/chairsreloaded/
authors: