From 3cb5ab8c7da701c2341172a2daea9a22a00ccb23 Mon Sep 17 00:00:00 2001 From: alterNERDtive Date: Mon, 19 Jun 2023 01:17:45 +0200 Subject: [PATCH] first working poc --- .../VaultModTweaks/Configuration.java | 115 ++++++++++++++++++ .../VaultModTweaks/VaultModTweaks.java | 10 +- .../mixin/MixinCrystalBuddingConfig.java | 38 ++++++ .../mixin/MixinEnchantmentEntry.java | 38 ++++++ .../mixin/MixinExpertisesGuiConfig.java | 40 ++++++ .../integration/mixin/MixinStageManager.java | 77 ++++++++++++ ...MixinUnidentifiedRelicFragmentsConfig.java | 39 ++++++ .../mixin/MixinVaultAltarConfig.java | 38 ++++++ .../mixin/MixinVaultCharmConfig.java | 41 +++++++ .../mixin/MixinVaultJewelCuttingConfig.java | 39 ++++++ .../mixin/MixinVaultPortalConfig.java | 40 ++++++ .../assets/the_vault_tweaks/lang/en_us.json | 9 ++ .../resources/mixins.the_vault_tweaks.json | 20 +++ 13 files changed, 537 insertions(+), 7 deletions(-) create mode 100644 src/main/java/tv/alterNERD/VaultModTweaks/Configuration.java create mode 100644 src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinCrystalBuddingConfig.java create mode 100644 src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinEnchantmentEntry.java create mode 100644 src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinExpertisesGuiConfig.java create mode 100644 src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinStageManager.java create mode 100644 src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinUnidentifiedRelicFragmentsConfig.java create mode 100644 src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinVaultAltarConfig.java create mode 100644 src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinVaultCharmConfig.java create mode 100644 src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinVaultJewelCuttingConfig.java create mode 100644 src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinVaultPortalConfig.java create mode 100644 src/main/resources/assets/the_vault_tweaks/lang/en_us.json create mode 100644 src/main/resources/mixins.the_vault_tweaks.json diff --git a/src/main/java/tv/alterNERD/VaultModTweaks/Configuration.java b/src/main/java/tv/alterNERD/VaultModTweaks/Configuration.java new file mode 100644 index 0000000..772bfd1 --- /dev/null +++ b/src/main/java/tv/alterNERD/VaultModTweaks/Configuration.java @@ -0,0 +1,115 @@ +package tv.alterNERD.VaultModTweaks; + +import net.minecraftforge.common.ForgeConfigSpec; +import net.minecraftforge.common.ForgeConfigSpec.BooleanValue; +import net.minecraftforge.common.ForgeConfigSpec.DoubleValue; +import net.minecraftforge.common.ForgeConfigSpec.IntValue; +import net.minecraftforge.common.ForgeConfigSpec.Builder; +import net.minecraftforge.common.ForgeConfigSpec.ConfigValue; + +public class Configuration { + public static final ForgeConfigSpec CONFIG; + + public static BooleanValue FORTUNE_ENABLED; + public static IntValue FORTUNE_LEVEL; + + public static BooleanValue JEWELER_ENABLED; + public static DoubleValue JEWELER_CHANCE; + + public static BooleanValue JEWELS_ENABLED; + public static IntValue JEWELS_SIZE; + public static IntValue JEWELS_MAX; + public static IntValue JEWELS_MIN; + + public static BooleanValue BUDDING_ENABLED; + public static IntValue BUDDING_MAX; + public static IntValue BUDDING_MIN; + + public static BooleanValue VAULTAR_ENABLED; + public static IntValue VAULTAR_INFUSION_TIME; + + public static BooleanValue FAKE_PLAYER_FIX; + public static BooleanValue ROUTER_VAULTAR_FIX; + public static BooleanValue FRAGMENT_WEIGHT_FIX; + + public static BooleanValue JUNKMGMT_ENABLED; + public static ConfigValue JUNKMGMT_T1; + public static ConfigValue JUNKMGMT_T2; + public static ConfigValue JUNKMGMT_T3; + public static ConfigValue JUNKMGMT_T4; + + static { + Builder builder = new Builder(); + setupConfig(builder); + CONFIG = builder.build(); + } + + private static void setupConfig(Builder builder) { + // Fortune changes + builder.push("Fortune"); + builder.comment("Replace the maximum Fortune level for the Vault Enchanter and remove the Fortunate Expertise"); + FORTUNE_ENABLED = builder.define("enableOverride", true); + builder.comment("Maximum Fortune level"); + FORTUNE_LEVEL = builder.defineInRange("maxLevel", 5, 3, 5); + builder.pop(); + + // Jeweler + builder.push("Jeweler"); + builder.comment("Remove the Jeweler Expertise and change the default cutting chance accordingly"); + JEWELER_ENABLED = builder.define("disableJeweler", true); + builder.comment("Chance to break the jewel / remove a modifier"); + JEWELER_CHANCE = builder.defineInRange("breakChance", 0.25d, 0d, 0.5d); + builder.pop(); + + // Budding Crystal + builder.push("BuddingCrystal"); + builder.comment("Change the Budding Crystal growth times (Sky Vaults only)"); + BUDDING_ENABLED = builder.define("enableOverride", true); + builder.comment("Maximum time between growth stages (pack default: 400)"); + BUDDING_MAX = builder.defineInRange("maxTime", 300, 300, 500); + builder.comment("Minimum time between growth stages (pack default: 280)"); + BUDDING_MIN = builder.defineInRange("minTime", 200, 100, 299); + builder.pop(); + + // Jewels + builder.push("Jewels"); + builder.comment("Change the max size for jewels and the size range for jewel cutting"); + JEWELS_ENABLED = builder.define("enableOverride", true); + builder.comment("Maximum Jewel size (pack default: 90) (CURRENTLY NON-FUNCTIONAL)"); + JEWELS_SIZE = builder.defineInRange("maxSize", 40, 10, 100); + builder.comment("Maximum size reduction when cutting (pack default: 10)"); + JEWELS_MAX = builder.defineInRange("maxCut", 10, 5, 20); + builder.comment("Minimum size reduction when cutting (pack default: 1)"); + JEWELS_MIN = builder.defineInRange("minCut", 3, 1, 4); + builder.pop(); + + // Vault Altar + builder.push("VaultAltar"); + builder.comment("Enable Vaultar config overrides"); + VAULTAR_ENABLED = builder.define("enableOverride", true); + builder.comment("The time it takes to infuse a crystal after giving a redstone signal (pack default: 5)"); + VAULTAR_INFUSION_TIME = builder.defineInRange("infusionTime", 1, 1, 10); + builder.pop(); + + // Vault Charm / Junk Management + builder.push("JunkManagement"); + builder.comment("Override Junk Charm multipliers for the Junk Management slots (pack defaults: 3/18/114/228)"); + JUNKMGMT_ENABLED = builder.define("enableOverride", true); + builder.comment("These values will be multiplied by the default junk list size (9)"); + JUNKMGMT_T1 = builder.define("tier1Multiplier", 28); + JUNKMGMT_T2 = builder.define("tier2Multiplier", 57); + JUNKMGMT_T3 = builder.define("tier3Multiplier", 114); + JUNKMGMT_T4 = builder.define("tier4Multiplier", 228); + builder.pop(); + + // Bug fixes + builder.push("Fixes"); + builder.comment("Fix fake player research (e.g. Router + Botany Pots interaction, AE2 auto crafting, …) (CURRENTLY NON-FUNCTIONAL)"); + FAKE_PLAYER_FIX = builder.define("fakePlayerResearchFix", true); + builder.comment("Fix Routers unable to place Vault Rocks on your Vaultar"); + ROUTER_VAULTAR_FIX = builder.define("routerVaultarFix", true); + builder.comment("Fix №5 fragments of all relics having half the weight"); + FRAGMENT_WEIGHT_FIX = builder.define("fragmentFix", true); + builder.pop(); + } +} diff --git a/src/main/java/tv/alterNERD/VaultModTweaks/VaultModTweaks.java b/src/main/java/tv/alterNERD/VaultModTweaks/VaultModTweaks.java index 271c3c6..ed2da54 100644 --- a/src/main/java/tv/alterNERD/VaultModTweaks/VaultModTweaks.java +++ b/src/main/java/tv/alterNERD/VaultModTweaks/VaultModTweaks.java @@ -4,25 +4,21 @@ import org.slf4j.Logger; import com.mojang.logging.LogUtils; -import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.config.ModConfig; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; -// The value here should match an entry in the META-INF/mods.toml file @Mod("the_vault_tweaks") public class VaultModTweaks { - // Directly reference a slf4j logger private static final Logger LOGGER = LogUtils.getLogger(); public VaultModTweaks() { - // Register the setup method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); - - // Register ourselves for server and other game events we are interested in - MinecraftForge.EVENT_BUS.register(this); + ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, Configuration.CONFIG); } private void setup(final FMLCommonSetupEvent event) diff --git a/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinCrystalBuddingConfig.java b/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinCrystalBuddingConfig.java new file mode 100644 index 0000000..6d78a56 --- /dev/null +++ b/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinCrystalBuddingConfig.java @@ -0,0 +1,38 @@ +package tv.alterNERD.VaultModTweaks.integration.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; + +import iskallia.vault.config.Config; +import iskallia.vault.config.CrystalBuddingConfig; +import tv.alterNERD.VaultModTweaks.Configuration; + +@Mixin(CrystalBuddingConfig.class) +public abstract class MixinCrystalBuddingConfig extends Config { + @Shadow + private float maxSecondsBetweenGrowthUpdates; + + @Shadow + private float minSecondsBetweenGrowthUpdates; + + @Override + protected void onLoad(Config oldConfigInstance) { + super.onLoad(oldConfigInstance); + if (Configuration.BUDDING_ENABLED.get()) { + this.maxSecondsBetweenGrowthUpdates = Configuration.BUDDING_MAX.get(); + this.minSecondsBetweenGrowthUpdates = Configuration.BUDDING_MIN.get(); + } + } + + @Shadow + @Override + public String getName() { + throw new UnsupportedOperationException("Unimplemented method 'getName'"); + } + + @Shadow + @Override + protected void reset() { + throw new UnsupportedOperationException("Unimplemented method 'reset'"); + } +} diff --git a/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinEnchantmentEntry.java b/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinEnchantmentEntry.java new file mode 100644 index 0000000..189eccf --- /dev/null +++ b/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinEnchantmentEntry.java @@ -0,0 +1,38 @@ +package tv.alterNERD.VaultModTweaks.integration.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; + +import iskallia.vault.util.EnchantmentEntry; +import net.minecraft.world.item.enchantment.Enchantment; +import tv.alterNERD.VaultModTweaks.Configuration; + +@Mixin(EnchantmentEntry.class) +public abstract class MixinEnchantmentEntry + { + @Shadow + private int level; + @Shadow + private Enchantment enchantment; + + @Overwrite(remap = false) + public int getLevel() { + if (Configuration.FORTUNE_ENABLED.get()) { + if (this.enchantment.getRegistryName().toString().equals("minecraft:fortune")) { + this.level = Configuration.FORTUNE_LEVEL.get(); + } + } + return this.level; + } + + @Overwrite(remap = false) + public boolean isValid() { + if (Configuration.FORTUNE_ENABLED.get()) { + if (this.enchantment.getRegistryName().toString().equals("minecraft:fortune") && this.level <= Configuration.FORTUNE_LEVEL.get()) { + return true; + } + } + return this.enchantment != null && this.level > 0 && this.level <= this.enchantment.getMaxLevel(); + } +} diff --git a/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinExpertisesGuiConfig.java b/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinExpertisesGuiConfig.java new file mode 100644 index 0000000..cbd296a --- /dev/null +++ b/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinExpertisesGuiConfig.java @@ -0,0 +1,40 @@ +package tv.alterNERD.VaultModTweaks.integration.mixin; + +import java.util.HashMap; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; + +import iskallia.vault.config.Config; +import iskallia.vault.config.ExpertisesGUIConfig; +import iskallia.vault.config.entry.SkillStyle; +import tv.alterNERD.VaultModTweaks.Configuration; + +@Mixin(ExpertisesGUIConfig.class) +public abstract class MixinExpertisesGuiConfig extends Config { + @Shadow + private HashMap styles; + + @Override + protected void onLoad(Config oldConfigInstance) { + super.onLoad(oldConfigInstance); + if (Configuration.FORTUNE_ENABLED.get()) { + this.styles.remove("Fortunate"); + } + if (Configuration.JEWELER_ENABLED.get()) { + this.styles.remove("Jeweler"); + } + } + + @Shadow + @Override + public String getName() { + throw new UnsupportedOperationException("Unimplemented method 'getName'"); + } + + @Shadow + @Override + protected void reset() { + throw new UnsupportedOperationException("Unimplemented method 'reset'"); + } +} diff --git a/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinStageManager.java b/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinStageManager.java new file mode 100644 index 0000000..a151c1e --- /dev/null +++ b/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinStageManager.java @@ -0,0 +1,77 @@ +package tv.alterNERD.VaultModTweaks.integration.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +import iskallia.vault.research.ResearchTree; +import iskallia.vault.research.StageManager; +import iskallia.vault.world.data.PlayerResearchesData; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.entity.player.Player; + +@Mixin(StageManager.class) +public abstract class MixinStageManager { + @Shadow + public static ResearchTree RESEARCH_TREE; + + @Redirect( + method = "onItemCrafted", + at = @At( + value = "INVOKE", + target = "getResearchTree(Lnet/minecraft/world/entity/player/Player;)Liskallia/vault/research/ResearchTree;", + remap = false + ), + remap = false + ) + private static ResearchTree overrideOnItemCrafted(Player player) { + return overrideGetResearchTree(player); + } + + @Redirect( + method = "onBlockInteraction", + at = @At( + value = "INVOKE", + target = "getResearchTree(Lnet/minecraft/world/entity/player/Player;)Liskallia/vault/research/ResearchTree;", + remap = false + ), + remap = false + ) + private static ResearchTree overrideOnBlockInteraction(Player player) { + return overrideGetResearchTree(player); + } + + @Redirect( + method = "onItemUse", + at = @At( + value = "INVOKE", + target = "getResearchTree(Lnet/minecraft/world/entity/player/Player;)Liskallia/vault/research/ResearchTree;", + remap = false + ), + remap = false + ) + private static ResearchTree overrideOnItemUse(Player player) { + return overrideGetResearchTree(player); + } + + @Redirect( + method = "onEntityInteraction", + at = @At( + value = "INVOKE", + target = "getResearchTree(Lnet/minecraft/world/entity/player/Player;)Liskallia/vault/research/ResearchTree;", + remap = false + ), + remap = false + ) + private static ResearchTree overrideOnEntityInteraction(Player player) { + return overrideGetResearchTree(player); + } + + private static ResearchTree overrideGetResearchTree(Player player) { + if (player.level.isClientSide) { + return RESEARCH_TREE; + } + return PlayerResearchesData.get((ServerLevel)player.level).getResearches(player); + } +} diff --git a/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinUnidentifiedRelicFragmentsConfig.java b/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinUnidentifiedRelicFragmentsConfig.java new file mode 100644 index 0000000..34b84fd --- /dev/null +++ b/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinUnidentifiedRelicFragmentsConfig.java @@ -0,0 +1,39 @@ +package tv.alterNERD.VaultModTweaks.integration.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; + +import iskallia.vault.config.Config; +import iskallia.vault.config.UnidentifiedRelicFragmentsConfig; +import iskallia.vault.util.data.WeightedList; +import net.minecraft.resources.ResourceLocation; +import tv.alterNERD.VaultModTweaks.Configuration; + +@Mixin(UnidentifiedRelicFragmentsConfig.class) +public abstract class MixinUnidentifiedRelicFragmentsConfig extends Config { + @Shadow + private WeightedList fragments; + + @Override + public void onLoad(Config oldConfigInstance) { + super.onLoad(oldConfigInstance); + if (Configuration.FRAGMENT_WEIGHT_FIX.get()) { + for (WeightedList.Entry item : fragments) { + item.weight = 2; + } + } + } + + @Shadow + @Override + public String getName() { + throw new UnsupportedOperationException("Unimplemented method 'getName'"); + } + + @Shadow + @Override + protected void reset() { + throw new UnsupportedOperationException("Unimplemented method 'reset'"); + } + +} diff --git a/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinVaultAltarConfig.java b/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinVaultAltarConfig.java new file mode 100644 index 0000000..3bfc638 --- /dev/null +++ b/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinVaultAltarConfig.java @@ -0,0 +1,38 @@ +package tv.alterNERD.VaultModTweaks.integration.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; + +import com.google.gson.annotations.Expose; + +import iskallia.vault.config.Config; +import iskallia.vault.config.VaultAltarConfig; +import tv.alterNERD.VaultModTweaks.Configuration; + +@Mixin(VaultAltarConfig.class) +public abstract class MixinVaultAltarConfig extends Config { + @Shadow + @Expose + public int INFUSION_TIME; + + @Override + protected void onLoad(Config oldConfigInstance) { + super.onLoad(oldConfigInstance); + if (Configuration.VAULTAR_ENABLED.get()) { + this.INFUSION_TIME = Configuration.VAULTAR_INFUSION_TIME.get(); + } + } + + @Shadow + @Override + public String getName() { + throw new UnsupportedOperationException("Unimplemented method 'getName'"); + } + + @Shadow + @Override + protected void reset() { + throw new UnsupportedOperationException("Unimplemented method 'reset'"); + } + +} diff --git a/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinVaultCharmConfig.java b/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinVaultCharmConfig.java new file mode 100644 index 0000000..d6d95a6 --- /dev/null +++ b/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinVaultCharmConfig.java @@ -0,0 +1,41 @@ +package tv.alterNERD.VaultModTweaks.integration.mixin; + +import java.util.HashMap; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; + +import iskallia.vault.config.Config; +import iskallia.vault.config.VaultCharmConfig; +import tv.alterNERD.VaultModTweaks.Configuration; + +@Mixin(VaultCharmConfig.class) +public abstract class MixinVaultCharmConfig extends Config { + @Shadow + private HashMap tierMultipliers; + + @Override + protected void onLoad(Config oldConfigInstance) { + super.onLoad(oldConfigInstance); + if (Configuration.JUNKMGMT_ENABLED.get()) { + tierMultipliers = new HashMap(4); + tierMultipliers.put(1, Configuration.JUNKMGMT_T1.get()); + tierMultipliers.put(2, Configuration.JUNKMGMT_T2.get()); + tierMultipliers.put(3, Configuration.JUNKMGMT_T3.get()); + tierMultipliers.put(4, Configuration.JUNKMGMT_T4.get()); + } + } + + @Shadow + @Override + public String getName() { + throw new UnsupportedOperationException("Unimplemented method 'getName'"); + } + + @Shadow + @Override + protected void reset() { + throw new UnsupportedOperationException("Unimplemented method 'reset'"); + } + +} diff --git a/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinVaultJewelCuttingConfig.java b/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinVaultJewelCuttingConfig.java new file mode 100644 index 0000000..e31f8a4 --- /dev/null +++ b/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinVaultJewelCuttingConfig.java @@ -0,0 +1,39 @@ +package tv.alterNERD.VaultModTweaks.integration.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; + +import iskallia.vault.config.Config; +import iskallia.vault.config.VaultJewelCuttingConfig; +import iskallia.vault.config.VaultJewelCuttingConfig.JewelCuttingRange; +import tv.alterNERD.VaultModTweaks.Configuration; + +@Mixin(VaultJewelCuttingConfig.class) +public abstract class MixinVaultJewelCuttingConfig extends Config { + @Shadow + private float jewelCuttingModifierRemovalChance; + + @Shadow + private JewelCuttingRange jewelCuttingRange; + + @Override + protected void onLoad(Config oldConfigInstance) { + super.onLoad(oldConfigInstance); + if (Configuration.JEWELER_ENABLED.get()) { + this.jewelCuttingModifierRemovalChance = Configuration.JEWELER_CHANCE.get().floatValue(); + this.jewelCuttingRange = new JewelCuttingRange(Configuration.JEWELS_MIN.get(), Configuration.JEWELS_MAX.get()); + } + } + + @Shadow + @Override + public String getName() { + throw new UnsupportedOperationException("Unimplemented method 'getName'"); + } + + @Shadow + @Override + protected void reset() { + throw new UnsupportedOperationException("Unimplemented method 'reset'"); + } +} diff --git a/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinVaultPortalConfig.java b/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinVaultPortalConfig.java new file mode 100644 index 0000000..a13ef5e --- /dev/null +++ b/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinVaultPortalConfig.java @@ -0,0 +1,40 @@ +package tv.alterNERD.VaultModTweaks.integration.mixin; + +import java.util.ArrayList; +import java.util.Arrays; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; + +import com.google.gson.annotations.Expose; + +import iskallia.vault.config.Config; +import iskallia.vault.config.VaultPortalConfig; + +@Mixin(VaultPortalConfig.class) +public abstract class MixinVaultPortalConfig extends Config { + @Shadow + @Expose + public String[] VALID_BLOCKS; + + @Override + protected void onLoad(Config oldConfigInstance) { + super.onLoad(oldConfigInstance); + ArrayList list = new ArrayList(Arrays.asList(VALID_BLOCKS)); + list.add("modularrouters:template_frame"); + VALID_BLOCKS = list.toArray(VALID_BLOCKS); + } + + @Shadow + @Override + public String getName() { + throw new UnsupportedOperationException("Unimplemented method 'getName'"); + } + + @Shadow + @Override + protected void reset() { + throw new UnsupportedOperationException("Unimplemented method 'reset'"); + } + +} diff --git a/src/main/resources/assets/the_vault_tweaks/lang/en_us.json b/src/main/resources/assets/the_vault_tweaks/lang/en_us.json new file mode 100644 index 0000000..8f5df98 --- /dev/null +++ b/src/main/resources/assets/the_vault_tweaks/lang/en_us.json @@ -0,0 +1,9 @@ +{ + "block.minecraft.andesite": "Andesite", + "block.minecraft.polished_andesite": "Polished Andesite", + "block.minecraft.andesite_stairs": "Andesite Stairs", + "block.minecraft.polished_andesite_stairs": "Polished Andesite Stairs", + "block.minecraft.andesite_slab": "Andesite Slab", + "block.minecraft.polished_andesite_slab": "Polished Andesite Slab", + "block.minecraft.andesite_wall": "Andesite Wall" +} \ No newline at end of file diff --git a/src/main/resources/mixins.the_vault_tweaks.json b/src/main/resources/mixins.the_vault_tweaks.json new file mode 100644 index 0000000..2d6f549 --- /dev/null +++ b/src/main/resources/mixins.the_vault_tweaks.json @@ -0,0 +1,20 @@ +{ + "required": true, + "package": "tv.alterNERD.VaultModTweaks.integration.mixin", + "compatibilityLevel": "JAVA_17", + "refmap": "mixins.the_vault_tweaks.refmap.json", + "mixins": [ + "MixinCrystalBuddingConfig", + "MixinEnchantmentEntry", + "MixinExpertisesGuiConfig", + "MixinStageManager", + "MixinUnidentifiedRelicFragmentsConfig", + "MixinVaultAltarConfig", + "MixinVaultCharmConfig", + "MixinVaultJewelCuttingConfig", + "MixinVaultPortalConfig" + ], + "client": [], + "server": [], + "minVersion": "0.8" +} \ No newline at end of file