Add mcMMO_Region_System.Enabled to persistent_data.yml (removed from hidden config)

This commit is contained in:
nossr50 2021-04-09 07:54:34 -07:00
parent e76fb9ab1b
commit 56f9341f8e
15 changed files with 15 additions and 37 deletions

View File

@ -1,4 +1,6 @@
Version 2.1.189 Version 2.1.189
The setting to disable the mcMMO user block tracker has been moved from our "hidden config" to persistent_data.yml
Added 'mcMMO_Region_System.Enabled' to persistent_data.yml (don't touch this setting unless you know what you are doing)
Fixed a bug that would remove components from death messages when players were killed by mobs (thanks lexikiq) Fixed a bug that would remove components from death messages when players were killed by mobs (thanks lexikiq)
Removed MHD command (it didn't do anything for a while now) Removed MHD command (it didn't do anything for a while now)
Removed UltraPermissions warning Removed UltraPermissions warning

View File

@ -1,6 +1,5 @@
package com.gmail.nossr50.commands.skills; package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.listeners.InteractionManager; import com.gmail.nossr50.listeners.InteractionManager;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;

View File

@ -9,7 +9,6 @@ public class HiddenConfig {
private static HiddenConfig instance; private static HiddenConfig instance;
private final String fileName; private final String fileName;
private YamlConfiguration config; private YamlConfiguration config;
private boolean chunkletsEnabled;
private int conversionRate; private int conversionRate;
private boolean useEnchantmentBuffs; private boolean useEnchantmentBuffs;
@ -30,15 +29,11 @@ public class HiddenConfig {
InputStreamReader reader = mcMMO.p.getResourceAsReader(fileName); InputStreamReader reader = mcMMO.p.getResourceAsReader(fileName);
if (reader != null) { if (reader != null) {
config = YamlConfiguration.loadConfiguration(reader); config = YamlConfiguration.loadConfiguration(reader);
chunkletsEnabled = config.getBoolean("Options.Chunklets", true);
conversionRate = config.getInt("Options.ConversionRate", 1); conversionRate = config.getInt("Options.ConversionRate", 1);
useEnchantmentBuffs = config.getBoolean("Options.EnchantmentBuffs", true); useEnchantmentBuffs = config.getBoolean("Options.EnchantmentBuffs", true);
} }
} }
public boolean getChunkletsEnabled() {
return chunkletsEnabled;
}
public int getConversionRate() { public int getConversionRate() {
return conversionRate; return conversionRate;

View File

@ -34,4 +34,9 @@ public class PersistentDataConfig extends AutoUpdateConfigLoader {
return config.getBoolean(key, false); return config.getBoolean(key, false);
} }
public boolean useBlockTracker() {
return config.getBoolean("mcMMO_Region_System.Enabled", true);
}
} }

View File

@ -1,6 +1,5 @@
package com.gmail.nossr50.datatypes.skills; package com.gmail.nossr50.datatypes.skills;
import com.gmail.nossr50.datatypes.skills.interfaces.Skill;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.text.StringUtils; import com.gmail.nossr50.util.text.StringUtils;

View File

