mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-20 20:22:28 +00:00
Fix minecart speed with water (#9076)
This commit is contained in:
1 parent
be5dab5801
commit
1b3640b42d
2 files changed
+5
-3
No files matched your search
@@ -221,8 +221,8 @@
|
||||
+ private float currentSpeedCapOnRail = getMaxCartSpeedOnRail();
|
||||
+ @Override public float getCurrentCartSpeedCapOnRail() { return currentSpeedCapOnRail; }
|
||||
+ @Override public void setCurrentCartSpeedCapOnRail(float value) { currentSpeedCapOnRail = Math.min(value, getMaxCartSpeedOnRail()); }
|
||||
+ private float maxSpeedAirLateral = DEFAULT_MAX_SPEED_AIR_LATERAL;
|
||||
+ @Override public float getMaxSpeedAirLateral() { return maxSpeedAirLateral; }
|
||||
+ @org.jetbrains.annotations.Nullable private Float maxSpeedAirLateral = null;
|
||||
+ @Override public float getMaxSpeedAirLateral() { return maxSpeedAirLateral == null ? (float) this.m_7097_() : maxSpeedAirLateral; }
|
||||
+ @Override public void setMaxSpeedAirLateral(float value) { maxSpeedAirLateral = value; }
|
||||
+ private float maxSpeedAirVertical = DEFAULT_MAX_SPEED_AIR_VERTICAL;
|
||||
+ @Override public float getMaxSpeedAirVertical() { return maxSpeedAirVertical; }
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
package net.minecraftforge.common.extensions;
|
||||
|
||||
import net.minecraft.world.entity.vehicle.MinecartFurnace;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.entity.vehicle.AbstractMinecart;
|
||||
import net.minecraft.world.level.block.state.properties.RailShape;
|
||||
@@ -60,7 +61,8 @@ public interface IForgeBaseRailBlock
|
||||
*/
|
||||
default float getRailMaxSpeed(BlockState state, Level level, BlockPos pos, AbstractMinecart cart)
|
||||
{
|
||||
return 0.4f;
|
||||
if (cart instanceof MinecartFurnace) return cart.isInWater() ? 0.15f : 0.2f;
|
||||
else return cart.isInWater() ? 0.2f : 0.4f;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user