Don't enable performance tweaks if server version is not supported

This commit is contained in:
Daniel Saukel 2016-07-28 16:13:01 +02:00
parent 3124a708cc
commit bdf5b54975
2 changed files with 10 additions and 1 deletions

View File

@ -134,6 +134,7 @@ public enum DMessages implements Messages {
GROUP_KICKED_PLAYER("Group_KickedPlayer", "&4&v1&6 kicked the player &4&v2&6 from the group &4&v3&6."),
GROUP_PLAYER_JOINED("Group_PlayerJoined", "&6Player &4&v1&6 has joined the group!"),
GROUP_WAVE_FINISHED("Group_WaveFinished", "&6Your group finished wave no. &4&v1&6. The next one is going to start in &4&v2&6 seconds."),
LOG_DISABLED_TWEAKS("Log_DisabledTweaks", "&4Disabled performance tweaks because there is no support for this server software."),
LOG_ERROR_MOB_ENCHANTMENT("Log_Error_MobEnchantment", "&4Error at loading mob.yml: Enchantment &6&v1&4 doesn't exist!"),
LOG_ERROR_MOBTYPE("Log_Error_MobType", "&4Error at loading mob.yml: Mob &6&v1&4 doesn't exist!"),
LOG_ERROR_NO_CONSOLE_COMMAND("Log_Error_NoConsoleCommand", "&6/dxl &v1&4 can not be executed as console!"),

View File

@ -16,8 +16,11 @@
*/
package io.github.dre2n.dungeonsxl.config;
import io.github.dre2n.commons.compatibility.CompatibilityHandler;
import io.github.dre2n.commons.compatibility.Internals;
import io.github.dre2n.commons.config.BRConfig;
import io.github.dre2n.commons.util.EnumUtil;
import io.github.dre2n.commons.util.messageutil.MessageUtil;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
@ -496,7 +499,12 @@ public class MainConfig extends BRConfig {
}
if (config.contains("tweaksEnabled")) {
tweaksEnabled = config.getBoolean("tweaksEnabled");
if (Internals.andHigher(Internals.v1_9_R1).contains(CompatibilityHandler.getInstance().getInternals())) {
tweaksEnabled = config.getBoolean("tweaksEnabled");
} else {
tweaksEnabled = false;
MessageUtil.log(DMessages.LOG_DISABLED_TWEAKS.getMessage());
}
}
if (config.contains("secureMode.enabled")) {