mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-21 07:49:29 +00:00
Add lava flow speed api
This commit is contained in:
22
patches/server/0081-Add-lava-flow-speed-api.patch
Normal file
22
patches/server/0081-Add-lava-flow-speed-api.patch
Normal file
@@ -0,0 +1,22 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samsuik <kfian294ma4@gmail.com>
|
||||
Date: Thu, 5 Dec 2024 22:21:39 +0000
|
||||
Subject: [PATCH] Add lava flow speed api
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/material/LavaFluid.java b/src/main/java/net/minecraft/world/level/material/LavaFluid.java
|
||||
index 5fb8ad171e132174af12d63e45dd623ecac7480a..e4d5d80a16dbf568ccd932aae0c30ee913873abb 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/material/LavaFluid.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/material/LavaFluid.java
|
||||
@@ -189,7 +189,10 @@ public abstract class LavaFluid extends FlowingFluid {
|
||||
|
||||
@Override
|
||||
public int getSpreadDelay(Level world, BlockPos pos, FluidState oldState, FluidState newState) {
|
||||
- int i = this.getTickDelay(world);
|
||||
+ // Sakura start - lava flow speed api
|
||||
+ final int flowSpeed = world.localConfig().config(pos).lavaFlowSpeed;
|
||||
+ int i = flowSpeed >= 0 ? flowSpeed : this.getTickDelay(world);
|
||||
+ // Sakura end - lava flow speed api
|
||||
|
||||
if (!oldState.isEmpty() && !newState.isEmpty() && !(Boolean) oldState.getValue(LavaFluid.FALLING) && !(Boolean) newState.getValue(LavaFluid.FALLING) && newState.getHeight(world, pos) > oldState.getHeight(world, pos) && world.getRandom().nextInt(4) != 0) {
|
||||
i *= 4;
|
||||
Reference in New Issue
Block a user