Skip to content

Commit

Permalink
gloomIgnore config added
Browse files Browse the repository at this point in the history
  • Loading branch information
Lothrazar committed Apr 4, 2024
1 parent 20bfb6e commit fc6f095
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 19 deletions.
36 changes: 19 additions & 17 deletions examples/config/cyclic.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions scripts/clean_config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

rm run/config/cyclic.toml
rm run/config/cyclic-client.toml

echo "configs reset"
4 changes: 4 additions & 0 deletions scripts/example_config.sh
Original file line number Diff line number Diff line change
@@ -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
11 changes: 10 additions & 1 deletion src/main/java/com/lothrazar/cyclic/config/ConfigRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public class ConfigRegistry {
private static ConfigValue<List<? extends String>> BEHEADING_SKINS;
private static ConfigValue<List<? extends String>> MBALL_IGNORE_LIST;
private static ConfigValue<List<? extends String>> DISARM_IGNORE_LIST;
public static ConfigValue<List<? extends String>> GLOOM_IGNORE_LIST;
public static BooleanValue CYAN_GENERATES;
public static IntValue CHARM_LUCK;
public static DoubleValue CHARM_SPEED;
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -511,6 +515,11 @@ public static List<String> getDisarmIgnoreList() {
return (List<String>) DISARM_IGNORE_LIST.get();
}

@SuppressWarnings("unchecked")
public static List<String> getGloomIgnoreList() {
return (List<String>) GLOOM_IGNORE_LIST.get();
}

public static Map<String, String> getMappedBeheading() {
Map<String, String> mappedBeheading = new HashMap<String, String>();
for (String s : BEHEADING_SKINS.get()) {
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/lothrazar/cyclic/enchant/EnchantGloom.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion update.json
Original file line number Diff line number Diff line change
Expand Up @@ -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+ "
}
}

0 comments on commit fc6f095

Please sign in to comment.