mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
fd5c98a9ef
Removes synchronization from sending packets Makes normal packet sends no longer need to be wrapped and queued like it use to work. Adds more packet queue immunities on top of keep alive to let the following scenarios go out without delay: - Keep Alive - Chat - Kick - All of the packets during the Player Joined World event Hoping that latter one helps join timeout issues more too for slow connections. Removes processing packet queue off of main thread - for the few cases where it is allowed, order is not necessary nor should it even be happening concurrently in first place (handshaking/login/status) Ensures packets sent asynchronously are dispatched on main thread This helps ensure safety for ProtocolLib as packet listeners are commonly accessing world state. This will allow you to schedule a packet to be sent async, but itll be dispatched sync for packet listeners to process. This should solve some deadlock risks This may provide a decent performance improvement because thread synchronization incurs a cache reset so by avoiding ever entering a synchronized block, we get to avoid that, and packet sending is a really hot activity.
42 lines
No EOL
2.1 KiB
Diff
42 lines
No EOL
2.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Shane Freeder <theboyetronic@gmail.com>
|
|
Date: Fri, 21 Feb 2020 18:44:28 +0000
|
|
Subject: [PATCH] Backport fix for MC-167561
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java
|
|
index db15d5e0a23..eec1e26b6eb 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityWolf.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityWolf.java
|
|
@@ -0,0 +0,0 @@ public class EntityWolf extends EntityTameableAnimal {
|
|
boolean flag = super.a(entityhuman, enumhand);
|
|
|
|
if (!flag || this.isBaby()) {
|
|
- this.goalSit.setSitting(!this.isSitting());
|
|
+ //this.goalSit.setSitting(!this.isSitting()); // Paper start - copied from below
|
|
+ if (this.i((EntityLiving) entityhuman) && !this.i(itemstack)) {
|
|
+ this.goalSit.setSitting(!this.isSitting());
|
|
+ this.jumping = false;
|
|
+ this.navigation.o();
|
|
+ this.setGoalTarget((EntityLiving) null, TargetReason.FORGOT_TARGET, true); // CraftBukkit - reason
|
|
+ }
|
|
+ // Paper end - copied from below
|
|
}
|
|
|
|
return flag;
|
|
@@ -0,0 +0,0 @@ public class EntityWolf extends EntityTameableAnimal {
|
|
return true;
|
|
}
|
|
|
|
+ /* Paper start - Move into above
|
|
if (this.i((EntityLiving) entityhuman) && !this.i(itemstack)) {
|
|
this.goalSit.setSitting(!this.isSitting());
|
|
this.jumping = false;
|
|
this.navigation.o();
|
|
this.setGoalTarget((EntityLiving) null, TargetReason.FORGOT_TARGET, true); // CraftBukkit - reason
|
|
}
|
|
+ */ // Paper end
|
|
} else if (item == Items.BONE && !this.isAngry()) {
|
|
if (!entityhuman.abilities.canInstantlyBuild) {
|
|
itemstack.subtract(1);
|
|
--
|