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: 55e2de5c6 Improve per player mob spawning (#3971) 42433c262 Updated Upstream (Bukkit/CraftBukkit) (#3980) e5ede546a Fix IDE Debug JVM Flag for 1.16 (#3983) 2712c6888 [Auto] Updated Upstream (Bukkit/CraftBukkit) 0901ffd04 Use title packet for actionbar methods (#3959) 2e11235d1 Expand MaterialTags (#3964) cc25ae47c Amend last commit to fix decompile error forgot to commit f503db37c Fix AdvancementDataPlayer leak due from quitting early in login 282763b88 Fix SPIGOT-5885 Unable to disable advancements 9b93d122e Fix SPIGOT-5824 Bukkit world-container is not used bede4d304 Load config files early on Tuinity Changes: b0673b3 Merge dev/optimise-notify into ver/1.16 d3dc35c Name craft scheduler threads according to the plugin using them
32 lines
1.7 KiB
Diff
32 lines
1.7 KiB
Diff
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 c27b60b18..af1fea428 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
|
@@ -2787,6 +2787,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.aC()) {
|
|
this.damageEntity(DamageSource.DROWN, 1.0F);
|
|
}
|