mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-31 04:46:37 +00:00
完善摔落伤害机制处理等
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user