@ -1,18 +1,6 @@
package com.gmail.nossr50.datatypes.skills.interfaces; package com.gmail.nossr50.datatypes.skills.interfaces;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
import com.gmail.nossr50.datatypes.skills.ToolType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.SkillManager;
import com.gmail.nossr50.util.text.StringUtils;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import java.util.List;
public interface Skill { public interface Skill {
/** /**

View File

@ -7,11 +7,8 @@ import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile; import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
import com.gmail.nossr50.datatypes.skills.ToolType;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.SkillManager;
import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.ItemUtils; import com.gmail.nossr50.util.ItemUtils;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
@ -31,14 +28,12 @@ import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.SoundCategory; import org.bukkit.SoundCategory;
import org.bukkit.enchantments.Enchantment; import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import java.util.List;
import java.util.Locale; import java.util.Locale;
public class Roll extends AcrobaticsSubSkill { public class Roll extends AcrobaticsSubSkill {

View File

@ -1,7 +1,6 @@
package com.gmail.nossr50.events.skills.secondaryabilities; package com.gmail.nossr50.events.skills.secondaryabilities;
import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.interfaces.Skill;
import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill;
import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;

View File

@ -36,7 +36,6 @@ import org.bukkit.GameMode;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockState; import org.bukkit.block.BlockState;
import org.bukkit.conversations.Conversation;
import org.bukkit.enchantments.Enchantment; import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.*; import org.bukkit.entity.*;
import org.bukkit.entity.minecart.PoweredMinecart; import org.bukkit.entity.minecart.PoweredMinecart;

View File

@ -9,9 +9,7 @@ import com.gmail.nossr50.config.mods.BlockConfigManager;
import com.gmail.nossr50.config.mods.EntityConfigManager; import com.gmail.nossr50.config.mods.EntityConfigManager;
import com.gmail.nossr50.config.mods.ToolConfigManager; import com.gmail.nossr50.config.mods.ToolConfigManager;
import com.gmail.nossr50.config.skills.alchemy.PotionConfig; import com.gmail.nossr50.config.skills.alchemy.PotionConfig;
import com.gmail.nossr50.config.skills.repair.RepairConfig;
import com.gmail.nossr50.config.skills.repair.RepairConfigManager; import com.gmail.nossr50.config.skills.repair.RepairConfigManager;
import com.gmail.nossr50.config.skills.salvage.SalvageConfig;
import com.gmail.nossr50.config.skills.salvage.SalvageConfigManager; import com.gmail.nossr50.config.skills.salvage.SalvageConfigManager;
import com.gmail.nossr50.config.treasure.FishingTreasureConfig; import com.gmail.nossr50.config.treasure.FishingTreasureConfig;
import com.gmail.nossr50.config.treasure.TreasureConfig; import com.gmail.nossr50.config.treasure.TreasureConfig;

View File

@ -1,9 +1,7 @@
package com.gmail.nossr50.skills.alchemy; package com.gmail.nossr50.skills.alchemy;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.skills.AlchemyBrewTask; import com.gmail.nossr50.runnables.skills.AlchemyBrewTask;
import com.gmail.nossr50.util.skills.RankUtils;
import org.bukkit.Location; import org.bukkit.Location;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -8,7 +8,6 @@ import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType; import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
import com.gmail.nossr50.datatypes.skills.interfaces.Skill;
import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill;
import com.gmail.nossr50.events.experience.McMMOPlayerLevelChangeEvent; import com.gmail.nossr50.events.experience.McMMOPlayerLevelChangeEvent;
import com.gmail.nossr50.events.experience.McMMOPlayerLevelDownEvent; import com.gmail.nossr50.events.experience.McMMOPlayerLevelDownEvent;

View File

@ -1,13 +1,12 @@
package com.gmail.nossr50.util.blockmeta; package com.gmail.nossr50.util.blockmeta;
import com.gmail.nossr50.config.HiddenConfig; import com.gmail.nossr50.config.PersistentDataConfig;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
public class ChunkManagerFactory { public class ChunkManagerFactory {
public static @NotNull ChunkManager getChunkManager() { public static @NotNull ChunkManager getChunkManager() {
HiddenConfig hConfig = HiddenConfig.getInstance();
if (hConfig.getChunkletsEnabled()) { if (PersistentDataConfig.getInstance().useBlockTracker()) {
return new HashChunkManager(); return new HashChunkManager();
} }

View File

@ -30,3 +30,8 @@ Persistent_Data:
# By default mcMMO gives 0 XP for this type of mob, not adjustable currently # By default mcMMO gives 0 XP for this type of mob, not adjustable currently
PLAYER_TAMED_MOB: PLAYER_TAMED_MOB:
Saved_To_Disk: false Saved_To_Disk: false
# When players put down a block we track it, the system used to track player blocks is super efficient and has been coded extremely well
# It is never recommended to turn this off as it allows exploits such as player dupes etc
# We use our own file system for this outside of NBT which has been programmed to be lightning fast
mcMMO_Region_System:
Enabled: true

View File

@ -1,7 +1,6 @@
package com.gmail.nossr50.database; package com.gmail.nossr50.database;
import com.gmail.nossr50.TestUtil; import com.gmail.nossr50.TestUtil;
import com.gmail.nossr50.config.GeneralConfig;
import com.google.common.io.Files; import com.google.common.io.Files;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@ -10,7 +9,6 @@ import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner; import org.powermock.modules.junit4.PowerMockRunner;
import java.io.*; import java.io.*;