From 240ab0a0af965bde56841e8f9af72b6e4d602da3 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 6 Jun 2019 03:38:09 -0700 Subject: [PATCH] Add Chimaera Wing to the items config --- Changelog.txt | 1 + .../config/hocon/items/ConfigItems.java | 51 +++++++++ .../hocon/items/ConfigItemsChimaeraWing.java | 100 ++++++++++++++++++ .../hocon/items/ConfigItemsConsumables.java | 17 +++ 4 files changed, 169 insertions(+) create mode 100644 src/main/java/com/gmail/nossr50/config/hocon/items/ConfigItemsChimaeraWing.java create mode 100644 src/main/java/com/gmail/nossr50/config/hocon/items/ConfigItemsConsumables.java diff --git a/Changelog.txt b/Changelog.txt index c895f3955..cf39c75be 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -39,6 +39,7 @@ Version 2.2.0 Lily pads were removed from the Alchemy Ingredient list as they are unused Experience formula conversion command no longer relies on a file to determine what formula you were using previously, instead it determines this from command parameters Fixed some tab completion bugs for /mcconvert command + Increased the default recipe cost for Chimaera Wing from 5 to 40 Admins will now be notified if a player trips over-fishing exploit detection 3+ times in a row (Locale: "Fishing.OverFishingDetected") Note: Admins are players who are an operator or have adminchat permission. diff --git a/src/main/java/com/gmail/nossr50/config/hocon/items/ConfigItems.java b/src/main/java/com/gmail/nossr50/config/hocon/items/ConfigItems.java index df37e4d69..2c18adaf9 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/items/ConfigItems.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/items/ConfigItems.java @@ -1,8 +1,59 @@ package com.gmail.nossr50.config.hocon.items; +import ninja.leaping.configurate.objectmapping.Setting; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; @ConfigSerializable public class ConfigItems { + @Setting(value = "Consumables", comment = "Settings for items that get consumed after one use.") + private ConfigItemsConsumables consumables = new ConfigItemsConsumables(); + + public ConfigItemsConsumables getConsumables() { + return consumables; + } + + public ConfigItemsChimaeraWing getChimaeraWing() { + return consumables.getChimaeraWing(); + } + + public int getUseCost() { + return getChimaeraWing().getUseCost(); + } + + public int getRecipeCost() { + return getChimaeraWing().getRecipeCost(); + } + + public String getRecipeMats() { + return getChimaeraWing().getRecipeMats(); + } + + public int getWarmup() { + return getChimaeraWing().getWarmup(); + } + + public int getCooldown() { + return getChimaeraWing().getCooldown(); + } + + public boolean isEnabled() { + return getChimaeraWing().isEnabled(); + } + + public int getRecentlyHurtCooldown() { + return getChimaeraWing().getRecentlyHurtCooldown(); + } + + public boolean isPreventUndergroundUse() { + return getChimaeraWing().isPreventUndergroundUse(); + } + + public boolean isUseBedSpawn() { + return getChimaeraWing().isUseBedSpawn(); + } + + public boolean isSoundEnabled() { + return getChimaeraWing().isSoundEnabled(); + } } diff --git a/src/main/java/com/gmail/nossr50/config/hocon/items/ConfigItemsChimaeraWing.java b/src/main/java/com/gmail/nossr50/config/hocon/items/ConfigItemsChimaeraWing.java new file mode 100644 index 000000000..1275de25b --- /dev/null +++ b/src/main/java/com/gmail/nossr50/config/hocon/items/ConfigItemsChimaeraWing.java @@ -0,0 +1,100 @@ +package com.gmail.nossr50.config.hocon.items; + +import ninja.leaping.configurate.objectmapping.Setting; +import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; + +@ConfigSerializable +public class ConfigItemsChimaeraWing { + + private static final int USE_COST_DEFAULT = 1; + private static final int RECIPE_COST_DEFAULT = 40; + private static final String MINECRAFT_FEATHER = "minecraft:feather"; + private static final int WARMUP_DEFAULT = 5; + private static final int COOLDOWN_DEFAULT = 240; + private static final boolean ENABLED = true; + private static final int HURT_COOLDOWN_DEFAULT = 60; + private static final boolean PREVENT_UNDERGROUND_USE_DEFAULT = true; + private static final boolean USE_BED_SPAWN_DEFAULT = true; + private static final boolean SOUND_ENABLED_DEFAULT = true; + + @Setting(value = "Amount-Consumed-Per-Activation", comment = "How many Chimaera Wings are needed and consumed with each use.") + private int useCost = USE_COST_DEFAULT; + + @Setting(value = "Recipe-Cost", comment = "How many of the item used to craft Chimaera wing are consumed to make 1 CW." + + "\nDefault value: "+RECIPE_COST_DEFAULT) + private int recipeCost = RECIPE_COST_DEFAULT; + + @Setting(value = "Recipe-Ingredient", comment = "The ingredient used to craft a Chimaera wing." + + "\nDefault value: "+MINECRAFT_FEATHER) + private String recipeMats = MINECRAFT_FEATHER; + + @Setting(value = "Warmup-Period", comment = "How many seconds a player must sit still and not take damage until the Chimaera Wing activates." + + "\nDefault value: "+WARMUP_DEFAULT) + private int warmup = WARMUP_DEFAULT; + + @Setting(value = "Cooldown", comment = "The amount of time players must wait before they are able to use this item again." + + "\nDefault value: "+COOLDOWN_DEFAULT) + private int cooldown = COOLDOWN_DEFAULT; + + @Setting(value = "Enable-Chimaera-Wing", comment = "Whether or not the CW will be enabled on the server." + + "\nDefault value: "+ENABLED) + private boolean enabled = ENABLED; + + @Setting(value = "Damage-Cooldown", comment = "When players take damage, they must wait this many seconds before the Chimaera Wing is usable." + + "\nDefault value: "+HURT_COOLDOWN_DEFAULT) + private int recentlyHurtCooldown = HURT_COOLDOWN_DEFAULT; + + @Setting(value = "Prevent-Underground-Use", comment = "Prevents players from using the CW if solid blocks exist above their character model." + + "\nThis item is actually a reference to Dragon Quest, can you tell?" + + "\nDefault value: "+PREVENT_UNDERGROUND_USE_DEFAULT) + private boolean preventUndergroundUse = PREVENT_UNDERGROUND_USE_DEFAULT; + + @Setting(value = "Use-Bed-Spawn", comment = "Chimaera Wing will attempt to take players to their bed if it exists." + + "\nIf this setting is turned off, players will be taken to the spawn for the current world they reside in." + + "\nDefault value: "+USE_BED_SPAWN_DEFAULT) + private boolean useBedSpawn = USE_BED_SPAWN_DEFAULT; + + @Setting(value = "Play-Sound-On-Use", comment = "Plays a sound effect with the item is used." + + "\nDefault value: "+SOUND_ENABLED_DEFAULT) + private boolean soundEnabled = SOUND_ENABLED_DEFAULT; + + public int getUseCost() { + return useCost; + } + + public int getRecipeCost() { + return recipeCost; + } + + public String getRecipeMats() { + return recipeMats; + } + + public int getWarmup() { + return warmup; + } + + public int getCooldown() { + return cooldown; + } + + public boolean isEnabled() { + return enabled; + } + + public int getRecentlyHurtCooldown() { + return recentlyHurtCooldown; + } + + public boolean isPreventUndergroundUse() { + return preventUndergroundUse; + } + + public boolean isUseBedSpawn() { + return useBedSpawn; + } + + public boolean isSoundEnabled() { + return soundEnabled; + } +} diff --git a/src/main/java/com/gmail/nossr50/config/hocon/items/ConfigItemsConsumables.java b/src/main/java/com/gmail/nossr50/config/hocon/items/ConfigItemsConsumables.java new file mode 100644 index 000000000..3148f5ba3 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/config/hocon/items/ConfigItemsConsumables.java @@ -0,0 +1,17 @@ +package com.gmail.nossr50.config.hocon.items; + +import ninja.leaping.configurate.objectmapping.Setting; +import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; + +@ConfigSerializable +public class ConfigItemsConsumables { + + @Setting(value = "Chimaera-Wing", comment = "Settings relating to the Chimaera Wing." + + "\nThe CW is an item in mcMMO that will teleport players to the bed they last rested at as long as they do not have any solid blocks above their head." + + "\nThe CW is crafted using a custom recipe.") + private ConfigItemsChimaeraWing chimaeraWing = new ConfigItemsChimaeraWing(); + + public ConfigItemsChimaeraWing getChimaeraWing() { + return chimaeraWing; + } +}