Update upstream

This commit is contained in:
tr7zw 2020-05-10 22:38:12 +02:00
parent 00747a519d
commit 6f69976222
11 changed files with 22 additions and 101 deletions

@ -1 +1 @@
Subproject commit 3c538c5a9b865be6d123a14e9a39718d3b4e5a0c
Subproject commit 4380d9ac49e7abe90d431b6a1d8c107904bd4b92

View File

@ -1,4 +1,4 @@
From 5d3979b9fb4af8c3ffe6d936c9b1dab1b39a11a3 Mon Sep 17 00:00:00 2001
From 01ec8ec840ab8820d9769cf0f4875c91b046af5b Mon Sep 17 00:00:00 2001
From: tr7zw <tr7zw@live.de>
Date: Thu, 2 Apr 2020 18:49:56 +0200
Subject: [PATCH] Add NBT-API as first-class lib
@ -78,7 +78,7 @@ index 3b10fcc13..acb135968 100644
+ // YAPFA end
}
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 511348bdb..add98eec7 100644
index 3f0f38031..771e7ea73 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -23,6 +23,8 @@ import org.jetbrains.annotations.Contract;
@ -90,7 +90,7 @@ index 511348bdb..add98eec7 100644
/**
* Represents a base entity in the world
*/
@@ -661,4 +663,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -659,4 +661,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@NotNull
org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason getEntitySpawnReason();
// Paper end

View File

