Skip to content

Commit

Permalink
Update Paper
Browse files Browse the repository at this point in the history
  • Loading branch information
Spottedleaf committed Oct 17, 2023
1 parent 9190eb0 commit 757cb09
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 94 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ group=dev.folia

version=1.20.2-R0.1-SNAPSHOT
mcVersion=1.20.2
paperRef=e57af7d01e509c747520cc1037169029256289bf
paperRef=4b0bc74c90582f2d52d720c795228130545cd103

org.gradle.caching=true
org.gradle.parallel=true
Expand Down
18 changes: 9 additions & 9 deletions patches/server/0003-Threaded-Regions.patch
Original file line number Diff line number Diff line change
Expand Up @@ -14712,7 +14712,7 @@ index 658e63ebde81dc14c8ab5850fb246dc0aab25dea..7e1f15ac8d2f7c86d4aba1be5df71705
public static <T> TicketType<T> create(String name, Comparator<T> argumentComparator) {
return new TicketType<>(name, argumentComparator, 0L);
diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
index 877498729c66de9aa6a27c9148f7494d7895615c..d8af2d59fb1f112f2f1a9fdbb3517fc72a2e572d 100644
index 50ed7cfe1ecef6d075ba484804827cec83ba2bf2..41c03421edd88dba669354595a2ace1277d93af6 100644
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
@@ -84,6 +84,13 @@ public class WorldGenRegion implements WorldGenLevel {
Expand Down Expand Up @@ -20761,7 +20761,7 @@ index d5c2a608e1b4c8099c96b33d9d758e968350a46d..1a4da589142c515e713d879095b105de
return true;
} else {
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index 4abec88caab4116cfa318f7b66c6b1a8346a7401..197462de762592c129cc504cac17515ebd5aa38a 100644
index 3e9758fa40bf93fe3d315cc66389193bd57bc393..20884dc82f8c95ec5ca92448c856fa9bc2c1e3ee 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -59,6 +59,13 @@ public class LevelChunk extends ChunkAccess {
Expand All @@ -20778,15 +20778,15 @@ index 4abec88caab4116cfa318f7b66c6b1a8346a7401..197462de762592c129cc504cac17515e
@Override
public boolean isRemoved() {
return true;
@@ -416,6 +423,7 @@ public class LevelChunk extends ChunkAccess {
@@ -412,6 +419,7 @@ public class LevelChunk extends ChunkAccess {

@Nullable
public BlockState setBlockState(BlockPos blockposition, BlockState iblockdata, boolean flag, boolean doPlace) {
+ io.papermc.paper.util.TickThread.ensureTickThread(this.level, blockposition, "Updating block asynchronously"); // Folia - region threading
// CraftBukkit end
int i = blockposition.getY();
LevelChunkSection chunksection = this.getSection(this.getSectionIndex(i));
@@ -466,7 +474,7 @@ public class LevelChunk extends ChunkAccess {
@@ -462,7 +470,7 @@ public class LevelChunk extends ChunkAccess {
return null;
} else {
// CraftBukkit - Don't place while processing the BlockPlaceEvent, unless it's a BlockContainer. Prevents blocks such as TNT from activating when cancelled.
Expand All @@ -20795,7 +20795,7 @@ index 4abec88caab4116cfa318f7b66c6b1a8346a7401..197462de762592c129cc504cac17515e
iblockdata.onPlace(this.level, blockposition, iblockdata1, flag);
}

@@ -513,7 +521,7 @@ public class LevelChunk extends ChunkAccess {
@@ -509,7 +517,7 @@ public class LevelChunk extends ChunkAccess {
@Nullable
public BlockEntity getBlockEntity(BlockPos pos, LevelChunk.EntityCreationType creationType) {
// CraftBukkit start
Expand All @@ -20804,7 +20804,7 @@ index 4abec88caab4116cfa318f7b66c6b1a8346a7401..197462de762592c129cc504cac17515e
if (tileentity == null) {
tileentity = (BlockEntity) this.blockEntities.get(pos);
}
@@ -800,13 +808,13 @@ public class LevelChunk extends ChunkAccess {
@@ -796,13 +804,13 @@ public class LevelChunk extends ChunkAccess {

org.bukkit.World world = this.level.getWorld();
if (world != null) {
Expand All @@ -20820,7 +20820,7 @@ index 4abec88caab4116cfa318f7b66c6b1a8346a7401..197462de762592c129cc504cac17515e
}
}
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk));
@@ -856,7 +864,7 @@ public class LevelChunk extends ChunkAccess {
@@ -852,7 +860,7 @@ public class LevelChunk extends ChunkAccess {
@Override
public boolean isUnsaved() {
// Paper start - add dirty system to tick lists
Expand All @@ -20829,7 +20829,7 @@ index 4abec88caab4116cfa318f7b66c6b1a8346a7401..197462de762592c129cc504cac17515e
if (this.blockTicks.isDirty(gameTime) || this.fluidTicks.isDirty(gameTime)) {
return true;
}
@@ -1122,6 +1130,13 @@ public class LevelChunk extends ChunkAccess {
@@ -1118,6 +1126,13 @@ public class LevelChunk extends ChunkAccess {
this.ticker = wrapped;
}

Expand All @@ -20843,7 +20843,7 @@ index 4abec88caab4116cfa318f7b66c6b1a8346a7401..197462de762592c129cc504cac17515e
@Override
public void tick() {
this.ticker.tick();
@@ -1158,6 +1173,13 @@ public class LevelChunk extends ChunkAccess {
@@ -1154,6 +1169,13 @@ public class LevelChunk extends ChunkAccess {
this.ticker = blockentityticker;
}

Expand Down
81 changes: 0 additions & 81 deletions patches/server/0017-Remove-unused-skyLightSources.patch

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -1913,10 +1913,10 @@ index 2c1bc515468e2ba99d463021758fb72ef160fbe9..93cc5523a1c3637bf4f04ff4ef0f8ef6
}
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index c474dec43f4c46421cdabc1154e22a3b269b0f11..f5a613ab1bb999a359a54de5314b14e8ed7cebc2 100644
index 20884dc82f8c95ec5ca92448c856fa9bc2c1e3ee..955d125e028f83a79068d5ad6aa7c38e67a5f55a 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -1186,11 +1186,14 @@ public class LevelChunk extends ChunkAccess {
@@ -1182,11 +1182,14 @@ public class LevelChunk extends ChunkAccess {
BlockPos blockposition = this.blockEntity.getBlockPos();

if (LevelChunk.this.isTicking(blockposition)) {
Expand All @@ -1931,7 +1931,7 @@ index c474dec43f4c46421cdabc1154e22a3b269b0f11..f5a613ab1bb999a359a54de5314b14e8
BlockState iblockdata = LevelChunk.this.getBlockState(blockposition);

if (this.blockEntity.getType().isValid(iblockdata)) {
@@ -1200,6 +1203,7 @@ public class LevelChunk extends ChunkAccess {
@@ -1196,6 +1199,7 @@ public class LevelChunk extends ChunkAccess {
this.loggedInvalidBlockState = true;
LevelChunk.LOGGER.warn("Block entity {} @ {} state {} invalid for ticking:", new Object[]{LogUtils.defer(this::getType), LogUtils.defer(this::getPos), iblockdata});
}
Expand Down

0 comments on commit 757cb09

Please sign in to comment.