mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: a4f066cc Fix method profiler inbalance introduced in a2a9ffe (#3132) c65dcad3 Don't delay chunk unloads during entity ticking bc17ce69 Delay unsafe actions until after entity ticking is done - Fixes #3114 5553e6b3 Disable Sync Events firing Async errors during shutdown e12c51d9 Use better variable for isStopping() API 586ee2bb Remove patch for MC-111480, fixed in 1.14 09a94215 Remove streams from Mob AI System bb5c294e Fix Disabling Asynchronous Chunks 089d8356 Implement Chunk Priority / Urgency System for World Gen fce69af7 Use dedicated thread for main thread blocking chunk loads 588b62e4 Add tick times API and /mspt command (#3102) 11de41c7 Add API MinecraftServer#isStopping (#3129) 942ff3c2 My patches are under MIT (#3130)
50 lines
2.5 KiB
Diff
50 lines
2.5 KiB
Diff
From ffa5c033e7015a17872192e78acd535ad6b38c40 Mon Sep 17 00:00:00 2001
|
|
From: Eearslya Sleiarion <eearslya@gmail.com>
|
|
Date: Mon, 24 Jun 2019 21:27:32 -0700
|
|
Subject: [PATCH] PaperPR - Add BellRingEvent
|
|
|
|
---
|
|
src/main/java/net/minecraft/server/BlockBell.java | 14 +++++++++++++-
|
|
1 file changed, 13 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockBell.java b/src/main/java/net/minecraft/server/BlockBell.java
|
|
index dbdbfb8ad9..0bbd1e1594 100644
|
|
--- a/src/main/java/net/minecraft/server/BlockBell.java
|
|
+++ b/src/main/java/net/minecraft/server/BlockBell.java
|
|
@@ -45,7 +45,7 @@ public class BlockBell extends BlockTileEntity {
|
|
Entity entity1 = ((EntityArrow) entity).getShooter();
|
|
EntityHuman entityhuman = entity1 instanceof EntityHuman ? (EntityHuman) entity1 : null;
|
|
|
|
- this.a(world, iblockdata, movingobjectpositionblock, entityhuman, true);
|
|
+ this.handleBellRing(world, iblockdata, movingobjectpositionblock, entityhuman, true, entity); // Purpur
|
|
}
|
|
|
|
}
|
|
@@ -56,11 +56,23 @@ public class BlockBell extends BlockTileEntity {
|
|
}
|
|
|
|
public boolean a(World world, IBlockData iblockdata, MovingObjectPositionBlock movingobjectpositionblock, @Nullable EntityHuman entityhuman, boolean flag) {
|
|
+ // Purpur start - BellRingEvent
|
|
+ return this.handleBellRing(world, iblockdata, movingobjectpositionblock, entityhuman, true, entityhuman);
|
|
+ }
|
|
+
|
|
+ public boolean handleBellRing(World world, IBlockData iblockdata, MovingObjectPositionBlock movingobjectpositionblock, @Nullable EntityHuman entityhuman, boolean flag, @Nullable Entity entity) {
|
|
+ // Purpur end
|
|
EnumDirection enumdirection = movingobjectpositionblock.getDirection();
|
|
BlockPosition blockposition = movingobjectpositionblock.getBlockPosition();
|
|
boolean flag1 = !flag || this.a(iblockdata, enumdirection, movingobjectpositionblock.getPos().y - (double) blockposition.getY());
|
|
|
|
if (flag1) {
|
|
+ // Purpur start - BellRingEvent
|
|
+ org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
|
+ if (!new com.destroystokyo.paper.event.block.BellRingEvent(block, (org.bukkit.entity.Entity) entity.getBukkitEntity()).callEvent()) {
|
|
+ return true;
|
|
+ }
|
|
+ // Purpur end
|
|
boolean flag2 = this.a(world, blockposition, enumdirection);
|
|
|
|
if (flag2 && entityhuman != null) {
|
|
--
|
|
2.24.0
|
|
|