Skip to content

Commit

Permalink
Updated Upstream (Paper)
Browse files Browse the repository at this point in the history
Upstream has released updates that appears to apply and compile correctly

Paper Changes:
3cf2c52d9 Improve Light Optimizations more
  • Loading branch information
BillyGalbreath committed Jul 31, 2020
1 parent f148002 commit e486798
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Paper
2 changes: 1 addition & 1 deletion current-paper
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.16.1--2ad7bb9931004e4da8a25a3b8857496492a2af35
1.16.1--0f64f81233910c6d9f752f3294e8d2ec9f0390ea
24 changes: 12 additions & 12 deletions patches/server/0001-Tuinity-Server-Changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4022,7 +4022,7 @@ index c14cdb6024..8ec21eb955 100644
if (chunk != null) {
playerchunkmap.callbackExecutor.execute(() -> {
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index ad8a00e0fb..78e7f6bc31 100644
index 0c70689f52..5fecf514ee 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -119,31 +119,28 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
Expand Down Expand Up @@ -4122,7 +4122,7 @@ index ad8a00e0fb..78e7f6bc31 100644
public PlayerChunkMap(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler<Runnable> iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator chunkgenerator, WorldLoadListener worldloadlistener, Supplier<WorldPersistentData> supplier, int i, boolean flag) {
super(new File(convertable_conversionsession.a(worldserver.getDimensionKey()), "region"), datafixer, flag);
//this.visibleChunks = this.updatingChunks.clone(); // Paper - no more cloning
@@ -433,6 +456,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -441,6 +464,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
PlayerChunkMap.this.sendChunk(player, new ChunkCoordIntPair(rangeX, rangeZ), null, true, false); // unloaded, loaded
});
// Paper end - no-tick view distance
Expand All @@ -4132,23 +4132,23 @@ index ad8a00e0fb..78e7f6bc31 100644
}
// Paper start - Chunk Prioritization
public void queueHolderUpdate(PlayerChunk playerchunk) {
@@ -746,6 +772,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -754,6 +780,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {

@Nullable
private PlayerChunk a(long i, int j, @Nullable PlayerChunk playerchunk, int k) {
+ com.tuinity.tuinity.util.TickThread.softEnsureTickThread("Chunk holder update"); // Tuinity
if (k > PlayerChunkMap.GOLDEN_TICKET && j > PlayerChunkMap.GOLDEN_TICKET) {
return playerchunk;
} else {
@@ -768,6 +795,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -776,6 +803,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
playerchunk.a(j);
} else {
playerchunk = new PlayerChunk(new ChunkCoordIntPair(i), j, this.lightEngine, this.p, this);
+ this.dataRegionManager.addChunk(playerchunk.location.x, playerchunk.location.z); // Tuinity
}

this.updatingChunks.put(i, playerchunk);
@@ -959,7 +987,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -967,7 +995,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}

com.destroystokyo.paper.io.PaperFileIOThread.Holder.INSTANCE.scheduleSave(this.world, chunkPos.x, chunkPos.z,
Expand All @@ -4157,7 +4157,7 @@ index ad8a00e0fb..78e7f6bc31 100644

if (!chunk.isNeedsSaving()) {
return;
@@ -993,7 +1021,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1001,7 +1029,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
asyncSaveData = ChunkRegionLoader.getAsyncSaveData(this.world, chunk);
}

Expand All @@ -4166,23 +4166,23 @@ index ad8a00e0fb..78e7f6bc31 100644
asyncSaveData, chunk);

chunk.setLastSaved(this.world.getTime());
@@ -1032,6 +1060,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1040,6 +1068,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.lightEngine.a(ichunkaccess.getPos());
this.lightEngine.queueUpdate();
this.worldLoadListener.a(ichunkaccess.getPos(), (ChunkStatus) null);
+ this.dataRegionManager.removeChunk(playerchunk.location.x, playerchunk.location.z); // Tuinity
}

}
@@ -1048,6 +1077,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1056,6 +1085,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}

protected boolean b() {
+ com.tuinity.tuinity.util.TickThread.softEnsureTickThread("Cannot update visibleChunks off of the main thread"); // Tuinity
if (!this.updatingChunksModified) {
return false;
} else {
@@ -1235,7 +1265,10 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1243,7 +1273,10 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
// Paper end
this.mailboxWorldGen.a(ChunkTaskQueueSorter.a(playerchunk, runnable));
Expand All @@ -4194,23 +4194,23 @@ index ad8a00e0fb..78e7f6bc31 100644
}

protected void c(ChunkCoordIntPair chunkcoordintpair) {
@@ -1487,6 +1520,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1495,6 +1528,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}

public void setViewDistance(int i) { // Paper - public
+ com.tuinity.tuinity.util.TickThread.softEnsureTickThread("Cannot update view distance off of the main thread"); // Tuinity
int j = MathHelper.clamp(i + 1, 3, 33); // Paper - diff on change, these make the lower view distance limit 2 and the upper 32

if (j != this.viewDistance) {
@@ -1500,6 +1534,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1508,6 +1542,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {

// Paper start - no-tick view distance
public final void setNoTickViewDistance(int viewDistance) {
+ com.tuinity.tuinity.util.TickThread.softEnsureTickThread("Cannot update view distance off of the main thread"); // Tuinity
viewDistance = viewDistance == -1 ? -1 : MathHelper.clamp(viewDistance, 2, 32);

this.noTickViewDistance = viewDistance;
@@ -2026,23 +2061,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -2034,23 +2069,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
private final void processTrackQueue() {
this.world.timings.tracker1.startTiming();
try {
Expand Down

0 comments on commit e486798

Please sign in to comment.