diff --git a/CHANGELOG.md b/CHANGELOG.md index e333ad5..c1523eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # develop +* Fixed Vault Altar Conduit energy usage when used in an AE2 grid. + # 3.10.1.3 (2023-06-21) * Removed Emerald cost from Vault Enchanter. diff --git a/README.md b/README.md index e91d2df..440c124 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,13 @@ If you do not disable the changes that affect expertises, I recommend a full exp ## Fixes -* Removed the “Andersite” “joke”. +* Removed the “Andersite” “joke” * ~~Removed call to a colour handling event that is called several thousand times per second; gives a noticeable performance boost, but turns jewels and unidentified items white~~ use * Fake players work with research again (e.g. Routers + Botany Pots, AE2 auto crafting) * Fake players can put Vault Rocks on the Altar again * Relic fragments \#5 are now equally as likely to drop as the others * AE2 auto crafting no longer requires manually giving its fake player all research +* Altar Conduit now draws the correct amount of power when connected to AE2 ## Changes @@ -23,4 +24,4 @@ If you do not disable the changes that affect expertises, I recommend a full exp * Budding Crystal (Sky Vaults only) growth time reduced * Altar infusion time (time between redstone signal and the crystal popping off) reduced * Vault Junk Upgrades (Junk Management) tier 1 and 2 buffed -* Jewel cutting buffed from 1–10 size reduction to 3–10 \ No newline at end of file +* Jewel cutting buffed from 1–10 size reduction to 3–10 diff --git a/build.gradle b/build.gradle index 61d919d..f6311c0 100644 --- a/build.gradle +++ b/build.gradle @@ -191,7 +191,9 @@ dependencies { annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' implementation fg.deobf('curse.maven:vault-hunters-official-mod-458203:4570130') - implementation fg.deobf('appeng:appliedenergistics2-forge:11.7.4') + implementation fg.deobf('curse.maven:vault-integrations-867003:4570137') + implementation fg.deobf("curse.maven:refined-storage-243076:3712882") + implementation fg.deobf('appeng:appliedenergistics2-forge:11.7.0') // Vault dependency implementation fg.deobf("curse.maven:curios-309927:4418032") diff --git a/src/main/java/tv/alterNERD/VaultModTweaks/Configuration.java b/src/main/java/tv/alterNERD/VaultModTweaks/Configuration.java index 8c12c76..f26740e 100644 --- a/src/main/java/tv/alterNERD/VaultModTweaks/Configuration.java +++ b/src/main/java/tv/alterNERD/VaultModTweaks/Configuration.java @@ -53,6 +53,7 @@ public class Configuration { public static BooleanValue FAKE_PLAYER_FIX; public static BooleanValue ROUTER_VAULTAR_FIX; public static BooleanValue FRAGMENT_WEIGHT_FIX; + public static BooleanValue VAULTAR_CONDUIT_FIX; public static BooleanValue JUNKMGMT_ENABLED; public static ConfigValue JUNKMGMT_T1; @@ -140,6 +141,8 @@ public class Configuration { 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.comment("Fix Vaultar Conduit power usage when used in an AE2 grid"); + VAULTAR_CONDUIT_FIX = builder.define("conduitEnergyFix", true); builder.pop(); CONFIG = builder.build(); diff --git a/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinAltarConduitNode.java b/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinAltarConduitNode.java new file mode 100644 index 0000000..93d119f --- /dev/null +++ b/src/main/java/tv/alterNERD/VaultModTweaks/integration/mixin/MixinAltarConduitNode.java @@ -0,0 +1,61 @@ +/** + * Copyright 2023 alterNERDtive. + * + * This file is part of Vault Mod Tweaks. + * + * Vault Mod Tweaks is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Vault Mod Tweaks is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with Vault Mod Tweaks. If not, see . + */ +package tv.alterNERD.VaultModTweaks.integration.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +import iskallia.vaultintegrations.altar.AltarConduitNode; +import iskallia.vaultintegrations.init.VIConfigs; +import tv.alterNERD.VaultModTweaks.Configuration; +import tv.alterNERD.VaultModTweaks.VaultModTweaks; +import tv.alterNERD.VaultModTweaks.util.I18n; + +/** + * Changes the {@link iskallia.vaultintegrations.altar.AltarConduitNode} class for + * managing the Altar Conduit as a node in RS/AE networks. + * + * Specifically, fixes the energy consumption when part of an AE2 grid. + */ +@Mixin(AltarConduitNode.class) +public class MixinAltarConduitNode { + /** + * Redirects the + * {@link iskallia.vaultintegrations.altar.AltarConduitNode#getEnergyUsage()} + * method to return a value in AE/t instead of RF/t. 1 AE = 2.5 RF. + * + * @return Energy usage in AE/t instead of RF/t + */ + @Redirect( + method = "setupAE", + at = @At( + value = "INVOKE", + target = "Liskallia/vaultintegrations/altar/AltarConduitNode;getEnergyUsage()I" + ), + remap = false + ) + private int getEnergyUsageRedirect(AltarConduitNode that) { + int rfPerTick = (int)VIConfigs.ALTAR_CONDUIT.getRFUsagePerTick(); + if (Configuration.VAULTAR_CONDUIT_FIX.get()) { + VaultModTweaks.LOGGER.info(I18n.get("the_vault_tweaks.log.inject.conduit.energy")); + rfPerTick = rfPerTick*2/5; + } + return rfPerTick; + } +} 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 index 4e93fdf..36ef003 100644 --- a/src/main/resources/assets/the_vault_tweaks/lang/en_us.json +++ b/src/main/resources/assets/the_vault_tweaks/lang/en_us.json @@ -1,6 +1,7 @@ { "the_vault_tweaks.log.inject.ae2research": "Injecting research for AE2 fake player …", "the_vault_tweaks.log.inject.buddingcrystal": "Injecting Budding Crystal settings …", + "the_vault_tweaks.log.inject.conduit.energy": "Injecting fixed Altar Conduit energy usage for AE2 …", "the_vault_tweaks.log.inject.enchanter.forfree": "Removing Emerald cost from Vault Enchanter …", "the_vault_tweaks.log.inject.expertise.fortunate": "Removing Fortunate expertise …", "the_vault_tweaks.log.inject.expertise.jeweler": "Removing Jeweler expertise …", diff --git a/src/main/resources/mixins.the_vault_tweaks.json b/src/main/resources/mixins.the_vault_tweaks.json index 052c328..713cf16 100644 --- a/src/main/resources/mixins.the_vault_tweaks.json +++ b/src/main/resources/mixins.the_vault_tweaks.json @@ -5,6 +5,7 @@ "compatibilityLevel": "JAVA_17", "refmap": "mixins.the_vault_tweaks.refmap.json", "mixins": [ + "MixinAltarConduitNode", "MixinCrystalBuddingConfig", "MixinEnchantmentCost", "MixinEnchantmentEntry",