From 37ee210a3c624b8c68fecc3df7a13308823120bb Mon Sep 17 00:00:00 2001 From: seymourimadeit Date: Fri, 19 Jul 2024 21:16:18 -0700 Subject: [PATCH] config gui --- changelog-1.21.txt | 3 +- gradle.properties | 2 +- .../PiglinProliferationClient.java | 3 ++ .../configuration/PPConfig.java | 4 ++- .../piglinproliferation/lang/en_us.json | 34 ++++++++++++++++++- .../data/c/tags/{blocks => block}/skulls.json | 0 .../shields.json => item/tools/shield.json} | 0 .../tags/item/enchantable/durability.json | 2 +- 8 files changed, 43 insertions(+), 5 deletions(-) rename src/main/resources/data/c/tags/{blocks => block}/skulls.json (100%) rename src/main/resources/data/c/tags/{items/shields.json => item/tools/shield.json} (100%) diff --git a/changelog-1.21.txt b/changelog-1.21.txt index 9530003..1739488 100644 --- a/changelog-1.21.txt +++ b/changelog-1.21.txt @@ -1 +1,2 @@ -- Fix tags being borked \ No newline at end of file +- Fix tags being borked +- Config menu \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index d1ce215..03f25cd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,7 +15,7 @@ minecraft_version=1.21 # as they do not follow standard versioning conventions. minecraft_version_range=[1.21, 1.22) # The Neo version must agree with the Minecraft version to get a valid artifact -neo_version=21.0.86-beta +neo_version=21.0.112-beta # The Neo version range can use any version of Neo as bounds or match the loader version range neo_version_range=[20.5.14,) # The loader version range can only use the major version of Neo/FML as bounds diff --git a/src/main/java/tallestred/piglinproliferation/PiglinProliferationClient.java b/src/main/java/tallestred/piglinproliferation/PiglinProliferationClient.java index 2277114..a53d51a 100644 --- a/src/main/java/tallestred/piglinproliferation/PiglinProliferationClient.java +++ b/src/main/java/tallestred/piglinproliferation/PiglinProliferationClient.java @@ -8,6 +8,8 @@ import net.neoforged.fml.ModContainer; import net.neoforged.fml.common.Mod; import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; +import net.neoforged.neoforge.client.gui.ConfigurationScreen; +import net.neoforged.neoforge.client.gui.IConfigScreenFactory; import tallestred.piglinproliferation.common.items.BucklerItem; import tallestred.piglinproliferation.common.items.PPItems; import tallestred.piglinproliferation.common.items.component.PPComponents; @@ -17,6 +19,7 @@ public class PiglinProliferationClient { public PiglinProliferationClient(IEventBus modEventBus, Dist dist, ModContainer container) { modEventBus.addListener(this::doClientStuff); + container.registerExtensionPoint(IConfigScreenFactory.class, ConfigurationScreen::new); } private void doClientStuff(final FMLClientSetupEvent event) { diff --git a/src/main/java/tallestred/piglinproliferation/configuration/PPConfig.java b/src/main/java/tallestred/piglinproliferation/configuration/PPConfig.java index 8644640..d9ab636 100644 --- a/src/main/java/tallestred/piglinproliferation/configuration/PPConfig.java +++ b/src/main/java/tallestred/piglinproliferation/configuration/PPConfig.java @@ -48,6 +48,7 @@ public static class CommonConfig { public final ModConfigSpec.IntValue maxBucklerChargeTime; public final ModConfigSpec.DoubleValue turningBucklerLaunchStrength; public final ModConfigSpec.ConfigValue> mobsThatCanAlsoUseBuckler; + public CommonConfig(ModConfigSpec.Builder builder) { builder.push("Vanilla Changes"); healingArrowDamage = builder.define("Allow healing and Regeneration arrows to not do damage?", true); @@ -65,7 +66,7 @@ public CommonConfig(ModConfigSpec.Builder builder) { zombifiedTravelerChance = builder.defineInRange("Chance of zombified piglins spawning with traveler clothing ", 0.10F, 0.0F, 9000.0F); builder.pop(); builder.push("Buckler"); - mobsThatCanAlsoUseBuckler = builder.define("Mobs that can also use the buckler", Lists.newArrayList("guardvillagers:guard")); + mobsThatCanAlsoUseBuckler = builder.defineListAllowEmpty("Mobs that can also use the buckler", ImmutableList.of("guardvillagers:guard"), () -> "guardvillagers:guard", o -> true); BangBlockDestruction = builder.define("Have the explosion spawned while using the Bang! enchant destroy blocks?", false); BruteBuckler = builder.define("Have brutes spawn with bucklers?", true); bucklerCooldown = builder.defineInRange("How long should the buckler's cooldown be in ticks?", 240, Integer.MIN_VALUE, Integer.MAX_VALUE); @@ -92,6 +93,7 @@ public static class ClientConfig { public final ModConfigSpec.BooleanValue ziglinTextures; public final ModConfigSpec.BooleanValue RenderAfterImage; public final ModConfigSpec.BooleanValue RenderAfterImageLayers; + public ClientConfig(ModConfigSpec.Builder builder) { builder.push("vanilla changes"); ziglinTextures = builder.define("Allow Zombified Piglins to render consistent clothing?", true); diff --git a/src/main/resources/assets/piglinproliferation/lang/en_us.json b/src/main/resources/assets/piglinproliferation/lang/en_us.json index 2474bd0..b62832e 100644 --- a/src/main/resources/assets/piglinproliferation/lang/en_us.json +++ b/src/main/resources/assets/piglinproliferation/lang/en_us.json @@ -96,5 +96,37 @@ "subtitles.entity.parrot.imitate.piglin_traveler": "Parrot grunts", "subtitles.entity.parrot.imitate.zombified_piglin": "Parrot grunts", "piglinproliferation.advancements.nether.obtain_travelers_compass.title": "Journey of a Thousand Blocks", - "piglinproliferation.advancements.nether.obtain_travelers_compass.description": "Obtain a Traveler's Compass by bartering with a Piglin Traveler - it may help you find what you need..." + "piglinproliferation.advancements.nether.obtain_travelers_compass.description": "Obtain a Traveler's Compass by bartering with a Piglin Traveler - it may help you find what you need...", + "piglinproliferation.configuration.Chance of buckler appearing in bastion loot": "Chance of buckler appearing in Bastion loot tables", + "piglinproliferation.configuration.Vanilla Changes": "Changes to Vanilla", + "piglinproliferation.configuration.Chance of zombified piglins spawning with alchemist clothing (including items)": "Chance of zombified piglins spawning with alchemist clothing (including items)", + "piglinproliferation.configuration.Alchemist spawnrate weight in bastions": "Alchemist spawnrate weight in bastions", + "piglinproliferation.configuration.Chance of travelers equipping crossbows": "Chance of travelers equipping crossbows", + "piglinproliferation.configuration.Have the explosion spawned while using the Bang! enchant destroy blocks?": "Have the explosion spawned while using the Bang! enchant destroy blocks?", + "piglinproliferation.configuration.Chance of zombified piglins spawning with brute clothing (including items)": "Chance of zombified piglins spawning with brute clothing (including items)", + "piglinproliferation.configuration.Chance of zombified piglins spawning with regular piglin clothing": "Chance of zombified piglins spawning with regular piglin clothing", + "piglinproliferation.configuration.Maximium healing arrow stack size": "Maximium healing arrow stack size", + "piglinproliferation.configuration.Chance of zombified piglins spawning with crossbows": "Chance of zombified piglins spawning with crossbows", + "piglinproliferation.configuration.Healing Arrow Chances": "Healing Arrow Chances", + "piglinproliferation.configuration.How long should the buckler's charge move if you have the max level of turning enchant be in ticks?": "How long should the buckler's charge move if you have the max level of turning enchant be in ticks?", + "piglinproliferation.configuration.Have brutes spawn with bucklers?": "Have brutes spawn with bucklers?", + "piglinproliferation.configuration.Mobs that can also use the buckler": "Mobs that can also use the buckler if it's equipped", + "piglinproliferation.configuration.Allow healing and Regeneration arrows to not do damage?": "Allow healing and Regeneration arrows to not do damage?", + "piglinproliferation.configuration.Launch strength ": "Launch strength with Turning enchantment", + "piglinproliferation.configuration.Piglin Traveler": "Piglin Traveler", + "piglinproliferation.configuration.Chances of an alchemist getting healing arrows": "Chances of an alchemist getting healing arrows\"", + "piglinproliferation.configuration.Chance of zombified piglins spawning with traveler clothing ": "Chance of zombified piglins spawning with traveler clothing", + "piglinproliferation.configuration.Minmium healing arrow stack size": "Minimum healing arrow stack size", + "piglinproliferation.configuration.How long should the buckler's cooldown be in ticks?": "How long should the buckler's cooldown be in ticks?", + "piglinproliferation.configuration.Piglin Alchemist": "Piglin Alchemist", + "piglinproliferation.configuration.Buckler": "Buckler configuration", + "piglinproliferation.configuration.How long should the buckler's charge move be in ticks?": "How long should the buckler's charge move be in ticks?", + "piglinproliferation.configuration.Chance of alchemist potions not getting broken when killed": "Chance of alchemist potions not getting broken when killed", + "piglinproliferation.configuration.section.piglinproliferation.client.toml": "Client config", + "piglinproliferation.configuration.section.piglinproliferation.common.toml": "Common config", + "piglinproliferation.configuration.Render the layers of an entity when charging? (this includes things like items and armor, be warned that the alpha transparencies may glitch out)": "Render the layers of an entity when charging? (this includes things like items and armor, be warned that the alpha transparencies may glitch out)", + "piglinproliferation.configuration.vanilla changes": "Vanilla changes", + "piglinproliferation.configuration.Render an after image while an entity is charging with a buckler?": ".Render an after image while an entity is charging with a buckler?", + "piglinproliferation.configuration.Allow Zombified Piglins to render consistent clothing?": "Allow Zombified Piglins to render consistent clothing?", + "piglinproliferation.configuration.after image": "After Image from Buckler charging" } \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/skulls.json b/src/main/resources/data/c/tags/block/skulls.json similarity index 100% rename from src/main/resources/data/c/tags/blocks/skulls.json rename to src/main/resources/data/c/tags/block/skulls.json diff --git a/src/main/resources/data/c/tags/items/shields.json b/src/main/resources/data/c/tags/item/tools/shield.json similarity index 100% rename from src/main/resources/data/c/tags/items/shields.json rename to src/main/resources/data/c/tags/item/tools/shield.json diff --git a/src/main/resources/data/minecraft/tags/item/enchantable/durability.json b/src/main/resources/data/minecraft/tags/item/enchantable/durability.json index 0623655..244002a 100644 --- a/src/main/resources/data/minecraft/tags/item/enchantable/durability.json +++ b/src/main/resources/data/minecraft/tags/item/enchantable/durability.json @@ -1,5 +1,5 @@ { - "replace": "none", + "replace": false, "values": [ "piglinproliferation:buckler" ]