Skip to content

Commit

Permalink
Remove fluid render handler for empty fluid
Browse files Browse the repository at this point in the history
  • Loading branch information
Su5eD committed Aug 21, 2023
1 parent 686077d commit d354449
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ org.gradle.daemon=true

# Versions
versionConnector=1.0.0-beta.7
versionAdapter=1.20.1-20230815.003105
versionAdapter=1.20.1-20230821.150928
versionAdapterDefinition=1.0.3

versionMc=1.20.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.world.level.BlockAndTintGetter;
import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Fluids;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.client.extensions.common.IClientFluidTypeExtensions;
import net.minecraftforge.fluids.FluidType;
Expand All @@ -31,11 +32,13 @@ public static void onClientSetup(FMLClientSetupEvent event) {
Map<Fluid, FluidRenderHandler> registryHandlers = ObfuscationReflectionHelper.getPrivateValue(FluidRenderHandlerRegistryImpl.class, (FluidRenderHandlerRegistryImpl) FluidRenderHandlerRegistry.INSTANCE, "handlers");
Map<FluidType, FluidRenderHandler> forgeHandlers = new HashMap<>();
for (Map.Entry<ResourceKey<Fluid>, Fluid> entry : ForgeRegistries.FLUIDS.getEntries()) {
ResourceKey<Fluid> key = entry.getKey();
if (!ConnectorEarlyLoader.isConnectorMod(key.location().getNamespace())) {
Fluid fluid = entry.getValue();
FluidRenderHandler handler = forgeHandlers.computeIfAbsent(fluid.getFluidType(), ForgeFluidRenderHandler::new);
registryHandlers.put(fluid, handler);
Fluid fluid = entry.getValue();
if (fluid != Fluids.EMPTY) {
ResourceKey<Fluid> key = entry.getKey();
if (!ConnectorEarlyLoader.isConnectorMod(key.location().getNamespace())) {
FluidRenderHandler handler = forgeHandlers.computeIfAbsent(fluid.getFluidType(), ForgeFluidRenderHandler::new);
registryHandlers.put(fluid, handler);
}
}
}
}
Expand Down

0 comments on commit d354449

Please sign in to comment.