mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2024-11-22 02:25:51 +01:00
Switch to Tuinity as base Fork
This commit is contained in:
parent
7b8f2699e3
commit
86f8a54179
7
.github/workflows/build.yml
vendored
7
.github/workflows/build.yml
vendored
@ -12,9 +12,12 @@ jobs:
|
||||
- name: Build YAPFA
|
||||
run: |
|
||||
git submodule init
|
||||
git submodule update
|
||||
git submodule update --init --recursive
|
||||
git config --global user.email "ci@github.com"
|
||||
git config --global user.name "Github CI"
|
||||
./yapfa up
|
||||
yapfaDir=`pwd`
|
||||
cd Tuinity
|
||||
./tuinity jar
|
||||
cd $yapfaDir
|
||||
./yapfa patch
|
||||
./yapfa build
|
||||
|
6
.gitmodules
vendored
6
.gitmodules
vendored
@ -1,3 +1,3 @@
|
||||
[submodule "Paper"]
|
||||
path = Paper
|
||||
url = https://github.com/PaperMC/Paper
|
||||
[submodule "Tuinity"]
|
||||
path = Tuinity
|
||||
url = https://github.com/Spottedleaf/Tuinity
|
||||
|
1
Paper
1
Paper
@ -1 +0,0 @@
|
||||
Subproject commit 7bd0b6ab1ab2d7a17b20048dfc06daa1319c3506
|
@ -1,8 +1,8 @@
|
||||
# YAPFA
|
||||
## (Yet another Paper fork attempt)
|
||||
## (Yet another ~~Paper~~ Tuinity fork attempt)
|
||||
## What ##
|
||||
|
||||
This Fork tries to import universal patches from [EMC](https://github.com/starlis/empirecraft) and [Purpur](https://github.com/pl3xgaming/Purpur), while adding a few more "extrem" patches that modify the basic minecraft server for more performance.
|
||||
This Fork tries to import universal patches from [EMC](https://github.com/starlis/empirecraft) and [Purpur](https://github.com/pl3xgaming/Purpur), while adding a few more "extrem" patches that modify the basic minecraft server for more performance. This fork was based on Paper, but is now based on [Tuinity](https://github.com/Spottedleaf/Tuinity).
|
||||
|
||||
## Building and setting up
|
||||
Run the following commands in the root directory:
|
||||
|
1
Tuinity
Submodule
1
Tuinity
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit d16b7882fc663ed975daf74091449c1927d0242a
|
@ -1,36 +1,36 @@
|
||||
From e56e7c35b802814b62608f98517d2368cca70e47 Mon Sep 17 00:00:00 2001
|
||||
From 3f7f02d0d9e68b60c6c92144fc458afd99a64eb2 Mon Sep 17 00:00:00 2001
|
||||
From: tr7zw <tr7zw@live.de>
|
||||
Date: Wed, 26 Feb 2020 17:03:06 +0100
|
||||
Subject: [PATCH] Modify POM
|
||||
|
||||
---
|
||||
pom.xml | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
pom.xml | 11 ++++++-----
|
||||
1 file changed, 6 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index 2cb97140..8103f6dd 100644
|
||||
index bab0b017..4bb7efe9 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -3,18 +3,18 @@
|
||||
@@ -3,18 +3,19 @@
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
- <groupId>com.destroystokyo.paper</groupId>
|
||||
- <artifactId>paper-parent</artifactId>
|
||||
- <groupId>com.tuinity</groupId>
|
||||
- <artifactId>tuinity-parent</artifactId>
|
||||
+ <groupId>de.tr7zw.yapfa</groupId>
|
||||
+ <artifactId>yapfa-parent</artifactId>
|
||||
<version>dev-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
- <groupId>com.destroystokyo.paper</groupId>
|
||||
- <artifactId>paper-api</artifactId>
|
||||
- <artifactId>tuinity-api</artifactId>
|
||||
+ <groupId>de.tr7zw.yapfa</groupId>
|
||||
+ <artifactId>yapfa-api</artifactId>
|
||||
<version>1.15.2-R0.1-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
- <name>Paper-API</name>
|
||||
- <url>https://github.com/PaperMC/Paper</url>
|
||||
- <name>Tuinity-API</name>
|
||||
- <url>https://github.com/Spottedleaf/Tuinity</url>
|
||||
+ <name>YAPFA-API</name>
|
||||
+ <url>https://github.com/tr7zw/YAPFA</url>
|
||||
<description>An enhanced plugin API for Minecraft servers.</description>
|
||||
|
@ -1,4 +1,4 @@
|
||||
From d9c138fbfa962b5aafcc8b5387882523bab251dc Mon Sep 17 00:00:00 2001
|
||||
From 1c8f1bf377624c066e0d6300a3f684193eb1d0e9 Mon Sep 17 00:00:00 2001
|
||||
From: tr7zw <tr7zw@live.de>
|
||||
Date: Wed, 26 Feb 2020 22:21:14 +0100
|
||||
Subject: [PATCH] Add GameProfileLookupEvent
|
||||
@ -10,10 +10,10 @@ Subject: [PATCH] Add GameProfileLookupEvent
|
||||
create mode 100644 src/main/java/de/tr7zw/yapfa/events/GameProfileLookupEvent.java
|
||||
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index ca897873..3f97b2be 100644
|
||||
index 4bb7efe9..d9fb880f 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -39,6 +39,10 @@
|
||||
@@ -40,6 +40,10 @@
|
||||
<id>sonatype</id>
|
||||
<url>https://oss.sonatype.org/content/groups/public/</url>
|
||||
</repository>
|
||||
@ -24,7 +24,7 @@ index ca897873..3f97b2be 100644
|
||||
</repositories>
|
||||
|
||||
<pluginRepositories>
|
||||
@@ -49,6 +53,13 @@
|
||||
@@ -50,6 +54,13 @@
|
||||
</pluginRepositories>
|
||||
|
||||
<dependencies>
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 8ad98f5fbf4542b3cb48d754448ff847bd45bab0 Mon Sep 17 00:00:00 2001
|
||||
From f729f3eb13144eb45278d3f0671f44339dd55552 Mon Sep 17 00:00:00 2001
|
||||
From: tr7zw <tr7zw@live.de>
|
||||
Date: Thu, 5 Mar 2020 21:13:14 +0100
|
||||
Subject: [PATCH] Add getLastTickMs() api
|
||||
@ -9,10 +9,10 @@ Subject: [PATCH] Add getLastTickMs() api
|
||||
2 files changed, 19 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 355bd2e2..f603f99f 100644
|
||||
index b9973406..610bd5b1 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -1618,6 +1618,14 @@ public final class Bukkit {
|
||||
@@ -1662,6 +1662,14 @@ public final class Bukkit {
|
||||
return server.getCurrentTick();
|
||||
}
|
||||
// Paper end
|
||||
@ -28,10 +28,10 @@ index 355bd2e2..f603f99f 100644
|
||||
@NotNull
|
||||
public static Server.Spigot spigot() {
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 98e7ba90..7cebe608 100644
|
||||
index 80f9abdc..7b6cbe71 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1416,4 +1416,15 @@ public interface Server extends PluginMessageRecipient {
|
||||
@@ -1456,4 +1456,15 @@ public interface Server extends PluginMessageRecipient {
|
||||
*/
|
||||
int getCurrentTick();
|
||||
// Paper end
|
||||
|
@ -1,37 +1,38 @@
|
||||
From 332de8cfc43e110aaf9c46ca3b9eef4ccf94c22d Mon Sep 17 00:00:00 2001
|
||||
From ddf4f73e653d81b5273acc1ad7cfc1ac00fd42e9 Mon Sep 17 00:00:00 2001
|
||||
From: tr7zw <tr7zw@live.de>
|
||||
Date: Wed, 26 Feb 2020 17:08:07 +0100
|
||||
Subject: [PATCH] Modify POM
|
||||
|
||||
---
|
||||
pom.xml | 18 +++++++++---------
|
||||
1 file changed, 9 insertions(+), 9 deletions(-)
|
||||
pom.xml | 21 +++++++++++----------
|
||||
1 file changed, 11 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index 55679af9..7e166ce9 100644
|
||||
index 332a8a45..742e423c 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -1,11 +1,11 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
@@ -1,11 +1,12 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
- <artifactId>paper</artifactId>
|
||||
- <artifactId>tuinity</artifactId>
|
||||
+ <artifactId>yapfa</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.15.2-R0.1-SNAPSHOT</version>
|
||||
- <name>Paper</name>
|
||||
- <url>https://papermc.io</url>
|
||||
- <name>Tuinity-Server</name>
|
||||
- <url>https://github.com/Spottedleaf/Tuinity</url>
|
||||
+ <name>YAPFA</name>
|
||||
+ <url>https://github.com/tr7zw/YAPFA</url>
|
||||
|
||||
+
|
||||
<properties>
|
||||
<!-- <skipTests>true</skipTests> Paper - This [was] not going to end well -->
|
||||
@@ -21,16 +21,16 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
@@ -20,16 +21,16 @@
|
||||
</properties>
|
||||
|
||||
<parent>
|
||||
- <groupId>com.destroystokyo.paper</groupId>
|
||||
- <artifactId>paper-parent</artifactId>
|
||||
- <groupId>com.tuinity</groupId>
|
||||
- <artifactId>tuinity-parent</artifactId>
|
||||
+ <groupId>de.tr7zw.yapfa</groupId>
|
||||
+ <artifactId>yapfa-parent</artifactId>
|
||||
<version>dev-SNAPSHOT</version>
|
||||
@ -40,27 +41,28 @@ index 55679af9..7e166ce9 100644
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
- <groupId>com.destroystokyo.paper</groupId>
|
||||
- <artifactId>paper-api</artifactId>
|
||||
- <groupId>com.tuinity</groupId>
|
||||
- <artifactId>tuinity-api</artifactId>
|
||||
+ <groupId>de.tr7zw.yapfa</groupId>
|
||||
+ <artifactId>yapfa-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
@@ -143,7 +143,7 @@
|
||||
@@ -148,15 +149,15 @@
|
||||
|
||||
<!-- This builds a completely 'ready to start' jar with all dependencies inside -->
|
||||
<build>
|
||||
- <finalName>paper-${minecraft.version}</finalName>
|
||||
- <finalName>tuinity-${minecraft.version}</finalName>
|
||||
- <defaultGoal>install</defaultGoal> <!-- Paper -->
|
||||
+ <finalName>yapfa-${minecraft.version}</finalName>
|
||||
<defaultGoal>clean install</defaultGoal> <!-- Paper -->
|
||||
+ <defaultGoal>clean install</defaultGoal> <!-- Paper -->
|
||||
<plugins>
|
||||
<plugin>
|
||||
@@ -151,7 +151,7 @@
|
||||
<groupId>com.lukegb.mojo</groupId>
|
||||
<artifactId>gitdescribe-maven-plugin</artifactId>
|
||||
<version>1.3</version>
|
||||
<configuration>
|
||||
- <outputPrefix>git-Paper-</outputPrefix>
|
||||
- <outputPrefix>git-Tuinity-</outputPrefix> <!-- Tuinity -->
|
||||
+ <outputPrefix>git-YAPFA-</outputPrefix>
|
||||
<scmDirectory>..</scmDirectory>
|
||||
</configuration>
|
||||
|
@ -1,47 +1,33 @@
|
||||
From 657c46021b893e6184415b1182fda23d7d9974d9 Mon Sep 17 00:00:00 2001
|
||||
From d1dfd7255c30123ed4d636bb4a6c2b1f03bac049 Mon Sep 17 00:00:00 2001
|
||||
From: tr7zw <tr7zw@live.de>
|
||||
Date: Wed, 26 Feb 2020 18:37:34 +0100
|
||||
Subject: [PATCH] Brandings
|
||||
|
||||
---
|
||||
.../paper/console/PaperConsole.java | 2 +-
|
||||
.../paper/util/misc/AreaMap.java | 1 +
|
||||
.../paper/console/PaperConsole.java | 1 +
|
||||
.../de/tr7zw/yapfa/YapfaVersionFetcher.java | 20 +++++++++++++++++++
|
||||
.../net/minecraft/server/MinecraftServer.java | 2 +-
|
||||
.../org/bukkit/craftbukkit/CraftServer.java | 2 +-
|
||||
.../craftbukkit/util/CraftMagicNumbers.java | 2 +-
|
||||
.../bukkit/craftbukkit/util/Versioning.java | 2 +-
|
||||
7 files changed, 26 insertions(+), 5 deletions(-)
|
||||
6 files changed, 25 insertions(+), 4 deletions(-)
|
||||
create mode 100644 src/main/java/de/tr7zw/yapfa/YapfaVersionFetcher.java
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
index cd6e25923..24e852ebd 100644
|
||||
index cd6e2592..e3599d11 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
@@ -17,7 +17,7 @@ public final class PaperConsole extends SimpleTerminalConsole {
|
||||
@Override
|
||||
@@ -18,6 +18,7 @@ public final class PaperConsole extends SimpleTerminalConsole {
|
||||
protected LineReader buildReader(LineReaderBuilder builder) {
|
||||
return super.buildReader(builder
|
||||
- .appName("Paper")
|
||||
+ .appName("YAPFA")
|
||||
.appName("Paper")
|
||||
+ .appName("YAPFA") // YAPFA
|
||||
.completer(new ConsoleCommandCompleter(this.server))
|
||||
);
|
||||
}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/util/misc/AreaMap.java b/src/main/java/com/destroystokyo/paper/util/misc/AreaMap.java
|
||||
index 5a44bc644..4bd88e5b3 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/util/misc/AreaMap.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/util/misc/AreaMap.java
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.destroystokyo.paper.util.misc;
|
||||
|
||||
import it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap;
|
||||
+import it.unimi.dsi.fastutil.longs.Long2ObjectMap.Entry;
|
||||
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
|
||||
import it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap;
|
||||
diff --git a/src/main/java/de/tr7zw/yapfa/YapfaVersionFetcher.java b/src/main/java/de/tr7zw/yapfa/YapfaVersionFetcher.java
|
||||
new file mode 100644
|
||||
index 000000000..4ca5fd338
|
||||
index 00000000..b7a73408
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/de/tr7zw/yapfa/YapfaVersionFetcher.java
|
||||
@@ -0,0 +1,20 @@
|
||||
@ -65,28 +51,28 @@ index 000000000..4ca5fd338
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
\ No newline at end of file
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index c9deaffc4..b5bed4705 100644
|
||||
index 2acd6bf2..eec9a5b2 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1484,7 +1484,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1482,7 +1482,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
}
|
||||
|
||||
public String getServerModName() {
|
||||
- return "Paper"; //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
||||
+ return "YAPFA"; //YAPFA - YAPFA > //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
||||
- return "Tuinity"; // Tuinity //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
||||
+ return "YAPFA"; // YAPFA // Tuinity //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
||||
}
|
||||
|
||||
public CrashReport b(CrashReport crashreport) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index b7dfda265..d6b06c06e 100644
|
||||
index 0b65cbb2..4b27af23 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -203,7 +203,7 @@ import javax.annotation.Nullable; // Paper
|
||||
import javax.annotation.Nonnull; // Paper
|
||||
|
||||
public final class CraftServer implements Server {
|
||||
- private final String serverName = "Paper"; // Paper
|
||||
+ private final String serverName = "YAPFA"; // YAPFA
|
||||
private final String serverVersion;
|
||||
private final String bukkitVersion = Versioning.getBukkitVersion();
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 1d76a3b9382672fb6f13dd9efb6b5e77e7962bcb Mon Sep 17 00:00:00 2001
|
||||
From 4421584fbbc1dfb981327ea61e8621616b60c3f1 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sat, 22 Dec 2012 00:35:15 -0500
|
||||
Subject: [PATCH] EMC PlayerUseItem Event
|
||||
@ -23,10 +23,10 @@ index ad474500..671fa069 100644
|
||||
this.setSlot(EnumItemSlot.MAINHAND, itemstack);
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
||||
index ce4340a4..51e10cfc 100644
|
||||
index 1b60310b..3f358ec5 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
||||
@@ -391,6 +391,15 @@ public class PlayerInteractManager {
|
||||
@@ -412,6 +412,15 @@ public class PlayerInteractManager {
|
||||
}
|
||||
|
||||
public EnumInteractionResult a(EntityHuman entityhuman, World world, ItemStack itemstack, EnumHand enumhand) {
|
||||
@ -42,7 +42,7 @@ index ce4340a4..51e10cfc 100644
|
||||
if (this.gamemode == EnumGamemode.SPECTATOR) {
|
||||
return EnumInteractionResult.PASS;
|
||||
} else if (entityhuman.getCooldownTracker().hasCooldown(itemstack.getItem())) {
|
||||
@@ -398,27 +407,53 @@ public class PlayerInteractManager {
|
||||
@@ -419,27 +428,53 @@ public class PlayerInteractManager {
|
||||
} else {
|
||||
int i = itemstack.getCount();
|
||||
int j = itemstack.getDamage();
|
||||
@ -102,7 +102,7 @@ index ce4340a4..51e10cfc 100644
|
||||
((EntityPlayer) entityhuman).updateInventory(entityhuman.defaultContainer);
|
||||
}
|
||||
|
||||
@@ -432,6 +467,7 @@ public class PlayerInteractManager {
|
||||
@@ -453,6 +488,7 @@ public class PlayerInteractManager {
|
||||
public boolean firedInteract = false;
|
||||
public EnumInteractionResult a(EntityHuman entityhuman, World world, ItemStack itemstack, EnumHand enumhand, MovingObjectPositionBlock movingobjectpositionblock) {
|
||||
BlockPosition blockposition = movingobjectpositionblock.getBlockPosition();
|
||||
@ -110,7 +110,7 @@ index ce4340a4..51e10cfc 100644
|
||||
IBlockData iblockdata = world.getType(blockposition);
|
||||
EnumInteractionResult enuminteractionresult = EnumInteractionResult.PASS;
|
||||
boolean cancelledBlock = false;
|
||||
@@ -499,17 +535,45 @@ public class PlayerInteractManager {
|
||||
@@ -520,17 +556,45 @@ public class PlayerInteractManager {
|
||||
}
|
||||
|
||||
if (!itemstack.isEmpty() && enuminteractionresult != EnumInteractionResult.SUCCESS && !interactResult) { // add !interactResult SPIGOT-764
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 89df9d7ca41b413ae9c3ac8193d8cedc89d68541 Mon Sep 17 00:00:00 2001
|
||||
From e1b72d3c45a36d430d4ef3b1bde43fbb6784bb5e Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Mon, 14 Apr 2014 20:44:38 -0400
|
||||
Subject: [PATCH] EMC Disable UUID conversion - Already done
|
||||
@ -9,10 +9,10 @@ Subject: [PATCH] EMC Disable UUID conversion - Already done
|
||||
2 files changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
index 349a0ea2..8a241c28 100644
|
||||
index ede43693..610826c9 100644
|
||||
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
@@ -249,7 +249,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
@@ -250,7 +250,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file.");
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 38cac2cc8d88fa416f879fa39ad554f2cde7c2a4 Mon Sep 17 00:00:00 2001
|
||||
From 360d20b06b9e2b1b8e68275a3ba054e1de3e7a65 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sun, 16 Mar 2014 20:44:46 -0400
|
||||
Subject: [PATCH] EMC EntityKnockbackEvent
|
||||
@ -44,10 +44,10 @@ index 584166f2..9346fbf0 100644
|
||||
if (this.isSprinting() && flag) {
|
||||
sendSoundEffect(this, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_PLAYER_ATTACK_KNOCKBACK, this.getSoundCategory(), 1.0F, 1.0F); // Paper - send while respecting visibility
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
index 1991cee4..329f3685 100644
|
||||
index 27ef4760..0592e095 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
@@ -1308,7 +1308,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
@@ -1315,7 +1315,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
|
||||
if (entity instanceof EntityLiving) {
|
||||
f += EnchantmentManager.a(this.getItemInMainHand(), ((EntityLiving) entity).getMonsterType());
|
||||
|
@ -1,4 +1,4 @@
|
||||
From f4e88ce690719daef8a3baac865262a070c43ea2 Mon Sep 17 00:00:00 2001
|
||||
From ec8804120c0877c9ed090ed7ed0e429eaffcab59 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Fri, 5 Sep 2014 23:04:54 -0400
|
||||
Subject: [PATCH] EMC Accept the EULA
|
||||
@ -9,10 +9,10 @@ Starlis LLC, the owner of Empire Minecraft, accepts the Minecraft EULA with this
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 32f1099a..b5bd0e38 100644
|
||||
index 15ceb83f..fa8a5f53 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1343,6 +1343,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1341,6 +1341,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
System.err.println( "If you do not agree to the above EULA please stop your server and remove this flag immediately." );
|
||||
}
|
||||
// Spigot End
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 8459ee7038d25c28284c47b244442a98d44d4cf9 Mon Sep 17 00:00:00 2001
|
||||
From 0d60368fc67b5a475b1285d0484c517b3565332f Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Thu, 25 Jun 2015 21:00:09 -0400
|
||||
Subject: [PATCH] EMC ServerReloadEvent
|
||||
@ -8,10 +8,10 @@ Subject: [PATCH] EMC ServerReloadEvent
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index d6b06c06..9384c929 100644
|
||||
index 4b27af23..d3a0a917 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -761,6 +761,7 @@ public final class CraftServer implements Server {
|
||||
@@ -771,6 +771,7 @@ public final class CraftServer implements Server {
|
||||
@Override
|
||||
public void reload() {
|
||||
org.spigotmc.WatchdogThread.hasStarted = false; // Paper - Disable watchdog early timeout on reload
|
||||
|
@ -1,4 +1,4 @@
|
||||
From b04e7fb704af33ef186743d10d773b5826e850ba Mon Sep 17 00:00:00 2001
|
||||
From 979580a2ffb58f7903fbddf2ef26203797535c79 Mon Sep 17 00:00:00 2001
|
||||
From: chickeneer <emcchickeneer@gmail.com>
|
||||
Date: Wed, 22 Jan 2020 01:22:34 -0600
|
||||
Subject: [PATCH] EMC Do not save entities with player passengers
|
||||
@ -8,10 +8,10 @@ Subject: [PATCH] EMC Do not save entities with player passengers
|
||||
1 file changed, 15 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
index 4349d22c..669eb9eb 100644
|
||||
index d529b795..1b2b73b8 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
@@ -444,7 +444,7 @@ public class ChunkRegionLoader {
|
||||
@@ -452,7 +452,7 @@ public class ChunkRegionLoader {
|
||||
if (asyncsavedata == null) toUpdate.add(entity); // todo fix this broken code, entityJoinedWorld wont work in this case!
|
||||
continue;
|
||||
}
|
||||
@ -20,7 +20,7 @@ index 4349d22c..669eb9eb 100644
|
||||
continue;
|
||||
}
|
||||
// Paper end
|
||||
@@ -525,6 +525,20 @@ public class ChunkRegionLoader {
|
||||
@@ -533,6 +533,20 @@ public class ChunkRegionLoader {
|
||||
return nbttagcompound;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 87a4ad5661fa6d92f8ead7f64e3c1548054d08ac Mon Sep 17 00:00:00 2001
|
||||
From 9339c992bd089a91513ff682736b5c44da787cd8 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sun, 15 Dec 2019 12:53:59 -0600
|
||||
Subject: [PATCH] Purpur Disable outdated build check
|
||||
@ -8,10 +8,10 @@ Subject: [PATCH] Purpur Disable outdated build check
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 374e0450..d6aa0306 100644
|
||||
index 2666940e..a9f2229c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -212,7 +212,7 @@ public class Main {
|
||||
@@ -219,7 +219,7 @@ public class Main {
|
||||
System.setProperty(TerminalConsoleAppender.JLINE_OVERRIDE_PROPERTY, "false"); // Paper
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From cc74d3456f0ffbd9abdbc0c6b740c6d17644a3fd Mon Sep 17 00:00:00 2001
|
||||
From 42b73c07d1ef71fd082f14c8eb6682817d33ea68 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 8974c16b..bfcf4a9b 100644
|
||||
index 181f1742..d2a224a8 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -1516,7 +1516,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -1616,7 +1616,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
}
|
||||
|
||||
public boolean c(NBTTagCompound nbttagcompound) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 08c19476a6b5359ebc6fe21668c9a9dbb38e01c6 Mon Sep 17 00:00:00 2001
|
||||
From f3d5def9a1faac55232b4c258ec5f3c36ae81ede Mon Sep 17 00:00:00 2001
|
||||
From: tr7zw <tr7zw@live.de>
|
||||
Date: Wed, 26 Feb 2020 22:22:02 +0100
|
||||
Subject: [PATCH] Add GameProfileLookupEvent
|
||||
@ -9,7 +9,7 @@ Subject: [PATCH] Add GameProfileLookupEvent
|
||||
2 files changed, 30 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
|
||||
index b151a13c1..9eacb3c43 100644
|
||||
index b151a13c..a37db9a5 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
|
||||
@@ -5,8 +5,12 @@ import com.google.common.base.Charsets;
|
||||
@ -34,7 +34,7 @@ index b151a13c1..9eacb3c43 100644
|
||||
- this.profile = result;
|
||||
- }
|
||||
+ // YAPFA start
|
||||
+ GameProfileLookupEvent event = new GameProfileLookupEvent(!de.tr7zw.yapfa.MainThreadHandler.isMainThread(Thread.currentThread()), profile.getId(), profile.getName());
|
||||
+ GameProfileLookupEvent event = new GameProfileLookupEvent(!Bukkit.isPrimaryThread(), profile.getId(), profile.getName());
|
||||
+ Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
+ if (event.getGameProfile() != null) {
|
||||
+ this.profile = event.getGameProfile();
|
||||
@ -49,7 +49,7 @@ index b151a13c1..9eacb3c43 100644
|
||||
return profile.isComplete() && (!isOnlineMode || !textures || hasTextures());
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java
|
||||
index 0882d82ce..8ed2c09ad 100644
|
||||
index 0882d82c..62607f49 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntitySkull.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntitySkull.java
|
||||
@@ -4,9 +4,14 @@ import com.google.common.collect.Iterables;
|
||||
@ -73,7 +73,7 @@ index 0882d82ce..8ed2c09ad 100644
|
||||
{
|
||||
- profile = TileEntitySkull.sessionService.fillProfileProperties( profile, true );
|
||||
+ // YAPFA start
|
||||
+ GameProfileLookupEvent event = new GameProfileLookupEvent(!de.tr7zw.yapfa.MainThreadHandler.isMainThread(Thread.currentThread()), profile.getId(), profile.getName());
|
||||
+ GameProfileLookupEvent event = new GameProfileLookupEvent(!Bukkit.isPrimaryThread(), profile.getId(), profile.getName());
|
||||
+ Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
+ if (event.getGameProfile() != null) {
|
||||
+ profile = event.getGameProfile();
|
@ -1,166 +0,0 @@
|
||||
From 8005dcac9b78f662be51bc0734b9d334a15d5a5a Mon Sep 17 00:00:00 2001
|
||||
From: tr7zw <tr7zw@live.de>
|
||||
Date: Thu, 5 Mar 2020 20:47:06 +0100
|
||||
Subject: [PATCH] Add MainThreadHandler to allow custom "MainThreads"
|
||||
|
||||
---
|
||||
.../de/tr7zw/yapfa/MainThreadHandler.java | 24 +++++++++++++++++++
|
||||
.../minecraft/server/IAsyncTaskHandler.java | 5 +++-
|
||||
.../java/net/minecraft/server/MCUtil.java | 6 +++--
|
||||
.../net/minecraft/server/MinecraftServer.java | 3 +++
|
||||
.../org/bukkit/craftbukkit/CraftServer.java | 4 +++-
|
||||
src/main/java/org/spigotmc/AsyncCatcher.java | 4 ++--
|
||||
6 files changed, 40 insertions(+), 6 deletions(-)
|
||||
create mode 100644 src/main/java/de/tr7zw/yapfa/MainThreadHandler.java
|
||||
|
||||
diff --git a/src/main/java/de/tr7zw/yapfa/MainThreadHandler.java b/src/main/java/de/tr7zw/yapfa/MainThreadHandler.java
|
||||
new file mode 100644
|
||||
index 000000000..f66e15e76
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/de/tr7zw/yapfa/MainThreadHandler.java
|
||||
@@ -0,0 +1,24 @@
|
||||
+package de.tr7zw.yapfa;
|
||||
+
|
||||
+import org.bukkit.craftbukkit.util.WeakCollection;
|
||||
+
|
||||
+/**
|
||||
+ * All Threads that are stored in this Collection are considered "MainThread"
|
||||
+ * for all intents and purposes.
|
||||
+ *
|
||||
+ * @author tr7zw
|
||||
+ *
|
||||
+ */
|
||||
+public class MainThreadHandler {
|
||||
+
|
||||
+ private static WeakCollection<Thread> weakMainThreads = new WeakCollection<Thread>();
|
||||
+
|
||||
+ public static void registerThread(Thread thread) {
|
||||
+ weakMainThreads.add(thread);
|
||||
+ }
|
||||
+
|
||||
+ public static boolean isMainThread(Thread thread) {
|
||||
+ return weakMainThreads.contains(thread);
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
|
||||
index cfe43e882..9009705ee 100644
|
||||
--- a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
|
||||
+++ b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
|
||||
@@ -1,6 +1,9 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import com.google.common.collect.Queues;
|
||||
+
|
||||
+import de.tr7zw.yapfa.MainThreadHandler;
|
||||
+
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.Executor;
|
||||
@@ -25,7 +28,7 @@ public abstract class IAsyncTaskHandler<R extends Runnable> implements Mailbox<R
|
||||
protected abstract boolean canExecute(R r0);
|
||||
|
||||
public boolean isMainThread() {
|
||||
- return Thread.currentThread() == this.getThread();
|
||||
+ return MainThreadHandler.isMainThread(Thread.currentThread()); // YAPFA
|
||||
}
|
||||
|
||||
protected abstract Thread getThread();
|
||||
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
|
||||
index bcd5cc9f2..f1310bf57 100644
|
||||
--- a/src/main/java/net/minecraft/server/MCUtil.java
|
||||
+++ b/src/main/java/net/minecraft/server/MCUtil.java
|
||||
@@ -10,6 +10,8 @@ import com.google.gson.internal.Streams;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.datafixers.util.Either;
|
||||
+
|
||||
+import de.tr7zw.yapfa.MainThreadHandler;
|
||||
import it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap;
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.bukkit.Location;
|
||||
@@ -195,7 +197,7 @@ public final class MCUtil {
|
||||
* @return
|
||||
*/
|
||||
public static void ensureMain(String reason, Runnable run) {
|
||||
- if (AsyncCatcher.enabled && Thread.currentThread() != MinecraftServer.getServer().serverThread) {
|
||||
+ if (AsyncCatcher.enabled && !MainThreadHandler.isMainThread(Thread.currentThread())) { // YAPFA
|
||||
if (reason != null) {
|
||||
new IllegalStateException("Asynchronous " + reason + "!").printStackTrace();
|
||||
}
|
||||
@@ -220,7 +222,7 @@ public final class MCUtil {
|
||||
* @return
|
||||
*/
|
||||
public static <T> T ensureMain(String reason, Supplier<T> run) {
|
||||
- if (AsyncCatcher.enabled && Thread.currentThread() != MinecraftServer.getServer().serverThread) {
|
||||
+ if (AsyncCatcher.enabled && !MainThreadHandler.isMainThread(Thread.currentThread())) { // YAPFA
|
||||
if (reason != null) {
|
||||
new IllegalStateException("Asynchronous " + reason + "! Blocking thread until it returns ").printStackTrace();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 816f4ff14..6ea3833fc 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2,6 +2,8 @@ package net.minecraft.server;
|
||||
|
||||
import com.google.common.base.Splitter;
|
||||
import co.aikar.timings.Timings;
|
||||
+import de.tr7zw.yapfa.MainThreadHandler;
|
||||
+
|
||||
import com.destroystokyo.paper.event.server.PaperServerListPingEvent;
|
||||
import com.google.common.base.Stopwatch;
|
||||
import com.google.common.collect.Lists;
|
||||
@@ -132,6 +134,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
thread.setUncaughtExceptionHandler((thread1, throwable) -> {
|
||||
MinecraftServer.LOGGER.error(throwable);
|
||||
});
|
||||
+ MainThreadHandler.registerThread(thread); // YAPFA
|
||||
});
|
||||
private long nextTick = SystemUtils.getMonotonicMillis();
|
||||
private long ab; final long getTickOversleepMaxTime() { return this.ab; } // Paper - OBFHELPER
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 9384c9292..19b74f3ca 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -14,6 +14,8 @@ import com.mojang.brigadier.StringReader;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import com.mojang.brigadier.tree.CommandNode;
|
||||
import com.mojang.brigadier.tree.LiteralCommandNode;
|
||||
+
|
||||
+import de.tr7zw.yapfa.MainThreadHandler;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufOutputStream;
|
||||
import io.netty.buffer.Unpooled;
|
||||
@@ -1684,7 +1686,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
@Override
|
||||
public boolean isPrimaryThread() {
|
||||
- return Thread.currentThread().equals(console.serverThread); // Paper - Fix issues with detecting main thread properly
|
||||
+ return MainThreadHandler.isMainThread(Thread.currentThread()); // YAPFA // Paper - Fix issues with detecting main thread properly
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/spigotmc/AsyncCatcher.java b/src/main/java/org/spigotmc/AsyncCatcher.java
|
||||
index 9f7d2ef93..f9fd9f603 100644
|
||||
--- a/src/main/java/org/spigotmc/AsyncCatcher.java
|
||||
+++ b/src/main/java/org/spigotmc/AsyncCatcher.java
|
||||
@@ -1,6 +1,6 @@
|
||||
package org.spigotmc;
|
||||
|
||||
-import net.minecraft.server.MinecraftServer;
|
||||
+import de.tr7zw.yapfa.MainThreadHandler;
|
||||
|
||||
public class AsyncCatcher
|
||||
{
|
||||
@@ -10,7 +10,7 @@ public class AsyncCatcher
|
||||
|
||||
public static void catchOp(String reason)
|
||||
{
|
||||
- if ( enabled && Thread.currentThread() != MinecraftServer.getServer().serverThread )
|
||||
+ if ( enabled && !MainThreadHandler.isMainThread(Thread.currentThread()) ) // YAPFA
|
||||
{
|
||||
throw new IllegalStateException( "Asynchronous " + reason + "!" );
|
||||
}
|
||||
--
|
||||
2.25.1.windows.1
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 90e8bcd5384daf77b5d94744e1f40fbaf71526e5 Mon Sep 17 00:00:00 2001
|
||||
From 03a99f384fef93ce99164346e625053155eb7438 Mon Sep 17 00:00:00 2001
|
||||
From: tr7zw <tr7zw@live.de>
|
||||
Date: Thu, 5 Mar 2020 21:13:33 +0100
|
||||
Subject: [PATCH] Add getLastTickMs() api
|
||||
@ -10,10 +10,10 @@ Subject: [PATCH] Add getLastTickMs() api
|
||||
3 files changed, 17 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 6ea3833fc..d5efea027 100644
|
||||
index 376cf955..0276abe1 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -886,6 +886,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -883,6 +883,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
private static final java.math.BigDecimal TPS_BASE = new java.math.BigDecimal(1E9).multiply(new java.math.BigDecimal(SAMPLE_INTERVAL));
|
||||
// Paper End
|
||||
// Spigot End
|
||||
@ -22,7 +22,7 @@ index 6ea3833fc..d5efea027 100644
|
||||
|
||||
public void run() {
|
||||
try {
|
||||
@@ -936,9 +938,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -933,9 +935,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
this.methodProfiler.d().d();
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ index 6ea3833fc..d5efea027 100644
|
||||
this.methodProfiler.exitEnter("nextTickWait");
|
||||
this.ac = true;
|
||||
this.ab = Math.max(SystemUtils.getMonotonicMillis() + 50L, this.nextTick);
|
||||
@@ -946,6 +952,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -943,6 +949,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
this.methodProfiler.exit();
|
||||
this.methodProfiler.b();
|
||||
this.hasTicked = true;
|
||||
@ -45,10 +45,10 @@ index 6ea3833fc..d5efea027 100644
|
||||
} else {
|
||||
this.a((CrashReport) null);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 19b74f3ca..e9c5bb9dd 100644
|
||||
index d3a0a917..ba21c369 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2189,4 +2189,13 @@ public final class CraftServer implements Server {
|
||||
@@ -2214,4 +2214,13 @@ public final class CraftServer implements Server {
|
||||
return net.minecraft.server.MinecraftServer.currentTick;
|
||||
}
|
||||
// Paper end
|
||||
@ -63,7 +63,7 @@ index 19b74f3ca..e9c5bb9dd 100644
|
||||
+ // YAPFA end
|
||||
}
|
||||
diff --git a/src/main/java/org/spigotmc/TicksPerSecondCommand.java b/src/main/java/org/spigotmc/TicksPerSecondCommand.java
|
||||
index 6d21c3269..ce23b407d 100644
|
||||
index 6d21c326..ce23b407 100644
|
||||
--- a/src/main/java/org/spigotmc/TicksPerSecondCommand.java
|
||||
+++ b/src/main/java/org/spigotmc/TicksPerSecondCommand.java
|
||||
@@ -30,7 +30,7 @@ public class TicksPerSecondCommand extends Command
|
@ -1,4 +1,4 @@
|
||||
From 9bb528c0c5db42ba279c5e6189e6dc6670d7c384 Mon Sep 17 00:00:00 2001
|
||||
From 233bb958da7d0c1d336b932860d95a77205b21f1 Mon Sep 17 00:00:00 2001
|
||||
From: tr7zw <tr7zw@live.de>
|
||||
Date: Thu, 5 Mar 2020 22:31:50 +0100
|
||||
Subject: [PATCH] Add config, yapfa command and basic settings
|
||||
@ -8,14 +8,14 @@ Subject: [PATCH] Add config, yapfa command and basic settings
|
||||
src/main/java/de/tr7zw/yapfa/YapfaConfig.java | 219 ++++++++++++++++++
|
||||
.../net/minecraft/server/DedicatedServer.java | 9 +
|
||||
.../java/net/minecraft/server/Entity.java | 3 +-
|
||||
.../net/minecraft/server/EntityLiving.java | 9 +-
|
||||
5 files changed, 366 insertions(+), 3 deletions(-)
|
||||
.../net/minecraft/server/EntityLiving.java | 6 +-
|
||||
5 files changed, 364 insertions(+), 2 deletions(-)
|
||||
create mode 100644 src/main/java/de/tr7zw/yapfa/YapfaCommand.java
|
||||
create mode 100644 src/main/java/de/tr7zw/yapfa/YapfaConfig.java
|
||||
|
||||
diff --git a/src/main/java/de/tr7zw/yapfa/YapfaCommand.java b/src/main/java/de/tr7zw/yapfa/YapfaCommand.java
|
||||
new file mode 100644
|
||||
index 000000000..58ce1f826
|
||||
index 00000000..76d83f3d
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/de/tr7zw/yapfa/YapfaCommand.java
|
||||
@@ -0,0 +1,129 @@
|
||||
@ -148,9 +148,10 @@ index 000000000..58ce1f826
|
||||
+ Command.broadcastCommandMessage(sender, ChatColor.GREEN + "YAPFA config reload complete.");
|
||||
+ }
|
||||
+}
|
||||
\ No newline at end of file
|
||||
diff --git a/src/main/java/de/tr7zw/yapfa/YapfaConfig.java b/src/main/java/de/tr7zw/yapfa/YapfaConfig.java
|
||||
new file mode 100644
|
||||
index 000000000..71c04cf49
|
||||
index 00000000..9711cbc5
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/de/tr7zw/yapfa/YapfaConfig.java
|
||||
@@ -0,0 +1,219 @@
|
||||
@ -373,8 +374,9 @@ index 000000000..71c04cf49
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
\ No newline at end of file
|
||||
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
index 8a241c28a..c4006ff01 100644
|
||||
index 610826c9..2ed69f56 100644
|
||||
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
@@ -194,6 +194,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
@ -390,14 +392,14 @@ index 8a241c28a..c4006ff01 100644
|
||||
+ }
|
||||
+ de.tr7zw.yapfa.YapfaConfig.registerCommands();
|
||||
+ // YAPFA end
|
||||
com.tuinity.tuinity.config.TuinityConfig.init((File) options.valueOf("tuinity-settings")); // Tuinity - Server Config
|
||||
|
||||
this.setSpawnAnimals(dedicatedserverproperties.spawnAnimals);
|
||||
this.setSpawnNPCs(dedicatedserverproperties.spawnNpcs);
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index bfcf4a9b0..c27c1d5c2 100644
|
||||
index d2a224a8..45fdcee0 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -662,6 +662,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -761,6 +761,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
|
||||
try {
|
||||
this.inLava = false;
|
||||
@ -405,7 +407,7 @@ index bfcf4a9b0..c27c1d5c2 100644
|
||||
this.checkBlockCollisions();
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.a(throwable, "Checking entity block collision");
|
||||
@@ -786,7 +787,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -885,7 +886,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
VoxelShapeCollision voxelshapecollision = VoxelShapeCollision.a(this);
|
||||
VoxelShape voxelshape = this.world.getWorldBorder().a();
|
||||
Stream<VoxelShape> stream = VoxelShapes.c(voxelshape, VoxelShapes.a(axisalignedbb.shrink(1.0E-7D)), OperatorBoolean.AND) ? Stream.empty() : Stream.of(voxelshape);
|
||||
@ -415,10 +417,10 @@ index bfcf4a9b0..c27c1d5c2 100644
|
||||
Vec3D vec3d1 = vec3d.g() == 0.0D ? vec3d : a(this, vec3d, axisalignedbb, this.world, voxelshapecollision, streamaccumulator);
|
||||
boolean flag = vec3d.x != vec3d1.x;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 5b402690d..fa3affb54 100644
|
||||
index 5b402690..839b0f51 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -246,10 +246,11 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -246,6 +246,7 @@ public abstract class EntityLiving extends Entity {
|
||||
this.world.getMethodProfiler().enter("livingEntityBaseTick");
|
||||
boolean flag = this instanceof EntityHuman;
|
||||
|
||||
@ -426,11 +428,6 @@ index 5b402690d..fa3affb54 100644
|
||||
if (this.isAlive()) {
|
||||
if (this.inBlock()) {
|
||||
this.damageEntity(DamageSource.STUCK, 1.0F);
|
||||
- } else if (flag && !this.world.getWorldBorder().a(this.getBoundingBox())) {
|
||||
+ } else if (flag && !de.tr7zw.yapfa.YapfaConfig.disablePlayerOutOfWorldBorderCheck && !this.world.getWorldBorder().a(this.getBoundingBox())) { // YAPFA
|
||||
double d0 = this.world.getWorldBorder().a((Entity) this) + this.world.getWorldBorder().getDamageBuffer();
|
||||
|
||||
if (d0 < 0.0D) {
|
||||
@@ -261,6 +262,7 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
}
|
||||
@ -455,7 +452,7 @@ index 5b402690d..fa3affb54 100644
|
||||
|
||||
if (!this.world.isClientSide) {
|
||||
BlockPosition blockposition = new BlockPosition(this);
|
||||
@@ -2640,11 +2644,12 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -2640,7 +2644,7 @@ public abstract class EntityLiving extends Entity {
|
||||
this.e(new Vec3D((double) this.aZ, (double) this.ba, (double) this.bb));
|
||||
this.world.getMethodProfiler().exit();
|
||||
this.world.getMethodProfiler().enter("push");
|
||||
@ -464,11 +461,6 @@ index 5b402690d..fa3affb54 100644
|
||||
--this.bn;
|
||||
this.a(axisalignedbb, this.getBoundingBox());
|
||||
}
|
||||
|
||||
+ if(!de.tr7zw.yapfa.YapfaConfig.disableEntityCollisions) // YAPFA
|
||||
this.collideNearby();
|
||||
this.world.getMethodProfiler().exit();
|
||||
}
|
||||
--
|
||||
2.25.1.windows.1
|
||||
|
@ -1,4 +1,4 @@
|
||||
From ead0f031e6ffc43a68ed0842ef4896bde0fd13ec Mon Sep 17 00:00:00 2001
|
||||
From 9ae232d05c7db4372c14cd33c9ef11e29770c731 Mon Sep 17 00:00:00 2001
|
||||
From: tr7zw <tr7zw@live.de>
|
||||
Date: Thu, 5 Mar 2020 23:08:01 +0100
|
||||
Subject: [PATCH] Kill the vanilla "GameProfiler"
|
||||
@ -11,7 +11,7 @@ Subject: [PATCH] Kill the vanilla "GameProfiler"
|
||||
|
||||
diff --git a/src/main/java/de/tr7zw/yapfa/GameProfilerDisabled.java b/src/main/java/de/tr7zw/yapfa/GameProfilerDisabled.java
|
||||
new file mode 100644
|
||||
index 000000000..96a2270a8
|
||||
index 00000000..96a2270a
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/de/tr7zw/yapfa/GameProfilerDisabled.java
|
||||
@@ -0,0 +1,51 @@
|
||||
@ -67,10 +67,10 @@ index 000000000..96a2270a8
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index d5efea027..692c0cac9 100644
|
||||
index 0276abe1..e803c968 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -82,7 +82,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -80,7 +80,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
private final MojangStatisticsGenerator snooper = new MojangStatisticsGenerator("server", this, SystemUtils.getMonotonicMillis());
|
||||
public File universe;
|
||||
private final List<Runnable> tickables = Lists.newArrayList();
|
||||
@ -79,7 +79,7 @@ index d5efea027..692c0cac9 100644
|
||||
private ServerConnection serverConnection;
|
||||
public final WorldLoadListenerFactory worldLoadListenerFactory;
|
||||
private final ServerPing serverPing = new ServerPing();
|
||||
@@ -935,7 +935,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -932,7 +932,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
this.nextTick += 50L;
|
||||
if (this.T) {
|
||||
this.T = false;
|
@ -1,138 +0,0 @@
|
||||
From af216c33212a285dbcb0b6255c568d005d91de43 Mon Sep 17 00:00:00 2001
|
||||
From: tr7zw <tr7zw@live.de>
|
||||
Date: Fri, 6 Mar 2020 20:28:47 +0100
|
||||
Subject: [PATCH] Rewrite the PathfinderGoalSelector class
|
||||
|
||||
---
|
||||
.../server/PathfinderGoalSelector.java | 79 +++++++++++++++++--
|
||||
1 file changed, 72 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java
|
||||
index 935136771..8e5b944b2 100644
|
||||
--- a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java
|
||||
+++ b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java
|
||||
@@ -1,9 +1,14 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
+
|
||||
+import net.minecraft.server.PathfinderGoal.Type;
|
||||
+
|
||||
import java.util.EnumMap;
|
||||
import java.util.EnumSet;
|
||||
+import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
+import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Stream;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
@@ -58,9 +63,16 @@ public class PathfinderGoalSelector {
|
||||
// Paper end
|
||||
|
||||
public void a(PathfinderGoal pathfindergoal) {
|
||||
- this.d.stream().filter((pathfindergoalwrapped) -> {
|
||||
+ // YAPFA start
|
||||
+ for(PathfinderGoalWrapped goal : this.d) {
|
||||
+ if(goal.j() == pathfindergoal && goal.g()) {
|
||||
+ goal.d();
|
||||
+ }
|
||||
+ }
|
||||
+ /*this.d.stream().filter((pathfindergoalwrapped) -> {
|
||||
return pathfindergoalwrapped.j() == pathfindergoal;
|
||||
- }).filter(PathfinderGoalWrapped::g).forEach(PathfinderGoalWrapped::d);
|
||||
+ }).filter(PathfinderGoalWrapped::g).forEach(PathfinderGoalWrapped::d);*/
|
||||
+ // YAPFA end
|
||||
this.d.removeIf((pathfindergoalwrapped) -> {
|
||||
return pathfindergoalwrapped.j() == pathfindergoal;
|
||||
});
|
||||
@@ -68,7 +80,24 @@ public class PathfinderGoalSelector {
|
||||
|
||||
public void doTick() {
|
||||
this.e.enter("goalCleanup");
|
||||
- this.c().filter((pathfindergoalwrapped) -> {
|
||||
+ // YAPFA start
|
||||
+ for (PathfinderGoalWrapped goal : this.d) {
|
||||
+ if (goal.g() && !goal.b()) {
|
||||
+ boolean flag = true;
|
||||
+
|
||||
+ for(Type t : goal.i()) {
|
||||
+ if(this.f.contains(t)) {
|
||||
+ flag = false;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (flag) {
|
||||
+ goal.d();
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ this.c.entrySet().removeIf(ent -> !ent.getValue().g());
|
||||
+ /*this.c().filter((pathfindergoalwrapped) -> {
|
||||
boolean flag;
|
||||
|
||||
if (pathfindergoalwrapped.g()) {
|
||||
@@ -90,10 +119,38 @@ public class PathfinderGoalSelector {
|
||||
this.c.remove(pathfindergoal_type);
|
||||
}
|
||||
|
||||
- });
|
||||
+ });*/
|
||||
+ // YAPFA end
|
||||
this.e.exit();
|
||||
this.e.enter("goalUpdate");
|
||||
- this.d.stream().filter((pathfindergoalwrapped) -> {
|
||||
+ // YAPFA start
|
||||
+ for(PathfinderGoalWrapped goal : this.d) {
|
||||
+ if(!goal.g() && goal.a()) {
|
||||
+ boolean noneMatch = true;
|
||||
+ for(Type t : goal.i()) {
|
||||
+ if(this.f.contains(t)) {
|
||||
+ noneMatch = false;
|
||||
+ }
|
||||
+ }
|
||||
+ if(noneMatch) {
|
||||
+ boolean allMatch = true;
|
||||
+ for(Type t : goal.i()) {
|
||||
+ if(!this.c.getOrDefault(t, PathfinderGoalSelector.b).a(goal)){
|
||||
+ allMatch = false;
|
||||
+ }
|
||||
+ }
|
||||
+ if(allMatch) {
|
||||
+ for(Type t : goal.i()) {
|
||||
+ PathfinderGoalWrapped pathfindergoalwrapped1 = (PathfinderGoalWrapped) this.c.getOrDefault(t, PathfinderGoalSelector.b);
|
||||
+ pathfindergoalwrapped1.d();
|
||||
+ this.c.put(t, goal);
|
||||
+ }
|
||||
+ goal.c();
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ /*this.d.stream().filter((pathfindergoalwrapped) -> {
|
||||
return !pathfindergoalwrapped.g();
|
||||
}).filter((pathfindergoalwrapped) -> {
|
||||
Stream stream = pathfindergoalwrapped.i().stream();
|
||||
@@ -113,10 +170,18 @@ public class PathfinderGoalSelector {
|
||||
this.c.put(pathfindergoal_type, pathfindergoalwrapped);
|
||||
});
|
||||
pathfindergoalwrapped.c();
|
||||
- });
|
||||
+ });*/
|
||||
+ // YAPFA end
|
||||
this.e.exit();
|
||||
this.e.enter("goalTick");
|
||||
- this.c().forEach(PathfinderGoalWrapped::e);
|
||||
+ // YAPFA start
|
||||
+ for(PathfinderGoalWrapped goal : this.d) {
|
||||
+ if(goal.g()) {
|
||||
+ goal.e();
|
||||
+ }
|
||||
+ }
|
||||
+ //this.c().forEach(PathfinderGoalWrapped::e);
|
||||
+ // YAPFA end
|
||||
this.e.exit();
|
||||
}
|
||||
|
||||
--
|
||||
2.25.1.windows.1
|
||||
|
@ -1,218 +0,0 @@
|
||||
From b8b3b931ccfa1f390db02deb97a830c537284652 Mon Sep 17 00:00:00 2001
|
||||
From: froobynooby <froobynooby@froobworld.com>
|
||||
Date: Thu, 20 Feb 2020 15:50:49 +0930
|
||||
Subject: [PATCH] PAPER Reduce entity tracker updates on move
|
||||
|
||||
With this patch, for each player we keep track of a set of
|
||||
entities that the player is tracking. This is used to split
|
||||
the entity tracker update logic in the movePlayer method in
|
||||
PlayerChunkMap in to two parts:
|
||||
* Full update: Run through all entity trackers and update them
|
||||
* Partial update: Run through all entity trackers for entities
|
||||
the player is already tracking and update them
|
||||
|
||||
Partial updates will always take less time than full updates,
|
||||
usually by a considerable amount if players and entities are
|
||||
spread out over the map. Assuming they are evenly spread,
|
||||
and given there are x many players, it would be expected to
|
||||
take 1/x the time of a full update.
|
||||
|
||||
Full updates are only run if the following conditions are met:
|
||||
* It has been 20 ticks since the last full update
|
||||
* The player has moved over set distance since the last full
|
||||
update (distance is configurable)
|
||||
|
||||
The motivation for the first condition is that the client
|
||||
sends the server its position once a second, which calls
|
||||
movePlayer, so at a minimum we want to be sending the player
|
||||
an updated set of entities it can see every second.
|
||||
|
||||
The motivation for the second condition is that looping
|
||||
through every entity in world to check if it is now within
|
||||
the tracking range after the player has moved 0.1 blocks is
|
||||
largely unnecessary. Checking only after the player has moved
|
||||
1 or 2 blocks is far better for performance, and very unlikely
|
||||
to give any noticeable side effects.
|
||||
|
||||
In testing, this has reduced the time taken for movement
|
||||
packet processing by up to 4x. Packet processing for movement
|
||||
packets often show up as a major contributor to TPS loss in
|
||||
servers with large player counts
|
||||
---
|
||||
.../destroystokyo/paper/PaperWorldConfig.java | 5 ++
|
||||
.../net/minecraft/server/EntityPlayer.java | 4 ++
|
||||
.../net/minecraft/server/PlayerChunkMap.java | 63 ++++++++++++++++++-
|
||||
3 files changed, 70 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 7d408542e..2ae44b230 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -658,4 +658,9 @@ public class PaperWorldConfig {
|
||||
private void nerfNetherPortalPigmen() {
|
||||
nerfNetherPortalPigmen = getBoolean("game-mechanics.nerf-pigmen-from-nether-portals", nerfNetherPortalPigmen);
|
||||
}
|
||||
+
|
||||
+ public double trackerUpdateDistance = 1;
|
||||
+ private void trackeruUpdateDistance() {
|
||||
+ trackerUpdateDistance = getDouble("tracker-update-distance", trackerUpdateDistance);
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index e7bfbc330..43774bc9a 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -86,6 +86,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
public final int[] mobCounts = new int[ENUMCREATURETYPE_TOTAL_ENUMS]; // Paper
|
||||
public final com.destroystokyo.paper.util.PooledHashSets.PooledObjectLinkedOpenHashSet<EntityPlayer> cachedSingleMobDistanceMap;
|
||||
// Paper end
|
||||
+ // Paper start - Reduce entity tracker updates on move
|
||||
+ public Vec3D lastTrackedPosition = new Vec3D(0, 0, 0);
|
||||
+ public long lastTrackedTick;
|
||||
+ // Paper end
|
||||
|
||||
// CraftBukkit start
|
||||
public String displayName;
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
index 57bea926a..d971a4426 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
@@ -133,6 +133,39 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
}
|
||||
|
||||
|
||||
+ // Paper end
|
||||
+
|
||||
+ // Paper start - Reduce entity tracker updates on move
|
||||
+ private double trackerUpdateDistanceSquared;
|
||||
+ private final Int2ObjectMap<Int2ObjectMap<PlayerChunkMap.EntityTracker>> playerTrackedEntities = new Int2ObjectOpenHashMap();
|
||||
+ private final Int2ObjectMap<Queue<Integer>> playerTrackedEntitiesRemoveQueue = new Int2ObjectOpenHashMap();
|
||||
+
|
||||
+ void flushRemoveQueue(EntityPlayer entityplayer) {
|
||||
+ Queue<Integer> removeQueue = getPlayerTrackedEntityMapRemoveQueue(entityplayer.getId());
|
||||
+ Int2ObjectMap<PlayerChunkMap.EntityTracker> entityMap = getPlayerTrackedEntityMap(entityplayer.getId());
|
||||
+ for (Integer id = removeQueue.poll(); id != null; id = removeQueue.poll()) {
|
||||
+ entityMap.remove(id);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ void flushRemoveQueues() {
|
||||
+ for (Int2ObjectMap.Entry<Queue<Integer>> entry : playerTrackedEntitiesRemoveQueue.int2ObjectEntrySet()) {
|
||||
+ Int2ObjectMap entityMap = getPlayerTrackedEntityMap(entry.getKey());
|
||||
+ Queue<Integer> removeQueue = entry.getValue();
|
||||
+ for (Integer id = removeQueue.poll(); id != null; id = removeQueue.poll()) {
|
||||
+ entityMap.remove(id);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ Int2ObjectMap getPlayerTrackedEntityMap(int id) {
|
||||
+ return playerTrackedEntities.computeIfAbsent(id, i -> new Int2ObjectOpenHashMap());
|
||||
+ }
|
||||
+
|
||||
+ Queue<Integer> getPlayerTrackedEntityMapRemoveQueue(int id) {
|
||||
+ return playerTrackedEntitiesRemoveQueue.computeIfAbsent(id, i -> new java.util.ArrayDeque<>());
|
||||
+ }
|
||||
+
|
||||
// Paper end
|
||||
|
||||
public PlayerChunkMap(WorldServer worldserver, File file, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler<Runnable> iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator<?> chunkgenerator, WorldLoadListener worldloadlistener, Supplier<WorldPersistentData> supplier, int i) {
|
||||
@@ -167,6 +200,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
this.m = new VillagePlace(new File(this.w, "poi"), datafixer, this.world); // Paper
|
||||
this.setViewDistance(i);
|
||||
this.playerMobDistanceMap = this.world.paperConfig.perPlayerMobSpawns ? new com.destroystokyo.paper.util.PlayerMobDistanceMap() : null; // Paper
|
||||
+ this.trackerUpdateDistanceSquared = Math.pow(this.world.paperConfig.trackerUpdateDistance, 2); // Paper
|
||||
}
|
||||
|
||||
public void updatePlayerMobTypeMap(Entity entity) {
|
||||
@@ -1334,8 +1368,19 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
}
|
||||
|
||||
public void movePlayer(EntityPlayer entityplayer) {
|
||||
- ObjectIterator objectiterator = this.trackedEntities.values().iterator();
|
||||
+ // Paper start
|
||||
+ // ObjectIterator objectiterator = this.trackedEntities.values().iterator();
|
||||
+ ObjectIterator objectiterator;
|
||||
|
||||
+ if (MinecraftServer.currentTick - entityplayer.lastTrackedTick >= 20
|
||||
+ || entityplayer.lastTrackedPosition.distanceSquared(entityplayer.getPositionVector()) >= trackerUpdateDistanceSquared) {
|
||||
+ entityplayer.lastTrackedPosition = entityplayer.getPositionVector();
|
||||
+ entityplayer.lastTrackedTick = MinecraftServer.currentTick;
|
||||
+ objectiterator = this.trackedEntities.values().iterator(); // Update all entity trackers
|
||||
+ } else {
|
||||
+ objectiterator = getPlayerTrackedEntityMap(entityplayer.getId()).values().iterator(); // Only update entity trackers for already tracked entities
|
||||
+ }
|
||||
+ // Paper end
|
||||
while (objectiterator.hasNext()) {
|
||||
PlayerChunkMap.EntityTracker playerchunkmap_entitytracker = (PlayerChunkMap.EntityTracker) objectiterator.next();
|
||||
|
||||
@@ -1345,6 +1390,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
playerchunkmap_entitytracker.updatePlayer(entityplayer);
|
||||
}
|
||||
}
|
||||
+ flushRemoveQueues(); // Paper
|
||||
|
||||
int i = MathHelper.floor(entityplayer.locX()) >> 4;
|
||||
int j = MathHelper.floor(entityplayer.locZ()) >> 4;
|
||||
@@ -1486,12 +1532,21 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
|
||||
playerchunkmap_entitytracker.clear(entityplayer);
|
||||
}
|
||||
+ // Paper start
|
||||
+ playerTrackedEntities.remove(entityplayer.getId());
|
||||
+ playerTrackedEntitiesRemoveQueue.remove(entityplayer.getId());
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
PlayerChunkMap.EntityTracker playerchunkmap_entitytracker1 = (PlayerChunkMap.EntityTracker) this.trackedEntities.remove(entity.getId());
|
||||
|
||||
if (playerchunkmap_entitytracker1 != null) {
|
||||
playerchunkmap_entitytracker1.a();
|
||||
+ // Paper start
|
||||
+ for (EntityPlayer player : playerchunkmap_entitytracker1.trackedPlayers) {
|
||||
+ getPlayerTrackedEntityMap(player.getId()).remove(playerchunkmap_entitytracker1.tracker.getId());
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
entity.tracker = null; // Paper - We're no longer tracked
|
||||
}
|
||||
@@ -1532,7 +1587,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
}
|
||||
world.timings.tracker2.stopTiming(); // Paper
|
||||
}
|
||||
-
|
||||
+ flushRemoveQueues(); // Paper
|
||||
|
||||
}
|
||||
|
||||
@@ -1581,6 +1636,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
}
|
||||
}
|
||||
}
|
||||
+ flushRemoveQueue(entityplayer); // Paper
|
||||
|
||||
Iterator iterator;
|
||||
Entity entity1;
|
||||
@@ -1677,6 +1733,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
org.spigotmc.AsyncCatcher.catchOp("player tracker clear"); // Spigot
|
||||
if (this.trackedPlayers.remove(entityplayer)) {
|
||||
this.trackerEntry.a(entityplayer);
|
||||
+ getPlayerTrackedEntityMap(entityplayer.getId()).remove(this.tracker.getId()); // Paper
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1713,9 +1770,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
|
||||
if (flag1 && this.trackedPlayerMap.putIfAbsent(entityplayer, true) == null) { // Paper
|
||||
this.trackerEntry.b(entityplayer);
|
||||
+ getPlayerTrackedEntityMap(entityplayer.getId()).put(this.tracker.getId(), this); // Paper
|
||||
}
|
||||
} else if (this.trackedPlayers.remove(entityplayer)) {
|
||||
this.trackerEntry.a(entityplayer);
|
||||
+ getPlayerTrackedEntityMapRemoveQueue(entityplayer.getId()).add(this.tracker.getId()); // Paper
|
||||
}
|
||||
|
||||
}
|
||||
--
|
||||
2.25.1.windows.1
|
||||
|
@ -9,7 +9,7 @@ done
|
||||
. $(dirname $SOURCE)/init.sh
|
||||
PS1="$"
|
||||
|
||||
paperVer=$(cat current-paper)
|
||||
tuinityVer=$(cat current-tuinity)
|
||||
gpgsign="$(git config commit.gpgsign || echo "false")"
|
||||
|
||||
echo "Rebuilding Forked projects.... "
|
||||
@ -69,8 +69,8 @@ function enableCommitSigningIfNeeded {
|
||||
}
|
||||
|
||||
(
|
||||
(applyPatch Paper/Paper-API ${FORK_NAME}-API HEAD api $API_REPO &&
|
||||
applyPatch Paper/Paper-Server ${FORK_NAME}-Server HEAD server $SERVER_REPO) || exit 1
|
||||
(applyPatch Tuinity/Tuinity-API ${FORK_NAME}-API HEAD api $API_REPO &&
|
||||
applyPatch Tuinity/Tuinity-Server ${FORK_NAME}-Server HEAD server $SERVER_REPO) || exit 1
|
||||
enableCommitSigningIfNeeded
|
||||
) || (
|
||||
echo "Failed to apply patches"
|
||||
|
@ -7,9 +7,9 @@ function changelog() {
|
||||
base=$(git ls-tree HEAD $1 | cut -d' ' -f3 | cut -f1)
|
||||
cd $1 && git log --oneline ${base}...HEAD
|
||||
}
|
||||
paper=$(changelog Paper)
|
||||
tuinity=$(changelog Tuinity)
|
||||
|
||||
log="Updated Paper \n\nUpdating our baseline Paper reference\n\nPaper changes since last:\n$paper"
|
||||
log="Updated Tuinity \n\nUpdating our baseline Tuinity reference\n\nTuinity changes since last:\n$tuinity"
|
||||
|
||||
echo -e "$log" | git commit -F -
|
||||
|
||||
|
@ -10,10 +10,10 @@ done
|
||||
|
||||
|
||||
cd $basedir
|
||||
paperVer=$(cat current-paper)
|
||||
tuinityVer=$(cat current-tuinity)
|
||||
|
||||
minecraftversion=$(cat $basedir/Paper/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4)
|
||||
decompile="Paper/work/Minecraft/$minecraftversion/spigot"
|
||||
minecraftversion=$(cat $basedir/Tuinity/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4)
|
||||
decompile="Tuinity/work/Minecraft/$minecraftversion/spigot"
|
||||
|
||||
mkdir -p mc-dev/src/net/minecraft/server
|
||||
|
||||
@ -29,7 +29,7 @@ do
|
||||
done
|
||||
|
||||
|
||||
base="$basedir/Paper/Paper-Server/src/main/java/net/minecraft/server"
|
||||
base="$basedir/Tuinity/Tuinity-Server/src/main/java/net/minecraft/server"
|
||||
cd $basedir/mc-dev/src/net/minecraft/server/
|
||||
for file in $(/bin/ls $base)
|
||||
do
|
||||
@ -40,4 +40,4 @@ done
|
||||
cd $basedir/mc-dev
|
||||
git add . -A
|
||||
git commit . -m "mc-dev"
|
||||
git tag -a "$paperVer" -m "$paperVer" 2>/dev/null
|
||||
git tag -a "$tuinityVer" -m "$tuinityVer" 2>/dev/null
|
||||
|
@ -8,8 +8,8 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
|
||||
done
|
||||
. $(dirname $SOURCE)/init.sh
|
||||
|
||||
workdir=$basedir/Paper/work
|
||||
minecraftversion=$(cat $basedir/Paper/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4)
|
||||
workdir=$basedir/Tuinity/work
|
||||
minecraftversion=$(cat $basedir/Tuinity/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4)
|
||||
decompiledir=$workdir/Minecraft/$minecraftversion/spigot
|
||||
|
||||
nms="net/minecraft/server"
|
||||
@ -18,13 +18,13 @@ cd $basedir
|
||||
|
||||
export importedmcdev=""
|
||||
function import {
|
||||
if [ -f "$basedir/Paper/Paper-Server/src/main/java/net/minecraft/server/$1.java" ]; then
|
||||
if [ -f "$basedir/Tuinity/Tuinity-Server/src/main/java/net/minecraft/server/$1.java" ]; then
|
||||
echo "ALREADY IMPORTED $1"
|
||||
return 0
|
||||
fi
|
||||
export importedmcdev="$importedmcdev $1"
|
||||
file="${1}.java"
|
||||
target="$basedir/Paper/Paper-Server/src/main/java/$nms/$file"
|
||||
target="$basedir/Tuinity/Tuinity-Server/src/main/java/$nms/$file"
|
||||
base="$decompiledir/$nms/$file"
|
||||
|
||||
if [[ ! -f "$target" ]]; then
|
||||
@ -43,7 +43,7 @@ function importLibrary {
|
||||
shift 3
|
||||
for file in "$@"; do
|
||||
file="$prefix/$file"
|
||||
target="$basedir/Paper/Paper-Server/src/main/java/${file}"
|
||||
target="$basedir/Tuinity/Tuinity-Server/src/main/java/${file}"
|
||||
targetdir=$(dirname "$target")
|
||||
mkdir -p "${targetdir}"
|
||||
base="$workdir/Minecraft/$minecraftversion/libraries/${group}/${lib}/$file"
|
||||
@ -57,7 +57,7 @@ function importLibrary {
|
||||
}
|
||||
|
||||
(
|
||||
cd Paper/Paper-Server/
|
||||
cd Tuinity/Tuinity-Server/
|
||||
lastlog=$(git log -1 --oneline)
|
||||
if [[ "$lastlog" = *"EMC-Extra mc-dev Imports"* ]]; then
|
||||
git reset --hard HEAD^
|
||||
@ -78,7 +78,7 @@ function containsElement {
|
||||
for f in $files; do
|
||||
containsElement "$f" ${nonnms[@]}
|
||||
if [ "$?" == "1" ]; then
|
||||
if [ ! -f "$basedir/Paper/Paper-Server/src/main/java/net/minecraft/server/$f.java" ]; then
|
||||
if [ ! -f "$basedir/Tuinity/Tuinity-Server/src/main/java/net/minecraft/server/$f.java" ]; then
|
||||
if [ ! -f "$decompiledir/$nms/$f.java" ]; then
|
||||
echo "$(bashColor 1 31) ERROR!!! Missing NMS$(bashColor 1 34) $f $(bashColorReset)";
|
||||
else
|
||||
@ -111,7 +111,7 @@ done
|
||||
########################################################
|
||||
########################################################
|
||||
(
|
||||
cd Paper/Paper-Server/
|
||||
cd Tuinity/Tuinity-Server/
|
||||
rm -rf nms-patches
|
||||
git add src -A
|
||||
echo -e "EMC-Extra mc-dev Imports\n\n$MODLOG" | git commit src -F -
|
||||
|
@ -8,6 +8,6 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
|
||||
done
|
||||
. $(dirname $SOURCE)/init.sh
|
||||
|
||||
minecraftversion=$(cat $basedir/Paper/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4)
|
||||
minecraftversion=$(cat $basedir/Tuinity/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4)
|
||||
|
||||
basedir
|
||||
|
@ -40,9 +40,9 @@ function savePatches {
|
||||
|
||||
savePatches ${FORK_NAME}-API api
|
||||
if [ -f "$basedir/${FORK_NAME}-API/.git/patch-apply-failed" ]; then
|
||||
echo "$(bashColor 1 31)[[[ WARNING ]]] $(bashColor 1 33)- Not saving Paper-Server as it appears ${FORK_NAME}-API did not apply clean.$(bashColorReset)"
|
||||
echo "$(bashColor 1 31)[[[ WARNING ]]] $(bashColor 1 33)- Not saving Tuinity-Server as it appears ${FORK_NAME}-API did not apply clean.$(bashColorReset)"
|
||||
echo "$(bashColor 1 33)If this is a mistake, delete $(bashColor 1 34)${FORK_NAME}-API/.git/patch-apply-failed$(bashColor 1 33) and run rebuild again.$(bashColorReset)"
|
||||
echo "$(bashColor 1 33)Otherwise, rerun ./paper patch to have a clean Paper-API apply so the latest Paper-Server can build.$(bashColorReset)"
|
||||
echo "$(bashColor 1 33)Otherwise, rerun ./tuinity patch to have a clean Tuinity-API apply so the latest Tuinity-Server can build.$(bashColorReset)"
|
||||
else
|
||||
savePatches ${FORK_NAME}-Server server
|
||||
${basedir}/scripts/push.sh
|
||||
|
@ -10,33 +10,33 @@ done
|
||||
|
||||
if [[ "$1" == up* ]]; then
|
||||
(
|
||||
cd "$basedir/Paper/"
|
||||
cd "$basedir/Tuinity/"
|
||||
git fetch && git reset --hard origin/ver/1.14
|
||||
cd ../
|
||||
git add Paper
|
||||
git add Tuinity
|
||||
)
|
||||
fi
|
||||
|
||||
paperVer=$(gethead Paper)
|
||||
cd "$basedir/Paper/"
|
||||
tuinityVer=$(gethead Tuinity)
|
||||
cd "$basedir/Tuinity/"
|
||||
|
||||
./paper patch
|
||||
./tuinity patch
|
||||
|
||||
cd "Paper-Server"
|
||||
cd "Tuinity-Server"
|
||||
mcVer=$(mvn -o org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=minecraft_version | sed -n -e '/^\[.*\]/ !{ /^[0-9]/ { p; q } }')
|
||||
|
||||
basedir
|
||||
. $basedir/scripts/importmcdev.sh
|
||||
|
||||
minecraftversion=$(cat $basedir/Paper/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4)
|
||||
version=$(echo -e "Paper: $paperVer\nmc-dev:$importedmcdev")
|
||||
minecraftversion=$(cat $basedir/Tuinity/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4)
|
||||
version=$(echo -e "Tuinity: $tuinityVer\nmc-dev:$importedmcdev")
|
||||
tag="${minecraftversion}-${mcVer}-$(echo -e $version | shasum | awk '{print $1}')"
|
||||
echo "$tag" > $basedir/current-paper
|
||||
git add "$basedir/current-paper"
|
||||
echo "$tag" > $basedir/current-tuinity
|
||||
git add "$basedir/current-tuinity"
|
||||
|
||||
$basedir/scripts/generatesources.sh
|
||||
|
||||
cd Paper/
|
||||
cd Tuinity/
|
||||
|
||||
function tag {
|
||||
(
|
||||
@ -51,10 +51,10 @@ echo "Tagging as $tag"
|
||||
echo -e "$version"
|
||||
|
||||
forcetag=0
|
||||
if [ "$(cat $basedir/current-paper)" != "$tag" ]; then
|
||||
if [ "$(cat $basedir/current-tuinity)" != "$tag" ]; then
|
||||
forcetag=1
|
||||
fi
|
||||
|
||||
tag Paper-API $forcetag
|
||||
tag Paper-Server $forcetag
|
||||
tag Tuinity-API $forcetag
|
||||
tag Tuinity-Server $forcetag
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user