mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-22 00:09:20 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@3ea95ef Do not access world state to see if we can see a Player PaperMC/Paper@71c84c8 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277) PaperMC/Paper@e3bc4c4 Make debug mode print current configuration phase PaperMC/Paper@d0ebfbb Fix corrupted plugin.yml breaking plugin loading (#10279) PaperMC/Paper@681bbff Fix spawnreason saving
33 lines
2.5 KiB
Diff
33 lines
2.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Samsuik <40902469+Samsuik@users.noreply.github.com>
|
|
Date: Thu, 16 Nov 2023 20:53:51 +0000
|
|
Subject: [PATCH] Falling Block Stacking Restrictions
|
|
|
|
|
|
diff --git a/src/main/java/me/samsuik/sakura/configuration/WorldConfiguration.java b/src/main/java/me/samsuik/sakura/configuration/WorldConfiguration.java
|
|
index f9a99319a4ba86762e2486a75f73df1cf74dcfdc..671fa0b3076276741ede09d5ae1f915e525ecf9f 100644
|
|
--- a/src/main/java/me/samsuik/sakura/configuration/WorldConfiguration.java
|
|
+++ b/src/main/java/me/samsuik/sakura/configuration/WorldConfiguration.java
|
|
@@ -70,7 +70,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
|
public boolean preventAtWorldHeight = false;
|
|
|
|
public boolean isFallingBlockInBounds(FallingBlockEntity entity) {
|
|
- return (!preventAgainstBorder || !io.papermc.paper.util.CollisionUtil.isAlmostCollidingOnBorder(entity.level().getWorldBorder(), entity.getBoundingBox()))
|
|
+ return (!preventAgainstBorder || !io.papermc.paper.util.CollisionUtil.isCollidingWithBorder(entity.level().getWorldBorder(), entity.getBoundingBox().inflate(0.01)))
|
|
&& (!preventAtWorldHeight || entity.blockPosition().getY() < entity.level().getMaxBuildHeight() - 1);
|
|
}
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
|
index 5ff54673066dd26b4eed5c5f86cfd1c0f4190bf3..642cfdfa8fe31aa5e0a6a60a5852df3dd11054e7 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
|
@@ -260,7 +260,7 @@ public class FallingBlockEntity extends Entity {
|
|
boolean flag3 = FallingBlock.isFree(this.level().getBlockState(blockposition.below())) && (!flag || !flag1);
|
|
boolean flag4 = this.blockState.canSurvive(this.level(), blockposition) && !flag3;
|
|
|
|
- if (flag2 && flag4) {
|
|
+ if (flag2 && flag4 && level().sakuraConfig().cannons.sand.isFallingBlockInBounds(this)) { // Sakura
|
|
if (this.blockState.hasProperty(BlockStateProperties.WATERLOGGED) && this.level().getFluidState(blockposition).getType() == Fluids.WATER) {
|
|
this.blockState = (BlockState) this.blockState.setValue(BlockStateProperties.WATERLOGGED, true);
|
|
}
|