-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix crash on dedicated server due to fluid render handler
- Loading branch information
1 parent
3784052
commit ce1c54d
Showing
4 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
fabric/src/main/java/net/blay09/mods/balm/fabric/FabricBalmProxy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package net.blay09.mods.balm.fabric; | ||
|
||
import net.blay09.mods.balm.fabric.fluid.SimpleMilkFluid; | ||
import net.minecraft.core.Registry; | ||
import net.minecraft.core.registries.BuiltInRegistries; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.world.level.material.Fluid; | ||
|
||
public class FabricBalmProxy { | ||
public Fluid enableMilkFluid() { | ||
return Registry.register(BuiltInRegistries.FLUID, new ResourceLocation("balm-fabric", "milk"), new SimpleMilkFluid()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
fabric/src/main/java/net/blay09/mods/balm/fabric/client/FabricBalmClientProxy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package net.blay09.mods.balm.fabric.client; | ||
|
||
import net.blay09.mods.balm.fabric.FabricBalmProxy; | ||
import net.fabricmc.fabric.api.client.render.fluid.v1.FluidRenderHandlerRegistry; | ||
import net.fabricmc.fabric.api.client.render.fluid.v1.SimpleFluidRenderHandler; | ||
import net.minecraft.world.level.material.Fluid; | ||
|
||
public class FabricBalmClientProxy extends FabricBalmProxy { | ||
|
||
@Override | ||
public Fluid enableMilkFluid() { | ||
final var fluid = super.enableMilkFluid(); | ||
FluidRenderHandlerRegistry.INSTANCE.register(fluid, new SimpleFluidRenderHandler(SimpleFluidRenderHandler.WATER_STILL, SimpleFluidRenderHandler.WATER_FLOWING, 0xFFFFFFFF)); | ||
return fluid; | ||
} | ||
} |