Skip to content

Commit

Permalink
fix pipe structures not actually being registered
Browse files Browse the repository at this point in the history
  • Loading branch information
screret committed Sep 29, 2024
1 parent 0885a47 commit b923f29
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -22,7 +22,7 @@ public final class NetLogicRegistry {

static {
NetLogicRegistrationEvent event = new NetLogicRegistrationEvent();
MinecraftForge.EVENT_BUS.post(event);
ModLoader.get().postEvent(event);
Set<NetLogicType<?>> gather = event.getGather();
NAMES_TO_NETWORK_IDS = HashBiMap.create(gather.size());
REGISTRY = new Int2ObjectArrayMap<>(gather.size());
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -20,7 +20,7 @@ public final class PipeStructureRegistry {

private static Map<Class<? extends IPipeStructure>, Set<? extends IPipeStructure>> fireEvent() {
PipeStructureRegistrationEvent event = new PipeStructureRegistrationEvent();
MinecraftForge.EVENT_BUS.post(event);
ModLoader.get().postEvent(event);
return event.getRegistry();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -22,7 +22,7 @@ public final class NetPredicateRegistry {

static {
NetPredicateRegistrationEvent event = new NetPredicateRegistrationEvent();
MinecraftForge.EVENT_BUS.post(event);
ModLoader.get().postEvent(event);
Set<NetPredicateType<?>> gather = event.getGather();
NAMES_TO_NETWORK_IDS = HashBiMap.create(gather.size());
REGISTRY = new Int2ObjectArrayMap<>(gather.size());
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/gregtechceu/gtceu/common/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit b923f29

Please sign in to comment.