set protect inventory to false in config file if protocol lib is not found.

This commit is contained in:
DNx5 2015-11-25 00:43:55 +07:00
parent 25c23e144c
commit ea420ab05f
2 changed files with 10 additions and 9 deletions

View File

@ -692,16 +692,21 @@ public class AuthMe extends JavaPlugin {
if (Settings.protectInventoryBeforeLogInEnabled) { if (Settings.protectInventoryBeforeLogInEnabled) {
ConsoleLogger.showError("WARNING!!! The protectInventory feature requires ProtocolLib! Disabling it..."); ConsoleLogger.showError("WARNING!!! The protectInventory feature requires ProtocolLib! Disabling it...");
Settings.protectInventoryBeforeLogInEnabled = false; Settings.protectInventoryBeforeLogInEnabled = false;
getSettings().set("settings.restrictions.ProtectInventoryBeforeLogIn", false);
} }
return; return;
} }
if (Settings.protectInventoryBeforeLogInEnabled) { if (Settings.protectInventoryBeforeLogInEnabled) {
inventoryProtector = new AuthMeInventoryPacketAdapter(this); if (inventoryProtector == null) {
inventoryProtector.register(); inventoryProtector = new AuthMeInventoryPacketAdapter(this);
} else if (inventoryProtector != null) { inventoryProtector.register();
ProtocolLibrary.getProtocolManager().removePacketListener(inventoryProtector); }
inventoryProtector = null; } else {
if (inventoryProtector != null) {
ProtocolLibrary.getProtocolManager().removePacketListener(inventoryProtector);
inventoryProtector = null;
}
} }
} }

View File

@ -621,10 +621,6 @@ public final class Settings extends YamlConfiguration {
set("Email.emailBlacklisted", new ArrayList<String>()); set("Email.emailBlacklisted", new ArrayList<String>());
changes = true; changes = true;
} }
if (contains("Performances.useMultiThreading")) {
set("Performances.useMultiThreading", null);
changes = true;
}
if (contains("Performances")) { if (contains("Performances")) {
set("Performances", null); set("Performances", null);
changes = true; changes = true;