Skip to content

Commit

Permalink
config gui
Browse files Browse the repository at this point in the history
  • Loading branch information
seymourimadeit committed Jul 20, 2024
1 parent fa71e85 commit 37ee210
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 5 deletions.
3 changes: 2 additions & 1 deletion changelog-1.21.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- Fix tags being borked
- Fix tags being borked
- Config menu
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public static class CommonConfig {
public final ModConfigSpec.IntValue maxBucklerChargeTime;
public final ModConfigSpec.DoubleValue turningBucklerLaunchStrength;
public final ModConfigSpec.ConfigValue<List<? extends String>> mobsThatCanAlsoUseBuckler;

public CommonConfig(ModConfigSpec.Builder builder) {
builder.push("Vanilla Changes");
healingArrowDamage = builder.define("Allow healing and Regeneration arrows to not do damage?", true);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
34 changes: 33 additions & 1 deletion src/main/resources/assets/piglinproliferation/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"replace": "none",
"replace": false,
"values": [
"piglinproliferation:buckler"
]
Expand Down

0 comments on commit 37ee210

Please sign in to comment.