Add edit config command.

This commit is contained in:
TheComputerGeek2
2017-02-21 23:22:08 -08:00
parent 87c06db63e
commit 398154b576
7 changed files with 75 additions and 0 deletions

View File

@@ -7,6 +7,11 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import com.massivecraft.massivecore.command.editor.annotation.EditorName;
import com.massivecraft.massivecore.command.editor.annotation.EditorType;
import com.massivecraft.massivecore.command.editor.annotation.EditorTypeInner;
import com.massivecraft.massivecore.command.editor.annotation.EditorVisible;
import com.massivecraft.massivecore.command.type.TypeMillisDiff;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
@@ -22,6 +27,7 @@ import com.massivecraft.massivecore.store.Entity;
import com.massivecraft.massivecore.util.MUtil;
import com.massivecraft.massivecore.util.TimeUnit;
@EditorName("config")
public class MConf extends Entity<MConf>
{
// -------------------------------------------- //
@@ -96,14 +102,17 @@ public class MConf extends Entity<MConf>
// After how many milliseconds should players be automatically kicked from their faction?
// The Default
@EditorType(TypeMillisDiff.class)
public long removePlayerMillisDefault = 10 * TimeUnit.MILLIS_PER_DAY; // 10 days
// Player Age Bonus
@EditorTypeInner({TypeMillisDiff.class, TypeMillisDiff.class})
public Map<Long, Long> removePlayerMillisPlayerAgeToBonus = MUtil.map(
2 * TimeUnit.MILLIS_PER_WEEK, 10 * TimeUnit.MILLIS_PER_DAY // +10 days after 2 weeks
);
// Faction Age Bonus
@EditorTypeInner({TypeMillisDiff.class, TypeMillisDiff.class})
public Map<Long, Long> removePlayerMillisFactionAgeToBonus = MUtil.map(
4 * TimeUnit.MILLIS_PER_WEEK, 10 * TimeUnit.MILLIS_PER_DAY, // +10 days after 4 weeks
2 * TimeUnit.MILLIS_PER_WEEK, 5 * TimeUnit.MILLIS_PER_DAY // +5 days after 2 weeks
@@ -492,6 +501,7 @@ public class MConf extends Entity<MConf>
public int seeChunkKeepEvery = 5;
public int seeChunkSkipEvery = 0;
@EditorType(TypeMillisDiff.class)
public long seeChunkPeriodMillis = 500;
public int seeChunkParticleAmount = 30;
public float seeChunkParticleOffsetY = 2;
@@ -529,6 +539,7 @@ public class MConf extends Entity<MConf>
// This way they can be protected in Faction territory.
// Interacting with these materials when they are already placed in the terrain results in an edit.
@EditorVisible(false)
public BackstringEnumSet<Material> materialsEditOnInteract = new BackstringEnumSet<Material>(Material.class,
"DIODE_BLOCK_OFF", // Minecraft 1.?
"DIODE_BLOCK_ON", // Minecraft 1.?
@@ -543,6 +554,7 @@ public class MConf extends Entity<MConf>
// Interacting with the the terrain holding this item in hand results in an edit.
// There's no need to add all block materials here. Only special items other than blocks.
@EditorVisible(false)
public BackstringEnumSet<Material> materialsEditTools = new BackstringEnumSet<Material>(Material.class,
"FIREBALL", // Minecraft 1.?
"FLINT_AND_STEEL", // Minecraft 1.?
@@ -555,6 +567,7 @@ public class MConf extends Entity<MConf>
// The duplication bug found in Spigot 1.8 protocol patch
// https://github.com/MassiveCraft/Factions/issues/693
@EditorVisible(false)
public BackstringEnumSet<Material> materialsEditToolsDupeBug = new BackstringEnumSet<Material>(Material.class,
"CHEST", // Minecraft 1.?
"SIGN_POST", // Minecraft 1.?
@@ -565,6 +578,7 @@ public class MConf extends Entity<MConf>
);
// Interacting with these materials placed in the terrain results in door toggling.
@EditorVisible(false)
public BackstringEnumSet<Material> materialsDoor = new BackstringEnumSet<Material>(Material.class,
"WOODEN_DOOR", // Minecraft 1.?
"ACACIA_DOOR", // Minecraft 1.8
@@ -582,6 +596,7 @@ public class MConf extends Entity<MConf>
);
// Interacting with these materials placed in the terrain results in opening a container.
@EditorVisible(false)
public BackstringEnumSet<Material> materialsContainer = new BackstringEnumSet<Material>(Material.class,
"DISPENSER", // Minecraft 1.?
"CHEST", // Minecraft 1.?
@@ -616,12 +631,14 @@ public class MConf extends Entity<MConf>
);
// Interacting with these entities results in an edit.
@EditorVisible(false)
public BackstringEnumSet<EntityType> entityTypesEditOnInteract = new BackstringEnumSet<EntityType>(EntityType.class,
"ITEM_FRAME", // Minecraft 1.?
"ARMOR_STAND" // Minecraft 1.8
);
// Damaging these entities results in an edit.
@EditorVisible(false)
public BackstringEnumSet<EntityType> entityTypesEditOnDamage = new BackstringEnumSet<EntityType>(EntityType.class,
"ITEM_FRAME", // Minecraft 1.?
"ARMOR_STAND", // Minecraft 1.8
@@ -629,12 +646,14 @@ public class MConf extends Entity<MConf>
);
// Interacting with these entities results in opening a container.
@EditorVisible(false)
public BackstringEnumSet<EntityType> entityTypesContainer = new BackstringEnumSet<EntityType>(EntityType.class,
"MINECART_CHEST", // Minecraft 1.?
"MINECART_HOPPER" // Minecraft 1.?
);
// The complete list of entities considered to be monsters.
@EditorVisible(false)
public BackstringEnumSet<EntityType> entityTypesMonsters = new BackstringEnumSet<EntityType>(EntityType.class,
"BLAZE", // Minecraft 1.?
"CAVE_SPIDER", // Minecraft 1.?
@@ -667,6 +686,7 @@ public class MConf extends Entity<MConf>
);
// List of entities considered to be animals.
@EditorVisible(false)
public BackstringEnumSet<EntityType> entityTypesAnimals = new BackstringEnumSet<EntityType>(EntityType.class,
"BAT", // Minecraft 1.?
"CHICKEN", // Minecraft 1.?