mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 18:37:42 +01:00
Entity lifespan
This commit is contained in:
committed by
granny
parent
fae83be586
commit
d2a0414806
@@ -119,12 +119,20 @@
|
||||
} // Paper
|
||||
}
|
||||
|
||||
@@ -1525,6 +_,8 @@
|
||||
this.lastPosZ = to.getZ();
|
||||
@@ -1526,6 +_,8 @@
|
||||
this.lastYaw = to.getYaw();
|
||||
this.lastPitch = to.getPitch();
|
||||
+
|
||||
+ if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ() || to.getYaw() != from.getYaw() || to.getPitch() != from.getPitch()) this.player.resetLastActionTime(); // Purpur - AFK API
|
||||
|
||||
+ if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ() || to.getYaw() != from.getYaw() || to.getPitch() != from.getPitch()) this.player.resetLastActionTime(); // Purpur - AFK API
|
||||
+
|
||||
Location oldTo = to.clone();
|
||||
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
|
||||
this.cserver.getPluginManager().callEvent(event);
|
||||
@@ -2734,6 +_,7 @@
|
||||
|
||||
AABB boundingBox = target.getBoundingBox();
|
||||
if (this.player.canInteractWithEntity(boundingBox, io.papermc.paper.configuration.GlobalConfiguration.get().misc.clientInteractionLeniencyDistance.or(3.0))) { // Paper - configurable lenience value for interact range
|
||||
+ if (target instanceof net.minecraft.world.entity.Mob mob) mob.ticksSinceLastInteraction = 0; // Purpur - Entity lifespan
|
||||
packet.dispatch(
|
||||
new ServerboundInteractPacket.Handler() {
|
||||
private void performInteraction(InteractionHand hand, ServerGamePacketListenerImpl.EntityInteraction entityInteraction, PlayerInteractEntityEvent event) { // CraftBukkit
|
||||
|
||||
Reference in New Issue
Block a user