Update to Minecraft 1.18-pre8

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-11-25 08:00:00 +11:00
parent 0d839e926c
commit 799bfc92e2
30 changed files with 206 additions and 758 deletions

View File

@@ -667,7 +667,7 @@
}
public SystemReport fillSystemReport(SystemReport systemreport) {
@@ -1351,16 +1647,17 @@
@@ -1354,16 +1650,17 @@
public CompletableFuture<Void> reloadResources(Collection<String> collection) {
CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> {
@@ -687,7 +687,7 @@
this.packRepository.setSelected(collection);
this.worldData.setDataPackConfig(getSelectedPacks(this.packRepository));
datapackresources.updateGlobals();
@@ -1714,7 +2011,7 @@
@@ -1717,7 +2014,7 @@
try {
label51:
{
@@ -696,7 +696,7 @@
try {
arraylist = Lists.newArrayList(NativeModuleLister.listModules());
@@ -1764,6 +2061,22 @@
@@ -1767,6 +2064,22 @@
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/level/ChunkProviderServer.java
+++ b/net/minecraft/server/level/ChunkProviderServer.java
@@ -83,6 +83,24 @@
@@ -86,6 +86,24 @@
this.clearCache();
}
@@ -25,7 +25,7 @@
@Override
public LightEngineThreaded getLightEngine() {
return this.lightEngine;
@@ -127,7 +145,7 @@
@@ -130,7 +148,7 @@
for (int l = 0; l < 4; ++l) {
if (k == this.lastChunkPos[l] && chunkstatus == this.lastChunkStatus[l]) {
ichunkaccess = this.lastChunk[l];
@@ -34,7 +34,7 @@
return ichunkaccess;
}
}
@@ -175,12 +193,12 @@
@@ -178,12 +196,12 @@
if (playerchunk == null) {
return null;
} else {
@@ -49,7 +49,7 @@
if (ichunkaccess1 != null) {
this.storeInCache(k, ichunkaccess1, ChunkStatus.FULL);
@@ -228,7 +246,15 @@
@@ -231,7 +249,15 @@
int l = 33 + ChunkStatus.getDistance(chunkstatus);
PlayerChunk playerchunk = this.getVisibleChunkIfPresent(k);
@@ -66,7 +66,7 @@
this.distanceManager.addTicket(TicketType.UNKNOWN, chunkcoordintpair, l, chunkcoordintpair);
if (this.chunkAbsent(playerchunk, l)) {
GameProfilerFiller gameprofilerfiller = this.level.getProfiler();
@@ -247,7 +273,7 @@
@@ -250,7 +276,7 @@
}
private boolean chunkAbsent(@Nullable PlayerChunk playerchunk, int i) {
@@ -75,7 +75,7 @@
}
@Override
@@ -314,7 +340,7 @@
@@ -317,7 +343,7 @@
} else if (!this.level.shouldTickBlocksAt(i)) {
return false;
} else {
@@ -84,7 +84,7 @@
return either != null && either.left().isPresent();
}
@@ -327,11 +353,31 @@
@@ -330,11 +356,31 @@
@Override
public void close() throws IOException {
@@ -117,7 +117,7 @@
@Override
public void tick(BooleanSupplier booleansupplier) {
this.level.getProfiler().push("purge");
@@ -360,7 +406,7 @@
@@ -363,7 +409,7 @@
gameprofilerfiller.push("pollingChunks");
int k = this.level.getGameRules().getInt(GameRules.RULE_RANDOMTICKING);
@@ -126,7 +126,7 @@
gameprofilerfiller.push("naturalSpawnCount");
int l = this.distanceManager.getNaturalSpawnChunkCount();
@@ -381,7 +427,7 @@
@@ -384,7 +430,7 @@
}
gameprofilerfiller.popPush("spawnAndTick");
@@ -135,7 +135,7 @@
Collections.shuffle(list);
Iterator iterator1 = list.iterator();
@@ -571,18 +617,26 @@
@@ -579,18 +625,26 @@
}
@Override
@@ -156,20 +156,19 @@
}
}
- private static final class a extends Record {
- private static record a(Chunk a, PlayerChunk b) {
+ // CraftBukkit start - decompile error
+ private static final record a(Chunk chunk, PlayerChunk holder) {
+ private static record a(Chunk chunk, PlayerChunk holder) {
+ /*
final Chunk chunk;
final PlayerChunk holder;
@@ -602,6 +656,8 @@
public final boolean equals(Object object) {
return this.equals<invokedynamic>(this, object);
@@ -606,5 +660,7 @@
public PlayerChunk holder() {
return this.holder;
}
+ */
+ // CraftBukkit end
public Chunk chunk() {
return this.chunk;
}
}

View File

@@ -12,7 +12,7 @@
public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.e {
private static final byte CHUNK_TYPE_REPLACEABLE = -1;
@@ -133,6 +138,27 @@
@@ -134,6 +139,27 @@
private final Queue<Runnable> unloadQueue;
int viewDistance;
@@ -40,7 +40,7 @@
public PlayerChunkMap(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler<Runnable> iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator chunkgenerator, WorldLoadListener worldloadlistener, ChunkStatusUpdateListener chunkstatusupdatelistener, Supplier<WorldPersistentData> supplier, int i, boolean flag) {
super(convertable_conversionsession.getDimensionPath(worldserver.dimension()).resolve("region"), datafixer, flag);
this.visibleChunkMap = this.updatingChunkMap.clone();
@@ -326,9 +352,12 @@
@@ -327,9 +353,12 @@
return completablefuture1.thenApply((list1) -> {
List<IChunkAccess> list2 = Lists.newArrayList();
@@ -55,16 +55,7 @@
final Either<IChunkAccess, PlayerChunk.Failure> either = (Either) iterator.next();
Optional<IChunkAccess> optional = either.left();
@@ -435,7 +464,7 @@
this.flushWorker();
} else {
this.visibleChunkMap.values().stream().filter(PlayerChunk::wasAccessibleSinceLastSave).forEach((playerchunk) -> {
- IChunkAccess ichunkaccess = (IChunkAccess) playerchunk.getChunkToSave().getNow((Object) null);
+ IChunkAccess ichunkaccess = (IChunkAccess) playerchunk.getChunkToSave().getNow(null); // CraftBukkit - decompile error
if (ichunkaccess instanceof ProtoChunkExtension || ichunkaccess instanceof Chunk) {
this.save(ichunkaccess);
@@ -488,7 +517,7 @@
@@ -490,7 +519,7 @@
private void scheduleUnload(long i, PlayerChunk playerchunk) {
CompletableFuture<IChunkAccess> completablefuture = playerchunk.getChunkToSave();
@@ -73,7 +64,7 @@
CompletableFuture<IChunkAccess> completablefuture1 = playerchunk.getChunkToSave();
if (completablefuture1 != completablefuture) {
@@ -664,7 +693,21 @@
@@ -669,7 +698,21 @@
private static void postLoadProtoChunk(WorldServer worldserver, List<NBTTagCompound> list) {
if (!list.isEmpty()) {
@@ -96,7 +87,16 @@
}
}
@@ -894,7 +937,8 @@
@@ -767,7 +810,7 @@
if (!playerchunk.wasAccessibleSinceLastSave()) {
return false;
} else {
- IChunkAccess ichunkaccess = (IChunkAccess) playerchunk.getChunkToSave().getNow((Object) null);
+ IChunkAccess ichunkaccess = (IChunkAccess) playerchunk.getChunkToSave().getNow(null); // CraftBukkit - decompile error
boolean flag;
if (ichunkaccess instanceof ProtoChunkExtension) {
@@ -922,7 +965,8 @@
return ichunkaccess instanceof Chunk ? Optional.of((Chunk) ichunkaccess) : Optional.empty();
});
@@ -106,7 +106,7 @@
return chunk.getBlockEntities().size();
}).orElse(0), tickingtracker.getTicketDebugString(i), tickingtracker.getLevel(i), optional1.map((chunk) -> {
return chunk.getBlockTicks().count();
@@ -907,7 +951,7 @@
@@ -935,7 +979,7 @@
private static String printFuture(CompletableFuture<Either<Chunk, PlayerChunk.Failure>> completablefuture) {
try {
@@ -115,7 +115,7 @@
return either != null ? (String) either.map((chunk) -> {
return "done";
@@ -925,7 +969,7 @@
@@ -953,7 +997,7 @@
private NBTTagCompound readChunk(ChunkCoordIntPair chunkcoordintpair) throws IOException {
NBTTagCompound nbttagcompound = this.read(chunkcoordintpair);
@@ -124,7 +124,7 @@
}
boolean anyPlayerCloseEnoughForSpawning(ChunkCoordIntPair chunkcoordintpair) {
@@ -1349,7 +1393,7 @@
@@ -1377,7 +1421,7 @@
public final Set<ServerPlayerConnection> seenBy = Sets.newIdentityHashSet();
public EntityTracker(Entity entity, int i, int j, boolean flag) {
@@ -133,7 +133,7 @@
this.entity = entity;
this.range = i;
this.lastSectionPos = SectionPosition.of(entity);
@@ -1402,12 +1446,20 @@
@@ -1430,12 +1474,20 @@
public void updatePlayer(EntityPlayer entityplayer) {
if (entityplayer != this.entity) {

View File

@@ -471,7 +471,7 @@
++j;
}
}
@@ -1101,7 +1282,7 @@
@@ -1102,7 +1283,7 @@
@Nullable
public BlockPosition findNearestMapFeature(StructureGenerator<?> structuregenerator, BlockPosition blockposition, int i, boolean flag) {
@@ -480,7 +480,7 @@
}
@Nullable
@@ -1138,11 +1319,21 @@
@@ -1139,11 +1320,21 @@
@Nullable
@Override
public WorldMap getMapData(String s) {
@@ -503,7 +503,7 @@
this.getServer().overworld().getDataStorage().set(s, worldmap);
}
@@ -1454,6 +1645,11 @@
@@ -1455,6 +1646,11 @@
@Override
public void blockUpdated(BlockPosition blockposition, Block block) {
if (!this.isDebug()) {
@@ -515,7 +515,7 @@
this.updateNeighborsAt(blockposition, block);
}
@@ -1473,12 +1669,12 @@
@@ -1474,12 +1670,12 @@
}
public boolean isFlat() {
@@ -530,7 +530,7 @@
}
@Nullable
@@ -1506,7 +1702,7 @@
@@ -1507,7 +1703,7 @@
private static <T> String getTypeCount(Iterable<T> iterable, Function<T, String> function) {
try {
Object2IntOpenHashMap<String> object2intopenhashmap = new Object2IntOpenHashMap();
@@ -539,7 +539,7 @@
while (iterator.hasNext()) {
T t0 = iterator.next();
@@ -1515,7 +1711,7 @@
@@ -1516,7 +1712,7 @@
object2intopenhashmap.addTo(s, 1);
}
@@ -548,7 +548,7 @@
String s1 = (String) entry.getKey();
return s1 + ":" + entry.getIntValue();
@@ -1526,17 +1722,33 @@
@@ -1527,17 +1723,33 @@
}
public static void makeObsidianPlatform(WorldServer worldserver) {
@@ -584,7 +584,7 @@
}
@Override
@@ -1629,6 +1841,7 @@
@@ -1632,6 +1844,7 @@
}
}
@@ -592,7 +592,7 @@
}
public void onTrackingEnd(Entity entity) {
@@ -1661,6 +1874,7 @@
@@ -1664,6 +1877,7 @@
gameeventlistenerregistrar.onListenerRemoved(entity.level);
}