mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Tuinity! \o/
This commit is contained in:
@@ -1,49 +0,0 @@
|
||||
From 0d8728d2c77181579b7efcc4ca6d588d45f1615a 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 2ef899c76..7db4e22c6 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockBell.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockBell.java
|
||||
@@ -44,7 +44,7 @@ public class BlockBell extends BlockTileEntity {
|
||||
Entity entity = iprojectile.getShooter();
|
||||
EntityHuman entityhuman = entity instanceof EntityHuman ? (EntityHuman) entity : null;
|
||||
|
||||
- this.a(world, iblockdata, movingobjectpositionblock, entityhuman, true);
|
||||
+ this.handleBellRing(world, iblockdata, movingobjectpositionblock, entityhuman, true, entity); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -53,11 +53,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, entity.getBukkitEntity()).callEvent()) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
boolean flag2 = this.a(world, blockposition, enumdirection);
|
||||
|
||||
if (flag2 && entityhuman != null) {
|
||||
--
|
||||
2.26.2
|
||||
|
||||
Reference in New Issue
Block a user