From a652db7b9031de218c9cc89f8c6eba715825681d Mon Sep 17 00:00:00 2001 From: lothrazar Date: Sat, 6 Apr 2024 12:41:30 -0700 Subject: [PATCH] fix config alignment --- build.gradle | 20 +- examples/config/cyclic.toml | 227 +++++++++--------- gradle.properties | 2 +- .../cyclic/config/ConfigRegistry.java | 14 +- .../cyclic/event/ClientInputEvents.java | 8 - .../cyclic/item/lunchbox/ItemLunchbox.java | 6 +- 6 files changed, 124 insertions(+), 153 deletions(-) diff --git a/build.gradle b/build.gradle index 858660b82..c9943e3e2 100644 --- a/build.gradle +++ b/build.gradle @@ -81,7 +81,6 @@ dependencies { implementation fg.deobf("top.theillusivec4.curios:curios-forge:${mc_version}-${curios_version}") implementation fg.deobf("com.blamejared.crafttweaker:CraftTweaker-forge-${mc_version}:${crafttweaker_version}") - compileOnly fg.deobf("vazkii.botania:Botania:${mc_version}-${botania_version}:api") runtimeOnly fg.deobf("vazkii.botania:Botania:${mc_version}-${botania_version}") @@ -90,24 +89,21 @@ dependencies { compileOnly fg.deobf("vazkii.patchouli:Patchouli:${mc_version}-${patchouli_version}:api") runtimeOnly fg.deobf("vazkii.patchouli:Patchouli:${mc_version}-${patchouli_version}") - + // implementation fg.deobf("curse.maven:autoreglib-250363:3642382") + // implementation fg.deobf("curse.maven:quark-243121:3840125") + // implementation fg.deobf("curse.maven:more-villagers-484954:3843498") + // implementation fg.deobf("curse.maven:yungs-api-421850:4428184") + // implementation fg.deobf("curse.maven:yungs-better-strongholds-465575:3778231") + // implementation fg.deobf("curse.maven:mekanism-268560:3875976") - implementation fg.deobf("curse.maven:yungs-api-421850:4428184") - implementation fg.deobf("curse.maven:yungs-better-strongholds-465575:3778231") - implementation fg.deobf("curse.maven:mekanism-268560:3875976") - -// implementation fg.deobf("curse.maven:absent-by-design-305840:3686851") - } repositories { // If you have mod jar dependencies in ./libs, you can declare them as a repository like so: - flatDir { - dir 'libs' - } + // flatDir { dir 'libs' } maven { // TOP name 'tterrag maven' url "https://maven.tterrag.com/" @@ -120,7 +116,7 @@ repositories { maven { url 'https://maven.theillusivec4.top/' } maven { url 'https://maven.blamejared.com' } maven { url 'https://modmaven.dev' } - maven { url 'https://www.cursemaven.com' } +// maven { url 'https://www.cursemaven.com' } } // Example for how to get properties into the manifest for reading by the runtime.. jar { diff --git a/examples/config/cyclic.toml b/examples/config/cyclic.toml index c3eef42d5..503e8381e 100644 --- a/examples/config/cyclic.toml +++ b/examples/config/cyclic.toml @@ -151,14 +151,14 @@ #Set false to disable enchantment enabled = true - [cyclic.enchantment.life_leech] - #Set false to disable enchantment - enabled = true - [cyclic.enchantment.gloom] #Set list of effects for Gloom enchant (cyclic:curse) to ignore and not use these ignored = ["minecraft:bad_omen", "minecraft:nausea", "botania:clear"] + [cyclic.enchantment.life_leech] + #Set false to disable enchantment + enabled = true + [cyclic.enchantment.curse] #(Gloom) Set false to disable enchantment enabled = true @@ -212,6 +212,8 @@ # Block specific configs ##################################################################################### [cyclic.blocks] + # Allows the dimensional Transfer Nodes to cross dimensions (no chunk loading is done, you have to do that on your own); This affects blocks cyclic:wireless_energy, cyclic:wireless_item, cyclic:wireless_fluid, cyclic:wireless_transmitter; If you change it to false it will only work if the target is in the same dimension. + wireless_transfer_dimensional = true #If true, then all potions marked as harmful/negative will be used in addition to the 'anti_beacon.potion_list' for cures and immunities (used by both sponge and artemisbeacon). harmful_potions = true @@ -231,6 +233,21 @@ #Range: 1 ~ 512 height = 8 + #Ender Anchor settings + [cyclic.blocks.eye_teleport] + #Maximum distance to activate + #Range: 2 ~ 256 + range = 128 + #Exp cost on teleport + #Range: 0 ~ 500 + exp = 0 + #Hunger cost on teleport + #Range: 0 ~ 20 + hunger = 1 + #Tick delay between checks, faster checks can consume server resources (1 means check every tick; 20 means only check once per second) + #Range: 1 ~ 20 + frequency = 5 + [cyclic.blocks.disenchanter] #Power per use disenchanter #Range: 0 ~ 64000 @@ -266,121 +283,15 @@ energy_cost_xdim = 8000 [cyclic.blocks.sound] + #Sound Recorder - how far out does it listen to record sounds + #Range: 1 ~ 64 + radius = 8 - ##################################################################################### - # Block specific configs - ##################################################################################### - [cyclic.blocks.sound.blocks] - # Allows the dimensional Transfer Nodes to cross dimensions (no chunk loading is done, you have to do that on your own); This affects blocks cyclic:wireless_energy, cyclic:wireless_item, cyclic:wireless_fluid, cyclic:wireless_transmitter; If you change it to false it will only work if the target is in the same dimension. - wireless_transfer_dimensional = true - - #Ender Anchor settings - [cyclic.blocks.sound.blocks.eye_teleport] - #Maximum distance to activate - #Range: 2 ~ 256 - range = 128 - #Exp cost on teleport - #Range: 0 ~ 500 - exp = 0 - #Hunger cost on teleport - #Range: 0 ~ 20 - hunger = 1 - #Tick delay between checks, faster checks can consume server resources (1 means check every tick; 20 means only check once per second) - #Range: 1 ~ 20 - frequency = 5 - - #Ender shelf settings - [cyclic.blocks.sound.blocks.sound] - #Sound Recorder - how far out does it listen to record sounds - #Range: 1 ~ 64 - radius = 8 - - #battery settings - [cyclic.blocks.sound.blocks.battery] - #RF/t charging rate for the battery item slot - #Range: 1 ~ 6400000 - charge = 8000 - - #fisher settings - [cyclic.blocks.sound.blocks.fisher] - #Chance to Fish from nearby water. Smaller values is slower fish - #Range: 1.0E-6 ~ 0.999 - chance = 0.06 - #Radius to Fish from nearby water - #Range: 1 ~ 32 - radius = 12 - - [cyclic.blocks.sound.blocks.ender_shelf] - #Controller Max distance to search (using manhattan distance) - #Range: 1 ~ 256 - controller_distance = 64 - #Each shelf has five rows. Set the number of books stored per row here - #Range: 1 ~ 1024 - books_per_row = 256 - - [cyclic.blocks.sound.blocks.terra_preta] - #Growth interval in ticks (100 would be every 5 seconds). - #Range: 1 ~ 64000 - growth_interval = 100 - #Chance that the crop will grow after the interval - #Range: 0.0 ~ 1.0 - growth_chance = 0.5 - #growth height above the soil - #Range: 2 ~ 32 - height = 8 - - [cyclic.blocks.sound.blocks.uncrafter] - #When searching for a recipe, does it ignore all NBT values (such as enchantments, RepairCost, Damage, etc). For example, if false it will not uncraft damaged or enchanted items - nbt_ignored = false - #Ticks used for each uncraft - #Range: 1 ~ 9999 - ticks = 60 - #ITEM IDS HERE. Block ALL recipes that output this item, no matter which recipe they use - ignore_list = ["minecraft:elytra", "minecraft:tipped_arrow", "minecraft:magma_block", "minecraft:stick", "spectrite:spectrite_arrow", "spectrite:spectrite_arrow_special", "techreborn:uumatter", "projecte:*"] - #RECIPE IDS HERE. Block these recipe ids from being reversed, but do not block all recipes for this output item - ignore_recipes = ["minecraft:white_dye_from_lily_of_the_valley", "minecraft:orange_dye_from_orange_tulip", "minecraft:magenta_dye_from_allium", "minecraft:magenta_dye_from_lilac", "minecraft:light_blue_dye_from_blue_orchid", "minecraft:yellow_dye_from_sunflower", "minecraft:yellow_dye_from_dandelion", "minecraft:pink_dye_from_peony", "minecraft:pink_dye_from_pink_tulip", "minecraft:light_gray_dye_from_oxeye_daisy", "minecraft:light_gray_dye_from_azure_bluet", "minecraft:light_gray_dye_from_white_tulip", "minecraft:blue_dye_from_cornflower", "minecraft:red_dye_from_poppy", "minecraft:red_dye_from_rose_bush", "minecraft:red_dye_from_tulip", "minecraft:black_dye_from_wither_rose", "minecraft:blue_dye", "minecraft:black_dye", "minecraft:brown_dye", "botania:cobweb", "minecraft:magma_cream", "minecraft:beacon", "minecraft:stick_from_bamboo_item", "minecraft:netherite_ingot_from_netherite_block", "mysticalagriculture:essence*", "mysticalagriculture:farmland_till", "refinedstorage:coloring_recipes*", "forcecraft:transmutation*", "cyclic:flower_purple_tulip", "cyclic:flower_absalon_tulip", "cyclic:flower_cyan", "cyclic:flower_lime_carnation", "cyclic:fireball", "cyclic:shapeless/spark"] - - #Ender Trigger settings - [cyclic.blocks.sound.blocks.eye_redstone] - #Maximum distance to activate - #Range: 2 ~ 256 - range = 32 - #Tick delay between checks, faster checks can consume server resources (1 means check every tick; 20 means only check once per second) - #Range: 1 ~ 20 - frequency = 5 - - #Sprinkler settings - [cyclic.blocks.sound.blocks.sprinkler] - #Tick rate. 20 will fire one block per second - #Range: 1 ~ 20 - ticks = 20 - #Radius - #Range: 1 ~ 32 - radius = 4 - #Water consumption - #Range: 0 ~ 1000 - water = 5 - - #terra_glass settings - [cyclic.blocks.sound.blocks.terra_glass] - #ticks between growth cycles - #Range: 1 ~ 10000 - timer = 100 - #growth height below the glass - #Range: 0 ~ 32 - height = 8 - - #experience_pylon settings - [cyclic.blocks.sound.blocks.experience_pylon] - #Radius to pickup xp orbs - #Range: 1 ~ 64 - radius = 16 - - #soundproofing settings - [cyclic.blocks.sound.blocks.soundproofing] - #Radius of sound proofing (distance from each block that it will listen) - #Range: 1 ~ 16 - radius = 6 + #battery settings + [cyclic.blocks.battery] + #RF/t charging rate for the battery item slot + #Range: 1 ~ 6400000 + charge = 8000 [cyclic.blocks.generator_fuel] #RF energy per tick generated while burning furnace fuel in this machine. Burn time in ticks is the same as furnace values, so 1 coal = 1600 ticks @@ -397,6 +308,15 @@ #Range: 0 ~ 64000 energy_cost = 10 + #fisher settings + [cyclic.blocks.fisher] + #Chance to Fish from nearby water. Smaller values is slower fish + #Range: 1.0E-6 ~ 0.999 + chance = 0.06 + #Radius to Fish from nearby water + #Range: 1 ~ 32 + radius = 12 + [cyclic.blocks.harvester] #Power per use harvester #Range: 0 ~ 64000 @@ -422,6 +342,15 @@ #Range: 0 ~ 16000 fluid_cost = 25 + #Ender Trigger settings + [cyclic.blocks.eye_redstone] + #Maximum distance to activate + #Range: 2 ~ 256 + range = 32 + #Tick delay between checks, faster checks can consume server resources (1 means check every tick; 20 means only check once per second) + #Range: 1 ~ 20 + frequency = 5 + [cyclic.blocks.peat] #Chance that Peat Bog converts to Peat when wet (is multiplied by the number of surrounding water blocks) #Range: 0.0010000000474974513 ~ 1.0 @@ -435,9 +364,37 @@ #Range: 0 ~ 512 height = 4 + #Sprinkler settings + [cyclic.blocks.sprinkler] + #Tick rate. 20 will fire one block per second + #Range: 1 ~ 20 + ticks = 20 + #Radius + #Range: 1 ~ 32 + radius = 4 + #Water consumption + #Range: 0 ~ 1000 + water = 5 + + #terra_glass settings + [cyclic.blocks.terra_glass] + #ticks between growth cycles + #Range: 1 ~ 10000 + timer = 100 + #growth height below the glass + #Range: 0 ~ 32 + height = 8 + + #experience_pylon settings + [cyclic.blocks.experience_pylon] + #Radius to pickup xp orbs + #Range: 1 ~ 64 + radius = 16 + + #soundproofing settings [cyclic.blocks.soundproofing] - #Radius to find and muffle sounds. - #Range: 1 ~ 128 + #Radius of sound proofing (distance from each block that it will listen) + #Range: 1 ~ 16 radius = 6 [cyclic.blocks.cables] @@ -486,6 +443,14 @@ #Range: 0 ~ 64000 energy_cost = 10 + [cyclic.blocks.ender_shelf] + #Controller Max distance to search (using manhattan distance) + #Range: 1 ~ 256 + controller_distance = 64 + #Each shelf has five rows. Set the number of books stored per row here + #Range: 1 ~ 1024 + books_per_row = 256 + [cyclic.blocks.uncraft] #Power per use uncraft #Range: 0 ~ 64000 @@ -509,6 +474,28 @@ #Range: 1 ~ 64000 fluid_cost = 100 + [cyclic.blocks.terra_preta] + #Growth interval in ticks (100 would be every 5 seconds). + #Range: 1 ~ 64000 + growth_interval = 100 + #Chance that the crop will grow after the interval + #Range: 0.0 ~ 1.0 + growth_chance = 0.5 + #growth height above the soil + #Range: 2 ~ 32 + height = 8 + + [cyclic.blocks.uncrafter] + #When searching for a recipe, does it ignore all NBT values (such as enchantments, RepairCost, Damage, etc). For example, if false it will not uncraft damaged or enchanted items + nbt_ignored = false + #Ticks used for each uncraft + #Range: 1 ~ 9999 + ticks = 60 + #ITEM IDS HERE. Block ALL recipes that output this item, no matter which recipe they use + ignore_list = ["minecraft:elytra", "minecraft:tipped_arrow", "minecraft:magma_block", "minecraft:stick", "spectrite:spectrite_arrow", "spectrite:spectrite_arrow_special", "techreborn:uumatter", "projecte:*"] + #RECIPE IDS HERE. Block these recipe ids from being reversed, but do not block all recipes for this output item + ignore_recipes = ["minecraft:white_dye_from_lily_of_the_valley", "minecraft:orange_dye_from_orange_tulip", "minecraft:magenta_dye_from_allium", "minecraft:magenta_dye_from_lilac", "minecraft:light_blue_dye_from_blue_orchid", "minecraft:yellow_dye_from_sunflower", "minecraft:yellow_dye_from_dandelion", "minecraft:pink_dye_from_peony", "minecraft:pink_dye_from_pink_tulip", "minecraft:light_gray_dye_from_oxeye_daisy", "minecraft:light_gray_dye_from_azure_bluet", "minecraft:light_gray_dye_from_white_tulip", "minecraft:blue_dye_from_cornflower", "minecraft:red_dye_from_poppy", "minecraft:red_dye_from_rose_bush", "minecraft:red_dye_from_tulip", "minecraft:black_dye_from_wither_rose", "minecraft:blue_dye", "minecraft:black_dye", "minecraft:brown_dye", "botania:cobweb", "minecraft:magma_cream", "minecraft:beacon", "minecraft:stick_from_bamboo_item", "minecraft:netherite_ingot_from_netherite_block", "mysticalagriculture:essence*", "mysticalagriculture:farmland_till", "refinedstorage:coloring_recipes*", "forcecraft:transmutation*", "cyclic:flower_purple_tulip", "cyclic:flower_absalon_tulip", "cyclic:flower_cyan", "cyclic:flower_lime_carnation", "cyclic:fireball", "cyclic:shapeless/spark"] + [cyclic.blocks.anti_beacon] #List of extra effects to clear. supports wildcard such as 'cyclic:*'. (This list is is used even if harmful_potions=false or true both) potion_list = ["minecraft:poison", "minecraft:*_poison", "minecraft:wither", "cyclic:gravity", "minecraft:weakness", "minecraft:slowness"] diff --git a/gradle.properties b/gradle.properties index 823617b4c..f3389931e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ org.gradle.daemon=false curse_id=239286 -mod_version=1.7.18-SNAPSHOT +mod_version=1.7.18 mc_version=1.18.2 forge_version=40.2.17 diff --git a/src/main/java/com/lothrazar/cyclic/config/ConfigRegistry.java b/src/main/java/com/lothrazar/cyclic/config/ConfigRegistry.java index abd9d2223..4da17bb9d 100644 --- a/src/main/java/com/lothrazar/cyclic/config/ConfigRegistry.java +++ b/src/main/java/com/lothrazar/cyclic/config/ConfigRegistry.java @@ -403,7 +403,11 @@ private static void initConfig() { CFG.pop(); //heart CFG.pop(); //items CFG.comment(WALL, " Block specific configs", WALL).push("blocks"); //////////////////////////////////////////////////////////////////////////////////// blocks - //buffer size for cables + TRANSFER_NODES_DIMENSIONAL = CFG.comment(" Allows the dimensional Transfer Nodes to cross dimensions " + + "(no chunk loading is done, you have to do that on your own); " + + "This affects blocks cyclic:wireless_energy, cyclic:wireless_item, cyclic:wireless_fluid, cyclic:wireless_transmitter; " + + "If you change it to false it will only work if the target is in the same dimension.") + .define("wireless_transfer_dimensional", true); TileAntiBeacon.HARMFUL_POTIONS = CFG.comment("If true, then all potions marked as harmful/negative will be used in addition to the 'anti_beacon.potion_list' for cures and immunities (used by both sponge and artemisbeacon).") .define("harmful_potions", true); TileAntiBeacon.RADIUS = CFG.comment("Radius to protect players and entities from potion effects being applied (used by both sponge and artemisbeacon). ") @@ -474,14 +478,6 @@ private static void initConfig() { TileAnvilVoid.FLUIDPAY = CFG.comment("Payment per void action, if not zero").defineInRange("fluid_cost", 25, 0, 16000); CFG.pop(); CFG.push("sound"); - CFG.comment(WALL, " Block specific configs", WALL) - .push("blocks"); - TRANSFER_NODES_DIMENSIONAL = CFG.comment(" Allows the dimensional Transfer Nodes to cross dimensions " - + "(no chunk loading is done, you have to do that on your own); " - + "This affects blocks cyclic:wireless_energy, cyclic:wireless_item, cyclic:wireless_fluid, cyclic:wireless_transmitter; " - + "If you change it to false it will only work if the target is in the same dimension.") - .define("wireless_transfer_dimensional", true); - CFG.push("sound_recorder"); RECORDER_RADIUS = CFG.comment("Sound Recorder - how far out does it listen to record sounds").defineInRange("radius", 8, 1, 64); CFG.pop(); CFG.push("ender_shelf"); diff --git a/src/main/java/com/lothrazar/cyclic/event/ClientInputEvents.java b/src/main/java/com/lothrazar/cyclic/event/ClientInputEvents.java index 03ba4b280..9b6aeee3e 100644 --- a/src/main/java/com/lothrazar/cyclic/event/ClientInputEvents.java +++ b/src/main/java/com/lothrazar/cyclic/event/ClientInputEvents.java @@ -64,18 +64,11 @@ public void onMouseReleasedPre(ScreenEvent.DrawScreenEvent.Pre event) { Minecraft mc = Minecraft.getInstance(); Screen screen = mc.screen; if (screen instanceof AbstractContainerScreen gui && !(screen instanceof CreativeModeInventoryScreen)) { - // if (gui.getSlotUnderMouse() != null) { - // System.out.println("DrawScreenEvent"); - // Slot slotHit = gui.getSlotUnderMouse(); - // ItemStack stackTarget = slotHit.getItem(); ItemStack maybeFood = mc.player.containerMenu.getCarried(); List boxes = ItemBaseCyclic.findAmmos(mc.player, ItemRegistry.LUNCHBOX.get()); - // if (held.isEdible()) { for (ItemStack box : boxes) { ItemLunchbox.setHoldingEdible(box, maybeFood.isEdible()); - // if (maybeFood.isEdible()) System.out.println(maybeFood + "DrawScreenEvent set edible " + box.getTag()); } - // } } } @@ -104,7 +97,6 @@ public void onMouseReleasedPre(ScreenEvent.MouseReleasedEvent.Pre event) { if (maybeFood.isEdible()) { int slotId = gui.getSlotUnderMouse().getContainerSlot(); SoundUtil.playSound(mc.player, SoundEvents.UI_BUTTON_CLICK); - // System.out.println("item Gui "); PacketRegistry.INSTANCE.sendToServer(new PacketItemGui(slotId, stackTarget.getItem())); event.setCanceled(true); return; diff --git a/src/main/java/com/lothrazar/cyclic/item/lunchbox/ItemLunchbox.java b/src/main/java/com/lothrazar/cyclic/item/lunchbox/ItemLunchbox.java index 55a2dc914..348305fd3 100644 --- a/src/main/java/com/lothrazar/cyclic/item/lunchbox/ItemLunchbox.java +++ b/src/main/java/com/lothrazar/cyclic/item/lunchbox/ItemLunchbox.java @@ -46,6 +46,7 @@ public class ItemLunchbox extends ItemBaseCyclic { + private static final String HOLDING = "holding"; public static final int SLOTS = 7; public ItemLunchbox(Properties prop) { @@ -171,12 +172,11 @@ public ICapabilityProvider initCapabilities(ItemStack stack, CompoundTag nbt) { } public static void setHoldingEdible(ItemStack box, boolean edible) { - box.getOrCreateTag().putBoolean("holding", edible); + box.getOrCreateTag().putBoolean(HOLDING, edible); } public static int getColour(ItemStack stack) { - if (stack.hasTag() && stack.getTag().getBoolean("holding")) { - // System.out.println("00boxr!ender overla!y!"); + if (stack.hasTag() && stack.getTag().getBoolean(HOLDING)) { // green? return 0x00AAAAFF; return 0x000000FF; // 0xFFFF0011; }