mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 21:31:25 +01:00
do some work
This commit is contained in:
parent
47ee5579ff
commit
7f1e33effe
@ -38,13 +38,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
- // CraftBukkit start - void -> boolean
|
- // CraftBukkit start - void -> boolean
|
||||||
- protected boolean actuallyHurt(DamageSource damagesource, float f) {
|
- public boolean actuallyHurt(DamageSource damagesource, float f) {
|
||||||
- boolean hurt = super.actuallyHurt(damagesource, f);
|
- boolean hurt = super.actuallyHurt(damagesource, f);
|
||||||
- if (!hurt) {
|
- if (!hurt) {
|
||||||
- return hurt;
|
- return hurt;
|
||||||
- }
|
- }
|
||||||
- // CraftBukkit end
|
- // CraftBukkit end
|
||||||
+ protected boolean actuallyHurt(DamageSource damagesource, float f) { // Paper - change return type to boolean
|
+ public boolean actuallyHurt(DamageSource damagesource, float f) { // Paper - change return type to boolean
|
||||||
this.standUpInstantly();
|
this.standUpInstantly();
|
||||||
- return hurt; // CraftBukkit
|
- return hurt; // CraftBukkit
|
||||||
+ return super.actuallyHurt(damagesource, f); // Paper - change return type to boolean
|
+ return super.actuallyHurt(damagesource, f); // Paper - change return type to boolean
|
||||||
@ -56,8 +56,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java
|
--- a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java
|
+++ b/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java
|
||||||
@@ -0,0 +0,0 @@ public class StructureCheck {
|
@@ -0,0 +0,0 @@ public class StructureCheck {
|
||||||
private final Registry<Biome> biomes;
|
private final ChunkScanAccess storageAccess;
|
||||||
private final Registry<Structure> structureConfigs;
|
private final RegistryAccess registryAccess;
|
||||||
private final StructureTemplateManager structureTemplateManager;
|
private final StructureTemplateManager structureTemplateManager;
|
||||||
- private final ResourceKey<Level> dimension;
|
- private final ResourceKey<Level> dimension;
|
||||||
+ private final ResourceKey<net.minecraft.world.level.dimension.LevelStem> dimension; // Paper - fix missing CB diff
|
+ private final ResourceKey<net.minecraft.world.level.dimension.LevelStem> dimension; // Paper - fix missing CB diff
|
||||||
@ -96,11 +96,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
|
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
|
||||||
Preconditions.checkArgument(key != null, "NamespacedKey key cannot be null");
|
Preconditions.checkArgument(key != null, "NamespacedKey key cannot be null");
|
||||||
|
|
||||||
LootDataManager registry = this.getServer().getLootData();
|
ReloadableServerRegistries.Holder registry = this.getServer().reloadableRegistries();
|
||||||
- return new CraftLootTable(key, registry.getLootTable(CraftNamespacedKey.toMinecraft(key)));
|
- return new CraftLootTable(key, registry.getLootTable(CraftLootTable.bukkitKeyToMinecraft(key)));
|
||||||
+ // Paper start - honor method contract
|
+ // Paper start - honor method contract
|
||||||
+ final ResourceLocation lootTableKey = CraftNamespacedKey.toMinecraft(key);
|
+ final ResourceKey<net.minecraft.world.level.storage.loot.LootTable> lootTableKey = CraftLootTable.bukkitKeyToMinecraft(key);
|
||||||
+ final Optional<net.minecraft.world.level.storage.loot.LootTable> table = registry.getElementOptional(net.minecraft.world.level.storage.loot.LootDataType.TABLE, lootTableKey);
|
+ final Optional<net.minecraft.world.level.storage.loot.LootTable> table = registry.get().lookup(Registries.LOOT_TABLE)
|
||||||
|
+ .flatMap(registryEntryLookup -> registryEntryLookup.get(lootTableKey))
|
||||||
|
+ .map(net.minecraft.core.Holder::value);
|
||||||
+ return table.map(lootTable -> new CraftLootTable(key, lootTable)).orElse(null);
|
+ return table.map(lootTable -> new CraftLootTable(key, lootTable)).orElse(null);
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
}
|
}
|
||||||
@ -111,9 +113,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
@@ -0,0 +0,0 @@ public class Main {
|
@@ -0,0 +0,0 @@ public class Main {
|
||||||
|
|
||||||
this.acceptsAll(Main.asList("forceUpgrade"), "Whether to force a world upgrade");
|
this.acceptsAll(Main.asList("forceUpgrade"), "Whether to force a world upgrade");
|
||||||
this.acceptsAll(Main.asList("eraseCache"), "Whether to force cache erase during world upgrade");
|
this.acceptsAll(Main.asList("eraseCache"), "Whether to force cache erase during world upgrade");
|
||||||
|
this.acceptsAll(Main.asList("recreateRegionFiles"), "Whether to recreate region files during world upgrade");
|
||||||
+ this.accepts("safeMode", "Loads level with vanilla datapack only"); // Paper
|
+ this.accepts("safeMode", "Loads level with vanilla datapack only"); // Paper
|
||||||
this.acceptsAll(Main.asList("nogui"), "Disables the graphical console");
|
this.acceptsAll(Main.asList("nogui"), "Disables the graphical console");
|
||||||
|
|
@ -34,8 +34,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
Bootstrap.checkBootstrapCalled(() -> "registry " + key);
|
Bootstrap.checkBootstrapCalled(() -> "registry " + key);
|
||||||
ResourceLocation resourceLocation = key.location();
|
ResourceLocation resourceLocation = key.location();
|
||||||
LOADERS.put(resourceLocation, () -> initializer.run(registry));
|
LOADERS.put(resourceLocation, () -> initializer.run(registry));
|
||||||
- WRITABLE_REGISTRY.register((ResourceKey<WritableRegistry<?>>)key, registry, lifecycle);
|
- WRITABLE_REGISTRY.register((ResourceKey<WritableRegistry<?>>)key, registry, RegistrationInfo.BUILT_IN);
|
||||||
+ WRITABLE_REGISTRY.register((ResourceKey)key, registry, lifecycle); // Paper - decompile fix
|
+ WRITABLE_REGISTRY.register((ResourceKey)key, registry, RegistrationInfo.BUILT_IN); // Paper - decompile fix
|
||||||
return registry;
|
return registry;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,28 +58,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!this.hasElementSeparator()) {
|
if (!this.hasElementSeparator()) {
|
||||||
diff --git a/src/main/java/net/minecraft/network/ConnectionProtocol.java b/src/main/java/net/minecraft/network/ConnectionProtocol.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/net/minecraft/network/ConnectionProtocol.java
|
|
||||||
+++ b/src/main/java/net/minecraft/network/ConnectionProtocol.java
|
|
||||||
@@ -0,0 +0,0 @@ public enum ConnectionProtocol {
|
|
||||||
protocol()
|
|
||||||
.addFlow(
|
|
||||||
PacketFlow.CLIENTBOUND,
|
|
||||||
- new ConnectionProtocol.PacketSet<ClientCommonPacketListener>()
|
|
||||||
+ new ConnectionProtocol.PacketSet<net.minecraft.network.protocol.configuration.ClientConfigurationPacketListener>() // Paper - decompile fix
|
|
||||||
.addPacket(ClientboundCustomPayloadPacket.class, ClientboundCustomPayloadPacket::new)
|
|
||||||
.addPacket(ClientboundDisconnectPacket.class, ClientboundDisconnectPacket::new)
|
|
||||||
.addPacket(ClientboundFinishConfigurationPacket.class, ClientboundFinishConfigurationPacket::new)
|
|
||||||
@@ -0,0 +0,0 @@ public enum ConnectionProtocol {
|
|
||||||
)
|
|
||||||
.addFlow(
|
|
||||||
PacketFlow.SERVERBOUND,
|
|
||||||
- new ConnectionProtocol.PacketSet<ServerCommonPacketListener>()
|
|
||||||
+ new ConnectionProtocol.PacketSet<net.minecraft.network.protocol.configuration.ServerConfigurationPacketListener>() // Paper - decompile fix
|
|
||||||
.addPacket(ServerboundClientInformationPacket.class, ServerboundClientInformationPacket::new)
|
|
||||||
.addPacket(ServerboundCustomPayloadPacket.class, ServerboundCustomPayloadPacket::new)
|
|
||||||
.addPacket(ServerboundFinishConfigurationPacket.class, ServerboundFinishConfigurationPacket::new)
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@ -106,16 +84,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static <T> SortedArraySet<T> create(Comparator<T> comparator) {
|
public static <T> SortedArraySet<T> create(Comparator<T> comparator) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
|
||||||
@@ -0,0 +0,0 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
|
|
||||||
}
|
|
||||||
|
|
||||||
this.recipes = (Map) map1.entrySet().stream().collect(ImmutableMap.toImmutableMap(Entry::getKey, (entry1) -> {
|
|
||||||
- return (entry1.getValue()); // CraftBukkit
|
|
||||||
+ return entry1.getValue(); // CraftBukkit // Paper - decompile fix - *shrugs internally* // todo: is this needed anymore?
|
|
||||||
}));
|
|
||||||
this.byName = Maps.newHashMap(builder.build()); // CraftBukkit
|
|
||||||
RecipeManager.LOGGER.info("Loaded {} recipes", map1.size());
|
|
@ -6000,15 +6000,15 @@ diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/j
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/network/PacketEncoder.java
|
--- a/src/main/java/net/minecraft/network/PacketEncoder.java
|
||||||
+++ b/src/main/java/net/minecraft/network/PacketEncoder.java
|
+++ b/src/main/java/net/minecraft/network/PacketEncoder.java
|
||||||
@@ -0,0 +0,0 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
@@ -0,0 +0,0 @@ public class PacketEncoder<T extends PacketListener> extends MessageToByteEncode
|
||||||
|
|
||||||
JvmProfiler.INSTANCE.onPacketSent(codecData.protocol(), i, channelHandlerContext.channel().remoteAddress(), k);
|
JvmProfiler.INSTANCE.onPacketSent(this.protocolInfo.id(), packetType, channelHandlerContext.channel().remoteAddress(), i);
|
||||||
} catch (Throwable var13) {
|
} catch (Throwable var9) {
|
||||||
- LOGGER.error("Error receiving packet {}", i, var13);
|
- LOGGER.error("Error sending packet {}", packetType, var9);
|
||||||
+ LOGGER.error("Packet encoding of packet ID {} threw (skippable? {})", i, packet.isSkippable(), var13); // Paper - Give proper error message
|
+ LOGGER.error("Error sending packet {} (skippable? {})", packetType, packet.isSkippable(), var9);
|
||||||
if (packet.isSkippable()) {
|
if (packet.isSkippable()) {
|
||||||
throw new SkipPacketException(var13);
|
throw new SkipPacketException(var9);
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/network/protocol/login/ClientboundCustomQueryPacket.java b/src/main/java/net/minecraft/network/protocol/login/ClientboundCustomQueryPacket.java
|
diff --git a/src/main/java/net/minecraft/network/protocol/login/ClientboundCustomQueryPacket.java b/src/main/java/net/minecraft/network/protocol/login/ClientboundCustomQueryPacket.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/network/protocol/login/ClientboundCustomQueryPacket.java
|
--- a/src/main/java/net/minecraft/network/protocol/login/ClientboundCustomQueryPacket.java
|
||||||
@ -6130,14 +6130,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
@@ -0,0 +0,0 @@ public class ChunkHolder {
|
@@ -0,0 +0,0 @@ public class ChunkHolder {
|
||||||
private static final List<ChunkStatus> CHUNK_STATUSES = ChunkStatus.getStatusList();
|
private static final List<ChunkStatus> CHUNK_STATUSES = ChunkStatus.getStatusList();
|
||||||
private final AtomicReferenceArray<CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>>> futures;
|
private final AtomicReferenceArray<CompletableFuture<ChunkResult<ChunkAccess>>> futures;
|
||||||
private final LevelHeightAccessor levelHeightAccessor;
|
private final LevelHeightAccessor levelHeightAccessor;
|
||||||
- private volatile CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> fullChunkFuture;
|
- private volatile CompletableFuture<ChunkResult<LevelChunk>> fullChunkFuture;
|
||||||
- private volatile CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> tickingChunkFuture;
|
- private volatile CompletableFuture<ChunkResult<LevelChunk>> tickingChunkFuture;
|
||||||
- private volatile CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> entityTickingChunkFuture;
|
- private volatile CompletableFuture<ChunkResult<LevelChunk>> entityTickingChunkFuture;
|
||||||
+ private volatile CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> fullChunkFuture; private int fullChunkCreateCount; private volatile boolean isFullChunkReady; // Paper - cache chunk ticking stage
|
+ private volatile CompletableFuture<ChunkResult<LevelChunk>> fullChunkFuture; private int fullChunkCreateCount; private volatile boolean isFullChunkReady; // Paper - cache chunk ticking stage
|
||||||
+ private volatile CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> tickingChunkFuture; private volatile boolean isTickingReady; // Paper - cache chunk ticking stage
|
+ private volatile CompletableFuture<ChunkResult<LevelChunk>> tickingChunkFuture; private volatile boolean isTickingReady; // Paper - cache chunk ticking stage
|
||||||
+ private volatile CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> entityTickingChunkFuture; private volatile boolean isEntityTickingReady; // Paper - cache chunk ticking stage
|
+ private volatile CompletableFuture<ChunkResult<LevelChunk>> entityTickingChunkFuture; private volatile boolean isEntityTickingReady; // Paper - cache chunk ticking stage
|
||||||
private CompletableFuture<ChunkAccess> chunkToSave;
|
private CompletableFuture<ChunkAccess> chunkToSave;
|
||||||
@Nullable
|
@Nullable
|
||||||
private final DebugBuffer<ChunkHolder.ChunkSaveDebug> chunkToSaveHistory;
|
private final DebugBuffer<ChunkHolder.ChunkSaveDebug> chunkToSaveHistory;
|
||||||
@ -6188,36 +6188,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
return ChunkLevel.generationStatus(this.ticketLevel).isOrAfter(leastStatus) ? this.getFutureIfPresentUnchecked(leastStatus) : ChunkHolder.UNLOADED_CHUNK_FUTURE;
|
return ChunkLevel.generationStatus(this.ticketLevel).isOrAfter(leastStatus) ? this.getFutureIfPresentUnchecked(leastStatus) : ChunkHolder.UNLOADED_CHUNK_FUTURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
- public CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> getTickingChunkFuture() {
|
- public CompletableFuture<ChunkResult<LevelChunk>> getTickingChunkFuture() {
|
||||||
+ public final CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> getTickingChunkFuture() { // Paper - final for inline
|
+ public final CompletableFuture<ChunkResult<LevelChunk>> getTickingChunkFuture() { // Paper - final for inline
|
||||||
return this.tickingChunkFuture;
|
return this.tickingChunkFuture;
|
||||||
}
|
}
|
||||||
|
|
||||||
- public CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> getEntityTickingChunkFuture() {
|
- public CompletableFuture<ChunkResult<LevelChunk>> getEntityTickingChunkFuture() {
|
||||||
+ public final CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> getEntityTickingChunkFuture() { // Paper - final for inline
|
+ public final CompletableFuture<ChunkResult<LevelChunk>> getEntityTickingChunkFuture() { // Paper - final for inline
|
||||||
return this.entityTickingChunkFuture;
|
return this.entityTickingChunkFuture;
|
||||||
}
|
}
|
||||||
|
|
||||||
- public CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> getFullChunkFuture() {
|
- public CompletableFuture<ChunkResult<LevelChunk>> getFullChunkFuture() {
|
||||||
+ public final CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> getFullChunkFuture() { // Paper - final for inline
|
+ public final CompletableFuture<ChunkResult<LevelChunk>> getFullChunkFuture() { // Paper - final for inline
|
||||||
return this.fullChunkFuture;
|
return this.fullChunkFuture;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
- public LevelChunk getTickingChunk() {
|
- public LevelChunk getTickingChunk() {
|
||||||
+ public final LevelChunk getTickingChunk() { // Paper - final for inline
|
+ public final LevelChunk getTickingChunk() { // Paper - final for inline
|
||||||
CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> completablefuture = this.getTickingChunkFuture();
|
return (LevelChunk) ((ChunkResult) this.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).orElse(null); // CraftBukkit - decompile error
|
||||||
Either<LevelChunk, ChunkHolder.ChunkLoadingFailure> either = (Either) completablefuture.getNow(null); // CraftBukkit - decompile error
|
|
||||||
|
|
||||||
@@ -0,0 +0,0 @@ public class ChunkHolder {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
|
||||||
- public LevelChunk getFullChunk() {
|
|
||||||
+ public final LevelChunk getFullChunk() { // Paper - final for inline
|
|
||||||
CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> completablefuture = this.getFullChunkFuture();
|
|
||||||
Either<LevelChunk, ChunkHolder.ChunkLoadingFailure> either = (Either) completablefuture.getNow(null); // CraftBukkit - decompile error
|
|
||||||
|
|
||||||
@@ -0,0 +0,0 @@ public class ChunkHolder {
|
@@ -0,0 +0,0 @@ public class ChunkHolder {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -6349,8 +6340,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
}
|
}
|
||||||
|
|
||||||
@@ -0,0 +0,0 @@ public class ChunkHolder {
|
@@ -0,0 +0,0 @@ public class ChunkHolder {
|
||||||
}
|
private static record ChunkSaveDebug(Thread thread, CompletableFuture<?> future, String source) {
|
||||||
};
|
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
@ -6432,12 +6423,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ // Paper end
|
+ // Paper end
|
||||||
+
|
+
|
||||||
public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureTemplateManager structureTemplateManager, Executor executor, BlockableEventLoop<Runnable> mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory, int viewDistance, boolean dsync) {
|
public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureTemplateManager structureTemplateManager, Executor executor, BlockableEventLoop<Runnable> mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory, int viewDistance, boolean dsync) {
|
||||||
super(session.getDimensionPath(world.dimension()).resolve("region"), dataFixer, dsync);
|
super(new RegionStorageInfo(session.getLevelId(), world.dimension(), "chunk"), session.getDimensionPath(world.dimension()).resolve("region"), dataFixer, dsync);
|
||||||
this.visibleChunkMap = this.updatingChunkMap.clone();
|
this.visibleChunkMap = this.updatingChunkMap.clone();
|
||||||
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
this.overworldDataStorage = persistentStateManagerFactory;
|
this.poiManager = new PoiManager(new RegionStorageInfo(session.getLevelId(), world.dimension(), "poi"), path.resolve("poi"), dataFixer, dsync, iregistrycustom, world);
|
||||||
this.poiManager = new PoiManager(path.resolve("poi"), dataFixer, dsync, iregistrycustom, world);
|
|
||||||
this.setServerViewDistance(viewDistance);
|
this.setServerViewDistance(viewDistance);
|
||||||
|
this.worldGenContext = new WorldGenContext(world, chunkGenerator, structureTemplateManager, this.lightEngine);
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ this.dataRegionManager = new io.papermc.paper.chunk.SingleThreadChunkRegionManager(this.level, 2, (1.0 / 3.0), 1, 6, "Data", DataRegionData::new, DataRegionSectionData::new);
|
+ this.dataRegionManager = new io.papermc.paper.chunk.SingleThreadChunkRegionManager(this.level, 2, (1.0 / 3.0), 1, 6, "Data", DataRegionData::new, DataRegionSectionData::new);
|
||||||
+ this.regionManagers.add(this.dataRegionManager);
|
+ this.regionManagers.add(this.dataRegionManager);
|
||||||
@ -6531,8 +6522,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
}
|
}
|
||||||
|
|
||||||
int l = 0;
|
int l = 0;
|
||||||
- ObjectIterator objectiterator = this.visibleChunkMap.values().iterator();
|
- ObjectIterator<ChunkHolder> objectiterator = this.visibleChunkMap.values().iterator();
|
||||||
+ Iterator objectiterator = io.papermc.paper.chunk.system.ChunkSystem.getVisibleChunkHolders(this.level).iterator(); // Paper
|
+ Iterator<ChunkHolder> objectiterator = io.papermc.paper.chunk.system.ChunkSystem.getVisibleChunkHolders(this.level).iterator(); // Paper
|
||||||
|
|
||||||
while (l < 20 && shouldKeepTicking.getAsBoolean() && objectiterator.hasNext()) {
|
while (l < 20 && shouldKeepTicking.getAsBoolean() && objectiterator.hasNext()) {
|
||||||
if (this.saveChunkIfNeeded((ChunkHolder) objectiterator.next())) {
|
if (this.saveChunkIfNeeded((ChunkHolder) objectiterator.next())) {
|
||||||
@ -6643,9 +6634,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
- private class ChunkDistanceManager extends DistanceManager {
|
- private class ChunkDistanceManager extends DistanceManager {
|
||||||
+ public class ChunkDistanceManager extends DistanceManager { // Paper - public
|
+ public class ChunkDistanceManager extends DistanceManager { // Paper - public
|
||||||
|
|
||||||
protected ChunkDistanceManager(Executor workerExecutor, Executor mainThreadExecutor) {
|
protected ChunkDistanceManager(final Executor workerExecutor, final Executor mainThreadExecutor) {
|
||||||
- super(workerExecutor, mainThreadExecutor);
|
- super(workerExecutor, mainThreadExecutor);
|
||||||
+ super(workerExecutor, mainThreadExecutor, ChunkMap.this);
|
+ super(workerExecutor, mainThreadExecutor, ChunkMap.this); // Paper
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -6678,7 +6669,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
public void removeTicketsOnClosing() {
|
public void removeTicketsOnClosing() {
|
||||||
- ImmutableSet<TicketType<?>> immutableset = ImmutableSet.of(TicketType.UNKNOWN, TicketType.POST_TELEPORT, TicketType.LIGHT);
|
- ImmutableSet<TicketType<?>> immutableset = ImmutableSet.of(TicketType.UNKNOWN, TicketType.POST_TELEPORT, TicketType.LIGHT);
|
||||||
+ ImmutableSet<TicketType<?>> immutableset = ImmutableSet.of(TicketType.UNKNOWN, TicketType.POST_TELEPORT, TicketType.LIGHT, TicketType.FUTURE_AWAIT); // Paper - add additional tickets to preserve
|
+ ImmutableSet<TicketType<?>> immutableset = ImmutableSet.of(TicketType.UNKNOWN, TicketType.POST_TELEPORT, TicketType.LIGHT, TicketType.FUTURE_AWAIT); // Paper - add additional tickets to preserve
|
||||||
ObjectIterator objectiterator = this.tickets.long2ObjectEntrySet().fastIterator();
|
ObjectIterator<Entry<SortedArraySet<Ticket<?>>>> objectiterator = this.tickets.long2ObjectEntrySet().fastIterator();
|
||||||
|
|
||||||
while (objectiterator.hasNext()) {
|
while (objectiterator.hasNext()) {
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
@ -6972,8 +6963,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) {
|
public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) {
|
||||||
super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile);
|
super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile);
|
||||||
@@ -0,0 +0,0 @@ public class ServerPlayer extends Player {
|
@@ -0,0 +0,0 @@ public class ServerPlayer extends Player {
|
||||||
this.fudgeSpawnLocation(world);
|
|
||||||
this.updateOptions(clientOptions);
|
this.updateOptions(clientOptions);
|
||||||
|
this.object = null;
|
||||||
|
|
||||||
+ this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper
|
+ this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper
|
||||||
+
|
+
|
||||||
@ -7034,7 +7025,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ player.isRealPlayer = true; // Paper
|
+ player.isRealPlayer = true; // Paper
|
||||||
GameProfile gameprofile = player.getGameProfile();
|
GameProfile gameprofile = player.getGameProfile();
|
||||||
GameProfileCache usercache = this.server.getProfileCache();
|
GameProfileCache usercache = this.server.getProfileCache();
|
||||||
String s;
|
// Optional optional; // CraftBukkit - decompile error
|
||||||
diff --git a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
|
diff --git a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
|
--- a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
|
||||||
@ -7057,7 +7048,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
return this.level.hasChunk((int) Math.floor(this.getX()) >> 4, (int) Math.floor(this.getZ()) >> 4);
|
return this.level.hasChunk((int) Math.floor(this.getX()) >> 4, (int) Math.floor(this.getZ()) >> 4);
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@ -7085,14 +7076,15 @@ diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/n
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
|
||||||
return this.target;
|
return this.target;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ public org.bukkit.craftbukkit.entity.CraftMob getBukkitMob() { return (org.bukkit.craftbukkit.entity.CraftMob) super.getBukkitEntity(); } // Paper
|
+ public org.bukkit.craftbukkit.entity.CraftMob getBukkitMob() { return (org.bukkit.craftbukkit.entity.CraftMob) super.getBukkitEntity(); } // Paper
|
||||||
public void setTarget(@Nullable LivingEntity target) {
|
+
|
||||||
// CraftBukkit start - fire event
|
@Nullable
|
||||||
this.setTarget(target, EntityTargetEvent.TargetReason.UNKNOWN, true);
|
protected final LivingEntity getTargetFromBrain() {
|
||||||
|
return (LivingEntity) this.getBrain().getMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); // CraftBukkit - decompile error
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/PathfinderMob.java b/src/main/java/net/minecraft/world/entity/PathfinderMob.java
|
diff --git a/src/main/java/net/minecraft/world/entity/PathfinderMob.java b/src/main/java/net/minecraft/world/entity/PathfinderMob.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/PathfinderMob.java
|
--- a/src/main/java/net/minecraft/world/entity/PathfinderMob.java
|
||||||
@ -7122,8 +7114,8 @@ diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/ja
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||||
@@ -0,0 +0,0 @@ public final class ItemStack {
|
@@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder {
|
||||||
return this.tag != null ? this.tag.getList("Enchantments", 10) : new ListTag();
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // Paper start - (this is just a good no conflict location)
|
+ // Paper start - (this is just a good no conflict location)
|
||||||
@ -7145,10 +7137,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
+
|
+
|
||||||
public void setTag(@Nullable CompoundTag nbt) {
|
public void applyComponents(DataComponentPatch changes) {
|
||||||
this.tag = nbt;
|
this.components.applyPatch(changes);
|
||||||
if (this.getItem().canBeDepleted()) {
|
this.getItem().verifyComponentsAfterLoad(this);
|
||||||
@@ -0,0 +0,0 @@ public final class ItemStack {
|
@@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public void setItem(Item item) {
|
public void setItem(Item item) {
|
||||||
@ -7259,7 +7251,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+import org.bukkit.craftbukkit.block.CraftBlockState;
|
+import org.bukkit.craftbukkit.block.CraftBlockState;
|
||||||
import org.bukkit.craftbukkit.block.data.CraftBlockData;
|
import org.bukkit.craftbukkit.block.data.CraftBlockData;
|
||||||
import org.bukkit.craftbukkit.util.CraftSpawnCategory;
|
import org.bukkit.craftbukkit.util.CraftSpawnCategory;
|
||||||
import org.bukkit.craftbukkit.util.CraftNamespacedKey;
|
import org.bukkit.entity.SpawnCategory;
|
||||||
@@ -0,0 +0,0 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -0,0 +0,0 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -8179,8 +8171,8 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
|
--- a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
|
||||||
@@ -0,0 +0,0 @@ import net.minecraft.world.ticks.LevelTickAccess;
|
@@ -0,0 +0,0 @@ import net.minecraft.world.phys.shapes.VoxelShape;
|
||||||
import net.minecraft.world.ticks.ScheduledTick;
|
import net.minecraft.world.ticks.LevelTickAccess;
|
||||||
import net.minecraft.world.ticks.TickPriority;
|
import net.minecraft.world.ticks.TickPriority;
|
||||||
import org.bukkit.event.entity.CreatureSpawnEvent;
|
import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||||
+import org.jetbrains.annotations.Nullable;
|
+import org.jetbrains.annotations.Nullable;
|
@ -20,12 +20,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+++ b/build.gradle.kts
|
+++ b/build.gradle.kts
|
||||||
@@ -0,0 +0,0 @@ dependencies {
|
@@ -0,0 +0,0 @@ dependencies {
|
||||||
implementation("jline:jline:2.12.1")
|
implementation("jline:jline:2.12.1")
|
||||||
implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
|
implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") // Paper - remove exclusion
|
||||||
implementation("org.ow2.asm:asm-commons:9.7")
|
implementation("org.ow2.asm:asm-commons:9.7")
|
||||||
+ implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files
|
+ implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files
|
||||||
implementation("commons-lang:commons-lang:2.6")
|
implementation("commons-lang:commons-lang:2.6")
|
||||||
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
|
runtimeOnly("org.xerial:sqlite-jdbc:3.45.3.0")
|
||||||
runtimeOnly("com.mysql:mysql-connector-j:8.2.0")
|
runtimeOnly("com.mysql:mysql-connector-j:8.3.0")
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||||
@ -4828,7 +4828,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/src/main/java/net/minecraft/server/Main.java
|
--- a/src/main/java/net/minecraft/server/Main.java
|
||||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||||
@@ -0,0 +0,0 @@ public class Main {
|
@@ -0,0 +0,0 @@ public class Main {
|
||||||
dedicatedserversettings.forceSave();
|
RegionFileVersion.configure(dedicatedserversettings.getProperties().regionFileComression);
|
||||||
Path path2 = Paths.get("eula.txt");
|
Path path2 = Paths.get("eula.txt");
|
||||||
Eula eula = new Eula(path2);
|
Eula eula = new Eula(path2);
|
||||||
+ // Paper start - load config files early for access below if needed
|
+ // Paper start - load config files early for access below if needed
|
@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest
|
+ testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest
|
||||||
}
|
}
|
||||||
|
|
||||||
val craftbukkitPackageVersion = "1_20_R3" // Paper
|
val craftbukkitPackageVersion = "1_20_R4" // Paper
|
||||||
@@ -0,0 +0,0 @@ tasks.jar {
|
@@ -0,0 +0,0 @@ tasks.jar {
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user