9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-29 03:39:07 +00:00

Fix tnt dupers that use coral blocks

This commit is contained in:
Samsuik
2024-12-25 22:57:14 +00:00
parent aa0c30f3ae
commit 388febbdfb

View File

@@ -6,16 +6,19 @@ Subject: [PATCH] Configure TNT duplication
Adds a configuration option to enable TNT duplication.
diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
index 4550217fdc3e804649b9c7e5e129680cae3ee0a5..496d7b439e98aac68554208fa9247fe4b525caab 100644
index 4550217fdc3e804649b9c7e5e129680cae3ee0a5..a0e46d413c584e2c82c60b005e07f68f20af65f8 100644
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
@@ -448,6 +448,11 @@ public class PistonBaseBlock extends DirectionalBlock {
@@ -448,6 +448,14 @@ public class PistonBaseBlock extends DirectionalBlock {
for (j = list.size() - 1; j >= 0; --j) {
// Paper start - fix a variety of piston desync dupes
boolean allowDesync = io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowPistonDuplication;
+ // Sakura start - configure tnt duplication
+ if (world.sakuraConfig().technical.allowTNTDuplication && list1.get(j).is(Blocks.TNT)) {
+ allowDesync = true;
+ if (world.sakuraConfig().technical.allowTNTDuplication) {
+ BlockState movedState = list1.get(j);
+ if (movedState.is(Blocks.TNT) || movedState.getBlock() instanceof net.minecraft.world.level.block.BaseCoralPlantTypeBlock) {
+ allowDesync = true;
+ }
+ }
+ // Sakura end - configure tnt duplication
BlockPos oldPos = blockposition3 = (BlockPos) list.get(j);