From b923f293f7764df5c1d4b4ba873d706de91b77a4 Mon Sep 17 00:00:00 2001 From: screret <68943070+screret@users.noreply.github.com> Date: Thu, 26 Sep 2024 18:19:57 +0300 Subject: [PATCH] fix pipe structures not actually being registered --- .../gtceu/api/graphnet/logic/NetLogicRegistry.java | 4 ++-- .../api/graphnet/pipenet/physical/PipeStructureRegistry.java | 4 ++-- .../gtceu/api/graphnet/predicate/NetPredicateRegistry.java | 4 ++-- src/main/java/com/gregtechceu/gtceu/common/CommonProxy.java | 4 ++-- src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/gregtechceu/gtceu/api/graphnet/logic/NetLogicRegistry.java b/src/main/java/com/gregtechceu/gtceu/api/graphnet/logic/NetLogicRegistry.java index e6a971e3b1..30b9143639 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/graphnet/logic/NetLogicRegistry.java +++ b/src/main/java/com/gregtechceu/gtceu/api/graphnet/logic/NetLogicRegistry.java @@ -4,7 +4,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.network.chat.Component; -import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.ModLoader; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; @@ -22,7 +22,7 @@ public final class NetLogicRegistry { static { NetLogicRegistrationEvent event = new NetLogicRegistrationEvent(); - MinecraftForge.EVENT_BUS.post(event); + ModLoader.get().postEvent(event); Set> gather = event.getGather(); NAMES_TO_NETWORK_IDS = HashBiMap.create(gather.size()); REGISTRY = new Int2ObjectArrayMap<>(gather.size()); diff --git a/src/main/java/com/gregtechceu/gtceu/api/graphnet/pipenet/physical/PipeStructureRegistry.java b/src/main/java/com/gregtechceu/gtceu/api/graphnet/pipenet/physical/PipeStructureRegistry.java index b5621a1268..4b98f129e4 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/graphnet/pipenet/physical/PipeStructureRegistry.java +++ b/src/main/java/com/gregtechceu/gtceu/api/graphnet/pipenet/physical/PipeStructureRegistry.java @@ -1,6 +1,6 @@ package com.gregtechceu.gtceu.api.graphnet.pipenet.physical; -import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.ModLoader; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.UnmodifiableView; @@ -20,7 +20,7 @@ public final class PipeStructureRegistry { private static Map, Set> fireEvent() { PipeStructureRegistrationEvent event = new PipeStructureRegistrationEvent(); - MinecraftForge.EVENT_BUS.post(event); + ModLoader.get().postEvent(event); return event.getRegistry(); } } diff --git a/src/main/java/com/gregtechceu/gtceu/api/graphnet/predicate/NetPredicateRegistry.java b/src/main/java/com/gregtechceu/gtceu/api/graphnet/predicate/NetPredicateRegistry.java index 729615c76b..7ee0d99242 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/graphnet/predicate/NetPredicateRegistry.java +++ b/src/main/java/com/gregtechceu/gtceu/api/graphnet/predicate/NetPredicateRegistry.java @@ -4,7 +4,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.network.chat.Component; -import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.ModLoader; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; @@ -22,7 +22,7 @@ public final class NetPredicateRegistry { static { NetPredicateRegistrationEvent event = new NetPredicateRegistrationEvent(); - MinecraftForge.EVENT_BUS.post(event); + ModLoader.get().postEvent(event); Set> gather = event.getGather(); NAMES_TO_NETWORK_IDS = HashBiMap.create(gather.size()); REGISTRY = new Int2ObjectArrayMap<>(gather.size()); diff --git a/src/main/java/com/gregtechceu/gtceu/common/CommonProxy.java b/src/main/java/com/gregtechceu/gtceu/common/CommonProxy.java index 232a7aa8ad..ca9670334a 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/CommonProxy.java +++ b/src/main/java/com/gregtechceu/gtceu/common/CommonProxy.java @@ -247,7 +247,7 @@ public void modConstruct(FMLConstructModEvent event) { } @SubscribeEvent - public static void registerPipeStructures(PipeStructureRegistrationEvent event) { + public void registerPipeStructures(PipeStructureRegistrationEvent event) { CableStructure.register(event); MaterialPipeStructure.register(event); LaserStructure.register(event); @@ -256,7 +256,7 @@ public static void registerPipeStructures(PipeStructureRegistrationEvent event) } @SubscribeEvent - public static void registerNetLogics(NetLogicRegistrationEvent event) { + public void registerNetLogics(NetLogicRegistrationEvent event) { event.accept(ChannelCountLogic.TYPE); event.accept(EnergyFlowLogic.TYPE); event.accept(FluidFlowLogic.TYPE); diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java b/src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java index f6b9cf7bd3..10245bc952 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java @@ -403,7 +403,7 @@ private static void registerMaterialPipeBlock(Material material, MaterialPipeStr MATERIAL_PIPE_BLOCKS_BUILDER.put(pipeType.prefix(), material, entry); } - // Optical Pipe Blocks + // Duct Pipe Blocks private static void generateDuctPipeBlocks() { GTCEu.LOGGER.debug("Generating GTCEu Duct Pipe Blocks..."); for (var structure : PipeStructureRegistry.getStructures(DuctStructure.class)) {