9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-19 14:59:32 +00:00
Files
LeavesMC/leaves-server/minecraft-patches/features/0010-Budding-Amethyst-can-push-by-piston.patch
violetc d5c9306a7f 1.21.4 (#413)
* init 1.21.4, and boom!

* build change, but weight not work

* just work

* Build changes, and delete timings

* Fix API patches (#406)

* Fix API patches

* merge

---------

Co-authored-by: violetc <58360096+s-yh-china@users.noreply.github.com>

* 0006/0129

* 0009/0129

* 0011/0129

* 0018/0129

* 0030/0129

* 0035/0129

* 0043/0129

* 0048/0129

* 0049/0129

* 0057/0129

* 0065/0129

* 0086/0129 (#408)

* 0072/0129

* 0080/0129

* Readd patch infos

* 0086/0129

* Delete applied patches

* 0087/0129

* 0091/0129

* 0097/0129

* 0101/0129

* 102/129

* 0107/0129

* 0112/0129

* 0118/0129

* 0129/0129, 100% patched

* fix some

* server work

* Protocol... (#409)

* Jade v7

* Fix changed part for Jade

* Formatting imports, add Lms Paster protocol

* REI payloads 5/8

* Add REI support, remove unnecessary content in Jade

* Rename

* Make jade better

* Make action work

* fix action jar

* Fix some protocol

* Fix bot action, and entity tickCount

* Fix Warden GameEventListener register on load

* Fix extra Raider drop

* Fix grindstone overstacking

* Update Paper, and some doc

* Merge

* [ci skip] Update Action

---------

Co-authored-by: Lumine1909 <133463833+Lumine1909@users.noreply.github.com>
2025-02-14 23:55:46 +08:00

55 lines
2.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Sun, 3 Apr 2022 11:31:04 +0800
Subject: [PATCH] Budding Amethyst can push by piston
diff --git a/net/minecraft/world/level/block/Block.java b/net/minecraft/world/level/block/Block.java
index 976de81d65b6494cdad20f4ec5125fceec86f951..37f561ae2eca0d118c63f519fabdcfe9cb710826 100644
--- a/net/minecraft/world/level/block/Block.java
+++ b/net/minecraft/world/level/block/Block.java
@@ -557,6 +557,13 @@ public class Block extends BlockBehaviour implements ItemLike {
}
// Spigot end
+ // Leaves start - reset push reaction
+ @org.jetbrains.annotations.Nullable
+ public net.minecraft.world.level.material.PushReaction getResetPushReaction() {
+ return null;
+ }
+ // Leaves end - reset push reaction
+
record ShapePairKey(VoxelShape first, VoxelShape second) {
@Override
public boolean equals(Object other) {
diff --git a/net/minecraft/world/level/block/BuddingAmethystBlock.java b/net/minecraft/world/level/block/BuddingAmethystBlock.java
index f6850d3ab54a6eb4ff718d861f39aac2facd3a88..5f51b4689b0ea92eb7e4e5e42e9eb5538930d60d 100644
--- a/net/minecraft/world/level/block/BuddingAmethystBlock.java
+++ b/net/minecraft/world/level/block/BuddingAmethystBlock.java
@@ -58,4 +58,12 @@ public class BuddingAmethystBlock extends AmethystBlock {
public static boolean canClusterGrowAtState(BlockState state) {
return state.isAir() || state.is(Blocks.WATER) && state.getFluidState().getAmount() == 8;
}
+
+ // Leaves start - budding amethyst can push by piston
+ @Override
+ @org.jetbrains.annotations.Nullable
+ public net.minecraft.world.level.material.PushReaction getResetPushReaction() {
+ return org.leavesmc.leaves.LeavesConfig.modify.buddingAmethystCanPushByPiston ? net.minecraft.world.level.material.PushReaction.PUSH_ONLY : null;
+ }
+ // Leaves end - budding amethyst can push by piston
}
diff --git a/net/minecraft/world/level/block/state/BlockBehaviour.java b/net/minecraft/world/level/block/state/BlockBehaviour.java
index 5473b4006f7e0266ea11a7b05cef78a113c30d97..a37a5528b36ebade8b0e3fe570c6d4819ab1cfbf 100644
--- a/net/minecraft/world/level/block/state/BlockBehaviour.java
+++ b/net/minecraft/world/level/block/state/BlockBehaviour.java
@@ -766,7 +766,7 @@ public abstract class BlockBehaviour implements FeatureElement {
}
public PushReaction getPistonPushReaction() {
- return !this.isDestroyable() ? PushReaction.BLOCK : this.pushReaction; // Paper - Protect Bedrock and End Portal/Frames from being destroyed
+ return !this.isDestroyable() ? PushReaction.BLOCK : this.getBlock().getResetPushReaction() == null ? this.pushReaction : this.getBlock().getResetPushReaction(); // Paper - Protect Bedrock and End Portal/Frames from being destroyed // Leaves - can reset
}
public boolean isSolidRender() {