Update Paper

This commit is contained in:
Spottedleaf 2023-10-16 19:08:01 -07:00
parent 9190eb011c
commit 757cb09c41
5 changed files with 13 additions and 94 deletions

View File

@ -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

View File

@ -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 {
@ -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 {
@ -20778,7 +20778,7 @@ 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) {
@ -20786,7 +20786,7 @@ index 4abec88caab4116cfa318f7b66c6b1a8346a7401..197462de762592c129cc504cac17515e
// 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.
@ -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
@ -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) {
@ -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
@ -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;
}
@ -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;
}

View File

@ -1,81 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Sat, 10 Jun 2023 14:05:26 -0700
Subject: [PATCH] Remove unused skyLightSources
Starlight does not use the sky light sources, and there
appear to be issues with TE access on Folia when initializing
them. So, we can just delete it entirely.
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
index 8b96d1b7548d354fbcabe6d1b5e9d6c3e2a5cb9d..e8fb179c5f443efd70293f31cdf00ca2eaf05006 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
@@ -74,7 +74,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
@Nullable
protected BlendingData blendingData;
public final Map<Heightmap.Types, Heightmap> heightmaps = Maps.newEnumMap(Heightmap.Types.class);
- protected ChunkSkyLightSources skyLightSources;
+ // Folia - remove unused skyLightSources
private final Map<Structure, StructureStart> structureStarts = Maps.newHashMap();
private final Map<Structure, LongSet> structuresRefences = Maps.newHashMap();
protected final Map<BlockPos, CompoundTag> pendingBlockEntities = Maps.newHashMap();
@@ -137,7 +137,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
this.inhabitedTime = inhabitedTime;
this.postProcessing = new ShortList[heightLimitView.getSectionsCount()];
this.blendingData = blendingData;
- this.skyLightSources = new ChunkSkyLightSources(heightLimitView);
+ // Folia - remove unused skyLightSources
if (sectionArray != null) {
if (this.sections.length == sectionArray.length) {
System.arraycopy(sectionArray, 0, this.sections, 0, this.sections.length);
@@ -549,12 +549,12 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
}
public void initializeLightSources() {
- this.skyLightSources.fillFrom(this);
+ // Folia - remove unused skyLightSources
}
@Override
public ChunkSkyLightSources getSkyLightSources() {
- return this.skyLightSources;
+ return null; // Folia - remove unused skyLightSources
}
public static record TicksToSave(SerializableTickContainer<Block> blocks, SerializableTickContainer<Fluid> fluids) {
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 197462de762592c129cc504cac17515ebd5aa38a..c474dec43f4c46421cdabc1154e22a3b269b0f11 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -264,7 +264,7 @@ public class LevelChunk extends ChunkAccess {
}
}
- this.skyLightSources = protoChunk.skyLightSources;
+ // Folia - remove unused skyLightSources
this.setLightCorrect(protoChunk.isLightCorrect());
this.unsaved = true;
this.needsDecoration = true; // CraftBukkit
@@ -456,7 +456,7 @@ public class LevelChunk extends ChunkAccess {
ProfilerFiller gameprofilerfiller = this.level.getProfiler();
gameprofilerfiller.push("updateSkyLightSources");
- this.skyLightSources.update(this, j, i, l);
+ // Folia - remove unused skyLightSources
gameprofilerfiller.popPush("queueCheckLight");
this.level.getChunkSource().getLightEngine().checkBlock(blockposition);
gameprofilerfiller.pop();
diff --git a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
index 6c72eb36020bc05104b21e52cea89de09b85f2d7..d361975826247a85a6aa5989814b525c2d1cbbc7 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
@@ -140,7 +140,7 @@ public class ProtoChunk extends ChunkAccess {
}
if (LightEngine.hasDifferentLightProperties(this, pos, blockState, state)) {
- this.skyLightSources.update(this, m, j, o);
+ // Folia - remove unused skyLightSources
this.lightEngine.checkBlock(pos);
}
}

View File

@ -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)) {
@ -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});
}