9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-31 04:46:37 +00:00

完善摔落伤害机制处理等

This commit is contained in:
XiaoMoMi
2025-09-11 03:20:47 +08:00
parent b817426575
commit 584d8e1f7a
10 changed files with 159 additions and 157 deletions

View File

@@ -178,17 +178,6 @@ public abstract class BlockBehavior {
public void spawnAfterBreak(Object thisBlock, Object[] args, Callable<Object> superMethod) throws Exception {
}
// 1.20.1~1.21.4 Level world, BlockState state, BlockPos pos, Entity entity, float fallDistance
// 1.21.5+ Level level, BlockState state, BlockPos pos, Entity entity, double fallDistance
public void fallOn(Object thisBlock, Object[] args, Callable<Object> superMethod) throws Exception {
superMethod.call();
}
// BlockGetter level, Entity entity
public void updateEntityMovementAfterFallOn(Object thisBlock, Object[] args, Callable<Object> superMethod) throws Exception {
superMethod.call();
}
public ImmutableBlockState updateStateForPlacement(BlockPlaceContext context, ImmutableBlockState state) {
return state;
}

View File

@@ -0,0 +1,17 @@
package net.momirealms.craftengine.core.block.behavior.special;
import java.util.concurrent.Callable;
public interface TriggerOnceBlockBehavior {
// 1.20.1~1.21.4 Level world, BlockState state, BlockPos pos, Entity entity, float fallDistance
// 1.21.5+ Level level, BlockState state, BlockPos pos, Entity entity, double fallDistance
default void fallOn(Object thisBlock, Object[] args, Callable<Object> superMethod) throws Exception {
superMethod.call();
}
// BlockGetter level, Entity entity
default void updateEntityMovementAfterFallOn(Object thisBlock, Object[] args, Callable<Object> superMethod) throws Exception {
superMethod.call();
}
}