Skip to content

Commit

Permalink
Don't classload FluidRenderHandler on dedicated server
Browse files Browse the repository at this point in the history
Fixes #1501
  • Loading branch information
unilock committed Nov 12, 2024
1 parent b65cc6e commit fc583c0
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import net.minecraft.world.level.material.Fluid;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.ModList;
import net.neoforged.fml.loading.FMLEnvironment;
import net.neoforged.neoforge.fluids.FluidStack;
import net.neoforged.neoforge.fluids.FluidType;
import net.neoforged.neoforge.registries.NeoForgeRegistries;
Expand Down Expand Up @@ -51,8 +52,13 @@ private static void initFabricFluidTypes() {
ResourceKey<Fluid> key = entry.getKey();
Fluid fluid = entry.getValue();
if (ModList.get().getModContainerById(key.location().getNamespace()).map(c -> ConnectorEarlyLoader.isConnectorMod(c.getModId())).orElse(false)) {
FluidRenderHandler renderHandler = FluidRenderHandlerRegistry.INSTANCE.get(fluid);
FluidType type = new FabricFluidType(FluidType.Properties.create(), fluid, renderHandler);
FluidType type;
if (FMLEnvironment.dist.isClient()) {
FluidRenderHandler renderHandler = FluidRenderHandlerRegistry.INSTANCE.get(fluid);
type = new FabricFluidType(FluidType.Properties.create(), fluid, renderHandler);
} else {
type = new FabricFluidType(FluidType.Properties.create(), fluid, null);
}
FABRIC_FLUID_TYPES.put(fluid, type);
FABRIC_FLUID_TYPES_BY_NAME.put(key.location(), type);
}
Expand Down

0 comments on commit fc583c0

Please sign in to comment.