diff --git a/examples/config/cyclic.toml b/examples/config/cyclic.toml index ae6b55963..d05d35945 100644 --- a/examples/config/cyclic.toml +++ b/examples/config/cyclic.toml @@ -15,17 +15,26 @@ growthRadius = 2 #Set false to disable enchantment reach = true - #Enchant level increase drop rate. % = beheadingDrop + (level-1)*beheadingPerLevel - #Range: 1 ~ 100 - beheadingPerLevel = 25 #Set false to disable enchantment beekeeper = true #Set false to disable enchantment experience_boost = true - #Set false to disable Multi Jump enchantment - launch = true #Set false to disable enchantment ender = true + #Beheading enchant add player skin head drop, add any mob id and any skin + beheadingEntityMHF = ["minecraft:blaze:MHF_Blaze", "minecraft:cat:MHF_Ocelot", "minecraft:cave_spider:MHF_CaveSpider", "minecraft:chicken:MHF_Chicken", "minecraft:cow:MHF_Cow", "minecraft:enderman:MHF_Enderman", "minecraft:ghast:MHF_Ghast", "minecraft:iron_golem:MHF_Golem", "minecraft:magma_cube:MHF_LavaSlime", "minecraft:mooshroom:MHF_MushroomCow", "minecraft:ocelot:MHF_Ocelot", "minecraft:pig:MHF_Pig", "minecraft:zombie_pigman:MHF_PigZombie", "minecraft:sheep:MHF_Sheep", "minecraft:slime:MHF_Slime", "minecraft:spider:MHF_Spider", "minecraft:squid:MHF_Squid", "minecraft:villager:MHF_Villager", "minecraft:witch:MHF_Witch", "minecraft:wolf:MHF_Wolf", "minecraft:guardian:MHF_Guardian", "minecraft:elder_guardian:MHF_Guardian", "minecraft:snow_golem:MHF_SnowGolem", "minecraft:silverfish:MHF_Silverfish", "minecraft:endermite:MHF_Endermite"] + #Set false to disable enchantment + venom = true + #Set false to disable enchantment + auto_smelt = true + #Initial level drop rate. So level I of enchant gives this % drop chance + #Range: 1 ~ 100 + beheadingDrop = 20 + #Enchant level increase drop rate. % = beheadingDrop + (level-1)*beheadingPerLevel + #Range: 1 ~ 100 + beheadingPerLevel = 25 + #Set false to disable Multi Jump enchantment + launch = true #Enchant level drop rate. % = drop + (level-1)*drop #Range: 1 ~ 100 disarmPercentPerLevel = 15 @@ -35,31 +44,24 @@ excavate = true #Set false to disable enchantment magnet = true - #Beheading enchant add player skin head drop, add any mob id and any skin - beheadingEntityMHF = ["minecraft:blaze:MHF_Blaze", "minecraft:cat:MHF_Ocelot", "minecraft:cave_spider:MHF_CaveSpider", "minecraft:chicken:MHF_Chicken", "minecraft:cow:MHF_Cow", "minecraft:enderman:MHF_Enderman", "minecraft:ghast:MHF_Ghast", "minecraft:iron_golem:MHF_Golem", "minecraft:magma_cube:MHF_LavaSlime", "minecraft:mooshroom:MHF_MushroomCow", "minecraft:ocelot:MHF_Ocelot", "minecraft:pig:MHF_Pig", "minecraft:zombie_pigman:MHF_PigZombie", "minecraft:sheep:MHF_Sheep", "minecraft:slime:MHF_Slime", "minecraft:spider:MHF_Spider", "minecraft:squid:MHF_Squid", "minecraft:villager:MHF_Villager", "minecraft:witch:MHF_Witch", "minecraft:wolf:MHF_Wolf", "minecraft:guardian:MHF_Guardian", "minecraft:elder_guardian:MHF_Guardian", "minecraft:snow_golem:MHF_SnowGolem", "minecraft:silverfish:MHF_Silverfish", "minecraft:endermite:MHF_Endermite"] #Set false to disable enchantment multishot = true #Set false to disable enchantment beheading = true + #Set list of effects for Gloom enchant (cyclic:curse) to ignore and not use these + gloomIgnored = ["minecraft:bad_omen", "minecraft:nausea", "botania:clear"] #Set false to disable enchantment quickshot = true #Mobs in this list cannot be disarmed and have their weapon stolen by the disarm enchantment disarmIngoredMobs = ["alexsmobs:mimicube"] #Set false to disable enchantment - venom = true - #Set false to disable enchantment life_leech = true - #Set false to disable enchantment + #Set false to disable gloom enchantment curse = true #Set false to disable enchantment - auto_smelt = true - #Set false to disable enchantment growth = true #Set false to disable enchantment step = true - #Initial level drop rate. So level I of enchant gives this % drop chance - #Range: 1 ~ 100 - beheadingDrop = 20 ##################################################################################### # Worldgen settings @@ -170,7 +172,7 @@ ##################################################################################### [cyclic.logging] #Unblock info logs; very spammy; can be useful for testing certain issues - info = true + info = false ##################################################################################### #Fluid cost for various machines @@ -446,7 +448,7 @@ crafter = 500 #Power per use user #Range: 0 ~ 64000 - user = 50 + user = 0 #Power per recipe solidifier #Range: 0 ~ 64000 solidifier = 5000 diff --git a/scripts/clean_config.sh b/scripts/clean_config.sh new file mode 100644 index 000000000..fb8a1e434 --- /dev/null +++ b/scripts/clean_config.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +rm run/config/cyclic.toml +rm run/config/cyclic-client.toml + +echo "configs reset" diff --git a/scripts/example_config.sh b/scripts/example_config.sh new file mode 100644 index 000000000..23ecdd889 --- /dev/null +++ b/scripts/example_config.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +cp run/config/cyclic.toml examples/config/cyclic.toml +cp run/config/cyclic-client.toml examples/config/cyclic-client.toml diff --git a/src/main/java/com/lothrazar/cyclic/config/ConfigRegistry.java b/src/main/java/com/lothrazar/cyclic/config/ConfigRegistry.java index 3526b93f5..383426d41 100644 --- a/src/main/java/com/lothrazar/cyclic/config/ConfigRegistry.java +++ b/src/main/java/com/lothrazar/cyclic/config/ConfigRegistry.java @@ -111,6 +111,7 @@ public class ConfigRegistry { private static ConfigValue> BEHEADING_SKINS; private static ConfigValue> MBALL_IGNORE_LIST; private static ConfigValue> DISARM_IGNORE_LIST; + public static ConfigValue> GLOOM_IGNORE_LIST; public static BooleanValue CYAN_GENERATES; public static IntValue CHARM_LUCK; public static DoubleValue CHARM_SPEED; @@ -204,7 +205,10 @@ private static void initConfig() { EnchantAutoSmelt.CFG = CFG.comment("Set false to disable enchantment").define(EnchantAutoSmelt.ID, true); EnchantBeekeeper.CFG = CFG.comment("Set false to disable enchantment").define(EnchantBeekeeper.ID, true); EnchantBeheading.CFG = CFG.comment("Set false to disable enchantment").define(EnchantBeheading.ID, true); - EnchantGloom.CFG = CFG.comment("Set false to disable enchantment").define(EnchantGloom.ID, true); + GLOOM_IGNORE_LIST = CFG.comment("Set list of effects for Gloom enchant (cyclic:curse) to ignore and not use these") + .defineList("gloomIgnored", Arrays.asList("minecraft:bad_omen", "minecraft:nausea", "botania:clear"), + it -> it instanceof String); + EnchantGloom.CFG = CFG.comment("Set false to disable gloom enchantment").define(EnchantGloom.ID, true); EnchantDisarm.CFG = CFG.comment("Set false to disable enchantment").define(EnchantDisarm.ID, true); EnchantDisarm.PERCENTPERLEVEL = CFG.comment("Enchant level drop rate. % = drop + (level-1)*drop").defineInRange(EnchantDisarm.ID + "PercentPerLevel", 15, 1, 100); DISARM_IGNORE_LIST = CFG.comment("Mobs in this list cannot be disarmed and have their weapon stolen by the disarm enchantment") @@ -511,6 +515,11 @@ public static List getDisarmIgnoreList() { return (List) DISARM_IGNORE_LIST.get(); } + @SuppressWarnings("unchecked") + public static List getGloomIgnoreList() { + return (List) GLOOM_IGNORE_LIST.get(); + } + public static Map getMappedBeheading() { Map mappedBeheading = new HashMap(); for (String s : BEHEADING_SKINS.get()) { diff --git a/src/main/java/com/lothrazar/cyclic/enchant/EnchantGloom.java b/src/main/java/com/lothrazar/cyclic/enchant/EnchantGloom.java index 9af528b31..0d7451e5f 100644 --- a/src/main/java/com/lothrazar/cyclic/enchant/EnchantGloom.java +++ b/src/main/java/com/lothrazar/cyclic/enchant/EnchantGloom.java @@ -1,8 +1,11 @@ package com.lothrazar.cyclic.enchant; +import com.lothrazar.cyclic.ModCyclic; import com.lothrazar.cyclic.base.EnchantBase; +import com.lothrazar.cyclic.config.ConfigRegistry; import com.lothrazar.cyclic.util.UtilEnchant; import com.lothrazar.cyclic.util.UtilFakePlayer; +import com.lothrazar.cyclic.util.UtilString; import java.util.Collections; import java.util.List; import net.minecraft.enchantment.EnchantmentType; @@ -65,6 +68,10 @@ public void onUserHurt(LivingEntity user, Entity attacker, int level) { continue; //should be impossible, but i had a random NPE crash log } + if (UtilString.isInList(ConfigRegistry.getGloomIgnoreList(), effect.getRegistryName())) { + ModCyclic.LOGGER.info("Gloom(curse) effect cannot apply " + effect.getRegistryName()); + continue; + } if (appliedEffects < MIN_EFFECTS || BASE_APPLY_CHANCE > user.world.rand.nextDouble()) { //the OR means, if we are under minimum, always go thru diff --git a/update.json b/update.json index cd2513d34..3d4510005 100644 --- a/update.json +++ b/update.json @@ -79,6 +79,6 @@ ,"1.5.20":"#2102 wooden and golden hopper deposit logic fixed, now matches 1.18.2+ versions. #2085 Hopper reach area & pickup logic now uses vanilla-hopper area size. JEED compatibility added for some potion effects. Port Fishing Net and Mending Fishingrods compatibility from 1.12.2 #2067. Ender Apple now sends a message if nothing is found (void/flatworlds/etc). Growth enchant now skips IGrowable blocks that return false for 'canGrow();'. Many new config options added for: growth enchant, beheading enchant, battery, sprinkler, experience_pylon, fisher, scythes, and others in cyclic.toml" ,"1.5.21":"#1933 Sack of Holding chest placement override added, with new config to revert back to legacy behavior if desired (overrideChestSingle). #2168 fix bug where ender shelf sometimes would not save contents when mined after exiting reloading world when client data desyncs. Added a percentage config and ignorelist config for cyclic:disarm enchantment (disarmPercentPerLevel, disarmIngoredMobs), resolves it dropping your copied weapon from alexsmobs:mimicube #2249. Fix #1878 layered and/or logic for multiple wireless transmitters on the same node " ,"1.5.22":"Fix #2351 advanced crafting stick not opening. " - ,"1.5.23":"Fix Soundproofing block not muting Mekanism sounds #2389 (for example Precision Sawmill and others - you may need four or more soundproofing blocks for the desired effect). New config [cyclic.blocks.soundproofing] radius = 6 to control the area. Fix item cable routing #2245 #2230. New config under [cyclic.blocks] wireless_transfer_dimensional = true allowing transfer nodes to connect across dimensions #1913. Balance recipe changes for #2372. Balance changes made for Excavate enchant it will no longer trigger if the tool is not 'mineable' effective for example axe on dirt. New feature for Excavate enchant #2116 it will not trigger on anything matching the block data-tag 'cyclic:ignored/excavate'. [Backported changes from mc1.20.1] zenscript support for generator_fluid and generator_item; #2182 candle model assets; Block Breaker no longer tries (and fails) to mine liquid source blocks; Block Randomizer use wireframe rendering only of non-air instead of solid shading; Glistering & Corrupted chorus only restores 1 food-unit down from 3; a few recipes tweaked/backported to match mc1.20.1+ " + ,"1.5.23":"New gloomIgnored config Gloom enchant (cyclic:curse) to ignore and not use these effects #2217 #2325. New config 'Fix Soundproofing block not muting Mekanism sounds #2389 (for example Precision Sawmill and others - you may need four or more soundproofing blocks for the desired effect). New config [cyclic.blocks.soundproofing] radius = 6 to control the area. Fix item cable routing #2245 #2230. New config under [cyclic.blocks] wireless_transfer_dimensional = true allowing transfer nodes to connect across dimensions #1913. Balance recipe changes for #2372. Balance changes made for Excavate enchant it will no longer trigger if the tool is not 'mineable' effective for example axe on dirt. New feature for Excavate enchant #2116 it will not trigger on anything matching the block data-tag 'cyclic:ignored/excavate'. [Backported changes from mc1.20.1] zenscript support for generator_fluid and generator_item; #2182 candle model assets; Block Breaker no longer tries (and fails) to mine liquid source blocks; Block Randomizer use wireframe rendering only of non-air instead of solid shading; Glistering & Corrupted chorus only restores 1 food-unit down from 3; a few recipes tweaked/backported to match mc1.20.1+ " } }