diff --git a/dependencies.gradle b/dependencies.gradle index 06d7c9e..d476166 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -161,6 +161,12 @@ dependencies { // Inventory BogoSorter (from CurseForge) compileOnly rfg.deobf("curse.maven:inventory-bogosorter-632327:5162169") // Version 1.4.8 + // Thermal Foundation (from CurseForge) + compileOnly "curse.maven:thermal-foundation-222880:2926428" // Version 2.6.7.1 + + // CoFH Core (compile time dep of Thermal Foundation) (from CurseForge) + compileOnly "curse.maven:cofh-core-69162:2920433" // Version 4.6.6.1 + /* -------------------------------- Soft Deps, Multiple Runtime Declaration -------------------------------- */ if (project.enable_draconic.toBoolean() || project.enable_thermal.toBoolean()) { runtimeOnly "curse.maven:redstone-flux-270789:2920436" // Version 2.1.1.1 @@ -275,7 +281,7 @@ dependencies { } if (project.enable_thermal.toBoolean()) { - // Thermal Expansion and Deps (Thermal Foundation, Redstone Arsenal, CoFH World, CoFH Core), runtime only, used in excitation coil texture (from CurseForge) + // Thermal Expansion, Thermal Foundation, CoFH Core and Deps (Redstone Arsenal, CoFH World) (from CurseForge) runtimeOnly "curse.maven:thermal-expansion-69163:2926431" // Version 5.5.7.1 runtimeOnly "curse.maven:thermal-foundation-222880:2926428" // Version 2.6.7.1 runtimeOnly "curse.maven:redstone-arsenal-70631:2939416" // Version 2.6.6.1 diff --git a/gradle.properties b/gradle.properties index 406641a..36c6dcf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -284,18 +284,19 @@ enable_default_world_gen_port = false enable_top_addons = false # Whether to enable Actually Additions in runtime. Allows specifying Linear XP Scaling for AA Machines. -enable_aa = false +enable_aa = true # Whether to enable Ender Storage in runtime. Enables remappers to remap items in ender storage. # If this is set to false, the remappers will not apply there. enable_ender_storage = false # Whether to enable Inventory BogoSorter in runtime. Fixes duplication glitch with Thermal Satchels. -enable_bogo = false +enable_bogo = true # Whether to enable Thermal Expansion and its deps in runtime. These are used for the excitation coil textures. +# Also sets the Tome of Experience to have Linear XP Scaling. # If this is set to false, the top of the excitation coil will have a null texture. -enable_thermal = false +enable_thermal = true # Whether to enable Mouse Tweaks in runtime. Useful for testing interactions with various GUIs. enable_mouse_tweaks = false diff --git a/src/main/java/com/nomiceu/nomilabs/LabsValues.java b/src/main/java/com/nomiceu/nomilabs/LabsValues.java index 3dee179..0173ca8 100644 --- a/src/main/java/com/nomiceu/nomilabs/LabsValues.java +++ b/src/main/java/com/nomiceu/nomilabs/LabsValues.java @@ -44,4 +44,5 @@ public class LabsValues { public static final String PACK_MODE_MODID = "packmode"; public static final String AE2_STUFF_MODID = "ae2stuff"; public static final String BOGOSORT_MODID = "bogosorter"; + public static final String THERMAL_FOUNDATION_MODID = "thermalfoundation"; } diff --git a/src/main/java/com/nomiceu/nomilabs/config/LabsConfig.java b/src/main/java/com/nomiceu/nomilabs/config/LabsConfig.java index 5f7aff2..4faed03 100644 --- a/src/main/java/com/nomiceu/nomilabs/config/LabsConfig.java +++ b/src/main/java/com/nomiceu/nomilabs/config/LabsConfig.java @@ -391,14 +391,15 @@ public static class Advanced { public boolean syncDimProperties = false; @Config.Comment({ "Amount of XP Per Level, for Linear XP Scaling.", - "Used for Linear XP Scaling in Actually Additions and EIO Machines.", + "Used for Linear XP Scaling in Actually Additions, EIO and Thermal Items/Machines.", + "Note that for Thermal, XP fixes are only applied for the Tome of Knowledge, not for any machines associated with Essence of Knowledge.", "MUST be used in conjunction with UT's Linear XP Scaling Config, else weird issues may happen!", "Enter a value of 0 for default.", "[default: 0]" }) - @Config.LangKey("config.nomilabs.advanced.aa_eio_linear_xp") + @Config.LangKey("config.nomilabs.advanced.other_mods_linear_xp") @Config.RequiresMcRestart @Config.RangeInt(min = 0) - public int aaEioLinearXp = 0; + public int otherModsLinearXp = 0; @Config.Comment({ "Whether to disable the Narrator.", "Fixes Crashes in Arm Macs, in some very specific environments.", diff --git a/src/main/java/com/nomiceu/nomilabs/core/LabsLateMixin.java b/src/main/java/com/nomiceu/nomilabs/core/LabsLateMixin.java index b212214..fc316ac 100644 --- a/src/main/java/com/nomiceu/nomilabs/core/LabsLateMixin.java +++ b/src/main/java/com/nomiceu/nomilabs/core/LabsLateMixin.java @@ -47,7 +47,8 @@ public class LabsLateMixin implements ILateMixinLoader { new AbstractMap.SimpleImmutableEntry<>(LabsValues.AE2_MODID, true), new AbstractMap.SimpleImmutableEntry<>(LabsValues.ENDER_IO_MODID, true), new AbstractMap.SimpleImmutableEntry<>(LabsValues.AA_MODID, true), - new AbstractMap.SimpleImmutableEntry<>(LabsValues.BOGOSORT_MODID, true)) + new AbstractMap.SimpleImmutableEntry<>(LabsValues.BOGOSORT_MODID, true), + new AbstractMap.SimpleImmutableEntry<>(LabsValues.THERMAL_FOUNDATION_MODID, true)) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); @Override diff --git a/src/main/java/com/nomiceu/nomilabs/mixin/actuallyadditions/TileEntityXPSolidifierMixin.java b/src/main/java/com/nomiceu/nomilabs/mixin/actuallyadditions/TileEntityXPSolidifierMixin.java index 5646af4..7d262fa 100644 --- a/src/main/java/com/nomiceu/nomilabs/mixin/actuallyadditions/TileEntityXPSolidifierMixin.java +++ b/src/main/java/com/nomiceu/nomilabs/mixin/actuallyadditions/TileEntityXPSolidifierMixin.java @@ -17,19 +17,19 @@ public abstract class TileEntityXPSolidifierMixin { @Inject(method = "getExperienceForLevel", at = @At("HEAD"), cancellable = true) private static void getLinearXpAmountLevel(int level, CallbackInfoReturnable cir) { - if (LabsConfig.advanced.aaEioLinearXp != 0 && level >= 0) - cir.setReturnValue(LabsConfig.advanced.aaEioLinearXp * level); + if (LabsConfig.advanced.otherModsLinearXp != 0 && level >= 0) + cir.setReturnValue(LabsConfig.advanced.otherModsLinearXp * level); } @Inject(method = "getLevelForExperience", at = @At("HEAD"), cancellable = true) private static void getLinearXPAmountXp(int experience, CallbackInfoReturnable cir) { - if (LabsConfig.advanced.aaEioLinearXp != 0 && experience >= 0) - cir.setReturnValue(experience / LabsConfig.advanced.aaEioLinearXp); + if (LabsConfig.advanced.otherModsLinearXp != 0 && experience >= 0) + cir.setReturnValue(experience / LabsConfig.advanced.otherModsLinearXp); } @Inject(method = "getXpBarCapacity", at = @At("HEAD"), cancellable = true) private static void getLinearXPAmount(int level, CallbackInfoReturnable cir) { - if (LabsConfig.advanced.aaEioLinearXp != 0 && level >= 0) - cir.setReturnValue(LabsConfig.advanced.aaEioLinearXp); + if (LabsConfig.advanced.otherModsLinearXp != 0 && level >= 0) + cir.setReturnValue(LabsConfig.advanced.otherModsLinearXp); } } diff --git a/src/main/java/com/nomiceu/nomilabs/mixin/enderio/XPUtilMixin.java b/src/main/java/com/nomiceu/nomilabs/mixin/enderio/XPUtilMixin.java index 6c90cc5..19e93c8 100644 --- a/src/main/java/com/nomiceu/nomilabs/mixin/enderio/XPUtilMixin.java +++ b/src/main/java/com/nomiceu/nomilabs/mixin/enderio/XPUtilMixin.java @@ -17,19 +17,19 @@ public class XPUtilMixin { @Inject(method = "calculateXPfromLevel", at = @At("HEAD"), cancellable = true) private static void calculateXpFromLevelLinear(int level, CallbackInfoReturnable cir) { - if (LabsConfig.advanced.aaEioLinearXp != 0 && level >= 0) - cir.setReturnValue(((long) LabsConfig.advanced.aaEioLinearXp * level)); + if (LabsConfig.advanced.otherModsLinearXp != 0 && level >= 0) + cir.setReturnValue(((long) LabsConfig.advanced.otherModsLinearXp * level)); } @Inject(method = "getLevelFromExp", at = @At("HEAD"), cancellable = true) private static void getLevelFromXpLinear(long exp, CallbackInfoReturnable cir) { - if (LabsConfig.advanced.aaEioLinearXp != 0 && exp >= 0) - cir.setReturnValue((int) (exp / LabsConfig.advanced.aaEioLinearXp)); + if (LabsConfig.advanced.otherModsLinearXp != 0 && exp >= 0) + cir.setReturnValue((int) (exp / LabsConfig.advanced.otherModsLinearXp)); } @Inject(method = "getXpBarCapacity", at = @At("HEAD"), cancellable = true) private static void getLinearXPAmount(int level, CallbackInfoReturnable cir) { - if (LabsConfig.advanced.aaEioLinearXp != 0 && level >= 0) - cir.setReturnValue(LabsConfig.advanced.aaEioLinearXp); + if (LabsConfig.advanced.otherModsLinearXp != 0 && level >= 0) + cir.setReturnValue(LabsConfig.advanced.otherModsLinearXp); } } diff --git a/src/main/java/com/nomiceu/nomilabs/mixin/thermalfoundation/ItemTomeExperienceMixin.java b/src/main/java/com/nomiceu/nomilabs/mixin/thermalfoundation/ItemTomeExperienceMixin.java new file mode 100644 index 0000000..2d311b0 --- /dev/null +++ b/src/main/java/com/nomiceu/nomilabs/mixin/thermalfoundation/ItemTomeExperienceMixin.java @@ -0,0 +1,23 @@ +package com.nomiceu.nomilabs.mixin.thermalfoundation; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import com.nomiceu.nomilabs.config.LabsConfig; + +import cofh.thermalfoundation.item.tome.ItemTomeExperience; + +/** + * Applies Linear XP Scaling to Thermal Tomes. + */ +@Mixin(value = ItemTomeExperience.class, remap = false) +public class ItemTomeExperienceMixin { + + @Inject(method = "getTotalExpForLevel", at = @At("HEAD"), cancellable = true) + private static void getLinearXp(int level, CallbackInfoReturnable cir) { + if (LabsConfig.advanced.otherModsLinearXp != 0 && level >= 0) + cir.setReturnValue(LabsConfig.advanced.otherModsLinearXp * level); + } +} diff --git a/src/main/resources/assets/nomilabs/lang/en_us.lang b/src/main/resources/assets/nomilabs/lang/en_us.lang index 6e61d18..4489953 100644 --- a/src/main/resources/assets/nomilabs/lang/en_us.lang +++ b/src/main/resources/assets/nomilabs/lang/en_us.lang @@ -77,7 +77,7 @@ config.nomilabs.advanced=Advanced Settings config.nomilabs.advanced.tooltip=Advanced Settings config.nomilabs.advanced.allow_other_modes=Allow Other Modes config.nomilabs.advanced.disable_xp_scaling=Disable Anvil XP Scaling -config.nomilabs.advanced.aa_eio_linear_xp=Actually Additions & EIO Linear XP +config.nomilabs.advanced.other_mods_linear_xp=Misc Mod Linear XP Support config.nomilabs.advanced.disable_narrator=Disable Narrator config.nomilabs.advanced.enable_nomi_ceu_data_fixes=Enable Nomi-CEu Specific Data Fixes config.nomilabs.advanced.ignore_items=ITEM Missing Registry Ignore List diff --git a/src/main/resources/mixins.nomilabs.thermalfoundation.json b/src/main/resources/mixins.nomilabs.thermalfoundation.json new file mode 100644 index 0000000..ecba5af --- /dev/null +++ b/src/main/resources/mixins.nomilabs.thermalfoundation.json @@ -0,0 +1,12 @@ +{ + "package": "com.nomiceu.nomilabs.mixin.thermalfoundation", + "refmap": "mixins.nomilabs.refmap.json", + "target": "@env(DEFAULT)", + "minVersion": "0.8", + "compatibilityLevel": "JAVA_8", + "mixins": [ + "ItemTomeExperienceMixin" + ], + "client": [], + "server": [] +}