13
0
geforkt von Mirrors/Paper

SPIGOT-7587: Remove fixes for now-resolved MC-142590 and MC-109346

By: Doc <nachito94@msn.com>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2024-03-10 09:20:54 +11:00
Ursprung 39994359d1
Commit 064818a555
3 geänderte Dateien mit 5 neuen und 28 gelöschten Zeilen

Datei anzeigen

@ -16,18 +16,7 @@
public static <T extends PacketListener> void ensureRunningOnSameThread(Packet<T> packet, T t0, IAsyncTaskHandler<?> iasynctaskhandler) throws CancelledPacketHandleException { public static <T extends PacketListener> void ensureRunningOnSameThread(Packet<T> packet, T t0, IAsyncTaskHandler<?> iasynctaskhandler) throws CancelledPacketHandleException {
if (!iasynctaskhandler.isSameThread()) { if (!iasynctaskhandler.isSameThread()) {
iasynctaskhandler.executeIfPossible(() -> { iasynctaskhandler.executeIfPossible(() -> {
+ if (MinecraftServer.getServer().hasStopped() || (t0 instanceof ServerCommonPacketListenerImpl && ((ServerCommonPacketListenerImpl) t0).processedDisconnect)) return; // CraftBukkit, MC-142590 + if (t0 instanceof ServerCommonPacketListenerImpl serverCommonPacketListener && serverCommonPacketListener.processedDisconnect) return; // CraftBukkit - Don't handle sync packets for kicked players
if (t0.shouldHandleMessage(packet)) { if (t0.shouldHandleMessage(packet)) {
try { try {
packet.handle(t0); packet.handle(t0);
@@ -60,6 +66,10 @@
});
throw CancelledPacketHandleException.RUNNING_ON_DIFFERENT_THREAD;
+ // CraftBukkit start - SPIGOT-5477, MC-142590
+ } else if (MinecraftServer.getServer().hasStopped() || (t0 instanceof ServerCommonPacketListenerImpl && ((ServerCommonPacketListenerImpl) t0).processedDisconnect)) {
+ throw CancelledPacketHandleException.RUNNING_ON_DIFFERENT_THREAD;
+ // CraftBukkit end
}
}
}

Datei anzeigen

@ -731,16 +731,11 @@
try { try {
arraylist = Lists.newArrayList(NativeModuleLister.listModules()); arraylist = Lists.newArrayList(NativeModuleLister.listModules());
@@ -1903,6 +2239,22 @@ @@ -1903,6 +2239,17 @@
} }
+ // CraftBukkit start + // CraftBukkit start
+ @Override
+ public boolean isSameThread() {
+ return super.isSameThread() || this.isStopped(); // CraftBukkit - MC-142590
+ }
+
+ public boolean isDebugging() { + public boolean isDebugging() {
+ return false; + return false;
+ } + }
@ -754,7 +749,7 @@
private void startMetricsRecordingTick() { private void startMetricsRecordingTick() {
if (this.willStartRecordingMetrics) { if (this.willStartRecordingMetrics) {
this.metricsRecorder = ActiveMetricsRecorder.createStarted(new ServerMetricsSamplersProvider(SystemUtils.timeSource, this.isDedicatedServer()), SystemUtils.timeSource, SystemUtils.ioPool(), new MetricsPersister("server"), this.onMetricsRecordingStopped, (path) -> { this.metricsRecorder = ActiveMetricsRecorder.createStarted(new ServerMetricsSamplersProvider(SystemUtils.timeSource, this.isDedicatedServer()), SystemUtils.timeSource, SystemUtils.ioPool(), new MetricsPersister("server"), this.onMetricsRecordingStopped, (path) -> {
@@ -2029,6 +2381,11 @@ @@ -2029,6 +2376,11 @@
} }

Datei anzeigen

@ -113,22 +113,15 @@
if (!collection.isEmpty()) { if (!collection.isEmpty()) {
consumer.accept(new PacketPlayOutUpdateAttributes(this.entity.getId(), collection)); consumer.accept(new PacketPlayOutUpdateAttributes(this.entity.getId(), collection));
} }
@@ -303,7 +342,14 @@ @@ -303,6 +342,7 @@
if (!list.isEmpty()) { if (!list.isEmpty()) {
consumer.accept(new PacketPlayOutEntityEquipment(this.entity.getId(), list)); consumer.accept(new PacketPlayOutEntityEquipment(this.entity.getId(), list));
} }
+ ((EntityLiving) this.entity).detectEquipmentUpdatesPublic(); // CraftBukkit - SPIGOT-3789: sync again immediately after sending + ((EntityLiving) this.entity).detectEquipmentUpdatesPublic(); // CraftBukkit - SPIGOT-3789: sync again immediately after sending
+ }
+
+ // CraftBukkit start - MC-109346: Fix for nonsensical head yaw
+ if (this.entity instanceof EntityPlayer) {
+ consumer.accept(new PacketPlayOutEntityHeadRotation(this.entity, (byte) MathHelper.floor(this.entity.getYHeadRot() * 256.0F / 360.0F)));
} }
+ // CraftBukkit end
if (!this.entity.getPassengers().isEmpty()) { if (!this.entity.getPassengers().isEmpty()) {
consumer.accept(new PacketPlayOutMount(this.entity)); @@ -338,6 +378,11 @@
@@ -338,6 +384,11 @@
Set<AttributeModifiable> set = ((EntityLiving) this.entity).getAttributes().getDirtyAttributes(); Set<AttributeModifiable> set = ((EntityLiving) this.entity).getAttributes().getDirtyAttributes();
if (!set.isEmpty()) { if (!set.isEmpty()) {