mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2024-11-22 10:35:42 +01:00
Upstream (#447)
* Updated Upstream and Sidestream(s) (Paper/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 4b78c0b80 [CI-SKIP] [Auto] Rebuild Patches 2d9ff13eb forced whitelist: use configuable kick message (fixes #5417) (#5418) 000cec2ab bug #5432 - post modern event even if legacy event is cancelled 6c83bc6e5 Remove from Map by key 857852c28 Make sure to remove correct TE during TE tick f7b4abb25 [Auto] Updated Upstream (Bukkit/CraftBukkit) Airplane Changes: 9a4bd85 Remove Multithreaded Tracker 1068498 Updated Upstream (Tuinity) Purpur Changes: 083a86e [ci-skip] Update for Toothpick changes 8b9b214 Updated Upstream (Paper & Tuinity) Empirecraft Changes: 6b5cffc2 Updated Paper * Updated Upstream and Sidestream(s) (Airplane/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Airplane Changes: 3ed988c Use AIR library for configuration parsing Purpur Changes: 9631959 Add 5 sec TPS to GUI (#260) 2a0a5e6 [ci-skip] Bump Toothpick Kotlin version 02b3444 Add back multithreaded entity tracker 43b4a2f Updated Upstream (Paper & Airplane) * update gradle from 6.8.2 to 6.8.3 * fix build (hopefully) * Updated Upstream and Sidestream(s) (Paper) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 211f8e041 Prevent light queue overfill when no players are online * well that was dumb * FINALLY it works * Updated Upstream and Sidestream(s) (Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Empirecraft Changes: 018fcff7 Updated Paper
This commit is contained in:
parent
774d9325cf
commit
679a88af3f
@ -267,7 +267,6 @@ # Patches
|
||||
| server | Make entity tracker use highest range of passengers | Spottedleaf | |
|
||||
| server | Make lava flow speed configurable | William Blake Galbreath | |
|
||||
| server | Make sure inlined getChunkAt has inlined logic for loaded | Spottedleaf | |
|
||||
| server | Make sure to remove correct TE during TE tick | Spottedleaf | |
|
||||
| server | Manually inline methods in BlockPosition | Spottedleaf | |
|
||||
| server | Mending mends most damages equipment first | William Blake Galbreath | |
|
||||
| server | Modify POM | YatopiaMC | |
|
||||
@ -331,7 +330,6 @@ # Patches
|
||||
| server | Players should not cram to death | William Blake Galbreath | |
|
||||
| server | Populator seed controls | Spottedleaf | |
|
||||
| server | Preload ProtocolLib EnumWrappers | ishland | |
|
||||
| server | Prevent light queue overfill when no players are online | Spottedleaf | |
|
||||
| server | Prevent long map entry creation in light engine | Spottedleaf | |
|
||||
| server | Prevent unload() calls removing tickets for sync loads | Spottedleaf | |
|
||||
| server | Projectile offset config | YouHaveTrouble | |
|
||||
@ -399,7 +397,6 @@ # Patches
|
||||
| server | Toggle for Zombified Piglin death always counting as player | jmp | |
|
||||
| server | Toggle for water sensitive mob damage | YouHaveTrouble | |
|
||||
| server | Totems work in inventory | draycia | |
|
||||
| server | Track Queue debug | Paul Sauve | |
|
||||
| server | Tuinity POM Changes | Spottedleaf | |
|
||||
| api | Tuinity POM Changes | Spottedleaf | |
|
||||
| server | Tuinity Server Config | Spottedleaf | |
|
||||
|
2
Paper
2
Paper
@ -1 +1 @@
|
||||
Subproject commit 8b47131da76e9a0e4da00d1888950a6e4fa3d07b
|
||||
Subproject commit 211f8e041c69147d305897bfbba251295e93eaa9
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
@ -72,7 +72,7 @@ index 7063f1da3654b382e26b0093ad5d0ff04a2b38c2..b9c5479e5561f8fe68ea8f94fbf4e64d
|
||||
|
||||
return history != null ? TextComponent.ofChildren(updateMessage, Component.newline(), history) : updateMessage;
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index e757cb5c2d50cb3a4dbe50d4726db09ab845fcbb..7cbbc1b1161f26f22a7f7832395af0d4a781cb1a 100644
|
||||
index 02d8a8f13d81c47316f704fb700afd0214a5f546..ca10d901ebd56bdee54f3c8cf607a5a34cd79f32 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1636,7 +1636,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
|
@ -21,14 +21,34 @@ GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index a3a3b17f3b30b55bb50905353e77723091bb5c1f..f9ead3ed315a3e726233545f35358cca0fc68e06 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -159,6 +159,13 @@
|
||||
<version>1.1.0-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
+ <!-- Airplane Config -->
|
||||
+ <dependency>
|
||||
+ <groupId>com.github.technove</groupId>
|
||||
+ <artifactId>AIR</artifactId>
|
||||
+ <version>fe3dbb4420</version>
|
||||
+ <scope>compile</scope>
|
||||
+ </dependency>
|
||||
</dependencies>
|
||||
|
||||
<!-- This builds a completely 'ready to start' jar with all dependencies inside -->
|
||||
diff --git a/src/main/java/gg/airplane/AirplaneCommand.java b/src/main/java/gg/airplane/AirplaneCommand.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..1fa9b40e2f89272fa8bc9d927a9a852b5eb0db22
|
||||
index 0000000000000000000000000000000000000000..89c89e633f14b5820147e734b1b7ad8cadfdce80
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/gg/airplane/AirplaneCommand.java
|
||||
@@ -0,0 +1,56 @@
|
||||
@@ -0,0 +1,65 @@
|
||||
+package gg.airplane;
|
||||
+
|
||||
+import net.kyori.adventure.text.Component;
|
||||
+import net.kyori.adventure.text.format.NamedTextColor;
|
||||
+import net.md_5.bungee.api.ChatColor;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+import org.bukkit.Bukkit;
|
||||
@ -36,6 +56,7 @@ index 0000000000000000000000000000000000000000..1fa9b40e2f89272fa8bc9d927a9a852b
|
||||
+import org.bukkit.command.Command;
|
||||
+import org.bukkit.command.CommandSender;
|
||||
+
|
||||
+import java.io.IOException;
|
||||
+import java.util.Collections;
|
||||
+import java.util.List;
|
||||
+import java.util.stream.Collectors;
|
||||
@ -72,7 +93,13 @@ index 0000000000000000000000000000000000000000..1fa9b40e2f89272fa8bc9d927a9a852b
|
||||
+
|
||||
+ if (args[0].equalsIgnoreCase("reload")) {
|
||||
+ MinecraftServer console = MinecraftServer.getServer();
|
||||
+ AirplaneConfig.load();
|
||||
+ try {
|
||||
+ AirplaneConfig.load();
|
||||
+ } catch (IOException e) {
|
||||
+ sender.sendMessage(Component.text("Failed to reload.", NamedTextColor.RED));
|
||||
+ e.printStackTrace();
|
||||
+ return true;
|
||||
+ }
|
||||
+ console.server.reloadCount++;
|
||||
+
|
||||
+ Command.broadcastCommandMessage(sender, prefix + "Airplane configuration has been reloaded.");
|
||||
@ -85,37 +112,42 @@ index 0000000000000000000000000000000000000000..1fa9b40e2f89272fa8bc9d927a9a852b
|
||||
+}
|
||||
diff --git a/src/main/java/gg/airplane/AirplaneConfig.java b/src/main/java/gg/airplane/AirplaneConfig.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..fbb9544027a48941bd0938d8f607e8c7ff9443a1
|
||||
index 0000000000000000000000000000000000000000..ab019b577002677a4ce788106f8e5a1d7757a2ae
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/gg/airplane/AirplaneConfig.java
|
||||
@@ -0,0 +1,47 @@
|
||||
@@ -0,0 +1,50 @@
|
||||
+package gg.airplane;
|
||||
+
|
||||
+import gg.airplane.manual.ManualParser;
|
||||
+import co.technove.air.AIR;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+import org.apache.logging.log4j.Level;
|
||||
+
|
||||
+import java.io.File;
|
||||
+import java.io.FileInputStream;
|
||||
+import java.io.FileOutputStream;
|
||||
+import java.io.IOException;
|
||||
+import java.lang.reflect.Method;
|
||||
+import java.lang.reflect.Modifier;
|
||||
+
|
||||
+public class AirplaneConfig {
|
||||
+
|
||||
+ private static ManualParser manual;
|
||||
+ private static AIR config;
|
||||
+
|
||||
+ public static void load() {
|
||||
+ try {
|
||||
+ manual = new ManualParser(new File("airplane.air"));
|
||||
+ } catch (IOException e) {
|
||||
+ e.printStackTrace();
|
||||
+ public static void load() throws IOException {
|
||||
+ File configFile = new File("airplane.air");
|
||||
+ if (configFile.exists()) {
|
||||
+ try (FileInputStream inputStream = new FileInputStream(configFile)) {
|
||||
+ config = new AIR(inputStream);
|
||||
+ }
|
||||
+ } else {
|
||||
+ config = new AIR();
|
||||
+ }
|
||||
+
|
||||
+ manual.get("info.version", "1.0");
|
||||
+ manual.setComment("info",
|
||||
+ config.setComment("info",
|
||||
+ "Airplane Configuration",
|
||||
+ "Read https://blog.airplane.gg/ to find out more about Airplane",
|
||||
+ "Join our Discord to receive support & optimization help: https://discord.gg/3gtc45q");
|
||||
+ config.getString("info.version", "1.0");
|
||||
+
|
||||
+ for (Method method : AirplaneConfig.class.getDeclaredMethods()) {
|
||||
+ if (Modifier.isStatic(method.getModifiers()) && Modifier.isPrivate(method.getModifiers())) {
|
||||
@ -128,10 +160,8 @@ index 0000000000000000000000000000000000000000..fbb9544027a48941bd0938d8f607e8c7
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ try {
|
||||
+ manual.save();
|
||||
+ } catch (IOException e) {
|
||||
+ e.printStackTrace();
|
||||
+ try (FileOutputStream outputStream = new FileOutputStream(configFile)) {
|
||||
+ config.save(outputStream);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@ -152,222 +182,6 @@ index 0000000000000000000000000000000000000000..807cf274619b8f7be839e249cb62b981
|
||||
+ MinecraftServer.getServer().server.getCommandMap().register("airplane", "Airplane", new AirplaneCommand());
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/gg/airplane/manual/ManualParser.java b/src/main/java/gg/airplane/manual/ManualParser.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..ace29adb0f140d99a8d85ac824654beded4bf5b8
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/gg/airplane/manual/ManualParser.java
|
||||
@@ -0,0 +1,210 @@
|
||||
+package gg.airplane.manual;
|
||||
+
|
||||
+import java.io.BufferedReader;
|
||||
+import java.io.BufferedWriter;
|
||||
+import java.io.File;
|
||||
+import java.io.FileReader;
|
||||
+import java.io.FileWriter;
|
||||
+import java.io.IOException;
|
||||
+import java.util.ArrayList;
|
||||
+import java.util.Arrays;
|
||||
+import java.util.LinkedHashMap;
|
||||
+import java.util.List;
|
||||
+import java.util.Map;
|
||||
+import java.util.TreeMap;
|
||||
+
|
||||
+// todo make this cleaner and more ergonomic to use
|
||||
+// also probably needs lists eventually
|
||||
+public class ManualParser {
|
||||
+
|
||||
+ private final File file;
|
||||
+ private final Map<String, Section> sections = new LinkedHashMap<>();
|
||||
+
|
||||
+ private static class ManualObject {
|
||||
+ public final String key;
|
||||
+ public final List<String> comments;
|
||||
+
|
||||
+ private ManualObject(String key, List<String> comments) {
|
||||
+ this.key = key;
|
||||
+ this.comments = comments == null ? new ArrayList<>() : comments;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private static class Section extends ManualObject {
|
||||
+ public final Map<String, Value> values;
|
||||
+
|
||||
+ private Section(String key, List<String> comments) {
|
||||
+ super(key, comments);
|
||||
+ this.values = new LinkedHashMap<>();
|
||||
+ }
|
||||
+
|
||||
+ public void add(String key, Value value) {
|
||||
+ this.values.put(key, value);
|
||||
+ value.parent = this;
|
||||
+ }
|
||||
+
|
||||
+ public Value get(String key) {
|
||||
+ return this.values.computeIfAbsent(key, k -> {
|
||||
+ Value value = new Value(k, null, null);
|
||||
+ value.parent = this;
|
||||
+ return value;
|
||||
+ });
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private static class Value extends ManualObject {
|
||||
+ public Object value;
|
||||
+ public Section parent;
|
||||
+
|
||||
+ private Value(String key, Object value, List<String> comments) {
|
||||
+ super(key, comments);
|
||||
+ this.value = value;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public ManualParser(File file) throws IOException {
|
||||
+ this.file = file;
|
||||
+
|
||||
+ if (!file.exists()) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
|
||||
+ Section currentSection = null;
|
||||
+ List<String> currentComment = new ArrayList<>();
|
||||
+
|
||||
+ String line;
|
||||
+ while ((line = reader.readLine()) != null) {
|
||||
+ line = line.trim();
|
||||
+
|
||||
+ if (line.length() == 0) {
|
||||
+ continue; // empty line
|
||||
+ }
|
||||
+
|
||||
+ if (line.startsWith("#")) {
|
||||
+ currentComment.add(line.substring(1).trim());
|
||||
+ } else if (line.startsWith("[")) {
|
||||
+ if (!line.endsWith("]")) {
|
||||
+ throw new IllegalArgumentException("Invalid configuration, section '" + line + "' does not end with ]");
|
||||
+ }
|
||||
+ if (line.length() < 3) {
|
||||
+ throw new IllegalArgumentException("Invalid configuration, section '" + line + "' does not have a name");
|
||||
+ }
|
||||
+ String sectionName = line.substring(1, line.length() - 1);
|
||||
+ Section newSection = new Section(sectionName, currentComment);
|
||||
+ currentComment = new ArrayList<>();
|
||||
+ currentSection = newSection;
|
||||
+ this.sections.put(sectionName, newSection);
|
||||
+ } else {
|
||||
+ if (currentSection == null) {
|
||||
+ throw new IllegalArgumentException("Invalid configuration, found value outside of section " + line);
|
||||
+ }
|
||||
+ int equals = line.indexOf("=");
|
||||
+ if (equals <= 1 || equals == line.length() - 1) {
|
||||
+ throw new IllegalArgumentException("Invalid configuration, assignment invalid " + line);
|
||||
+ }
|
||||
+
|
||||
+ String key = line.substring(0, equals).trim();
|
||||
+
|
||||
+ String value = line.substring(equals + 1).trim();
|
||||
+ if (value.length() == 0) {
|
||||
+ throw new IllegalArgumentException("Invalid configuration, value does not exist " + line);
|
||||
+ }
|
||||
+ if (value.startsWith("\"")) {
|
||||
+ if (!value.endsWith("\"")) {
|
||||
+ throw new IllegalArgumentException("Invalid configuration, value has no ending quote " + line);
|
||||
+ }
|
||||
+ String stringValue = value.substring(1, value.length() - 1);
|
||||
+ currentSection.add(key, new Value(key, stringValue, currentComment));
|
||||
+ } else if (Character.isDigit(value.charAt(0))) {
|
||||
+ if (value.contains(".")) {
|
||||
+ double doubleValue = Double.parseDouble(value);
|
||||
+ currentSection.add(key, new Value(key, doubleValue, currentComment));
|
||||
+ } else {
|
||||
+ int intValue = Integer.parseInt(value);
|
||||
+ currentSection.add(key, new Value(key, intValue, currentComment));
|
||||
+ }
|
||||
+ } else if (value.equals("true") || value.equals("false")) {
|
||||
+ boolean boolValue = Boolean.parseBoolean(value);
|
||||
+ currentSection.add(key, new Value(key, boolValue, currentComment));
|
||||
+ } else {
|
||||
+ throw new IllegalArgumentException("Invalid configuration, unknown type for " + line);
|
||||
+ }
|
||||
+ currentComment = new ArrayList<>();
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public void save() throws IOException {
|
||||
+ try (BufferedWriter writer = new BufferedWriter(new FileWriter(this.file))) {
|
||||
+ for (Map.Entry<String, Section> entry : this.sections.entrySet()) {
|
||||
+ Section section = entry.getValue();
|
||||
+ if (section.comments != null) {
|
||||
+ for (String comment : section.comments) {
|
||||
+ writer.write("# " + comment + "\n");
|
||||
+ }
|
||||
+ }
|
||||
+ writer.write("[" + section.key + "]" + "\n");
|
||||
+ for (Value value : section.values.values()) {
|
||||
+ if (value.comments != null) {
|
||||
+ for (String comment : value.comments) {
|
||||
+ writer.write(" # " + comment + "\n");
|
||||
+ }
|
||||
+ }
|
||||
+ writer.write(" " + value.key + " = " + serialize(value.value) + "\n");
|
||||
+ }
|
||||
+ writer.write("\n");
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private ManualObject getObject(String key) {
|
||||
+ String[] split = key.split("\\.", 2);
|
||||
+ if (split.length == 1) {
|
||||
+ return this.sections.computeIfAbsent(key, k -> new Section(k, null));
|
||||
+ }
|
||||
+ return this.sections.computeIfAbsent(split[0], k -> new Section(k, null)).get(split[1]);
|
||||
+ }
|
||||
+
|
||||
+ public void setComment(String key, String... comment) {
|
||||
+ ManualObject object = this.getObject(key);
|
||||
+ object.comments.clear();
|
||||
+ object.comments.addAll(Arrays.asList(comment));
|
||||
+ }
|
||||
+
|
||||
+ public <T> T get(String key, T defaultValue, String... comment) {
|
||||
+ String[] split = key.split("\\.", 2);
|
||||
+ if (split.length == 1) {
|
||||
+ throw new IllegalArgumentException("Key " + key + " does not include section");
|
||||
+ }
|
||||
+ Section section = this.sections.computeIfAbsent(split[0], k -> new Section(k, null));
|
||||
+ if (!section.values.containsKey(split[1])) {
|
||||
+ Value value = section.get(split[1]);
|
||||
+ value.value = defaultValue;
|
||||
+ value.comments.addAll(Arrays.asList(comment));
|
||||
+ return defaultValue;
|
||||
+ }
|
||||
+ Value value = section.get(split[1]);
|
||||
+ if (value.comments.isEmpty()) {
|
||||
+ value.comments.addAll(Arrays.asList(comment));
|
||||
+ }
|
||||
+ return (T) value.value;
|
||||
+ }
|
||||
+
|
||||
+ public void set(String key, Object value) {
|
||||
+ ManualObject object = getObject(key);
|
||||
+ if (!(object instanceof Value)) {
|
||||
+ throw new IllegalArgumentException("Invalid key for value " + key);
|
||||
+ }
|
||||
+ ((Value) object).value = value;
|
||||
+ }
|
||||
+
|
||||
+ private String serialize(Object object) {
|
||||
+ if (object instanceof String) {
|
||||
+ return "\"" + object + "\"";
|
||||
+ }
|
||||
+ return String.valueOf(object);
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index d902efdb8f2d42ea4c3933f7fa76ebe135ee09db..24a46ad36613faa5f5a1a12b70f7af886e1608ae 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
|
@ -108,7 +108,7 @@ index e612e1d30f76e217b1aa23488ab025adce048f57..c9198d242b9053fad6fa5b53c1894679
|
||||
default MovingObjectPositionBlock rayTraceBlock(RayTrace raytrace1, BlockPosition blockposition) {
|
||||
// Paper start - Prevent raytrace from loading chunks
|
||||
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
|
||||
index 68fa071fc576f398682ef461df102be432cdcb4c..9860bef7d4372071228532d28e6d21e675dff25c 100644
|
||||
index af01f5d635eada7175b9d7fdb47a65530686a539..3e08e56f67516333e7d880fdc595447a3ae4dc83 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/World.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/World.java
|
||||
@@ -69,6 +69,8 @@ import net.minecraft.world.level.saveddata.maps.WorldMap;
|
||||
|
@ -23,7 +23,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
index 46f960b9276dced41deb8f741454b6cce5a81529..277132da0b3672a9097b16f3b8534975dc795e3e 100644
|
||||
index 655e994376dcc65f4fd76e182d4ef5bc20142063..0440aa285226d5ed1853c059d91b5779501e95d1 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
@@ -1210,7 +1210,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
|
@ -34,7 +34,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
|
||||
index cb83f1152c52a99d25e4e80cc8bf18c6793e8b50..87c87b9767003652814c3726eece64470dbb69a8 100644
|
||||
index fe040615ff03478a20cdf8376f89a6b7d100ba61..207a9c3928aad7c6e89a120b54d87e003ebd232c 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
|
||||
@@ -1000,6 +1000,7 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
@ -46,7 +46,7 @@ index cb83f1152c52a99d25e4e80cc8bf18c6793e8b50..87c87b9767003652814c3726eece6447
|
||||
boolean flag2 = world.ticksPerAnimalSpawns != 0L && worlddata.getTime() % world.ticksPerAnimalSpawns == 0L; // CraftBukkit
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
index 277132da0b3672a9097b16f3b8534975dc795e3e..b33f37309d4dd22c033ad84effa4ff9d6e20a790 100644
|
||||
index 0440aa285226d5ed1853c059d91b5779501e95d1..8fa26ce7a9eed8ec43791079d6416eb2cd4a9398 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
@@ -1200,6 +1200,8 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
@ -77,7 +77,7 @@ index 277132da0b3672a9097b16f3b8534975dc795e3e..b33f37309d4dd22c033ad84effa4ff9d
|
||||
// Tuinity start - optimise chunk ice snow ticking
|
||||
BiomeBase[] biomeCache = this.biomeBaseCache;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
|
||||
index ffef28f9fa82a6961ef6db5f6732cfee4352ee01..c987dff9660469bf5144ef07e0d13fbfea31e7dd 100644
|
||||
index df35ae12ecbe88ab396bed9850ef80433ff42fd4..7474c070598bc093e06f02f19d49f3a6fa6b3d4e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
|
||||
@@ -99,6 +99,18 @@ public class Chunk implements IChunkAccess {
|
||||
|
@ -27,10 +27,10 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/gg/airplane/AirplaneConfig.java b/src/main/java/gg/airplane/AirplaneConfig.java
|
||||
index fbb9544027a48941bd0938d8f607e8c7ff9443a1..e0bed57aa5547a214ad779dbd0f648f3663147f9 100644
|
||||
index ab019b577002677a4ce788106f8e5a1d7757a2ae..946e476e1ca8c3ced119c64a05643c8c64760724 100644
|
||||
--- a/src/main/java/gg/airplane/AirplaneConfig.java
|
||||
+++ b/src/main/java/gg/airplane/AirplaneConfig.java
|
||||
@@ -44,4 +44,29 @@ public class AirplaneConfig {
|
||||
@@ -47,4 +47,30 @@ public class AirplaneConfig {
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,21 +42,22 @@ index fbb9544027a48941bd0938d8f607e8c7ff9443a1..e0bed57aa5547a214ad779dbd0f648f3
|
||||
+ public static boolean dynamicHoglinBehavior = true;
|
||||
+
|
||||
+ private static void dynamicActivationRange() {
|
||||
+ manual.setComment("activation-range", "Optimizes how entities act when", "they're far away from the player");
|
||||
+ config.setComment("activation-range", "Optimizes how entities act when", "they're far away from the player");
|
||||
+
|
||||
+ maximumActivationPrio = manual.get("activation-range.max-tick-freq", maximumActivationPrio,
|
||||
+ maximumActivationPrio = config.getInt("activation-range.max-tick-freq", maximumActivationPrio,
|
||||
+ "This value defines how often in ticks, the furthest entity",
|
||||
+ "will get their pathfinders and behaviors ticked. 20 = 1s");
|
||||
+ activationDistanceMod = manual.get("activation-range.activation-dist-mod", activationDistanceMod,
|
||||
+ activationDistanceMod = config.getInt("activation-range.activation-dist-mod", activationDistanceMod,
|
||||
+ "This value defines how much distance modifies an entity's",
|
||||
+ "tick frequency. freq = (distanceToPlayer^2) / (2^value)",
|
||||
+ "If you want further away entities to tick less often, use 8.",
|
||||
+ "If you want further away entities to tick more often, try 10.");
|
||||
+
|
||||
+ manual.setComment("behavior-activation", "A list of entities to use the dynamic activation range", "to modify how often their behaviors are ticked");
|
||||
+ dynamicVillagerBehavior = manual.get("behavior-activation.villager", dynamicVillagerBehavior);
|
||||
+ dynamicPiglinBehavior = manual.get("behavior-activation.piglin", dynamicPiglinBehavior);
|
||||
+ dynamicHoglinBehavior = manual.get("behavior-activation.hoglin", dynamicHoglinBehavior);
|
||||
+ config.setComment("behavior-activation", "A list of entities to use the dynamic activation range", "to modify how often their behaviors are ticked");
|
||||
+
|
||||
+ dynamicVillagerBehavior = config.getBoolean("behavior-activation.villager", dynamicVillagerBehavior);
|
||||
+ dynamicPiglinBehavior = config.getBoolean("behavior-activation.piglin", dynamicPiglinBehavior);
|
||||
+ dynamicHoglinBehavior = config.getBoolean("behavior-activation.hoglin", dynamicHoglinBehavior);
|
||||
+ }
|
||||
+
|
||||
}
|
||||
|
@ -20,11 +20,11 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index a3a3b17f3b30b55bb50905353e77723091bb5c1f..fc2c3714b6c772d67e258be269aa92dda80cdb12 100644
|
||||
index f9ead3ed315a3e726233545f35358cca0fc68e06..988a4464b1c84f7aa973269f1c109fb49b1b4d4b 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -159,8 +159,23 @@
|
||||
<version>1.1.0-SNAPSHOT</version>
|
||||
@@ -166,8 +166,23 @@
|
||||
<version>fe3dbb4420</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
+ <!-- Airplane - Flare -->
|
||||
@ -48,34 +48,35 @@ index a3a3b17f3b30b55bb50905353e77723091bb5c1f..fc2c3714b6c772d67e258be269aa92dd
|
||||
<build>
|
||||
<finalName>tuinity-${minecraft.version}</finalName>
|
||||
diff --git a/src/main/java/gg/airplane/AirplaneConfig.java b/src/main/java/gg/airplane/AirplaneConfig.java
|
||||
index e0bed57aa5547a214ad779dbd0f648f3663147f9..39ef53c9dd49d5951103777002f866a64a252bfd 100644
|
||||
index 946e476e1ca8c3ced119c64a05643c8c64760724..a77e628518920e84b03a8a00e1308a9a53a00896 100644
|
||||
--- a/src/main/java/gg/airplane/AirplaneConfig.java
|
||||
+++ b/src/main/java/gg/airplane/AirplaneConfig.java
|
||||
@@ -69,4 +69,26 @@ public class AirplaneConfig {
|
||||
dynamicHoglinBehavior = manual.get("behavior-activation.hoglin", dynamicHoglinBehavior);
|
||||
@@ -73,4 +73,27 @@ public class AirplaneConfig {
|
||||
dynamicHoglinBehavior = config.getBoolean("behavior-activation.hoglin", dynamicHoglinBehavior);
|
||||
}
|
||||
|
||||
+
|
||||
+ public static String profileWebUrl = "https://flare.airplane.gg";
|
||||
+
|
||||
+ private static void profilerOptions() {
|
||||
+ manual.setComment("flare", "Configures Flare, the built-in profiler");
|
||||
+ config.setComment("flare", "Configures Flare, the built-in profiler");
|
||||
+
|
||||
+ profileWebUrl = manual.get("flare.url", profileWebUrl, "Sets the server to use for profiles.");
|
||||
+ profileWebUrl = config.getString("flare.url", profileWebUrl, "Sets the server to use for profiles.");
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ public static String accessToken = "";
|
||||
+
|
||||
+ private static void airplaneWebServices() {
|
||||
+ manual.setComment("web-services", "Options for connecting to Airplane's online utilities");
|
||||
+ config.setComment("web-services", "Options for connecting to Airplane's online utilities");
|
||||
+
|
||||
+ accessToken = manual.get("web-services.token", "");
|
||||
+ accessToken = config.getString("web-services.token", "");
|
||||
+ // todo lookup token (off-thread) and let users know if their token is valid
|
||||
+ if (accessToken.length() > 0) {
|
||||
+ gg.airplane.flare.FlareSetup.init(); // Airplane
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+
|
||||
}
|
||||
diff --git a/src/main/java/gg/airplane/AirplaneLogger.java b/src/main/java/gg/airplane/AirplaneLogger.java
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Skip copying unloading tile entities
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
|
||||
index 9860bef7d4372071228532d28e6d21e675dff25c..a5530b21f20d55386346b4e3970c65bcddffee51 100644
|
||||
index 3e08e56f67516333e7d880fdc595447a3ae4dc83..f0420b87025a090a659542a00614e805bf850fd2 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/World.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/World.java
|
||||
@@ -106,7 +106,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Reduce entity chunk ticking checks from 3 to 1
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
index b33f37309d4dd22c033ad84effa4ff9d6e20a790..b788c33605fc96d17758cf42e508872e38fb4322 100644
|
||||
index 8fa26ce7a9eed8ec43791079d6416eb2cd4a9398..81b0ced87adbeffc7fd2343910735cd0f4c1bf13 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
@@ -1081,11 +1081,12 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
@ -31,7 +31,7 @@ index b33f37309d4dd22c033ad84effa4ff9d6e20a790..b788c33605fc96d17758cf42e508872e
|
||||
this.updateNavigatorsInRegion(entity);
|
||||
}
|
||||
} else {
|
||||
@@ -1416,7 +1417,9 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
@@ -1415,7 +1416,9 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
}
|
||||
// Tuinity end - log detailed entity tick information
|
||||
|
||||
@ -42,7 +42,7 @@ index b33f37309d4dd22c033ad84effa4ff9d6e20a790..b788c33605fc96d17758cf42e508872e
|
||||
// Tuinity start - log detailed entity tick information
|
||||
com.tuinity.tuinity.util.TickThread.ensureTickThread("Cannot tick an entity off-main");
|
||||
try {
|
||||
@@ -1424,7 +1427,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
@@ -1423,7 +1426,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
currentlyTickingEntity.lazySet(entity);
|
||||
}
|
||||
// Tuinity end - log detailed entity tick information
|
@ -1,96 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Sauve <paul@technove.co>
|
||||
Date: Thu, 25 Feb 2021 20:25:49 -0600
|
||||
Subject: [PATCH] Track Queue debug
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/tuinity/tuinity/util/maplist/IteratorSafeOrderedReferenceSet.java b/src/main/java/com/tuinity/tuinity/util/maplist/IteratorSafeOrderedReferenceSet.java
|
||||
index b9bdce7c7ca8b7b107b0dca165d722321c16229d..739839314fd8a88b5fca8b9678e1df07a166c35d 100644
|
||||
--- a/src/main/java/com/tuinity/tuinity/util/maplist/IteratorSafeOrderedReferenceSet.java
|
||||
+++ b/src/main/java/com/tuinity/tuinity/util/maplist/IteratorSafeOrderedReferenceSet.java
|
||||
@@ -20,7 +20,7 @@ public final class IteratorSafeOrderedReferenceSet<E> {
|
||||
|
||||
protected final double maxFragFactor;
|
||||
|
||||
- protected int iteratorCount;
|
||||
+ public int iteratorCount; // Airplane - public for debug
|
||||
|
||||
private final boolean threadRestricted;
|
||||
|
||||
diff --git a/src/main/java/gg/airplane/commands/AirplaneCommands.java b/src/main/java/gg/airplane/commands/AirplaneCommands.java
|
||||
index 66b20250a26d005427601b1cdee43bdd9eba70cc..f84e26b2d8ab9a9b2d9e92e18002483127121135 100644
|
||||
--- a/src/main/java/gg/airplane/commands/AirplaneCommands.java
|
||||
+++ b/src/main/java/gg/airplane/commands/AirplaneCommands.java
|
||||
@@ -2,11 +2,13 @@ package gg.airplane.commands;
|
||||
|
||||
import gg.airplane.AirplaneCommand;
|
||||
import gg.airplane.flare.FlareCommand;
|
||||
+import gg.airplane.structs.TrackQueue;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
|
||||
public class AirplaneCommands {
|
||||
public static void init() {
|
||||
MinecraftServer.getServer().server.getCommandMap().register("airplane", "Airplane", new AirplaneCommand());
|
||||
MinecraftServer.getServer().server.getCommandMap().register("flare", "Airplane", new FlareCommand());
|
||||
+ TrackQueue.TrackQueueDebugCommand.register();
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/gg/airplane/structs/TrackQueue.java b/src/main/java/gg/airplane/structs/TrackQueue.java
|
||||
index ae7c5430b4f5970ede602bb234b5ffcee424f6a7..4419fbe94041f4b8a0ea848880798289d063b8e2 100644
|
||||
--- a/src/main/java/gg/airplane/structs/TrackQueue.java
|
||||
+++ b/src/main/java/gg/airplane/structs/TrackQueue.java
|
||||
@@ -1,9 +1,12 @@
|
||||
package gg.airplane.structs;
|
||||
|
||||
import com.tuinity.tuinity.util.maplist.IteratorSafeOrderedReferenceSet;
|
||||
+import net.minecraft.server.level.WorldServer;
|
||||
import net.minecraft.world.level.chunk.Chunk;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import org.apache.logging.log4j.Level;
|
||||
+import org.bukkit.command.Command;
|
||||
+import org.bukkit.command.CommandSender;
|
||||
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.concurrent.ForkJoinPool;
|
||||
@@ -14,6 +17,28 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
*/
|
||||
public class TrackQueue {
|
||||
|
||||
+ public static class TrackQueueDebugCommand extends Command {
|
||||
+ protected TrackQueueDebugCommand() {
|
||||
+ super("trackqueuedebug");
|
||||
+ }
|
||||
+
|
||||
+ public static void register() {
|
||||
+ MinecraftServer.getServer().server.getCommandMap().register("trackqueuedebug", "Airplane", new TrackQueueDebugCommand());
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean execute(CommandSender sender, String commandLabel, String[] args) {
|
||||
+ if (!sender.isOp()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ for (WorldServer world : MinecraftServer.getServer().getWorlds()) {
|
||||
+ IteratorSafeOrderedReferenceSet<Chunk> chunks = world.getChunkProvider().entityTickingChunks;
|
||||
+ sender.sendMessage(world.getWorld().getName() + ": " + chunks.size() + " / " + chunks.getListSize() + " (iterators: " + chunks.iteratorCount + ")");
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
private final IteratorSafeOrderedReferenceSet<Chunk> chunks;
|
||||
private final ForkJoinPool pool = new ForkJoinPool(Math.max(4, Runtime.getRuntime().availableProcessors() >> 2));
|
||||
private final AtomicInteger taskIndex = new AtomicInteger();
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
|
||||
index 87c87b9767003652814c3726eece64470dbb69a8..dc1b7db4d39d4dfa65d60e5a059d3b94def6cf62 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
|
||||
@@ -388,7 +388,7 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
}
|
||||
|
||||
final com.tuinity.tuinity.util.maplist.IteratorSafeOrderedReferenceSet<Chunk> tickingChunks = new com.tuinity.tuinity.util.maplist.IteratorSafeOrderedReferenceSet<>(4096, 0.75f, 4096, 0.15, true);
|
||||
- final com.tuinity.tuinity.util.maplist.IteratorSafeOrderedReferenceSet<Chunk> entityTickingChunks = new com.tuinity.tuinity.util.maplist.IteratorSafeOrderedReferenceSet<>(4096, 0.75f, 4096, 0.15, true);
|
||||
+ public final com.tuinity.tuinity.util.maplist.IteratorSafeOrderedReferenceSet<Chunk> entityTickingChunks = new com.tuinity.tuinity.util.maplist.IteratorSafeOrderedReferenceSet<>(4096, 0.75f, 4096, 0.15, true); // Airplane - public for debug
|
||||
// Tuinity end
|
||||
|
||||
public ChunkProviderServer(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, ChunkGenerator chunkgenerator, int i, boolean flag, WorldLoadListener worldloadlistener, Supplier<WorldPersistentData> supplier) {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Disable the Snooper
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index e8146dad220330bdcc46e563172b40a66931d17c..34552a2bd96428013dba6f2bead737af75a28d0d 100644
|
||||
index 966b6e2f9b7c473d8dfcae205d8ef8f08912ded9..f72574fde82307a0e73a9eca6c9dc967d0c48f22 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1441,6 +1441,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] dont load chunks for physics
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
|
||||
index 72d4bc6d2ada37c6a9c7158f641b1c73eb171dbb..9ae1aaa5ba7d76e31dd122af4a58286aa5ec0825 100644
|
||||
index ad9ccd07cc9f49c9d5b106b9078a4ed2ae8d3413..1814f9fe3a43b7bd06e920066e3500606708e08c 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/World.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/World.java
|
||||
@@ -868,7 +868,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
|
@ -129,7 +129,7 @@ index 0000000000000000000000000000000000000000..fe7330fabe386966c2d203a190a00a78
|
||||
+}
|
||||
\ No newline at end of file
|
||||
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
|
||||
index 9ae1aaa5ba7d76e31dd122af4a58286aa5ec0825..f6f233ea7344924303b7462b88eaf348de439c0e 100644
|
||||
index 1814f9fe3a43b7bd06e920066e3500606708e08c..1132743062846f0ac20a2611bc2ec697d6ea97da 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/World.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/World.java
|
||||
@@ -160,6 +160,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
|
@ -24,10 +24,10 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/com/tuinity/tuinity/util/maplist/IteratorSafeOrderedReferenceSet.java b/src/main/java/com/tuinity/tuinity/util/maplist/IteratorSafeOrderedReferenceSet.java
|
||||
index be408aebbccbda46e8aa82ef337574137cfa0096..b9bdce7c7ca8b7b107b0dca165d722321c16229d 100644
|
||||
index be408aebbccbda46e8aa82ef337574137cfa0096..739839314fd8a88b5fca8b9678e1df07a166c35d 100644
|
||||
--- a/src/main/java/com/tuinity/tuinity/util/maplist/IteratorSafeOrderedReferenceSet.java
|
||||
+++ b/src/main/java/com/tuinity/tuinity/util/maplist/IteratorSafeOrderedReferenceSet.java
|
||||
@@ -16,7 +16,7 @@ public final class IteratorSafeOrderedReferenceSet<E> {
|
||||
@@ -16,11 +16,11 @@ public final class IteratorSafeOrderedReferenceSet<E> {
|
||||
|
||||
/* list impl */
|
||||
protected E[] listElements;
|
||||
@ -36,41 +36,67 @@ index be408aebbccbda46e8aa82ef337574137cfa0096..b9bdce7c7ca8b7b107b0dca165d72232
|
||||
|
||||
protected final double maxFragFactor;
|
||||
|
||||
- protected int iteratorCount;
|
||||
+ public int iteratorCount; // Airplane - public for debug
|
||||
|
||||
private final boolean threadRestricted;
|
||||
|
||||
diff --git a/src/main/java/gg/airplane/AirplaneConfig.java b/src/main/java/gg/airplane/AirplaneConfig.java
|
||||
index 39ef53c9dd49d5951103777002f866a64a252bfd..3886c731a69540f638d57a411285da289d3b704b 100644
|
||||
index a77e628518920e84b03a8a00e1308a9a53a00896..9f8d2528a9482cb562c610eecd21204d422da47a 100644
|
||||
--- a/src/main/java/gg/airplane/AirplaneConfig.java
|
||||
+++ b/src/main/java/gg/airplane/AirplaneConfig.java
|
||||
@@ -91,4 +91,18 @@ public class AirplaneConfig {
|
||||
}
|
||||
@@ -96,4 +96,18 @@ public class AirplaneConfig {
|
||||
}
|
||||
|
||||
|
||||
+
|
||||
+ public static boolean multithreadedEntityTracker = false;
|
||||
+ public static boolean entityTrackerAsyncPackets = false;
|
||||
+
|
||||
+ private static void entityTracker() {
|
||||
+ manual.setComment("tracker", "Options to improve the performance of the entity tracker");
|
||||
+ config.setComment("tracker", "Options to improve the performance of the entity tracker");
|
||||
+
|
||||
+ multithreadedEntityTracker = manual.get("tracker.multithreaded", multithreadedEntityTracker,
|
||||
+ multithreadedEntityTracker = config.getBoolean("tracker.multithreaded", multithreadedEntityTracker,
|
||||
+ "This enables the multithreading of the tracker.");
|
||||
+ entityTrackerAsyncPackets = manual.get("tracker.unsafe-async-packets", entityTrackerAsyncPackets,
|
||||
+ entityTrackerAsyncPackets = config.getBoolean("tracker.unsafe-async-packets", entityTrackerAsyncPackets,
|
||||
+ "This option can break plugins that assume packets from the",
|
||||
+ "entity tracker will be sent sync.");
|
||||
+ }
|
||||
+
|
||||
}
|
||||
diff --git a/src/main/java/gg/airplane/commands/AirplaneCommands.java b/src/main/java/gg/airplane/commands/AirplaneCommands.java
|
||||
index 66b20250a26d005427601b1cdee43bdd9eba70cc..f84e26b2d8ab9a9b2d9e92e18002483127121135 100644
|
||||
--- a/src/main/java/gg/airplane/commands/AirplaneCommands.java
|
||||
+++ b/src/main/java/gg/airplane/commands/AirplaneCommands.java
|
||||
@@ -2,11 +2,13 @@ package gg.airplane.commands;
|
||||
|
||||
import gg.airplane.AirplaneCommand;
|
||||
import gg.airplane.flare.FlareCommand;
|
||||
+import gg.airplane.structs.TrackQueue;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
|
||||
public class AirplaneCommands {
|
||||
public static void init() {
|
||||
MinecraftServer.getServer().server.getCommandMap().register("airplane", "Airplane", new AirplaneCommand());
|
||||
MinecraftServer.getServer().server.getCommandMap().register("flare", "Airplane", new FlareCommand());
|
||||
+ TrackQueue.TrackQueueDebugCommand.register();
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/gg/airplane/structs/TrackQueue.java b/src/main/java/gg/airplane/structs/TrackQueue.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..ae7c5430b4f5970ede602bb234b5ffcee424f6a7
|
||||
index 0000000000000000000000000000000000000000..4419fbe94041f4b8a0ea848880798289d063b8e2
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/gg/airplane/structs/TrackQueue.java
|
||||
@@ -0,0 +1,84 @@
|
||||
@@ -0,0 +1,109 @@
|
||||
+package gg.airplane.structs;
|
||||
+
|
||||
+import com.tuinity.tuinity.util.maplist.IteratorSafeOrderedReferenceSet;
|
||||
+import net.minecraft.server.level.WorldServer;
|
||||
+import net.minecraft.world.level.chunk.Chunk;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+import org.apache.logging.log4j.Level;
|
||||
+import org.bukkit.command.Command;
|
||||
+import org.bukkit.command.CommandSender;
|
||||
+
|
||||
+import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
+import java.util.concurrent.ForkJoinPool;
|
||||
@ -81,6 +107,28 @@ index 0000000000000000000000000000000000000000..ae7c5430b4f5970ede602bb234b5ffce
|
||||
+ */
|
||||
+public class TrackQueue {
|
||||
+
|
||||
+ public static class TrackQueueDebugCommand extends Command {
|
||||
+ protected TrackQueueDebugCommand() {
|
||||
+ super("trackqueuedebug");
|
||||
+ }
|
||||
+
|
||||
+ public static void register() {
|
||||
+ MinecraftServer.getServer().server.getCommandMap().register("trackqueuedebug", "Airplane", new TrackQueueDebugCommand());
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean execute(CommandSender sender, String commandLabel, String[] args) {
|
||||
+ if (!sender.isOp()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ for (WorldServer world : MinecraftServer.getServer().getWorlds()) {
|
||||
+ IteratorSafeOrderedReferenceSet<Chunk> chunks = world.getChunkProvider().entityTickingChunks;
|
||||
+ sender.sendMessage(world.getWorld().getName() + ": " + chunks.size() + " / " + chunks.getListSize() + " (iterators: " + chunks.iteratorCount + ")");
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private final IteratorSafeOrderedReferenceSet<Chunk> chunks;
|
||||
+ private final ForkJoinPool pool = new ForkJoinPool(Math.max(4, Runtime.getRuntime().availableProcessors() >> 2));
|
||||
+ private final AtomicInteger taskIndex = new AtomicInteger();
|
||||
@ -149,6 +197,19 @@ index 0000000000000000000000000000000000000000..ae7c5430b4f5970ede602bb234b5ffce
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
|
||||
index 207a9c3928aad7c6e89a120b54d87e003ebd232c..424cd048f905cd0ed3f7a4545a26ffde8da1f91f 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
|
||||
@@ -388,7 +388,7 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
}
|
||||
|
||||
final com.tuinity.tuinity.util.maplist.IteratorSafeOrderedReferenceSet<Chunk> tickingChunks = new com.tuinity.tuinity.util.maplist.IteratorSafeOrderedReferenceSet<>(4096, 0.75f, 4096, 0.15, true);
|
||||
- final com.tuinity.tuinity.util.maplist.IteratorSafeOrderedReferenceSet<Chunk> entityTickingChunks = new com.tuinity.tuinity.util.maplist.IteratorSafeOrderedReferenceSet<>(4096, 0.75f, 4096, 0.15, true);
|
||||
+ public final com.tuinity.tuinity.util.maplist.IteratorSafeOrderedReferenceSet<Chunk> entityTickingChunks = new com.tuinity.tuinity.util.maplist.IteratorSafeOrderedReferenceSet<>(4096, 0.75f, 4096, 0.15, true); // Airplane - public for debug
|
||||
// Tuinity end
|
||||
|
||||
public ChunkProviderServer(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, ChunkGenerator chunkgenerator, int i, boolean flag, WorldLoadListener worldloadlistener, Supplier<WorldPersistentData> supplier) {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
||||
index 59989db6dcf96a8ab5a75775bb588c31cec3418a..534c7266fe9d6f60b74a71e5e61ed248e515dffd 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
||||
@ -371,7 +432,7 @@ index d7eede51f1c4ebbe8e00b16efd6331c87db53bb4..585dbb250d975d2e9c34af26b9d5927c
|
||||
if (playerchunk != null && playerchunk.getSendingChunk() != null && PlayerChunkMap.this.playerChunkManager.isChunkSent(entityplayer, MathHelper.floor(this.tracker.locX()) >> 4, MathHelper.floor(this.tracker.locZ()) >> 4)) { // Paper - no-tick view distance // Tuinity - don't broadcast in chunks the player hasn't received
|
||||
flag1 = PlayerChunkMap.b(chunkcoordintpair, entityplayer, false) <= PlayerChunkMap.this.viewDistance;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
|
||||
index c987dff9660469bf5144ef07e0d13fbfea31e7dd..506c75013831a01e323a43ac94986600b8433e11 100644
|
||||
index 7474c070598bc093e06f02f19d49f3a6fa6b3d4e..c07fb5ca761c0f2067bd103026ded618a8620947 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
|
||||
@@ -111,6 +111,26 @@ public class Chunk implements IChunkAccess {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Rebrand
|
||||
|
||||
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index fc2c3714b6c772d67e258be269aa92dda80cdb12..cf6e53e9f483d21b17e2782816be4403fa5be717 100644
|
||||
index 988a4464b1c84f7aa973269f1c109fb49b1b4d4b..9d9ea5cff8a07c445837de74b3f887316cd79772 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -27,8 +27,10 @@
|
||||
@ -21,6 +21,35 @@ index fc2c3714b6c772d67e258be269aa92dda80cdb12..cf6e53e9f483d21b17e2782816be4403
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
@@ -181,6 +183,11 @@
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
+ <!-- Purpur - Snapshots -->
|
||||
+ <repository>
|
||||
+ <id>purpur-snapshots</id>
|
||||
+ <url>https://repo.pl3x.net/</url>
|
||||
+ </repository>
|
||||
</repositories>
|
||||
|
||||
<!-- This builds a completely 'ready to start' jar with all dependencies inside -->
|
||||
@@ -360,8 +367,15 @@
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jdt</groupId>
|
||||
<artifactId>ecj</artifactId>
|
||||
- <version>3.24.0</version>
|
||||
+ <!-- Purpur start -->
|
||||
+ <version>3.25.0</version>
|
||||
+ </dependency>
|
||||
+ <dependency>
|
||||
+ <groupId>org.jetbrains.kotlin</groupId>
|
||||
+ <artifactId>kotlin-stdlib</artifactId>
|
||||
+ <version>1.4.33-SNAPSHOT</version>
|
||||
</dependency>
|
||||
+ <!-- Purpur end -->
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
index 89eeb9d202405747409e65fcf226d95379987e29..4d9e685c691a37078ff7452e50ab8c13999dbe10 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
@ -60,7 +89,7 @@ index 3bc5cd1e53dd7c94b948e7f57f0dc8e073e349b0..87891161f5b06bb8be0e2016b490484e
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 7cbbc1b1161f26f22a7f7832395af0d4a781cb1a..9301d93ffb5a961cb68a5c37c30b656087c1b45c 100644
|
||||
index ca10d901ebd56bdee54f3c8cf607a5a34cd79f32..4f602f0448585b95b8b2b05006f0fa9f9c57ba43 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1636,7 +1636,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
@ -65,7 +65,7 @@ index 24a46ad36613faa5f5a1a12b70f7af886e1608ae..28d47ef97939309ce26b6e4cae14925b
|
||||
// Paper end
|
||||
com.tuinity.tuinity.config.TuinityConfig.init((java.io.File) options.valueOf("tuinity-settings")); // Tuinity - Server Config
|
||||
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
|
||||
index a5530b21f20d55386346b4e3970c65bcddffee51..dd0ea2ba66eba55472e8652c83bb8dede2a3af41 100644
|
||||
index f0420b87025a090a659542a00614e805bf850fd2..89b892c23a396d94c11b5d6b7ffe79e892297181 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/World.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/World.java
|
||||
@@ -157,6 +157,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
@ -64,7 +64,7 @@ index 534c7266fe9d6f60b74a71e5e61ed248e515dffd..f30dcbd26ed56ba8f1a99260722a0b39
|
||||
return this.serverStatisticManager;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
index b788c33605fc96d17758cf42e508872e38fb4322..9a99edb041cfd311212c014fd17aed88b232b074 100644
|
||||
index 81b0ced87adbeffc7fd2343910735cd0f4c1bf13..68e5115733cfefbf01e3ab4fa9dc5ae064e3de81 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
@@ -1000,7 +1000,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
@ -76,7 +76,7 @@ index b788c33605fc96d17758cf42e508872e38fb4322..9a99edb041cfd311212c014fd17aed88
|
||||
})) {
|
||||
// CraftBukkit start
|
||||
long l = this.worldData.getDayTime() + 24000L;
|
||||
@@ -1347,7 +1347,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
@@ -1346,7 +1346,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
while (iterator.hasNext()) {
|
||||
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Configurable server mod name
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 9301d93ffb5a961cb68a5c37c30b656087c1b45c..2af7c84167f75f1d16d0fd74a4c8156502325446 100644
|
||||
index 4f602f0448585b95b8b2b05006f0fa9f9c57ba43..ccccd3fffb9027469d545f586b15c045b5698b63 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1636,7 +1636,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
@ -5,7 +5,7 @@ Subject: [PATCH] Lagging threshold
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 2af7c84167f75f1d16d0fd74a4c8156502325446..34793bc4bd14dc7a34f32ccfec05cf50eb77cee2 100644
|
||||
index ccccd3fffb9027469d545f586b15c045b5698b63..22ca3082fff5a630fe7d6a5ec1e70f5675a5a8bc 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -279,6 +279,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
@ -5,7 +5,7 @@ Subject: [PATCH] Zombie horse naturally spawn
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
index 9a99edb041cfd311212c014fd17aed88b232b074..9d4ceaebf43b349454f10abfb5bb995d084c11fb 100644
|
||||
index 68e5115733cfefbf01e3ab4fa9dc5ae064e3de81..bd6db4fff4556a934b7956c9810b75ab294d094b 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
@@ -96,6 +96,7 @@ import net.minecraft.world.entity.ai.village.poi.VillagePlace;
|
@ -5,7 +5,7 @@ Subject: [PATCH] Configurable TPS Catchup
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 34793bc4bd14dc7a34f32ccfec05cf50eb77cee2..5367c3b7bdfb6951986e5c844fb978f42a0bfec5 100644
|
||||
index 22ca3082fff5a630fe7d6a5ec1e70f5675a5a8bc..9cc171e17e0d5d8f60a6d229eb2d39fb9181412f 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1122,7 +1122,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
@ -4,8 +4,30 @@ Date: Sun, 28 Jul 2019 01:27:37 -0500
|
||||
Subject: [PATCH] Add 5 second tps average in /tps
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java b/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java
|
||||
index dc6bc1910ad0f9b27144d5750078c3ca607d03d3..e8be35f836ede2630d44902e99a21489a7bad61f 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java
|
||||
@@ -58,7 +58,7 @@ public class RAMDetails extends JList<String> {
|
||||
GraphData data = RAMGraph.DATA.peekLast();
|
||||
Vector<String> vector = new Vector<>();
|
||||
|
||||
- double[] tps = new double[] {server.tps1.getAverage(), server.tps5.getAverage(), server.tps15.getAverage()};
|
||||
+ double[] tps = new double[] {server.tps5s.getAverage(), server.tps1.getAverage(), server.tps5.getAverage(), server.tps15.getAverage()}; // Purpur
|
||||
String[] tpsAvg = new String[tps.length];
|
||||
|
||||
for ( int g = 0; g < tps.length; g++) {
|
||||
@@ -67,7 +67,7 @@ public class RAMDetails extends JList<String> {
|
||||
vector.add("Memory use: " + (data.getUsedMem() / 1024L / 1024L) + " mb (" + (data.getFree() * 100L / data.getMax()) + "% free)");
|
||||
vector.add("Heap: " + (data.getTotal() / 1024L / 1024L) + " / " + (data.getMax() / 1024L / 1024L) + " mb");
|
||||
vector.add("Avg tick: " + DECIMAL_FORMAT.format(getAverage(server.getTickTimes())) + " ms");
|
||||
- vector.add("TPS from last 1m, 5m, 15m: " + String.join(", ", tpsAvg));
|
||||
+ vector.add("TPS from last 5s, 1m, 5m, 15m: " + String.join(", ", tpsAvg)); // Purpur
|
||||
|
||||
setListData(vector);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 5367c3b7bdfb6951986e5c844fb978f42a0bfec5..c6c4349954cb302e933739870814f54e426bd825 100644
|
||||
index 9cc171e17e0d5d8f60a6d229eb2d39fb9181412f..fd32bd05973785c4fc64849a8b7a96551a3223b9 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -278,7 +278,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
@ -61,7 +61,7 @@ index d98526785ff2fa3b72e8ffffcb89a57a2203a5c8..7859d84471436b427138593776ebd30a
|
||||
return iblockdata.r(iblockaccess, blockposition) ? false : (iblockdata.isPowerSource() ? false : (!fluid.isEmpty() ? false : (iblockdata.a((Tag) TagsBlock.PREVENT_MOB_SPAWNING_INSIDE) ? false : !entitytypes.a(iblockdata))));
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
|
||||
index dd0ea2ba66eba55472e8652c83bb8dede2a3af41..bfc168c27b28fd6be9a9ac879d1f286ea98d078e 100644
|
||||
index 89b892c23a396d94c11b5d6b7ffe79e892297181..23ade8d822fc7c50ccaeaef4a67351caf9a7df30 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/World.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/World.java
|
||||
@@ -1749,6 +1749,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user