diff --git a/README.md b/README.md index 575f8297..8948e971 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Allomancy 5.1.0 This mod adds the basics of [Allomancy](http://coppermind.net/wiki/Allomancy) from Brandon Sanderson's book series *Mistborn*. -This mod is currently updated for `Minecraft 1.21` and `NeoForge 21.0.40-beta` +This mod is currently updated for `Minecraft 1.21` and `NeoForge 21.0.110-beta` Please verify and report any issues! diff --git a/build.gradle b/build.gradle index ddd66c80..f280b49a 100644 --- a/build.gradle +++ b/build.gradle @@ -3,8 +3,8 @@ plugins { id 'eclipse' id 'idea' id 'maven-publish' - id 'net.neoforged.gradle.userdev' version '7.0.151' - id 'net.neoforged.gradle.mixin' version '7.0.151' + id 'net.neoforged.gradle.userdev' version '7.0.155' + id 'net.neoforged.gradle.mixin' version '7.0.155' } tasks.named('wrapper', Wrapper).configure { diff --git a/gradle.properties b/gradle.properties index c060b233..2b81e980 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,15 +12,15 @@ 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.40-beta +neo_version=21.0.113-beta # The Neo version range can use any version of Neo as bounds -neo_version_range=[21.0.40-beta,) +neo_version_range=[21.0.110-beta,) # The loader version range can only use the major version of FML as bounds loader_version_range=[4,) # read more on this at https://github.com/neoforged/NeoGradle/blob/NG_7.0/README.md#apply-parchment-mappings # you can also find the latest versions at: https://parchmentmc.org/docs/getting-started neogradle.subsystems.parchment.minecraftVersion=1.21 -neogradle.subsystems.parchment.mappingsVersion=2024.06.23 +neogradle.subsystems.parchment.mappingsVersion=2024.07.07 # https://www.curseforge.com/minecraft/mc-mods/jade/files/all jade_id=5444008 jade_api=5427895 diff --git a/src/generated/resources/assets/allomancy/lang/en_us.json b/src/generated/resources/assets/allomancy/lang/en_us.json index 12930a3a..58912ff3 100644 --- a/src/generated/resources/assets/allomancy/lang/en_us.json +++ b/src/generated/resources/assets/allomancy/lang/en_us.json @@ -111,6 +111,15 @@ "allomancy.chromium.red": "Red Chromium Symbol", "allomancy.chromium.white": "White Chromium Symbol", "allomancy.chromium.yellow": "Yellow Chromium Symbol", + "allomancy.configuration.animate_selection": "Animate Metal Selection Wheel", + "allomancy.configuration.gameplay": "Allomancy Gameplay Settings", + "allomancy.configuration.graphics": "Allomancy Graphics Settings", + "allomancy.configuration.max_metal_distance": "Maximum Steelsight Distance", + "allomancy.configuration.overlay_enabled": "Vial HUD Enabled", + "allomancy.configuration.overlay_position": "Vial HUD Position", + "allomancy.configuration.random_mistings": "Randomly Assign Mistings", + "allomancy.configuration.respect_player_UUID": "Misting from UUID", + "allomancy.configuration.whitelist": "Metal Whitelist", "allomancy.copper.black": "Black Copper Symbol", "allomancy.copper.blue": "Blue Copper Symbol", "allomancy.copper.brown": "Brown Copper Symbol", @@ -425,7 +434,7 @@ "item.allomancy.zinc_pattern.desc": "Zinc Symbol", "key.burn": "Burn Metals", "key.categories.allomancy": "Allomancy", - "key.hud": "Show HUD", + "key.hud": "Show Vial HUD", "key.metals.aluminum": "Toggle Aluminum", "key.metals.bendalloy": "Toggle Bendalloy", "key.metals.brass": "Toggle Brass", diff --git a/src/main/java/com/legobmw99/allomancy/Allomancy.java b/src/main/java/com/legobmw99/allomancy/Allomancy.java index 6e57e0db..d11938ae 100644 --- a/src/main/java/com/legobmw99/allomancy/Allomancy.java +++ b/src/main/java/com/legobmw99/allomancy/Allomancy.java @@ -17,6 +17,8 @@ import net.neoforged.bus.api.IEventBus; import net.neoforged.fml.ModContainer; import net.neoforged.fml.common.Mod; +import net.neoforged.neoforge.client.gui.ConfigurationScreen; +import net.neoforged.neoforge.client.gui.IConfigScreenFactory; import net.neoforged.neoforge.common.NeoForge; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -64,5 +66,7 @@ public Allomancy(IEventBus bus, ModContainer container, Dist dist) { bus.addListener(AllomancyConfig::onLoad); bus.addListener(AllomancyConfig::onReload); + container.registerExtensionPoint(IConfigScreenFactory.class, ConfigurationScreen::new); + } } diff --git a/src/main/java/com/legobmw99/allomancy/datagen/Languages.java b/src/main/java/com/legobmw99/allomancy/datagen/Languages.java index 4ad2379e..a44fce14 100644 --- a/src/main/java/com/legobmw99/allomancy/datagen/Languages.java +++ b/src/main/java/com/legobmw99/allomancy/datagen/Languages.java @@ -122,7 +122,7 @@ protected void addTranslations() { add("key.categories.allomancy", "Allomancy"); add("key.burn", "Burn Metals"); - add("key.hud", "Show HUD"); + add("key.hud", "Show Vial HUD"); add("allomancy.gui", "Select Metal"); add("commands.allomancy.getpowers", "%s currently has Allomantic powers: %s"); @@ -144,5 +144,16 @@ protected void addTranslations() { add("allomancy.networking.failed", "Allomancy packet failed to play: %s"); add("allomancy.networking.kicked", "Requested illegal action: %s"); + add("allomancy.configuration.gameplay", "Allomancy Gameplay Settings"); + add("allomancy.configuration.whitelist", "Metal Whitelist"); + add("allomancy.configuration.random_mistings", "Randomly Assign Mistings"); + add("allomancy.configuration.respect_player_UUID", "Misting from UUID"); + + add("allomancy.configuration.graphics", "Allomancy Graphics Settings"); + add("allomancy.configuration.overlay_enabled", "Vial HUD Enabled"); + add("allomancy.configuration.overlay_position", "Vial HUD Position"); + add("allomancy.configuration.animate_selection", "Animate Metal Selection Wheel"); + add("allomancy.configuration.max_metal_distance", "Maximum Steelsight Distance"); + } } diff --git a/src/main/java/com/legobmw99/allomancy/modules/powers/PowersConfig.java b/src/main/java/com/legobmw99/allomancy/modules/powers/PowersConfig.java index a7fa4863..db225c7a 100644 --- a/src/main/java/com/legobmw99/allomancy/modules/powers/PowersConfig.java +++ b/src/main/java/com/legobmw99/allomancy/modules/powers/PowersConfig.java @@ -3,6 +3,7 @@ import com.legobmw99.allomancy.modules.powers.client.gui.MetalOverlay; import com.legobmw99.allomancy.modules.powers.util.Physical; import com.legobmw99.allomancy.util.AllomancyConfig; +import net.minecraft.resources.ResourceLocation; import net.neoforged.fml.config.ModConfig; import net.neoforged.fml.event.config.ModConfigEvent; import net.neoforged.neoforge.common.ModConfigSpec; @@ -38,7 +39,12 @@ public static void init(ModConfigSpec.Builder server_builder, server_builder.comment("Settings for the gameplay elements of the mod").push("gameplay"); cfg_whitelist = server_builder .comment("List of registry names of items and blocks that are counted as 'metal'") - .defineListAllowEmpty("whitelist", Physical::default_whitelist, o -> o instanceof String); + .defineListAllowEmpty("whitelist", Physical::default_whitelist, String::new, o -> { + if (o instanceof String s) { + return ResourceLocation.tryParse(s) != null; + } + return false; + }); server_builder.pop(); client_builder.push("graphics"); @@ -46,9 +52,9 @@ public static void init(ModConfigSpec.Builder server_builder, .comment("Maximum iron/steel sight distance. Can have an impact on performance") .defineInRange("max_metal_distance", 15, 3, 30); animate_selection = client_builder.comment("Animate the selection wheel").define("animate_selection", true); - enable_overlay = client_builder.comment("Enable the screen overlay").define("overlay_enabled", true); + enable_overlay = client_builder.comment("Enable the metal vial HUD").define("overlay_enabled", true); overlay_position = client_builder - .comment("Screen Overlay Position") + .comment("Metal vial HUD position") .defineEnum("overlay_position", MetalOverlay.SCREEN_LOC.TOP_LEFT); client_builder.pop(); diff --git a/src/main/java/com/legobmw99/allomancy/modules/powers/util/Physical.java b/src/main/java/com/legobmw99/allomancy/modules/powers/util/Physical.java index 679facde..f2725387 100644 --- a/src/main/java/com/legobmw99/allomancy/modules/powers/util/Physical.java +++ b/src/main/java/com/legobmw99/allomancy/modules/powers/util/Physical.java @@ -153,12 +153,16 @@ private static Vec3 cutoff(Vec3 value, double e) { return new Vec3(mag.x < e ? 0 : value.x, mag.y < e ? 0 : value.y, mag.z < e ? 0 : value.z); } - private static HashSet defaultList; - + private static HashSet defaultSet; + private static List defaultList = null; // TODO? this could be a Tag one day public static List default_whitelist() { - defaultList = new HashSet<>(); + if (defaultList != null) { + return defaultList; + } + + defaultSet = new HashSet<>(); add(Items.BUCKET); add(Items.LAVA_BUCKET); @@ -265,15 +269,15 @@ public static List default_whitelist() { .forEach(Physical::add); - List list = new ArrayList<>(defaultList); - list.sort(String::compareTo); - return list; + defaultList = new ArrayList<>(defaultSet); + defaultList.sort(String::compareTo); + return defaultList; } private static void add(String s) { Allomancy.LOGGER.info("Adding {} to the default whitelist!", s); - defaultList.add(s); + defaultSet.add(s); } private static void add(ResourceLocation r) {