|
1 | 1 | package net.neganote.gtutilities; |
2 | 2 |
|
| 3 | +import com.gregtechceu.gtceu.GTCEu; |
3 | 4 | import com.gregtechceu.gtceu.api.GTCEuAPI; |
4 | 5 | import com.gregtechceu.gtceu.api.data.chemical.material.event.MaterialEvent; |
5 | 6 | import com.gregtechceu.gtceu.api.data.chemical.material.event.MaterialRegistryEvent; |
|
14 | 15 | import net.minecraft.resources.ResourceLocation; |
15 | 16 | import net.minecraft.world.item.CreativeModeTab; |
16 | 17 | import net.minecraft.world.item.Items; |
| 18 | +import net.minecraftforge.api.distmarker.Dist; |
| 19 | +import net.minecraftforge.api.distmarker.OnlyIn; |
17 | 20 | import net.minecraftforge.common.MinecraftForge; |
18 | 21 | import net.minecraftforge.eventbus.api.IEventBus; |
19 | 22 | import net.minecraftforge.eventbus.api.SubscribeEvent; |
@@ -44,7 +47,9 @@ public GregTechModernUtilities() { |
44 | 47 | IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); |
45 | 48 |
|
46 | 49 | modEventBus.addListener(this::commonSetup); |
47 | | - modEventBus.addListener(this::clientSetup); |
| 50 | + if (GTCEu.isClientSide()) { |
| 51 | + modEventBus.addListener(this::clientSetup); |
| 52 | + } |
48 | 53 | modEventBus.addListener(this::addMaterialRegistries); |
49 | 54 | modEventBus.addListener(this::addMaterials); |
50 | 55 | modEventBus.addListener(this::modifyMaterials); |
@@ -99,6 +104,7 @@ private void commonSetup(final FMLCommonSetupEvent event) { |
99 | 104 | }); |
100 | 105 | } |
101 | 106 |
|
| 107 | + @OnlyIn(Dist.CLIENT) |
102 | 108 | @SubscribeEvent |
103 | 109 | public void clientSetup(final FMLClientSetupEvent event) { |
104 | 110 | event.enqueueWork(() -> ItemProperties.register(UtilItems.OMNIBREAKER.get(), id("omnibreaker_name"), |
|
0 commit comments