tutorial:fluids
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
tutorial:fluids [2020/01/18 15:40] – Update tutorial to 1.15.1 + some cleanup virtuoel | tutorial:fluids [2020/11/15 01:12] – [Making a fluid block] .build() is not needed solidblock | ||
---|---|---|---|
Line 5: | Line 5: | ||
===== Making an abstract fluid ===== | ===== Making an abstract fluid ===== | ||
- | Vanilla fluids extend '' | + | Vanilla fluids extend '' |
<code java [enable_line_numbers=" | <code java [enable_line_numbers=" | ||
- | public abstract class TutorialFluid extends | + | public abstract class TutorialFluid extends |
{ | { | ||
/** | /** | ||
Line 32: | Line 32: | ||
*/ | */ | ||
@Override | @Override | ||
- | protected void beforeBreakingBlock(IWorld | + | protected void beforeBreakingBlock(WorldAccess |
{ | { | ||
final BlockEntity blockEntity = state.getBlock().hasBlockEntity() ? world.getBlockEntity(pos) : null; | final BlockEntity blockEntity = state.getBlock().hasBlockEntity() ? world.getBlockEntity(pos) : null; | ||
- | Block.dropStacks(state, | + | Block.dropStacks(state, |
} | } | ||
Line 45: | Line 45: | ||
*/ | */ | ||
@Override | @Override | ||
- | protected boolean | + | protected boolean |
{ | { | ||
return false; | return false; | ||
Line 55: | Line 55: | ||
*/ | */ | ||
@Override | @Override | ||
- | protected int method_15733(WorldView worldView) | + | protected int getFlowSpeed(WorldView worldView) |
{ | { | ||
return 4; | return 4; | ||
Line 61: | Line 61: | ||
/** | /** | ||
- | * Water returns 1. Lava returns | + | * Water returns 1. Lava returns |
*/ | */ | ||
@Override | @Override | ||
Line 164: | Line 164: | ||
// ... | // ... | ||
- | public static | + | public static |
- | public static | + | public static |
public static Item ACID_BUCKET; | public static Item ACID_BUCKET; | ||
Line 176: | Line 176: | ||
// ... | // ... | ||
- | STILL_ACID = Registry.FLUID.add(new Identifier(MOD_ID, | + | STILL_ACID = Registry.register(Registry.FLUID, |
- | FLOWING_ACID = Registry.FLUID.add(new Identifier(MOD_ID, | + | FLOWING_ACID = Registry.register(Registry.FLUID, |
- | ACID_BUCKET = Registry.ITEM.add(new Identifier(MOD_ID, | + | ACID_BUCKET = Registry.register(Registry.ITEM, |
// ... | // ... | ||
Line 215: | Line 215: | ||
// ... | // ... | ||
- | ACID = Registry.BLOCK.add(new Identifier(MOD_ID, | + | ACID = Registry.register(Registry.BLOCK, new Identifier(MOD_ID, |
// ... | // ... | ||
Line 293: | Line 293: | ||
final Identifier listenerId = new Identifier(fluidId.getNamespace(), | final Identifier listenerId = new Identifier(fluidId.getNamespace(), | ||
- | final Sprite[] fluidSprites = new Sprite[] | + | final Sprite[] fluidSprites = { null, null }; |
ResourceManagerHelper.get(ResourceType.CLIENT_RESOURCES).registerReloadListener(new SimpleSynchronousResourceReloadListener() | ResourceManagerHelper.get(ResourceType.CLIENT_RESOURCES).registerReloadListener(new SimpleSynchronousResourceReloadListener() |
tutorial/fluids.txt · Last modified: 2023/05/04 11:31 by solidblock