mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 10:57:43 +01:00
Stonecutter damage
This commit is contained in:
committed by
granny
parent
bc307f6750
commit
26189d0fde
@@ -0,0 +1,17 @@
|
||||
--- a/net/minecraft/world/level/block/StonecutterBlock.java
|
||||
+++ b/net/minecraft/world/level/block/StonecutterBlock.java
|
||||
@@ -93,4 +_,14 @@
|
||||
protected boolean isPathfindable(BlockState state, PathComputationType pathComputationType) {
|
||||
return false;
|
||||
}
|
||||
+
|
||||
+ // Purpur start - Stonecutter damage
|
||||
+ @Override
|
||||
+ public void stepOn(Level level, BlockPos pos, BlockState state, net.minecraft.world.entity.Entity entity) {
|
||||
+ if (level.purpurConfig.stonecutterDamage > 0.0F && entity instanceof net.minecraft.world.entity.LivingEntity) {
|
||||
+ entity.hurtServer((net.minecraft.server.level.ServerLevel) level, entity.damageSources().stonecutter().directBlock(level, pos), level.purpurConfig.stonecutterDamage);
|
||||
+ }
|
||||
+ super.stepOn(level, pos, state, entity);
|
||||
+ }
|
||||
+ // Purpur end - Stonecutter damage
|
||||
}
|
||||
@@ -9,3 +9,12 @@
|
||||
&& cachedPathType != PathType.TRAPDOOR
|
||||
&& cachedPathType != PathType.POWDER_SNOW) {
|
||||
node = this.tryJumpOn(x, y, z, verticalDeltaLimit, nodeFloorLevel, direction, pathType, mutableBlockPos);
|
||||
@@ -493,7 +_,7 @@
|
||||
return PathType.TRAPDOOR;
|
||||
} else if (blockState.is(Blocks.POWDER_SNOW)) {
|
||||
return PathType.POWDER_SNOW;
|
||||
- } else if (blockState.is(Blocks.CACTUS) || blockState.is(Blocks.SWEET_BERRY_BUSH)) {
|
||||
+ } else if (blockState.is(Blocks.CACTUS) || blockState.is(Blocks.SWEET_BERRY_BUSH) || blockState.is(Blocks.STONECUTTER)) { // Purpur - Stonecutter damage
|
||||
return PathType.DAMAGE_OTHER;
|
||||
} else if (blockState.is(Blocks.HONEY_BLOCK)) {
|
||||
return PathType.STICKY_HONEY;
|
||||
|
||||
Reference in New Issue
Block a user