Use implicit string based lazily evaluating sets instead of explicit enum sets. Fixes MassiveCraft/Factions#730. Fixes MassiveCraft/Factions#733.

This commit is contained in:
Olof Larsson 2014-12-16 02:07:09 +01:00
parent 9915386235
commit cc31d334bf

View File

@ -17,6 +17,7 @@ import com.massivecraft.factions.Rel;
import com.massivecraft.factions.WorldExceptionSet; import com.massivecraft.factions.WorldExceptionSet;
import com.massivecraft.factions.engine.EngineChat; import com.massivecraft.factions.engine.EngineChat;
import com.massivecraft.factions.event.EventFactionsChunkChangeType; import com.massivecraft.factions.event.EventFactionsChunkChangeType;
import com.massivecraft.massivecore.collections.BackstringEnumSet;
import com.massivecraft.massivecore.store.Entity; import com.massivecraft.massivecore.store.Entity;
import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.MUtil;
import com.massivecraft.massivecore.util.TimeUnit; import com.massivecraft.massivecore.util.TimeUnit;
@ -466,88 +467,88 @@ public class MConf extends Entity<MConf>
// If you however are using Forge with mods that add new container types you might want to add them here. // If you however are using Forge with mods that add new container types you might want to add them here.
// This way they can be protected in Faction territory. // This way they can be protected in Faction territory.
public Set<Material> materialsEditOnInteract = MUtil.set( public BackstringEnumSet<Material> materialsEditOnInteract = new BackstringEnumSet<Material>(Material.class,
Material.DIODE_BLOCK_OFF, "DIODE_BLOCK_OFF", // Minecraft 1.?
Material.DIODE_BLOCK_ON, "DIODE_BLOCK_ON", // Minecraft 1.?
Material.NOTE_BLOCK, "NOTE_BLOCK", // Minecraft 1.?
Material.CAULDRON, "CAULDRON", // Minecraft 1.?
Material.SOIL "SOIL" // Minecraft 1.?
); );
public Set<Material> materialsEditTools = MUtil.set( public BackstringEnumSet<Material> materialsEditTools = new BackstringEnumSet<Material>(Material.class,
Material.FIREBALL, "FIREBALL", // Minecraft 1.?
Material.FLINT_AND_STEEL, "FLINT_AND_STEEL", // Minecraft 1.?
Material.BUCKET, "BUCKET", // Minecraft 1.?
Material.WATER_BUCKET, "WATER_BUCKET", // Minecraft 1.?
Material.LAVA_BUCKET "LAVA_BUCKET" // Minecraft 1.?
); );
// The duplication bug found in Spigot 1.8 protocol patch // The duplication bug found in Spigot 1.8 protocol patch
// https://github.com/MassiveCraft/Factions/issues/693 // https://github.com/MassiveCraft/Factions/issues/693
public Set<Material> materialsEditToolsDupeBug = MUtil.set( public BackstringEnumSet<Material> materialsEditToolsDupeBug = new BackstringEnumSet<Material>(Material.class,
Material.CHEST, "CHEST", // Minecraft 1.?
Material.SIGN_POST, "SIGN_POST", // Minecraft 1.?
Material.TRAPPED_CHEST, "TRAPPED_CHEST", // Minecraft 1.?
Material.SIGN, "SIGN", // Minecraft 1.?
Material.WOOD_DOOR, "WOOD_DOOR", // Minecraft 1.?
Material.IRON_DOOR "IRON_DOOR" // Minecraft 1.?
); );
public Set<Material> materialsDoor = MUtil.set( public BackstringEnumSet<Material> materialsDoor = new BackstringEnumSet<Material>(Material.class,
Material.WOODEN_DOOR, "WOODEN_DOOR", // Minecraft 1.?
Material.ACACIA_DOOR, "ACACIA_DOOR", // Minecraft 1.8
Material.BIRCH_DOOR, "BIRCH_DOOR", // Minecraft 1.8
Material.DARK_OAK_DOOR, "DARK_OAK_DOOR", // Minecraft 1.8
Material.JUNGLE_DOOR, "JUNGLE_DOOR", // Minecraft 1.8
Material.SPRUCE_DOOR, "SPRUCE_DOOR", // Minecraft 1.8
Material.TRAP_DOOR, "TRAP_DOOR", // Minecraft 1.?
Material.FENCE_GATE, "FENCE_GATE", // Minecraft 1.?
Material.ACACIA_FENCE_GATE, "ACACIA_FENCE_GATE", // Minecraft 1.8
Material.BIRCH_FENCE_GATE, "BIRCH_FENCE_GATE", // Minecraft 1.8
Material.DARK_OAK_FENCE_GATE, "DARK_OAK_FENCE_GATE", // Minecraft 1.8
Material.JUNGLE_FENCE_GATE, "JUNGLE_FENCE_GATE", // Minecraft 1.8
Material.SPRUCE_FENCE_GATE "SPRUCE_FENCE_GATE" // Minecraft 1.8
); );
public Set<Material> materialsContainer = MUtil.set( public BackstringEnumSet<Material> materialsContainer = new BackstringEnumSet<Material>(Material.class,
Material.DISPENSER, "DISPENSER", // Minecraft 1.?
Material.CHEST, "CHEST", // Minecraft 1.?
Material.FURNACE, "FURNACE", // Minecraft 1.?
Material.BURNING_FURNACE, "BURNING_FURNACE", // Minecraft 1.?
Material.JUKEBOX, "JUKEBOX", // Minecraft 1.?
Material.BREWING_STAND, "BREWING_STAND", // Minecraft 1.?
Material.ENCHANTMENT_TABLE, "ENCHANTMENT_TABLE", // Minecraft 1.?
Material.ANVIL, "ANVIL", // Minecraft 1.?
Material.BEACON, "BEACON", // Minecraft 1.?
Material.TRAPPED_CHEST, "TRAPPED_CHEST", // Minecraft 1.?
Material.HOPPER, "HOPPER", // Minecraft 1.?
Material.DROPPER "DROPPER" // Minecraft 1.?
); );
public Set<EntityType> entityTypesContainer = MUtil.set( public BackstringEnumSet<EntityType> entityTypesContainer = new BackstringEnumSet<EntityType>(EntityType.class,
EntityType.MINECART_CHEST, "MINECART_CHEST", // Minecraft 1.?
EntityType.MINECART_HOPPER, "MINECART_HOPPER", // Minecraft 1.?
EntityType.ARMOR_STAND "ARMOR_STAND" // Minecraft 1.?
); );
public Set<EntityType> entityTypesMonsters = MUtil.set( public BackstringEnumSet<EntityType> entityTypesMonsters = new BackstringEnumSet<EntityType>(EntityType.class,
EntityType.BLAZE, "BLAZE", // Minecraft 1.?
EntityType.CAVE_SPIDER, "CAVE_SPIDER", // Minecraft 1.?
EntityType.CREEPER, "CREEPER", // Minecraft 1.?
EntityType.ENDERMAN, "ENDERMAN", // Minecraft 1.?
EntityType.ENDER_DRAGON, "ENDER_DRAGON", // Minecraft 1.?
EntityType.GUARDIAN, "GUARDIAN", // Minecraft 1.8
EntityType.GHAST, "GHAST", // Minecraft 1.?
EntityType.GIANT, "GIANT", // Minecraft 1.?
EntityType.MAGMA_CUBE, "MAGMA_CUBE", // Minecraft 1.?
EntityType.PIG_ZOMBIE, "PIG_ZOMBIE", // Minecraft 1.?
EntityType.SILVERFISH, "SILVERFISH", // Minecraft 1.?
EntityType.SKELETON, "SKELETON", // Minecraft 1.?
EntityType.SLIME, "SLIME", // Minecraft 1.?
EntityType.SPIDER, "SPIDER", // Minecraft 1.?
EntityType.WITCH, "WITCH", // Minecraft 1.?
EntityType.WITHER, "WITHER", // Minecraft 1.?
EntityType.ZOMBIE "ZOMBIE" // Minecraft 1.?
); );
// -------------------------------------------- // // -------------------------------------------- //