mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 08:57:44 +01:00
Update to 1.16.2
This commit is contained in:
31
patches/server/0022-EntityMoveEvent.patch
Normal file
31
patches/server/0022-EntityMoveEvent.patch
Normal file
@@ -0,0 +1,31 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Tue, 11 Feb 2020 21:56:48 -0600
|
||||
Subject: [PATCH] EntityMoveEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 130516ce6..17128d5aa 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -2790,6 +2790,20 @@ public abstract class EntityLiving extends Entity {
|
||||
|
||||
this.collideNearby();
|
||||
this.world.getMethodProfiler().exit();
|
||||
+ // Purpur start
|
||||
+ if (net.pl3x.purpur.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0) {
|
||||
+ if (lastX != locX() || lastY != locY() || lastZ != locZ() || lastYaw != yaw || lastPitch != pitch) {
|
||||
+ Location from = new Location(world.getWorld(), lastX, lastY, lastZ, lastYaw, lastPitch);
|
||||
+ Location to = new Location (world.getWorld(), locX(), locY(), locZ(), yaw, pitch);
|
||||
+ net.pl3x.purpur.event.entity.EntityMoveEvent event = new net.pl3x.purpur.event.entity.EntityMoveEvent(getBukkitLivingEntity(), from, to.clone());
|
||||
+ if (!event.callEvent()) {
|
||||
+ setLocation(from.getX(), from.getY(), from.getZ(), from.getYaw(), from.getPitch());
|
||||
+ } else if (!to.equals(event.getTo())) {
|
||||
+ setLocation(to.getX(), to.getY(), to.getZ(), to.getYaw(), to.getPitch());
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
if (!this.world.isClientSide && this.dN() && this.aF()) {
|
||||
this.damageEntity(DamageSource.DROWN, 1.0F);
|
||||
}
|
||||
Reference in New Issue
Block a user