tutorial:fluids
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tutorial:fluids [2021/12/17 11:38] – [Rendering setup] Updated the content by using the rendering-fluids api. salvopelux | tutorial:fluids [2023/05/04 11:31] (current) – [Rendering setup] solidblock | ||
|---|---|---|---|
| Line 17: | Line 17: | ||
| /** | /** | ||
| - | * @return whether the fluid infinite like water | + | * @return whether the fluid is infinite |
| */ | */ | ||
| @Override | @Override | ||
| Line 25: | Line 25: | ||
| /** | /** | ||
| - | * Perform actions when fluid flows into a replaceable block. Water drops | + | * Perform actions when the fluid flows into a replaceable block. Water drops |
| * the block' | * the block' | ||
| */ | */ | ||
| Line 35: | Line 35: | ||
| /** | /** | ||
| - | * Lava returns true if its FluidState is above a certain height and the | + | * Lava returns true if it' |
| * Fluid is Water. | * Fluid is Water. | ||
| * | * | ||
| Line 146: | Line 146: | ||
| @Override | @Override | ||
| public void onInitialize() { | public void onInitialize() { | ||
| - | STILL_ACID = class_2378.method_10230(class_2378.field_11154, new class_2960(MOD_ID, " | + | STILL_ACID = class_2378.method_10230(class_7923.field_41173, new class_2960(" |
| - | FLOWING_ACID = class_2378.method_10230(class_2378.field_11154, new class_2960(MOD_ID, " | + | FLOWING_ACID = class_2378.method_10230(class_7923.field_41173, new class_2960(" |
| - | ACID_BUCKET = class_2378.method_10230(class_2378.field_11142, new class_2960(MOD_ID, " | + | ACID_BUCKET = class_2378.method_10230(class_7923.field_41178, new class_2960(" |
| new class_1755(STILL_ACID, | new class_1755(STILL_ACID, | ||
| Line 163: | Line 163: | ||
| " | " | ||
| [ | [ | ||
| - | "your_mod_id: | + | "tutorial: |
| - | "your_mod_id: | + | "tutorial: |
| ] | ] | ||
| } | } | ||
| Line 177: | Line 177: | ||
| @Override | @Override | ||
| public void onInitialize() { | public void onInitialize() { | ||
| - | ACID = class_2378.method_10230(class_2378.field_11146, new class_2960(MOD_ID, | + | ACID = class_2378.method_10230(class_7923.field_41175, new class_2960(MOD_ID, |
| // ... | // ... | ||
| 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 '' | + | For your fluids to have textures or be tinted with a color, you will need to register a '' |
| < | < | ||
| + | @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. | ||
| // | // | ||
| - | // registry.register(new Identifier(" | + | // registry.register(new Identifier(" |
| - | // registry.register(new Identifier(" | + | // registry.register(new Identifier(" |
| //}); | //}); | ||
| Line 272: | Line 273: | ||
| ===== Generation in the world ===== | ===== Generation in the world ===== | ||
| - | To make lakes of acid generate in the world, you can create a ''< | + | TODO Update |
| - | + | ||
| - | <code java [enable_line_numbers=" | + | |
| - | public static LakeFeature ACID_LAKE; | + | |
| - | + | ||
| - | @Override | + | |
| - | public void onInitialize() { | + | |
| - | ACID_LAKE = Registry.register(Registry.FEATURE, | + | |
| - | + | ||
| - | // generate in swamps, similar to water lakes, but with a chance of 40 (the higher the number, the lower the generation chance) | + | |
| - | Biomes.SWAMP.addFeature( | + | |
| - | GenerationStep.Feature.LOCAL_MODIFICATIONS, | + | |
| - | ACID_LAKE.configure(new SingleStateFeatureConfig(ACID.getDefaultState())) | + | |
| - | .createDecoratedFeature(Decorator.WATER_LAKE.configure(new ChanceDecoratorConfig(40))) | + | |
| - | ); | + | |
| - | } | + | |
| </ | </ | ||
| - | |||
| - | |||
tutorial/fluids.1639741113.txt.gz · Last modified: 2021/12/17 11:38 by salvopelux