@ -1,4 +1,4 @@
From bf4463326998f23d1e3942aacc87eae7c98f3895 Mon Sep 17 00:00:00 2001
From 07ccf6a036ae9ee1bce447c3cd347793ea68e764 Mon Sep 17 00:00:00 2001
From: tr7zw <tr7zw@live.de>
Date: Wed, 26 Feb 2020 21:39:58 +0100
Subject: [PATCH] Don't save Fireworks and Arrows
@ -8,10 +8,10 @@ Subject: [PATCH] Don't save Fireworks and Arrows
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 5ed0a949e6..72a0c776f4 100644
index 2f7c78e2b4..153a87ffa0 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1613,7 +1613,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -1614,7 +1614,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
public boolean c(NBTTagCompound nbttagcompound) {

View File

@ -1,4 +1,4 @@
From 4cbe12c279e22aaf675873489fdd2086f068481b Mon Sep 17 00:00:00 2001
From 67b7879d0cfe99f7d30f812e59c601624a144254 Mon Sep 17 00:00:00 2001
From: tr7zw <tr7zw@live.de>
Date: Mon, 23 Mar 2020 18:20:58 +0100
Subject: [PATCH] Remove Stream usage
@ -158,7 +158,7 @@ index e40375b67a..2a5574be3a 100644
entity.enderTeleportTo(entity.locX(), entity.locY() + 1.0D + d0, entity.locZ());
}
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 07813c55cd..5ec9f04421 100644
index 58ba120915..46668693ef 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -72,7 +72,7 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
@ -269,7 +269,7 @@ index f0d7a91fa0..15e2439d69 100644
public Stream<MinecraftKey> c() {
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index ddb82ef5be..5d3809d1f8 100644
index 7a4bb21f05..d91f20d989 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -13,6 +13,7 @@ import java.util.Locale;
@ -461,7 +461,7 @@ index 9e30bb818c..1c11480b88 100644
this.world.getMethodProfiler().exit();
}
diff --git a/src/main/java/net/minecraft/server/VoxelShapes.java b/src/main/java/net/minecraft/server/VoxelShapes.java
index 17e99be012..3d695a9f24 100644
index 6db190de59..e0527459a6 100644
--- a/src/main/java/net/minecraft/server/VoxelShapes.java
+++ b/src/main/java/net/minecraft/server/VoxelShapes.java
@@ -5,9 +5,12 @@ import com.google.common.math.DoubleMath;
@ -477,7 +477,7 @@ index 17e99be012..3d695a9f24 100644
import java.util.stream.Stream;
public final class VoxelShapes {
@@ -200,6 +203,106 @@ public final class VoxelShapes {
@@ -202,6 +205,106 @@ public final class VoxelShapes {
return d0;
}

View File

@ -1,4 +1,4 @@
From cd3e60148db11a7f500e9b2d257b8689c9a4701b Mon Sep 17 00:00:00 2001
From f26762de38c0f91772aca3ff854a56c280001b6d Mon Sep 17 00:00:00 2001
From: tr7zw <tr7zw@live.de>
Date: Sat, 4 Apr 2020 23:23:04 +0200
Subject: [PATCH] Player saving async FileIO
@ -183,7 +183,7 @@ index c1e8ff6ab3..db4f628830 100644
nbttagcompound.set("ShoulderEntityLeft", this.getShoulderEntityLeft());
}
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 9786f110c5..54e778815e 100644
index bcf95c4bb0..f50f844473 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -16,6 +16,8 @@ import java.util.Map;
@ -195,7 +195,7 @@ index 9786f110c5..54e778815e 100644
import javax.annotation.Nullable;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -1184,6 +1186,28 @@ public abstract class PlayerList {
@@ -1185,6 +1187,28 @@ public abstract class PlayerList {
if (team != null) scoreboard.removeTeam(team);
}
// Paper end
@ -224,7 +224,7 @@ index 9786f110c5..54e778815e 100644
}
// Paper end
@@ -1223,13 +1247,13 @@ public abstract class PlayerList {
@@ -1224,13 +1248,13 @@ public abstract class PlayerList {
File file = new File(this.server.getWorldServer(DimensionManager.OVERWORLD).getDataManager().getDirectory(), "stats");
File file1 = new File(file, uuid + ".json");

View File

@ -1,79 +0,0 @@
From 45f26767c05e5218540a06cc13e92d09f27b0cf1 Mon Sep 17 00:00:00 2001
From: Sotr <i@omc.hk>
Date: Wed, 15 Apr 2020 04:28:25 +0700
Subject: [PATCH] Akarin Cache hashcode for BlockPosition
---
.../net/minecraft/server/BaseBlockPosition.java | 15 ++++++++++++++-
.../java/net/minecraft/server/BlockPosition.java | 4 ++++
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java
index c439a8d019..cc18560431 100644
--- a/src/main/java/net/minecraft/server/BaseBlockPosition.java
+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java
@@ -18,6 +18,7 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> {
return y < 0 || y >= 256;
}
// Paper end
+ protected int hash; // Akarin - cache hashcode
public BaseBlockPosition(int i, int j, int k) {
this.x = i;
@@ -42,8 +43,20 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> {
}
public int hashCode() {
- return (this.getY() + this.getZ() * 31) * 31 + this.getX();
+ // Akarin start - cache hashcode
+ int result = hash; // Make the situation not too bad when it is modified by multiple threads
+ if (result == 0) {
+ result = (this.getY() + this.getZ() * 31) * 31 + this.getX();
+ hash = result;
+ }
+ return result;
+ // return (this.getY() + this.getZ() * 31) * 31 + this.getX();
+ }
+
+ public void recalcHashCode() {
+ hash = 0;
}
+ // Akarin end
public int compareTo(BaseBlockPosition baseblockposition) {
return this.getY() == baseblockposition.getY() ? (this.getZ() == baseblockposition.getZ() ? this.getX() - baseblockposition.getX() : this.getZ() - baseblockposition.getZ()) : this.getY() - baseblockposition.getY();
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 5ec9f04421..4c040297ff 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -440,6 +440,7 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
this.y = j;
this.z = k;
// Paper end
+ this.recalcHashCode(); // Akarin - cache hashcode
return this;
}
@@ -480,16 +481,19 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
public final void setX(final int x) { this.o(x); } // Paper - OBFHELPER
public void o(int i) {
this.x = i; // Paper change to x
+ this.recalcHashCode(); // Akarin - cache hashcode
}
public final void setY(final int y) { this.p(y); } // Paper - OBFHELPER
public void p(int i) {
this.y = i; // Paper change to y
+ this.recalcHashCode(); // Akarin - cache hashcode
}
public final void setZ(final int z) { this.q(z); } // Paper - OBFHELPER
public void q(int i) {
this.z = i; // Paper change to z
+ this.recalcHashCode(); // Akarin - cache hashcode
}
@Override
--
2.25.1.windows.1

View File

@ -1,4 +1,4 @@
From 7d9dbeec19b1eaddc1e4e70b4e8920d93095cf3a Mon Sep 17 00:00:00 2001
From 7f8814d44da724648b530f8cc5d05be677732ece Mon Sep 17 00:00:00 2001
From: Sotr <i@omc.hk>
Date: Wed, 15 Apr 2020 03:51:50 +0700
Subject: [PATCH] Akarin Optimize door interact with pathfinding

View File

@ -1,4 +1,4 @@
From d3722a3415f461f815260767cf19a3b9bf9ef13c Mon Sep 17 00:00:00 2001
From 351024244f10e93aef27810fccd4f84f6dabc58c Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Fri, 21 Feb 2020 17:04:51 -0600
Subject: [PATCH] Purpur MC-125757 Fix - Always increment arrow despawn counter

View File

@ -1,4 +1,4 @@
From f8d62246c260c587cb856a3e4dff216d8420d3ee Mon Sep 17 00:00:00 2001
From 4c512006f8a8f54f804cf459e3ddbcb95adff7ec Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Sat, 4 Apr 2020 03:07:59 -0500
Subject: [PATCH] Purpur Skip events if there's no listeners

View File

@ -1,4 +1,4 @@
From 48c1f65d7ee60e9ee875f754d854bcb8b5cbbf91 Mon Sep 17 00:00:00 2001
From e72ae11add27505bd4dc784eda716fc6276d0896 Mon Sep 17 00:00:00 2001
From: tr7zw <tr7zw@live.de>
Date: Tue, 21 Apr 2020 15:49:52 +0200
Subject: [PATCH] Purpur Add more timings timers
@ -200,7 +200,7 @@ index a68fc11ec6..95dde66531 100644
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index e1de2edd02..63e23a840b 100644
index 481732b0c5..443e2b8869 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -871,7 +871,9 @@ public class WorldServer extends World {

View File

@ -1,4 +1,4 @@
From 6c1c0d60a9245c1ba1d00c1ecd680d3941c2ad11 Mon Sep 17 00:00:00 2001
From 86c737cf314ac4634345105dcd2e6ca0258e6edc Mon Sep 17 00:00:00 2001
From: tr7zw <tr7zw@live.de>
Date: Tue, 21 Apr 2020 16:14:10 +0200
Subject: [PATCH] Modify default configs