diff --git a/src/main/java/me/desht/pneumaticcraft/PneumaticCraftRepressurized.java b/src/main/java/me/desht/pneumaticcraft/PneumaticCraftRepressurized.java index e8227e574..2e5fc2969 100644 --- a/src/main/java/me/desht/pneumaticcraft/PneumaticCraftRepressurized.java +++ b/src/main/java/me/desht/pneumaticcraft/PneumaticCraftRepressurized.java @@ -53,11 +53,6 @@ import me.desht.pneumaticcraft.common.util.chunkloading.PlayerLogoutTracker; import me.desht.pneumaticcraft.common.villages.VillageStructures; import me.desht.pneumaticcraft.lib.Log; -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.server.packs.PackType; -import net.minecraft.server.packs.repository.PackSource; -import net.minecraft.server.packs.repository.Pack.Position; import net.neoforged.bus.api.IEventBus; import net.neoforged.fml.ModContainer; import net.neoforged.fml.ModList; @@ -92,7 +87,6 @@ public PneumaticCraftRepressurized(ModContainer container, IEventBus modBus) { modBus.addListener(this::newRegistries); modBus.addListener(ForcedChunks.INSTANCE::registerTicketController); modBus.addListener(CapabilitySetup::registerCaps); - modBus.addListener(this::addPackFinders); registerAllDeferredRegistryObjects(modBus); @@ -110,11 +104,6 @@ public PneumaticCraftRepressurized(ModContainer container, IEventBus modBus) { forgeBus.addListener(VillageStructures::addMechanicHouse); forgeBus.register(PlayerLogoutTracker.INSTANCE); } - - private void addPackFinders(AddPackFindersEvent event) { - if (ModList.get().isLoaded("fusion")) - event.addPackFinders(ResourceLocation.fromNamespaceAndPath("pneumaticcraft", "fusion_integration"), PackType.CLIENT_RESOURCES, Component.literal("Fusion for PneumaticCraft"), PackSource.BUILT_IN, false, Position.TOP); - } private void newRegistries(NewRegistryEvent event) { // bit kludgy, but this event is fired right after we know for sure which mods are present, diff --git a/src/main/java/me/desht/pneumaticcraft/common/block/PressureChamberGlassBlock.java b/src/main/java/me/desht/pneumaticcraft/common/block/PressureChamberGlassBlock.java index 56d92095f..4871074b6 100644 --- a/src/main/java/me/desht/pneumaticcraft/common/block/PressureChamberGlassBlock.java +++ b/src/main/java/me/desht/pneumaticcraft/common/block/PressureChamberGlassBlock.java @@ -74,7 +74,7 @@ public boolean propagatesSkylightDown(BlockState p_200123_1_, BlockGetter p_2001 public void appendHoverText(ItemStack stack, Item.TooltipContext context, List curInfo, TooltipFlag flag) { super.appendHoverText(stack, context, curInfo, flag); - if (!ModList.get().isLoaded(ModIds.CTM)) { + if (!ModList.get().isLoaded(ModIds.CTM) && !ModList.get().isLoaded(ModIds.FUSION)) { curInfo.add(xlate("gui.tooltip.block.pneumaticcraft.pressure_chamber_glass.ctm").withStyle(ChatFormatting.GRAY)); } } diff --git a/src/main/java/me/desht/pneumaticcraft/common/thirdparty/Fusion.java b/src/main/java/me/desht/pneumaticcraft/common/thirdparty/Fusion.java new file mode 100644 index 000000000..b1c9579a0 --- /dev/null +++ b/src/main/java/me/desht/pneumaticcraft/common/thirdparty/Fusion.java @@ -0,0 +1,23 @@ +package me.desht.pneumaticcraft.common.thirdparty; + +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.packs.PackType; +import net.minecraft.server.packs.repository.PackSource; +import net.minecraft.server.packs.repository.Pack.Position; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.ModList; +import net.neoforged.neoforge.event.AddPackFindersEvent; + +public class Fusion implements IThirdParty { + + private void addPackFinders(AddPackFindersEvent event) { + if (ModList.get().isLoaded("fusion")) + event.addPackFinders(ResourceLocation.fromNamespaceAndPath("pneumaticcraft", "fusion_integration"), PackType.CLIENT_RESOURCES, Component.literal("Fusion for PneumaticCraft"), PackSource.BUILT_IN, false, Position.TOP); + } + + @Override + public void clientPreInit(IEventBus modBus) { + modBus.addListener(this::addPackFinders); + } +} diff --git a/src/main/java/me/desht/pneumaticcraft/common/thirdparty/ThirdPartyManager.java b/src/main/java/me/desht/pneumaticcraft/common/thirdparty/ThirdPartyManager.java index 8fffcdc4e..0ced5be33 100644 --- a/src/main/java/me/desht/pneumaticcraft/common/thirdparty/ThirdPartyManager.java +++ b/src/main/java/me/desht/pneumaticcraft/common/thirdparty/ThirdPartyManager.java @@ -74,6 +74,7 @@ private void discoverMods() { thirdPartyClasses.put(ModIds.CRAFTTWEAKER, () -> IMPLICIT_INIT); thirdPartyClasses.put(ModIds.GAMESTAGES, Gamestages::new); thirdPartyClasses.put(ModIds.CREATE, Create::new); + thirdPartyClasses.put(ModIds.FUSION, Fusion::new); thirdPartyClasses.put(ModIds.FFS, FTBFilterSystem::new); // these were supported in 1.12.2 and may or may not come back... diff --git a/src/main/java/me/desht/pneumaticcraft/lib/ModIds.java b/src/main/java/me/desht/pneumaticcraft/lib/ModIds.java index 05ebfb708..156792665 100644 --- a/src/main/java/me/desht/pneumaticcraft/lib/ModIds.java +++ b/src/main/java/me/desht/pneumaticcraft/lib/ModIds.java @@ -45,4 +45,5 @@ public class ModIds { public static final String THE_ONE_PROBE = "theoneprobe"; public static final String FFS = "ftbfiltersystem"; public static final String CTM = "ctm"; + public static final String FUSION = "fusion"; } diff --git a/src/main/resources/assets/pneumaticcraft/lang/en_us.json b/src/main/resources/assets/pneumaticcraft/lang/en_us.json index 4e38e3c14..9b1d55aff 100644 --- a/src/main/resources/assets/pneumaticcraft/lang/en_us.json +++ b/src/main/resources/assets/pneumaticcraft/lang/en_us.json @@ -247,7 +247,7 @@ "gui.tooltip.block.pneumaticcraft.pneumatic_dynamo" : "Converts compressed air into Forge Energy (compatible with RF and many other mods' energy). It has a base efficiency of 40%%, i.e. 100mL of air be used to generate 40 FE. Speed Upgrades will reduce this efficiency slightly.\nThis Dynamo generates heat, which must be dissipated to avoid efficiency loss.", "gui.tooltip.block.pneumaticcraft.pneumatic_generator" : "This machine converts compressed air into Industrial Craft 2 EU. You can interact with this machine with an IC2 Wrench just like any other IC2 machine.", "gui.tooltip.block.pneumaticcraft.pressure_chamber_glass" : "This block is used to create a Pressure Chamber. Create a hollow 3x3x3/4x4x4/5x5x5 structure with at least one Pressure Chamber Valve in a face (not edge or corner) of the structure. Pressure Chamber Walls and Pressure Chamber Glass can be used interchangeably.", - "gui.tooltip.block.pneumaticcraft.pressure_chamber_glass.ctm" : "Install ConnectedTexturesMod (CTM) for connected textures", + "gui.tooltip.block.pneumaticcraft.pressure_chamber_glass.ctm" : "Install ConnectedTexturesMod (CTM) or Fusion for connected textures", "gui.tooltip.block.pneumaticcraft.pressure_chamber_interface" : "This block is used to import/export items to/from a Pressure Chamber. It imports on the 'I' face, and exports on the 'O' face. You should have at least two Pressure Chamber Interfaces in your Pressure Chamber: one with the 'O' face pointing into the chamber, and one with the 'O' face pointing out to the outside world.", "gui.tooltip.block.pneumaticcraft.pressure_chamber_valve" : "This multi-block structure can be used as air storage. Its primary usage, however, is to compress various materials into other materials. Like Iron into Compressed Iron. Or Coal into Diamonds.", "gui.tooltip.block.pneumaticcraft.pressure_chamber_wall" : "This block is used to create a Pressure Chamber. Create a hollow 3x3x3/4x4x4/5x5x5 structure with at least one Pressure Chamber Valve in a face (not edge or corner) of the structure. Pressure Chamber Walls and Pressure Chamber Glass can be used interchangeably.",