2022-06-09 10:51:45 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: commandblockguy <commandblockguy1@gmail.com>
|
|
|
|
Date: Fri, 14 Aug 2020 14:44:14 -0500
|
|
|
|
Subject: [PATCH] Prevent headless pistons from being created
|
|
|
|
|
|
|
|
Prevent headless pistons from being created by explosions or tree/mushroom growth.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
2023-09-22 06:40:51 +02:00
|
|
|
index 93529defa5d36bb9b4c69eedda9b7ac3d0a189ce..e6e7ac7c5c31b6ff16a7bae6cc0706d31ea16c07 100644
|
2022-06-09 10:51:45 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
2023-09-22 06:40:51 +02:00
|
|
|
@@ -184,6 +184,15 @@ public class Explosion {
|
2022-06-09 10:51:45 +02:00
|
|
|
|
|
|
|
if (f > 0.0F && this.damageCalculator.shouldBlockExplode(this, this.level, blockposition, iblockdata, f)) {
|
|
|
|
set.add(blockposition);
|
|
|
|
+ // Paper start - prevent headless pistons from forming
|
|
|
|
+ if (!io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowHeadlessPistons && iblockdata.getBlock() == Blocks.MOVING_PISTON) {
|
|
|
|
+ BlockEntity extension = this.level.getBlockEntity(blockposition);
|
|
|
|
+ if (extension instanceof net.minecraft.world.level.block.piston.PistonMovingBlockEntity blockEntity && blockEntity.isSourcePiston()) {
|
|
|
|
+ net.minecraft.core.Direction direction = iblockdata.getValue(net.minecraft.world.level.block.piston.PistonHeadBlock.FACING);
|
|
|
|
+ set.add(blockposition.relative(direction.getOpposite()));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
|
|
|
|
d4 += d0 * 0.30000001192092896D;
|