Updated Upstream and Sidestream(s) (Tuinity/Airplane/Origami)

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.

Tuinity Changes:
f32fe9a Updated Upstream (Paper)

Airplane Changes:
125aff7 Updated Upstream (Tuinity)

Origami Changes:
756162f Update Paper
2f9721c Update snakeyaml and enable comment loading/saving
This commit is contained in:
Simon Gardling 2021-06-09 16:22:42 -04:00
parent 2a75e955a3
commit 939aa76bf3
52 changed files with 371 additions and 50 deletions

View File

@ -151,6 +151,7 @@ This is an overview of all the patches that are currently used.
| server | Reduce chunk loading & lookups | Paul Sauve | |
| server | Reduce frequency of checking for entity despawn | Paul Sauve | |
| server | Reduce iterator allocation from chunk gen | Spottedleaf | |
| server | Reduce memory allocations | Paul Sauve | |
| server | Reduce pathfinder branches | Spottedleaf | |
| server | Reduce projectile chunk loading | Paul Sauve | |
| server | Remove chunk lookup & lambda allocation from counting mobs | Spottedleaf | |

View File

@ -0,0 +1,271 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Paul Sauve <paul@technove.co>
Date: Tue, 9 Feb 2021 19:05:58 -0600
Subject: [PATCH] Reduce memory allocations
Airplane
Copyright (C) 2020 Technove LLC
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
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/src/main/java/net/minecraft/core/BlockPosition.java b/src/main/java/net/minecraft/core/BlockPosition.java
index 6a6381e85fef2ae2b9b5e6dff0b7917b92fa01e5..2685a395a2eff9083cd8c654c4b7e2141b0ca99b 100644
--- a/src/main/java/net/minecraft/core/BlockPosition.java
+++ b/src/main/java/net/minecraft/core/BlockPosition.java
@@ -438,12 +438,26 @@ public class BlockPosition extends BaseBlockPosition {
public BlockPosition b(int i, int j, int k) {
return super.b(i, j, k).immutableCopy();
}
+ // Airplane start - version of b that doesn't copy
+ public BlockPosition addValues(int x, int y, int z) {
+ ((BaseBlockPosition)this).a += x;
+ ((BaseBlockPosition)this).b += y;
+ ((BaseBlockPosition)this).e += z;
+ return this;
+ }
+ // Airplane end
@Override
public BlockPosition shift(EnumDirection enumdirection, int i) {
return super.shift(enumdirection, i).immutableCopy();
}
+ // Airplane start - mutable shift method
+ public MutableBlockPosition mutableShift(EnumDirection enumdirection, int i) {
+ return this.setValues(this.getX() + enumdirection.getAdjacentX() * i, this.getY() + enumdirection.getAdjacentY() * i, this.getZ() + enumdirection.getAdjacentZ() * i);
+ }
+ // Airplane end
+
@Override
public BlockPosition a(EnumDirection.EnumAxis enumdirection_enumaxis, int i) {
return super.a(enumdirection_enumaxis, i).immutableCopy();
diff --git a/src/main/java/net/minecraft/core/EnumDirection.java b/src/main/java/net/minecraft/core/EnumDirection.java
index 7918d830a4aef09c9f517284e83a9376299116ad..0a40df2151bd388b6633a6f50b14f1f41ed4ce62 100644
--- a/src/main/java/net/minecraft/core/EnumDirection.java
+++ b/src/main/java/net/minecraft/core/EnumDirection.java
@@ -30,7 +30,7 @@ public enum EnumDirection implements INamable {
private final EnumDirection.EnumAxis k;
private final EnumDirection.EnumAxisDirection l;
private final BaseBlockPosition m;
- private static final EnumDirection[] n = values();
+ private static final EnumDirection[] n = values(); public static EnumDirection[] getValues() { return n; } // Airplane - getter
private static final Map<String, EnumDirection> o = (Map) Arrays.stream(EnumDirection.n).collect(Collectors.toMap(EnumDirection::m, (enumdirection) -> {
return enumdirection;
}));
diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
index d827e18d8c3b9b5869dbb1e233f415ba0efb7c1b..fc687515fdfd47e90e11a2832de07d784edeef25 100644
--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
@@ -705,7 +705,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return d2 * d2 + d3 * d3;
}
- private static int b(ChunkCoordIntPair chunkcoordintpair, EntityPlayer entityplayer, boolean flag) {
+ // Airplane start - create copy that accepts x/z instead of allocating pair
+ private static int b(ChunkCoordIntPair chunkcoordintpair, EntityPlayer entityplayer, boolean flag) { return someDistanceCalculation(chunkcoordintpair.x, chunkcoordintpair.z, entityplayer, flag); }
+ private static int someDistanceCalculation(int x, int z, EntityPlayer entityplayer, boolean flag) {
int i;
int j;
@@ -719,12 +721,16 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
j = MathHelper.floor(entityplayer.locZ() / 16.0D);
}
- return a(chunkcoordintpair, i, j);
+ return someOtherDistanceCalculation(x, z, i, j);
+ // Airplane end
}
- private static int a(ChunkCoordIntPair chunkcoordintpair, int i, int j) {
- int k = chunkcoordintpair.x - i;
- int l = chunkcoordintpair.z - j;
+ // Airplane start - create copy that accepts x/z instead of allocating pair
+ private static int a(ChunkCoordIntPair chunkcoordintpair, int i, int j) { return someOtherDistanceCalculation(chunkcoordintpair.x, chunkcoordintpair.z, i, j); }
+ private static int someOtherDistanceCalculation(int x, int z, int i, int j) {
+ int k = x - i;
+ int l = z - j;
+ // Airplane end
return Math.max(Math.abs(k), Math.abs(l));
}
@@ -2546,11 +2552,17 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
boolean flag1 = this.tracker.attachedToPlayer;
if (!flag1) {
+ // Airplane start - use int/longs instead of ChunkCoordIntPair
+ /*
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(this.tracker.chunkX, this.tracker.chunkZ);
- PlayerChunk playerchunk = PlayerChunkMap.this.getVisibleChunk(chunkcoordintpair.pair());
+ */
+ int x = this.tracker.chunkX, z = this.tracker.chunkZ;
+ long chunkcoordintpair = ChunkCoordIntPair.pair(x, z);
+ PlayerChunk playerchunk = PlayerChunkMap.this.getVisibleChunk(chunkcoordintpair);
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;
+ flag1 = PlayerChunkMap.someDistanceCalculation(x, z, entityplayer, false) <= PlayerChunkMap.this.viewDistance;
+ // Airplane end
}
}
@@ -2580,8 +2592,10 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
}
private int b() {
+ // Airplane start
+ int i = this.trackingDistance; // move out of if statement
+ if (!this.tracker.passengers.isEmpty()) {
Collection<Entity> collection = this.tracker.getAllPassengers();
- int i = this.trackingDistance;
Iterator iterator = collection.iterator();
while (iterator.hasNext()) {
@@ -2593,6 +2607,8 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
i = j;
}
}
+ }
+ // Airplane end
return this.a(i);
}
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index 39b978c6e61e675249743d082699bb9882fd39ff..b4d8fbbc421b3288ae66db2932825b3e2f9b8d98 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -1107,7 +1107,28 @@ public class WorldServer extends World implements GeneratorAccessSeed {
gameprofilerfiller.enter("tick");
if (!entity.dead && !(entity instanceof EntityComplexPart)) {
+ // Airplane start - inline this.a to prevent creation of lambda
+ /*
this.a(this::entityJoinedWorld, entity);
+ */
+ boolean doMidTick = false; // usually there's a returns in the catch, so treat it like that
+ try {
+ this.entityJoinedWorld(entity);
+ doMidTick = true;
+ } catch (Throwable throwable) {
+ if (throwable instanceof ThreadDeath) throw throwable; // Paper
+ // Paper start - Prevent tile entity and entity crashes
+ String msg = "Entity threw exception at " + entity.world.getWorld().getName() + ":" + entity.locX() + "," + entity.locY() + "," + entity.locZ();
+ System.err.println(msg);
+ throwable.printStackTrace();
+ getServer().getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerInternalException(msg, throwable)));
+ entity.dead = true;
+ // Paper end
+ }
+ if (doMidTick) {
+ MinecraftServer.getServer().executeMidTickTasks(); // Tuinity - execute chunk tasks mid tick
+ }
+ // Airplane end
}
gameprofilerfiller.exit();
@@ -1451,9 +1472,14 @@ public class WorldServer extends World implements GeneratorAccessSeed {
++entity.ticksLived;
GameProfilerFiller gameprofilerfiller = this.getMethodProfiler();
+ // Airplane start - create debug lambda once, todo do we even WANT the method profiler?
+ /*
gameprofilerfiller.a(() -> {
return IRegistry.ENTITY_TYPE.getKey(entity.getEntityType()).toString();
});
+ */
+ gameprofilerfiller.a(entity.getEntityType().getEntityName);
+ // Airplane end
gameprofilerfiller.c("tickNonPassenger");
if (isActive) { // Paper - EAR 2
TimingHistory.activatedEntityTicks++; // Paper
diff --git a/src/main/java/net/minecraft/world/entity/EntityTypes.java b/src/main/java/net/minecraft/world/entity/EntityTypes.java
index 80c229c1852199fda85c03453d64cae33e413e89..7f70dda656ff9d802200f18139d2695e58c551c7 100644
--- a/src/main/java/net/minecraft/world/entity/EntityTypes.java
+++ b/src/main/java/net/minecraft/world/entity/EntityTypes.java
@@ -270,6 +270,8 @@ public class EntityTypes<T extends Entity> {
private MinecraftKey bq;
private final EntitySize br;
+ public java.util.function.Supplier<String> getEntityName = () -> IRegistry.ENTITY_TYPE.getKey(this).toString(); // Airplane - create lambda ones
+
private static <T extends Entity> EntityTypes<T> a(String s, EntityTypes.Builder entitytypes_builder) { // CraftBukkit - decompile error
return (EntityTypes) IRegistry.a((IRegistry) IRegistry.ENTITY_TYPE, s, (Object) entitytypes_builder.a(s));
}
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index 37da32675f0c00c793cd137c9a7305932cefb705..726d0aec2c40ac8e40dba3a12f17870abae6dca6 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -1110,19 +1110,19 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
public void a(Consumer<Entity> consumer, Entity entity) {
try {
- consumer.accept(entity);
+ consumer.accept(entity); // Airplane - error on change
} catch (Throwable throwable) {
if (throwable instanceof ThreadDeath) throw throwable; // Paper
// Paper start - Prevent tile entity and entity crashes
String msg = "Entity threw exception at " + entity.world.getWorld().getName() + ":" + entity.locX() + "," + entity.locY() + "," + entity.locZ();
System.err.println(msg);
throwable.printStackTrace();
- getServer().getPluginManager().callEvent(new ServerExceptionEvent(new ServerInternalException(msg, throwable)));
+ getServer().getPluginManager().callEvent(new ServerExceptionEvent(new ServerInternalException(msg, throwable))); // Airplane - error on change
entity.dead = true;
return;
// Paper end
}
- MinecraftServer.getServer().executeMidTickTasks(); // Tuinity - execute chunk tasks mid tick
+ MinecraftServer.getServer().executeMidTickTasks(); // Tuinity - execute chunk tasks mid tick // Airplane - error on change
}
// Paper start - Prevent armor stands from doing entity lookups
@Override
diff --git a/src/main/java/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java b/src/main/java/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
index 712596420af83e6e1b9d147ae2fd8d8a1f36e1b9..9c29fa3efac7e16df81b8a44934e3286bb37f1f6 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
@@ -54,8 +54,14 @@ public abstract class BlockDirtSnowSpreadable extends BlockDirtSnow {
if (worldserver.getLightLevel(blockposition.up()) >= 9) {
IBlockData iblockdata1 = this.getBlockData();
+ // Airplane start - use mutable position
+ BlockPosition.MutableBlockPosition blockposition1 = new BlockPosition.MutableBlockPosition();
for (int i = 0; i < 4; ++i) {
+ blockposition1.setValues(blockposition).addValues(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1);
+ /*
BlockPosition blockposition1 = blockposition.b(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1);
+ */
+ // Airplane end
if (worldserver.getType(blockposition1).a(Blocks.DIRT) && c(iblockdata1, (IWorldReader) worldserver, blockposition1)) {
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, (IBlockData) iblockdata1.set(BlockDirtSnowSpreadable.a, worldserver.getType(blockposition1.up()).a(Blocks.SNOW))); // CraftBukkit
diff --git a/src/main/java/net/minecraft/world/level/block/BlockFire.java b/src/main/java/net/minecraft/world/level/block/BlockFire.java
index 70c32b7a53a1107cced3491ebac19b0eaf4fec2e..3f3e241f3b24d9df9d57760c5515ff021718065a 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockFire.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockFire.java
@@ -340,13 +340,15 @@ public class BlockFire extends BlockFireAbstract {
return 0;
} else {
int i = 0;
- EnumDirection[] aenumdirection = EnumDirection.values();
+ EnumDirection[] aenumdirection = EnumDirection.getValues(); // Airplane - don't allocate new array here
int j = aenumdirection.length;
+ BlockPosition.MutableBlockPosition copy = new BlockPosition.MutableBlockPosition(); // Airplane - single allocation for this method
for (int k = 0; k < j; ++k) {
+ copy.setValues(blockposition); // Airplane - reset values
EnumDirection enumdirection = aenumdirection[k];
// Paper start
- IBlockData iblockdata = iworldreader.getTypeIfLoaded(blockposition.shift(enumdirection));
+ IBlockData iblockdata = iworldreader.getTypeIfLoaded(copy.mutableShift(enumdirection, 1)); // Airplane - mutable shift
if (iblockdata == null) {
continue;
}

View File

@ -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 37da32675f0c00c793cd137c9a7305932cefb705..3c9d27900fe3b6cf7e8eb4df42e1758f507894b1 100644
index 726d0aec2c40ac8e40dba3a12f17870abae6dca6..334281d4cbdb2d82ca93e862498af961d9abfd31 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 {

View File

@ -39,7 +39,7 @@ index 6f90a4182e008b49a4b3328e569311382e4bec0d..1472bbdac9b545c97368df03672b975a
}
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index 3c9d27900fe3b6cf7e8eb4df42e1758f507894b1..cf1b190a1d9175b872c65d2ea69a9187346520e4 100644
index 334281d4cbdb2d82ca93e862498af961d9abfd31..d1591f8d0b45126acef5d24ddb41d76293f5b42d 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -18,6 +18,7 @@ import java.util.function.Consumer;

View File

@ -116,7 +116,7 @@ index 0000000000000000000000000000000000000000..7103aa120d3a27d5579d54bd6f4018dc
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index 39b978c6e61e675249743d082699bb9882fd39ff..b11af463045bbd3bab8d269fde34071ca5f026af 100644
index b4d8fbbc421b3288ae66db2932825b3e2f9b8d98..1553be4263f08ae21447ccf2e19e8a30a2932208 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -846,6 +846,22 @@ public class WorldServer extends World implements GeneratorAccessSeed {

View File

@ -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 cf1b190a1d9175b872c65d2ea69a9187346520e4..704ccbc73e5d1221587bae4780d0f48676014479 100644
index d1591f8d0b45126acef5d24ddb41d76293f5b42d..8ed6ff1c180fe6dd3b29c476799f6b83af0be007 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -830,7 +830,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable {

View File

@ -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 704ccbc73e5d1221587bae4780d0f48676014479..313d27714b98c58627d1ce247bf63384929a746f 100644
index 8ed6ff1c180fe6dd3b29c476799f6b83af0be007..1583c8608a34a84b84873dd10668d6a5f67ab416 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -159,6 +159,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable {

View File

@ -20,10 +20,10 @@ index e33e889c291d37a821a4fbd40d9aac7bb079de0d..5dfa0658838c4801cdf260eae8b98163
new TimingsExport(listeners, parent, history).start();
diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..0f66484a80d3cc7caaf8a111bd50229e673bd8e0
index 0000000000000000000000000000000000000000..508534e91eda174645b7f432bf844c9db8bc2e26
--- /dev/null
+++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
@@ -0,0 +1,236 @@
@@ -0,0 +1,292 @@
+package com.tuinity.tuinity.config;
+
+import com.destroystokyo.paper.util.SneakyThrow;
@ -219,6 +219,16 @@ index 0000000000000000000000000000000000000000..0f66484a80d3cc7caaf8a111bd50229e
+ return config == null ? this.worldDefaults.getBoolean(path) : config.getBoolean(path, this.worldDefaults.getBoolean(path));
+ }
+
+ boolean getBooleanRaw(final String path, final boolean dfl) {
+ final ConfigurationSection config = TuinityConfig.config.getConfigurationSection(this.configPath);
+ if (TuinityConfig.configVersion < 1) {
+ if (config != null && config.getBoolean(path) == dfl) {
+ config.set(path, null);
+ }
+ }
+ return config == null ? this.worldDefaults.getBoolean(path, dfl) : config.getBoolean(path, this.worldDefaults.getBoolean(path, dfl));
+ }
+
+ int getInt(final String path, final int dfl) {
+ final ConfigurationSection config = TuinityConfig.config.getConfigurationSection(this.configPath);
+ this.worldDefaults.addDefault(path, Integer.valueOf(dfl));
@ -230,6 +240,16 @@ index 0000000000000000000000000000000000000000..0f66484a80d3cc7caaf8a111bd50229e
+ return config == null ? this.worldDefaults.getInt(path) : config.getInt(path, this.worldDefaults.getInt(path));
+ }
+
+ int getIntRaw(final String path, final int dfl) {
+ final ConfigurationSection config = TuinityConfig.config.getConfigurationSection(this.configPath);
+ if (TuinityConfig.configVersion < 1) {
+ if (config != null && config.getInt(path) == dfl) {
+ config.set(path, null);
+ }
+ }
+ return config == null ? this.worldDefaults.getInt(path, dfl) : config.getInt(path, this.worldDefaults.getInt(path, dfl));
+ }
+
+ long getLong(final String path, final long dfl) {
+ final ConfigurationSection config = TuinityConfig.config.getConfigurationSection(this.configPath);
+ this.worldDefaults.addDefault(path, Long.valueOf(dfl));
@ -241,6 +261,16 @@ index 0000000000000000000000000000000000000000..0f66484a80d3cc7caaf8a111bd50229e
+ return config == null ? this.worldDefaults.getLong(path) : config.getLong(path, this.worldDefaults.getLong(path));
+ }
+
+ long getLongRaw(final String path, final long dfl) {
+ final ConfigurationSection config = TuinityConfig.config.getConfigurationSection(this.configPath);
+ if (TuinityConfig.configVersion < 1) {
+ if (config != null && config.getLong(path) == dfl) {
+ config.set(path, null);
+ }
+ }
+ return config == null ? this.worldDefaults.getLong(path, dfl) : config.getLong(path, this.worldDefaults.getLong(path, dfl));
+ }
+
+ double getDouble(final String path, final double dfl) {
+ final ConfigurationSection config = TuinityConfig.config.getConfigurationSection(this.configPath);
+ this.worldDefaults.addDefault(path, Double.valueOf(dfl));
@ -252,11 +282,37 @@ index 0000000000000000000000000000000000000000..0f66484a80d3cc7caaf8a111bd50229e
+ return config == null ? this.worldDefaults.getDouble(path) : config.getDouble(path, this.worldDefaults.getDouble(path));
+ }
+
+ double getDoubleRaw(final String path, final double dfl) {
+ final ConfigurationSection config = TuinityConfig.config.getConfigurationSection(this.configPath);
+ if (TuinityConfig.configVersion < 1) {
+ if (config != null && config.getDouble(path) == dfl) {
+ config.set(path, null);
+ }
+ }
+ return config == null ? this.worldDefaults.getDouble(path, dfl) : config.getDouble(path, this.worldDefaults.getDouble(path, dfl));
+ }
+
+ String getString(final String path, final String dfl) {
+ final ConfigurationSection config = TuinityConfig.config.getConfigurationSection(this.configPath);
+ this.worldDefaults.addDefault(path, dfl);
+ return config == null ? this.worldDefaults.getString(path) : config.getString(path, this.worldDefaults.getString(path));
+ }
+
+ String getStringRaw(final String path, final String dfl) {
+ final ConfigurationSection config = TuinityConfig.config.getConfigurationSection(this.configPath);
+ return config == null ? this.worldDefaults.getString(path, dfl) : config.getString(path, this.worldDefaults.getString(path, dfl));
+ }
+
+ List getList(final String path, final List dfl) {
+ final ConfigurationSection config = TuinityConfig.config.getConfigurationSection(this.configPath);
+ this.worldDefaults.addDefault(path, dfl);
+ return config == null ? this.worldDefaults.getList(path) : config.getList(path, this.worldDefaults.getList(path));
+ }
+
+ List getListRaw(final String path, final List dfl) {
+ final ConfigurationSection config = TuinityConfig.config.getConfigurationSection(this.configPath);
+ return config == null ? this.worldDefaults.getList(path, dfl) : config.getList(path, this.worldDefaults.getList(path, dfl));
+ }
+ }
+
+}

View File

@ -8,7 +8,7 @@ These are the changes to CB
Currently a placeholder patch.
diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
index 0f66484a80d3cc7caaf8a111bd50229e673bd8e0..f10fa659680f8a574f77d260bbc52be349c244e8 100644
index 508534e91eda174645b7f432bf844c9db8bc2e26..8b72d044e2d56c7933b48bdf5f6139d64f9660b7 100644
--- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
+++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
@@ -110,6 +110,19 @@ public final class TuinityConfig {
@ -31,9 +31,9 @@ index 0f66484a80d3cc7caaf8a111bd50229e673bd8e0..f10fa659680f8a574f77d260bbc52be3
public static final class WorldConfig {
public final String worldName;
@@ -231,6 +244,15 @@ public final class TuinityConfig {
this.worldDefaults.addDefault(path, dfl);
return config == null ? this.worldDefaults.getString(path) : config.getString(path, this.worldDefaults.getString(path));
@@ -287,6 +300,15 @@ public final class TuinityConfig {
final ConfigurationSection config = TuinityConfig.config.getConfigurationSection(this.configPath);
return config == null ? this.worldDefaults.getList(path, dfl) : config.getList(path, this.worldDefaults.getList(path, dfl));
}
+
+ /** ignored if {@link TuinityConfig#tickWorldsInParallel} == false */

View File

@ -19,7 +19,7 @@ affects player loaded chunks, when we want to target all
loads.
diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
index f10fa659680f8a574f77d260bbc52be349c244e8..182f419fde8eb3646a79cc0ba689ee486cb53338 100644
index 8b72d044e2d56c7933b48bdf5f6139d64f9660b7..7043d58211996628f0825169842d1e1739defb40 100644
--- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
+++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
@@ -1,6 +1,7 @@

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Lag compensate block breaking
Use time instead of ticks if ticks fall behind
diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
index 182f419fde8eb3646a79cc0ba689ee486cb53338..5aa558bd05c4ab735730263f220478c36a4ba0fd 100644
index 7043d58211996628f0825169842d1e1739defb40..4e21f6b4c02b97be4f15f5ba53fe280df2c48a46 100644
--- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
+++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
@@ -133,6 +133,12 @@ public final class TuinityConfig {

View File

@ -24,7 +24,7 @@ and an action can be defined: DROP or KICK
If interval or rate are less-than 0, the limit is ignored
diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
index 5aa558bd05c4ab735730263f220478c36a4ba0fd..761b03d08bbdfd2733ac5e4fc12931ef6a0ea8e5 100644
index 4e21f6b4c02b97be4f15f5ba53fe280df2c48a46..66e7e1d2efaea6f16219013bb30b93a1cb5abad0 100644
--- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
+++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
@@ -1,6 +1,7 @@

View File

@ -3709,7 +3709,7 @@ index 0000000000000000000000000000000000000000..0e4442a94559346b19a536d35ce5def6
+ }
+}
diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
index 761b03d08bbdfd2733ac5e4fc12931ef6a0ea8e5..edc26e8a1bea5dc5ebbc5abec0dcea604c410d95 100644
index 66e7e1d2efaea6f16219013bb30b93a1cb5abad0..d050c959baf2b6265547164db56161110d3c500e 100644
--- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
+++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
@@ -232,6 +232,12 @@ public final class TuinityConfig {

View File

@ -9,7 +9,7 @@ Configurable under
`send-full-pos-for-hard-colliding-entities`
diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
index edc26e8a1bea5dc5ebbc5abec0dcea604c410d95..9832f676f7e549598193fbe4ad04ee5d5ca20c1c 100644
index d050c959baf2b6265547164db56161110d3c500e..2f88f4fedb2dac875f82040b09a2ff03a141981f 100644
--- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
+++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
@@ -238,6 +238,12 @@ public final class TuinityConfig {

View File

@ -1032,7 +1032,7 @@ index 0000000000000000000000000000000000000000..0d577aa1c7868ce89c3902535adcb554
+ }
+}
diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
index 9832f676f7e549598193fbe4ad04ee5d5ca20c1c..24940f1824d33727bacd82bb16136229bbbfbcc2 100644
index 2f88f4fedb2dac875f82040b09a2ff03a141981f..739df84a0b5a9e54cc00b095e2636d154260e91d 100644
--- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
+++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
@@ -244,6 +244,25 @@ public final class TuinityConfig {

View File

@ -7,10 +7,10 @@ Original code by JellySquid, licensed under GNU Lesser General Public License v3
you can find the original code on https://github.com/CaffeineMC/lithium-fabric/ (Yarn mappings)
diff --git a/src/main/java/net/minecraft/core/EnumDirection.java b/src/main/java/net/minecraft/core/EnumDirection.java
index 7918d830a4aef09c9f517284e83a9376299116ad..5f2b1d763b552ee29e9bbe43c00ec85b1d78edb0 100644
index 0a40df2151bd388b6633a6f50b14f1f41ed4ce62..e7f56ae5214af02e5dbcf16b781032545702a0d8 100644
--- a/src/main/java/net/minecraft/core/EnumDirection.java
+++ b/src/main/java/net/minecraft/core/EnumDirection.java
@@ -24,13 +24,13 @@ public enum EnumDirection implements INamable {
@@ -24,7 +24,7 @@ public enum EnumDirection implements INamable {
DOWN(0, 1, -1, "down", EnumDirection.EnumAxisDirection.NEGATIVE, EnumDirection.EnumAxis.Y, new BaseBlockPosition(0, -1, 0)), UP(1, 0, -1, "up", EnumDirection.EnumAxisDirection.POSITIVE, EnumDirection.EnumAxis.Y, new BaseBlockPosition(0, 1, 0)), NORTH(2, 3, 2, "north", EnumDirection.EnumAxisDirection.NEGATIVE, EnumDirection.EnumAxis.Z, new BaseBlockPosition(0, 0, -1)), SOUTH(3, 2, 0, "south", EnumDirection.EnumAxisDirection.POSITIVE, EnumDirection.EnumAxis.Z, new BaseBlockPosition(0, 0, 1)), WEST(4, 5, 1, "west", EnumDirection.EnumAxisDirection.NEGATIVE, EnumDirection.EnumAxis.X, new BaseBlockPosition(-1, 0, 0)), EAST(5, 4, 3, "east", EnumDirection.EnumAxisDirection.POSITIVE, EnumDirection.EnumAxis.X, new BaseBlockPosition(1, 0, 0));
private final int g;
@ -19,13 +19,6 @@ index 7918d830a4aef09c9f517284e83a9376299116ad..5f2b1d763b552ee29e9bbe43c00ec85b
private final int i;
private final String j;
private final EnumDirection.EnumAxis k;
private final EnumDirection.EnumAxisDirection l;
private final BaseBlockPosition m;
- private static final EnumDirection[] n = values();
+ private static final EnumDirection[] n = values(); private static final EnumDirection[] ALL = n;// Yatopia OBF HELPER
private static final Map<String, EnumDirection> o = (Map) Arrays.stream(EnumDirection.n).collect(Collectors.toMap(EnumDirection::m, (enumdirection) -> {
return enumdirection;
}));
@@ -112,8 +112,12 @@ public enum EnumDirection implements INamable {
return this.l;
}
@ -36,7 +29,7 @@ index 7918d830a4aef09c9f517284e83a9376299116ad..5f2b1d763b552ee29e9bbe43c00ec85b
+ */
public EnumDirection opposite() {
- return fromType1(this.h);
+ return ALL[this.h];
+ return getValues()[this.h];
}
public EnumDirection g() {
@ -50,7 +43,7 @@ index 7918d830a4aef09c9f517284e83a9376299116ad..5f2b1d763b552ee29e9bbe43c00ec85b
+ */
public static EnumDirection a(Random random) {
- return (EnumDirection) SystemUtils.a((Object[]) EnumDirection.n, random);
+ return ALL[random.nextInt(ALL.length)];
+ return getValues()[random.nextInt(getValues().length)];
}
public static EnumDirection a(double d0, double d1, double d2) {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Optimize TileEntity load/unload
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index 313d27714b98c58627d1ce247bf63384929a746f..b8156023746bda827f19f4e972c3bdb56340f046 100644
index 1583c8608a34a84b84873dd10668d6a5f67ab416..b6e11ea50e7bca0c5a7109a8715c0ede15e61e44 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -105,8 +105,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable {

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Optimize some stuff in WorldServer ticking
Replaced some streams and some array lists with glue lists
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index b11af463045bbd3bab8d269fde34071ca5f026af..e26ece12d07d64e2e5a5c587b8d7371f01700e43 100644
index 1553be4263f08ae21447ccf2e19e8a30a2932208..671662c90366351b1bd364a6e29e5a4fe6c19b10 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -996,12 +996,21 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@ -48,7 +48,7 @@ index b11af463045bbd3bab8d269fde34071ca5f026af..e26ece12d07d64e2e5a5c587b8d7371f
long l = this.worldData.getDayTime() + 24000L;
TimeSkipEvent event = new TimeSkipEvent(this.getWorld(), TimeSkipEvent.SkipReason.NIGHT_SKIP, (l - l % 24000L) - this.getDayTime());
if (this.getGameRules().getBoolean(GameRules.DO_DAYLIGHT_CYCLE)) {
@@ -1205,9 +1212,9 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1226,9 +1233,9 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
private void wakeupPlayers() {
@ -60,7 +60,7 @@ index b11af463045bbd3bab8d269fde34071ca5f026af..e26ece12d07d64e2e5a5c587b8d7371f
}
// Paper start - optimise random block ticking
@@ -2029,8 +2036,9 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -2055,8 +2062,9 @@ public class WorldServer extends World implements GeneratorAccessSeed {
// Spigot start
if ( entity instanceof EntityHuman )
{
@ -71,7 +71,7 @@ index b11af463045bbd3bab8d269fde34071ca5f026af..e26ece12d07d64e2e5a5c587b8d7371f
for (Object o : worldData.data.values() )
{
if ( o instanceof WorldMap )
@@ -2047,7 +2055,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -2073,7 +2081,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
}
}

View File

@ -67,7 +67,7 @@ index 0000000000000000000000000000000000000000..e647624f4c9afe8bc603792ad88c807e
+ }
+}
diff --git a/src/main/java/net/minecraft/core/BlockPosition.java b/src/main/java/net/minecraft/core/BlockPosition.java
index 6a6381e85fef2ae2b9b5e6dff0b7917b92fa01e5..967b4cca2a41ab30b4e988c6d389b47b0c04dc81 100644
index 2685a395a2eff9083cd8c654c4b7e2141b0ca99b..902cdf1b2ba56534d80ce270a84b8d3ab0b026dc 100644
--- a/src/main/java/net/minecraft/core/BlockPosition.java
+++ b/src/main/java/net/minecraft/core/BlockPosition.java
@@ -341,6 +341,16 @@ public class BlockPosition extends BaseBlockPosition {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Nuke streams off BlockPosition
diff --git a/src/main/java/net/minecraft/core/BlockPosition.java b/src/main/java/net/minecraft/core/BlockPosition.java
index 967b4cca2a41ab30b4e988c6d389b47b0c04dc81..0db11942386f1e504014250101f4a40b95babfdb 100644
index 902cdf1b2ba56534d80ce270a84b8d3ab0b026dc..84e753804f58cbbe1b3b30aa1fe1fecd739a1551 100644
--- a/src/main/java/net/minecraft/core/BlockPosition.java
+++ b/src/main/java/net/minecraft/core/BlockPosition.java
@@ -318,7 +318,15 @@ public class BlockPosition extends BaseBlockPosition {

View File

@ -18,10 +18,10 @@ index 76ac408021c5124fd634682cba97dc63392642f5..b8f8fe2ed501efdccc0398fdf9923191
return this.size == 0 && this.pendingTasks.isEmpty();
}
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index e26ece12d07d64e2e5a5c587b8d7371f01700e43..861c834e9bfa653e78bc884d5a9712b990a7b632 100644
index 671662c90366351b1bd364a6e29e5a4fe6c19b10..13b00ae4e2a9fd2714b9bfd6ca9015f27b492399 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -2015,6 +2015,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -2041,6 +2041,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
// Paper end

View File

@ -108,7 +108,7 @@ index 69a982832489fc78fd46418341bdcba1e2be69e9..7bcaa5be42383cd1f1cfce6457c235a8
ChatComponentText chatcomponenttext = new ChatComponentText("Internal server error");
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index b8156023746bda827f19f4e972c3bdb56340f046..5166c78fe1db631a988b6567932e1be685ebb19c 100644
index b6e11ea50e7bca0c5a7109a8715c0ede15e61e44..d571624244bf3db54ec266cb760407889fc33bf4 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -1049,6 +1049,10 @@ public abstract class World implements GeneratorAccess, AutoCloseable {

View File

@ -55,7 +55,7 @@ index 742d802d63963778454e41e5b19a3d889c544efc..13264b642a065dbbf908cef0a0f086ee
if (valid && !this.isSpectator() || this.world.isLoaded(this.getChunkCoordinates())) { // Paper - don't tick dead players that are not in the world currently (pending respawn)
super.tick();
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index 861c834e9bfa653e78bc884d5a9712b990a7b632..49b8048de109625f82988ad3baad77082e88cd61 100644
index 13b00ae4e2a9fd2714b9bfd6ca9015f27b492399..9e9ecd78a0c1803449d44df680fd19c0f6bc1154 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -169,8 +169,9 @@ import org.bukkit.event.weather.LightningStrikeEvent;
@ -379,7 +379,7 @@ index 6132c711836908569006a8993973526275c9fb7c..02f7a588f883c0ed8b5daef6839e385b
if (iblockdata.getBlock() instanceof BlockBed) {
this.world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockBed.OCCUPIED, false), 3);
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index 5166c78fe1db631a988b6567932e1be685ebb19c..2276b90a35e9f823cc20f622f4ee7ad923eefec3 100644
index d571624244bf3db54ec266cb760407889fc33bf4..b04a785c70126ad3cc60eff47dffc4a913e0dd87 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -96,7 +96,9 @@ import org.bukkit.craftbukkit.block.data.CraftBlockData;

View File

@ -140,7 +140,7 @@ index 0000000000000000000000000000000000000000..e2e4f7968a399b4641df07b2931fff6d
+}
\ No newline at end of file
diff --git a/src/main/java/net/minecraft/core/BlockPosition.java b/src/main/java/net/minecraft/core/BlockPosition.java
index 0db11942386f1e504014250101f4a40b95babfdb..ce4602c7d5a2f957f8426dc1f332ef6c7097c328 100644
index 84e753804f58cbbe1b3b30aa1fe1fecd739a1551..e3ac546214793cb9c5af19046d20216095c6cc02 100644
--- a/src/main/java/net/minecraft/core/BlockPosition.java
+++ b/src/main/java/net/minecraft/core/BlockPosition.java
@@ -18,10 +18,16 @@ import net.minecraft.world.phys.Vec3D;

View File

@ -32,7 +32,7 @@ index 0000000000000000000000000000000000000000..f78927e71258e859154cca8ba78d1713
+ }
+}
diff --git a/src/main/java/net/minecraft/core/EnumDirection.java b/src/main/java/net/minecraft/core/EnumDirection.java
index 5f2b1d763b552ee29e9bbe43c00ec85b1d78edb0..8112d7b9eddf76760b568e66642c173b6fcf4b08 100644
index e7f56ae5214af02e5dbcf16b781032545702a0d8..25b3b60abe2cb701675c359c57b4793162574ccc 100644
--- a/src/main/java/net/minecraft/core/EnumDirection.java
+++ b/src/main/java/net/minecraft/core/EnumDirection.java
@@ -100,6 +100,7 @@ public enum EnumDirection implements INamable {

View File

@ -621,7 +621,7 @@ index 0000000000000000000000000000000000000000..4e765ab19ffb300b6c810333b2dc7976
+}
\ 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 2276b90a35e9f823cc20f622f4ee7ad923eefec3..32d2145222093797bec994f5c96d94863739915d 100644
index b04a785c70126ad3cc60eff47dffc4a913e0dd87..0ac2e6a5d2492599fad179c60e67369fd2f65647 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -97,8 +97,11 @@ import org.bukkit.event.block.BlockPhysicsEvent;

@ -1 +1 @@
Subproject commit a13c511bd2e18e441852b57946cf700793d5b653
Subproject commit 125aff784d9b4f8f41de4b9c502ba39c688dddc9

@ -1 +1 @@
Subproject commit 35c6a27557ee1f61bc2d432c7b8e5d11f81d3962
Subproject commit 756162fbd31a5566db7efcdc544f67b347b782d5

@ -1 +1 @@
Subproject commit df76b3cc5abe56163c9b51b1a8eb2737601b492f
Subproject commit f32fe9aaaad11839df3d0e893aae251658940481

View File

@ -1 +1 @@
a13c511bd2e18e441852b57946cf700793d5b653
125aff784d9b4f8f41de4b9c502ba39c688dddc9

View File

@ -1 +1 @@
35c6a27557ee1f61bc2d432c7b8e5d11f81d3962
756162fbd31a5566db7efcdc544f67b347b782d5

View File

@ -1 +1 @@
df76b3cc5abe56163c9b51b1a8eb2737601b492f
f32fe9aaaad11839df3d0e893aae251658940481

View File

@ -1,4 +1,4 @@
name=Airplane
useBlackList=True
list=server/Disable-Paper-timings-by-default.patch,server/Only-check-for-spooky-season-once-an-hour.patch,server/Reduce-memory-allocations.patch,api/Fix-JB-annotations-for-gradle-credit-jpenilla.patch,server/Airplane-Branding-Changes.patch
list=server/Disable-Paper-timings-by-default.patch,server/Only-check-for-spooky-season-once-an-hour.patch,api/Fix-JB-annotations-for-gradle-credit-jpenilla.patch,server/Airplane-Branding-Changes.patch
branch=origin/master