User Tools

Site Tools


tutorial:fluids

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorial:fluids [2023/05/04 11:25] – [Implementation] use tutorial namespace solidblocktutorial:fluids [2023/05/04 11:31] (current) – [Rendering setup] solidblock
Line 241: Line 241:
  
 ===== Rendering setup ===== ===== Rendering setup =====
-For your fluids to have textures or be tinted with a color, you will need to register a ''FluidRenderHandler'' for them. Here, we will reuse water's textures and just change the tint color applied to them. To make sure the textures are rendered as translucent, you can use Fabric's ''BlockRenderLayerMap''.+For your fluids to have textures or be tinted with a color, you will need to register a ''FluidRenderHandler'' for them. Here, we will reuse water's textures and just change the tint color applied to them. To make sure the textures are rendered as translucent, you can use Fabric's ''BlockRenderLayerMap'' (see [[blockappearance]]).
  
 <yarncode java [enable_line_numbers="true"]> <yarncode java [enable_line_numbers="true"]>
 +@Environment(EnvType.CLIENT)
 public class TutorialModClient implements ClientModInitializer { public class TutorialModClient implements ClientModInitializer {
  
Line 260: Line 261:
  //To register your custom textures use this method.  //To register your custom textures use this method.
  //ClientSpriteRegistryCallback.event(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE).register((atlasTexture, registry) -> {  //ClientSpriteRegistryCallback.event(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE).register((atlasTexture, registry) -> {
- //    registry.register(new Identifier("modid:block/custom_fluid_still")); + //    registry.register(new Identifier("tutorial:block/custom_fluid_still")); 
- //    registry.register(new Identifier("modid:block/custom_fluid_flowing"));+ //    registry.register(new Identifier("tutorial:block/custom_fluid_flowing"));
  //});  //});
  
tutorial/fluids.1683199518.txt.gz · Last modified: 2023/05/04 11:25 by solidblock