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/03/19 23:12] – Update outdated Intermediary names daomephstatutorial:fluids [2023/05/04 11:31] (current) – [Rendering setup] solidblock
Line 17: Line 17:
  
  /**  /**
- * @return whether the fluid is infinite like water+ * @return whether the fluid is infinite (which means can be infinitely created like water). In vanilla, it depends on the game rule.
  */  */
  @Override  @Override
Line 146: Line 146:
 @Override @Override
 public void onInitialize() { public void onInitialize() {
- STILL_ACID = class_2378.method_10230(class_7923.field_41173, new class_2960(MOD_ID, "acid"), new AcidFluid.Still()); + STILL_ACID = class_2378.method_10230(class_7923.field_41173, new class_2960("tutorial", "acid"), new AcidFluid.Still()); 
- FLOWING_ACID = class_2378.method_10230(class_7923.field_41173, new class_2960(MOD_ID, "flowing_acid"), new AcidFluid.Flowing()); + FLOWING_ACID = class_2378.method_10230(class_7923.field_41173, new class_2960("tutorial", "flowing_acid"), new AcidFluid.Flowing()); 
- ACID_BUCKET = class_2378.method_10230(class_7923.field_41178, new class_2960(MOD_ID, "acid_bucket"), + ACID_BUCKET = class_2378.method_10230(class_7923.field_41178, new class_2960("tutorial", "acid_bucket"), 
         new class_1755(STILL_ACID, new class_1792.class_1793().method_7896(class_1802.field_8550).method_7889(1)));         new class_1755(STILL_ACID, new class_1792.class_1793().method_7896(class_1802.field_8550).method_7889(1)));
    
Line 163: Line 163:
  "values":  "values":
  [  [
- "your_mod_id:acid", + "tutorial:acid", 
- "your_mod_id:flowing_acid"+ "tutorial:flowing_acid"
  ]  ]
 } }
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.1679267562.txt.gz · Last modified: 2023/03/19 23:12 by daomephsta