13
0
geforkt von Mirrors/Paper

First server patches

Dieser Commit ist enthalten in:
Nassim Jahnke 2022-06-07 20:12:34 +02:00
Ursprung 66eb6f7632
Commit b31be0569d
10 geänderte Dateien mit 426 neuen und 394 gelöschten Zeilen

Datei anzeigen

@ -9,3 +9,4 @@
# minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter
# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java
minecraft net.minecraft.network.protocol.game.ClientboundPlayerChatPacket

Datei anzeigen

@ -1062,7 +1062,7 @@ diff --git a/src/main/java/net/minecraft/ChatFormatting.java b/src/main/java/net
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/ChatFormatting.java
+++ b/src/main/java/net/minecraft/ChatFormatting.java
@@ -0,0 +0,0 @@ public enum ChatFormatting {
@@ -0,0 +0,0 @@ public enum ChatFormatting implements StringRepresentable {
return name == null ? null : FORMATTING_BY_NAME.get(cleanName(name));
}
@ -1100,9 +1100,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public java.util.Locale adventure$locale; // Paper
public static final short MAX_STRING_LENGTH = 32767;
public static final int MAX_COMPONENT_STRING_LENGTH = 262144;
private static final int PUBLIC_KEY_SIZE = 256;
@@ -0,0 +0,0 @@ public class FriendlyByteBuf extends ByteBuf {
return Component.Serializer.fromJson(this.readUtf(262144));
}
}
+ // Paper start
@ -1166,30 +1166,43 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
JsonObject jsonobject = new JsonObject();
if (!ichatbasecomponent.getStyle().isEmpty()) {
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerChatPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerChatPacket.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java
@@ -0,0 +0,0 @@ import net.minecraft.network.protocol.Packet;
public class ClientboundChatPacket implements Packet<ClientGamePacketListener> {
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerChatPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerChatPacket.java
@@ -0,0 +0,0 @@ import net.minecraft.network.chat.PlayerChatMessage;
import net.minecraft.network.protocol.Packet;
import net.minecraft.util.Crypt;
private final Component message;
+ public net.kyori.adventure.text.Component adventure$message; // Paper
public net.md_5.bungee.api.chat.BaseComponent[] components; // Spigot
private final ChatType type;
private final UUID sender;
@@ -0,0 +0,0 @@ public class ClientboundChatPacket implements Packet<ClientGamePacketListener> {
-public record ClientboundPlayerChatPacket(Component signedContent, Optional<Component> unsignedContent, int typeId, ChatSender sender, Instant timeStamp, Crypt.SaltSignaturePair saltSignature) implements Packet<ClientGamePacketListener> {
+// Paper start
+public record ClientboundPlayerChatPacket(@org.jetbrains.annotations.Nullable net.kyori.adventure.text.Component adventure$message, Component signedContent, Optional<Component> unsignedContent, int typeId, ChatSender sender, Instant timeStamp, Crypt.SaltSignaturePair saltSignature) implements Packet<ClientGamePacketListener> {
private static final Duration MESSAGE_EXPIRES_AFTER = ServerboundChatPacket.MESSAGE_EXPIRES_AFTER.plus(Duration.ofMinutes(2L));
+ public ClientboundPlayerChatPacket(Component signedContent, Optional<Component> unsignedContent, int typeId, ChatSender sender, Instant timeStamp, Crypt.SaltSignaturePair saltSignature) {
+ this(null, signedContent, unsignedContent, typeId, sender, timeStamp, saltSignature);
+ }
+ // Paper end
+
public ClientboundPlayerChatPacket(FriendlyByteBuf buf) {
this(buf.readComponent(), buf.readOptional(FriendlyByteBuf::readComponent), buf.readVarInt(), new ChatSender(buf), buf.readInstant(), new Crypt.SaltSignaturePair(buf));
}
@@ -0,0 +0,0 @@ public record ClientboundPlayerChatPacket(Component signedContent, Optional<Comp
@Override
public void write(FriendlyByteBuf buf) {
buf.writeComponent(this.signedContent);
+ // Paper start
+ //TODO Proper API and writing signed contents
+ if (this.adventure$message != null) {
+ buf.writeBoolean(true);
+ buf.writeComponent(this.adventure$message);
+ } else
+ } else {
buf.writeOptional(this.unsignedContent, FriendlyByteBuf::writeComponent);
+ }
+ // Paper end
// Spigot start
if (this.components != null) {
buf.writeUtf(net.md_5.bungee.chat.ComponentSerializer.toString(components));
buf.writeVarInt(this.typeId);
this.sender.write(buf);
buf.writeInstant(this.timeStamp);
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetActionBarTextPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetActionBarTextPacket.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetActionBarTextPacket.java
@ -1262,6 +1275,52 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
buf.writeComponent(this.text);
}
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSystemChatPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSystemChatPacket.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSystemChatPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSystemChatPacket.java
@@ -0,0 +0,0 @@ import net.minecraft.network.chat.ChatType;
import net.minecraft.network.chat.Component;
import net.minecraft.network.protocol.Packet;
+// Paper start
// Spigot start
-public record ClientboundSystemChatPacket(String content, int typeId) implements Packet<ClientGamePacketListener> {
+public record ClientboundSystemChatPacket(@org.jetbrains.annotations.Nullable net.kyori.adventure.text.Component adventure$message, String content, int typeId) implements Packet<ClientGamePacketListener> {
+
+ public ClientboundSystemChatPacket(String content, int typeId) {
+ this(null, content, typeId);
+ }
public ClientboundSystemChatPacket(Component content, int typeId) {
- this(Component.Serializer.toJson(content), typeId);
+ this(null, Component.Serializer.toJson(content), typeId);
}
public ClientboundSystemChatPacket(net.md_5.bungee.api.chat.BaseComponent[] content, int typeId) {
- this(net.md_5.bungee.chat.ComponentSerializer.toString(content), typeId);
+ this(null, net.md_5.bungee.chat.ComponentSerializer.toString(content), typeId);
}
// Spigot end
+ // Paper end
public ClientboundSystemChatPacket(FriendlyByteBuf buf) {
this(buf.readComponent(), buf.readVarInt());
@@ -0,0 +0,0 @@ public record ClientboundSystemChatPacket(String content, int typeId) implements
@Override
public void write(FriendlyByteBuf buf) {
- buf.writeUtf(this.content, 262144); // Spigot
+ // Paper start
+ if (adventure$message != null) {
+ buf.writeComponent(this.adventure$message);
+ } else {
+ buf.writeUtf(this.content, 262144); // Spigot
+ }
+ // Paper end
buf.writeVarInt(this.typeId);
}
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundTabListPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundTabListPacket.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundTabListPacket.java
@ -1464,15 +1523,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ List<net.kyori.adventure.text.Component> lines = new java.util.ArrayList<>();
for (int i = 0; i < signText.size(); ++i) {
- TextFilter.FilteredText itextfilter_a = (TextFilter.FilteredText) signText.get(i);
+ TextFilter.FilteredText currentLine = signText.get(i);
FilteredText<Component> filteredtext = (signText.get(i)).map(Component::literal); // CraftBukkit - decompile error
if (this.player.isTextFilteringEnabled()) {
- lines[i] = ChatFormatting.stripFormatting(new TextComponent(ChatFormatting.stripFormatting(itextfilter_a.getFiltered())).getString());
+ lines.add(net.kyori.adventure.text.Component.text(currentLine.getFiltered()));
- lines[i] = ChatFormatting.stripFormatting(filteredtext.filteredOrElse(CommonComponents.EMPTY).getString());
+ lines.add(net.kyori.adventure.text.Component.text(filteredtext.filteredOrElse(CommonComponents.EMPTY).getString())); // Paper - adventure
} else {
- lines[i] = ChatFormatting.stripFormatting(new TextComponent(ChatFormatting.stripFormatting(itextfilter_a.getRaw())).getString());
+ lines.add(net.kyori.adventure.text.Component.text(currentLine.getRaw()));
- lines[i] = ChatFormatting.stripFormatting(filteredtext.raw().getString());
+ lines.add(net.kyori.adventure.text.Component.text(filteredtext.raw().getString())); // Paper - adventure
}
}
SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.player.getBukkitEntity(), lines);
@ -1553,9 +1611,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class PlayerList {
}
// CraftBukkit start
chatmessage.withStyle(ChatFormatting.YELLOW);
- String joinMessage = CraftChatMessage.fromComponent(chatmessage);
+ Component joinMessage = chatmessage; // Paper - Adventure
ichatmutablecomponent.withStyle(ChatFormatting.YELLOW);
- String joinMessage = CraftChatMessage.fromComponent(ichatmutablecomponent);
+ Component joinMessage = ichatmutablecomponent; // Paper - Adventure
playerconnection.teleport(player.getX(), player.getY(), player.getZ(), player.getYRot(), player.getXRot());
this.players.add(player);
@ -1564,7 +1622,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
player.containerMenu.transferTo(player.containerMenu, bukkitPlayer);
- PlayerJoinEvent playerJoinEvent = new PlayerJoinEvent(bukkitPlayer, joinMessage);
+ PlayerJoinEvent playerJoinEvent = new PlayerJoinEvent(bukkitPlayer, PaperAdventure.asAdventure(chatmessage)); // Paper - Adventure
+ PlayerJoinEvent playerJoinEvent = new PlayerJoinEvent(bukkitPlayer, PaperAdventure.asAdventure(ichatmutablecomponent)); // Paper - Adventure
this.cserver.getPluginManager().callEvent(playerJoinEvent);
if (!player.connection.connection.isConnected()) {
@ -1576,11 +1634,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- if (joinMessage != null && joinMessage.length() > 0) {
- for (Component line : org.bukkit.craftbukkit.util.CraftChatMessage.fromString(joinMessage)) {
- this.server.getPlayerList().broadcastAll(new ClientboundChatPacket(line, ChatType.SYSTEM, Util.NIL_UUID));
- this.server.getPlayerList().broadcastSystemMessage(line, ChatType.SYSTEM);
- }
+ if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure
+ joinMessage = PaperAdventure.asVanilla(jm); // Paper - Adventure
+ this.server.getPlayerList().broadcastAll(new ClientboundChatPacket(joinMessage, ChatType.SYSTEM, Util.NIL_UUID)); // Paper - Adventure
+ this.server.getPlayerList().broadcastSystemMessage(joinMessage, ChatType.SYSTEM); // Paper - Adventure
}
// CraftBukkit end
@ -1615,10 +1673,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
// return chatmessage;
- event.disallow(PlayerLoginEvent.Result.KICK_BANNED, CraftChatMessage.fromComponent(chatmessage));
+ event.disallow(PlayerLoginEvent.Result.KICK_BANNED, PaperAdventure.asAdventure(chatmessage)); // Paper - Adventure
- event.disallow(PlayerLoginEvent.Result.KICK_BANNED, CraftChatMessage.fromComponent(ichatmutablecomponent));
+ event.disallow(PlayerLoginEvent.Result.KICK_BANNED, PaperAdventure.asAdventure(ichatmutablecomponent)); // Paper - Adventure
} else if (!this.isWhiteListed(gameprofile)) {
chatmessage = new TranslatableComponent("multiplayer.disconnect.not_whitelisted");
ichatmutablecomponent = Component.translatable("multiplayer.disconnect.not_whitelisted");
- event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, org.spigotmc.SpigotConfig.whitelistMessage); // Spigot
+ event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(org.spigotmc.SpigotConfig.whitelistMessage)); // Spigot // Paper - Adventure
} else if (this.getIpBans().isBanned(socketaddress) && !this.getIpBans().get(socketaddress).hasExpired()) {
@ -1628,10 +1686,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
// return chatmessage;
- event.disallow(PlayerLoginEvent.Result.KICK_BANNED, CraftChatMessage.fromComponent(chatmessage));
+ event.disallow(PlayerLoginEvent.Result.KICK_BANNED, PaperAdventure.asAdventure(chatmessage)); // Paper - Adventure
- event.disallow(PlayerLoginEvent.Result.KICK_BANNED, CraftChatMessage.fromComponent(ichatmutablecomponent));
+ event.disallow(PlayerLoginEvent.Result.KICK_BANNED, PaperAdventure.asAdventure(ichatmutablecomponent)); // Paper - Adventure
} else {
// return this.players.size() >= this.maxPlayers && !this.canBypassPlayerLimit(gameprofile) ? new ChatMessage("multiplayer.disconnect.server_full") : null;
// return this.players.size() >= this.maxPlayers && !this.canBypassPlayerLimit(gameprofile) ? IChatBaseComponent.translatable("multiplayer.disconnect.server_full") : null;
if (this.players.size() >= this.maxPlayers && !this.canBypassPlayerLimit(gameprofile)) {
- event.disallow(PlayerLoginEvent.Result.KICK_FULL, org.spigotmc.SpigotConfig.serverFullMessage); // Spigot
+ event.disallow(PlayerLoginEvent.Result.KICK_FULL, net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(org.spigotmc.SpigotConfig.serverFullMessage)); // Spigot // Paper - Adventure
@ -2504,8 +2562,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private void updatePlayerListHeaderFooter() {
if (this.getHandle().connection == null) return;
- ClientboundTabListPacket packet = new ClientboundTabListPacket((this.playerListHeader == null) ? new TextComponent("") : this.playerListHeader, (this.playerListFooter == null) ? new TextComponent("") : this.playerListFooter);
+ ClientboundTabListPacket packet = new ClientboundTabListPacket((this.playerListHeader == null) ? new TextComponent("") : io.papermc.paper.adventure.PaperAdventure.asVanilla(this.playerListHeader), (this.playerListFooter == null) ? new TextComponent("") : io.papermc.paper.adventure.PaperAdventure.asVanilla(this.playerListFooter));
- ClientboundTabListPacket packet = new ClientboundTabListPacket((this.playerListHeader == null) ? Component.empty() : this.playerListHeader, (this.playerListFooter == null) ? Component.empty() : this.playerListFooter);
+ ClientboundTabListPacket packet = new ClientboundTabListPacket((this.playerListHeader == null) ? Component.empty() : io.papermc.paper.adventure.PaperAdventure.asVanilla(this.playerListHeader), (this.playerListFooter == null) ? Component.empty() : io.papermc.paper.adventure.PaperAdventure.asVanilla(this.playerListFooter)); // Paper - adventure
this.getHandle().connection.send(packet);
}
@ -3033,7 +3091,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ @Deprecated // Paper - Adventure
public MinecraftMerchant(String title) {
Validate.notNull(title, "Title cannot be null");
this.title = new TextComponent(title);
this.title = Component.literal(title);
}
+ // Paper start
+ public MinecraftMerchant(net.kyori.adventure.text.Component title) {

Datei anzeigen

@ -16,11 +16,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- exclude(group = "org.apache.logging.log4j", module = "log4j-api")
- }
+ implementation("org.apache.logging.log4j:log4j-iostreams:2.17.1") // Paper
implementation("org.ow2.asm:asm:9.2")
+ implementation("org.ow2.asm:asm-commons:9.2") // Paper - ASM event executor generation
implementation("org.ow2.asm:asm:9.3")
+ implementation("org.ow2.asm:asm-commons:9.3") // Paper - ASM event executor generation
implementation("commons-lang:commons-lang:2.6")
runtimeOnly("org.xerial:sqlite-jdbc:3.36.0.3")
runtimeOnly("mysql:mysql-connector-java:8.0.27")
runtimeOnly("mysql:mysql-connector-java:8.0.29")
@@ -0,0 +0,0 @@ tasks.jar {
val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim()
val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\""
@ -51,7 +51,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ Date buildDate = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z").parse(Main.class.getPackage().getImplementationVendor()); // Paper
Calendar deadline = Calendar.getInstance();
deadline.add(Calendar.DAY_OF_YEAR, -21);
deadline.add(Calendar.DAY_OF_YEAR, -3);
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java

Datei anzeigen

@ -24,10 +24,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
long l = minecraftserver.getWorldData().worldGenSettings().seed();
- this.structureCheck = new StructureCheck(this.chunkSource.chunkScanner(), this.registryAccess(), minecraftserver.getStructureManager(), resourcekey, chunkgenerator, this, chunkgenerator.getBiomeSource(), l, datafixer);
+ this.structureCheck = new StructureCheck(this.chunkSource.chunkScanner(), this.registryAccess(), minecraftserver.getStructureManager(), this.getTypeKey(), chunkgenerator, this, chunkgenerator.getBiomeSource(), l, datafixer); // Paper - Fix missing CB diff
this.structureFeatureManager = new StructureFeatureManager(this, this.serverLevelData.worldGenSettings(), this.structureCheck); // CraftBukkit
if (this.dimensionType().createDragonFight()) {
- this.structureCheck = new StructureCheck(this.chunkSource.chunkScanner(), this.registryAccess(), minecraftserver.getStructureManager(), resourcekey, chunkgenerator, this.chunkSource.randomState(), this, chunkgenerator.getBiomeSource(), l, datafixer);
+ this.structureCheck = new StructureCheck(this.chunkSource.chunkScanner(), this.registryAccess(), minecraftserver.getStructureManager(), this.getTypeKey(), chunkgenerator, this.chunkSource.randomState(), this, chunkgenerator.getBiomeSource(), l, datafixer); // Paper - Fix missing CB diff
this.structureManager = new StructureManager(this, this.serverLevelData.worldGenSettings(), this.structureCheck); // CraftBukkit
if (this.dimension() == Level.END && this.dimensionTypeRegistration().is(BuiltinDimensionTypes.END)) {
this.dragonFight = new EndDragonFight(this, this.serverLevelData.worldGenSettings().seed(), this.serverLevelData.endDragonFightData()); // CraftBukkit
diff --git a/src/main/java/net/minecraft/world/entity/Marker.java b/src/main/java/net/minecraft/world/entity/Marker.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
@ -50,22 +50,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java
@@ -0,0 +0,0 @@ public class StructureCheck {
private final Registry<Biome> biomes;
private final Registry<ConfiguredStructureFeature<?, ?>> structureConfigs;
private final StructureManager structureManager;
private final Registry<Structure> structureConfigs;
private final StructureTemplateManager structureTemplateManager;
- private final ResourceKey<Level> dimension;
+ private final ResourceKey<net.minecraft.world.level.dimension.LevelStem> dimension; // Paper - fix missing CB diff
private final ChunkGenerator chunkGenerator;
private final RandomState randomState;
private final LevelHeightAccessor heightAccessor;
private final BiomeSource biomeSource;
@@ -0,0 +0,0 @@ public class StructureCheck {
private final Long2ObjectMap<Object2IntMap<ConfiguredStructureFeature<?, ?>>> loadedChunks = new Long2ObjectOpenHashMap<>();
private final Map<ConfiguredStructureFeature<?, ?>, Long2BooleanMap> featureChecks = new HashMap<>();
private final Long2ObjectMap<Object2IntMap<Structure>> loadedChunks = new Long2ObjectOpenHashMap<>();
private final Map<Structure, Long2BooleanMap> featureChecks = new HashMap<>();
- public StructureCheck(ChunkScanAccess chunkIoWorker, RegistryAccess registryManager, StructureManager structureManager, ResourceKey<Level> worldKey, ChunkGenerator chunkGenerator, LevelHeightAccessor world, BiomeSource biomeSource, long seed, DataFixer dataFixer) {
+ public StructureCheck(ChunkScanAccess chunkIoWorker, RegistryAccess registryManager, StructureManager structureManager, ResourceKey<net.minecraft.world.level.dimension.LevelStem> worldKey, ChunkGenerator chunkGenerator, LevelHeightAccessor world, BiomeSource biomeSource, long seed, DataFixer dataFixer) { // Paper - fix missing CB diff
- public StructureCheck(ChunkScanAccess chunkIoWorker, RegistryAccess registryManager, StructureTemplateManager structureTemplateManager, ResourceKey<Level> worldKey, ChunkGenerator chunkGenerator, RandomState noiseConfig, LevelHeightAccessor world, BiomeSource biomeSource, long seed, DataFixer dataFixer) {
+ public StructureCheck(ChunkScanAccess chunkIoWorker, RegistryAccess registryManager, StructureTemplateManager structureTemplateManager, ResourceKey<net.minecraft.world.level.dimension.LevelStem> worldKey, ChunkGenerator chunkGenerator, RandomState noiseConfig, LevelHeightAccessor world, BiomeSource biomeSource, long seed, DataFixer dataFixer) { // Paper - fix missing CB diff
this.storageAccess = chunkIoWorker;
this.registryAccess = registryManager;
this.structureManager = structureManager;
this.structureTemplateManager = structureTemplateManager;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@ -84,20 +84,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end
}
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomWorldChunkManager.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomWorldChunkManager.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/generator/CustomWorldChunkManager.java
+++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomWorldChunkManager.java
@@ -0,0 +0,0 @@ public class CustomWorldChunkManager extends BiomeSource {
@Override
public BiomeSource withSeed(long seed) {
- // TODO check method further
- throw new UnsupportedOperationException("Cannot copy CustomWorldChunkManager");
+ return this; // Paper - Since this doesn't take a seed, no need to throw UOE
}
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/util/permissions/CraftDefaultPermissions.java b/src/main/java/org/bukkit/craftbukkit/util/permissions/CraftDefaultPermissions.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644

Dateidiff unterdrückt, weil mindestens eine Zeile zu lang ist

Datei anzeigen

@ -5038,13 +5038,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
MinecraftServer.LOGGER.info("Saving usercache.json");
this.getProfileCache().save();
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.lastOverloadWarning = this.nextTickTime;
}
this.lastOverloadWarning = this.nextTickTime;
}
+ ++MinecraftServer.currentTickLong; // Paper
if ( tickCount++ % MinecraftServer.SAMPLE_INTERVAL == 0 )
{
double currentTps = 1E3 / ( curTime - tickSection ) * MinecraftServer.SAMPLE_INTERVAL;
+ ++MinecraftServer.currentTickLong; // Paper
if ( tickCount++ % MinecraftServer.SAMPLE_INTERVAL == 0 )
{
double currentTps = 1E3 / ( curTime - tickSection ) * MinecraftServer.SAMPLE_INTERVAL;
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftServer.LOGGER.debug("Autosave finished");
SpigotTimings.worldSaveTimer.stopTiming(); // Spigot
@ -5369,12 +5369,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ // Paper end
+
public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureManager structureManager, 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);
this.visibleChunkMap = this.updatingChunkMap.clone();
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.overworldDataStorage = persistentStateManagerFactory;
this.poiManager = new PoiManager(path.resolve("poi"), dataFixer, dsync, world);
this.poiManager = new PoiManager(path.resolve("poi"), dataFixer, dsync, world.registryAccess(), world);
this.setViewDistance(viewDistance);
+ // Paper start
+ this.dataRegionManager = new io.papermc.paper.chunk.SingleThreadChunkRegionManager(this.level, 2, (1.0 / 3.0), 1, 6, "Data", DataRegionData::new, DataRegionSectionData::new);
@ -5439,7 +5439,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
};
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (!flag1) {
this.distanceManager.addPlayer(SectionPos.of((Entity) player), player);
this.distanceManager.addPlayer(SectionPos.of((EntityAccess) player), player);
}
+ this.addPlayerToDistanceMaps(player); // Paper - distance maps
} else {
@ -5848,7 +5848,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ final io.papermc.paper.util.maplist.IteratorSafeOrderedReferenceSet<LevelChunk> entityTickingChunks = new io.papermc.paper.util.maplist.IteratorSafeOrderedReferenceSet<>(4096, 0.75f, 4096, 0.15, true);
+ // Paper end
public ServerChunkCache(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureManager structureManager, Executor workerExecutor, ChunkGenerator chunkGenerator, int viewDistance, int simulationDistance, boolean dsync, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory) {
public ServerChunkCache(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureTemplateManager structureTemplateManager, Executor workerExecutor, ChunkGenerator chunkGenerator, int viewDistance, int simulationDistance, boolean dsync, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory) {
this.level = world;
@@ -0,0 +0,0 @@ public class ServerChunkCache extends ChunkSource {
this.lastChunk[0] = chunk;
@ -5904,8 +5904,8 @@ diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/mai
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -0,0 +0,0 @@ import org.bukkit.event.server.MapInitializeEvent;
import org.bukkit.event.weather.LightningStrikeEvent;
@@ -0,0 +0,0 @@ import org.bukkit.event.weather.LightningStrikeEvent;
import org.bukkit.event.world.GenericGameEvent;
import org.bukkit.event.world.TimeSkipEvent;
// CraftBukkit end
+import it.unimi.dsi.fastutil.ints.IntArrayList; // Paper
@ -6006,9 +6006,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ // Paper end
+
// Add env and gen to constructor, WorldData -> WorldDataServer
public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, ServerLevelData iworlddataserver, ResourceKey<Level> resourcekey, Holder<DimensionType> holder, ChunkProgressListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List<CustomSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
// Add env and gen to constructor, IWorldDataServer -> WorldDataServer
public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
// Holder holder = worlddimension.typeHolder(); // CraftBukkit - decompile error
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
@ -6019,8 +6019,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper
+
public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile) {
super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile);
public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, @Nullable ProfilePublicKey publicKey) {
super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile, publicKey);
this.chatVisibility = ChatVisiblity.FULL;
@@ -0,0 +0,0 @@ public class ServerPlayer extends Player {
this.maxUpStep = 1.0F;
@ -6074,23 +6074,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override
public BlockState getBlockState(BlockPos pos) {
return this.getChunk(SectionPos.blockToSectionCoord(pos.getX()), SectionPos.blockToSectionCoord(pos.getZ())).getBlockState(pos);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
private final MinecraftServer server;
public ServerPlayer player;
private int tickCount;
- private long keepAliveTime;
- private boolean keepAlivePending;
- private long keepAliveChallenge;
+ private long keepAliveTime; @Deprecated private void setLastPing(long lastPing) { this.keepAliveTime = lastPing;}; @Deprecated private long getLastPing() { return this.keepAliveTime;}; // Paper - OBFHELPER
+ private boolean keepAlivePending; @Deprecated private void setPendingPing(boolean isPending) { this.keepAlivePending = isPending;}; @Deprecated private boolean isPendingPing() { return this.keepAlivePending;}; // Paper - OBFHELPER
+ private long keepAliveChallenge; @Deprecated private void setKeepAliveID(long keepAliveID) { this.keepAliveChallenge = keepAliveID;}; @Deprecated private long getKeepAliveID() {return this.keepAliveChallenge; }; // Paper - OBFHELPER
// CraftBukkit start - multithreaded fields
private final AtomicInteger chatSpamTickCount = new AtomicInteger();
// CraftBukkit end
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
--- a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
@ -6166,8 +6149,8 @@ diff --git a/src/main/java/net/minecraft/world/entity/monster/Monster.java b/src
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Monster.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Monster.java
@@ -0,0 +0,0 @@ import net.minecraft.world.level.LightLayer;
import net.minecraft.world.level.ServerLevelAccessor;
@@ -0,0 +0,0 @@ import net.minecraft.world.level.ServerLevelAccessor;
import net.minecraft.world.level.dimension.DimensionType;
public abstract class Monster extends PathfinderMob implements Enemy {
+ public org.bukkit.craftbukkit.entity.CraftMonster getBukkitMonster() { return (org.bukkit.craftbukkit.entity.CraftMonster) super.getBukkitEntity(); } // Paper
@ -6254,7 +6237,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/world/level/ChunkPos.java
+++ b/src/main/java/net/minecraft/world/level/ChunkPos.java
@@ -0,0 +0,0 @@ public class ChunkPos {
private static final int REGION_MASK = 31;
public static final int REGION_MAX_INDEX = 31;
public final int x;
public final int z;
+ public final long longKey; // Paper
@ -6280,6 +6263,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.longKey = asLong(this.x, this.z); // Paper
}
public static ChunkPos minFromRegion(int x, int z) {
@@ -0,0 +0,0 @@ public class ChunkPos {
}
public long toLong() {
- return asLong(this.x, this.z);
+ return longKey; // Paper
@ -6486,7 +6473,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private final BlockBehaviour.StatePredicate isSuffocating;
private final BlockBehaviour.StatePredicate isViewBlocking;
@@ -0,0 +0,0 @@ public abstract class BlockBehaviour {
this.emissiveRendering = blockbase_info.emissiveRendering;
this.offsetType = (BlockBehaviour.OffsetType) blockbase_info.offsetType.apply(this.asState());
}
+ // Paper start

Datei anzeigen

@ -426,7 +426,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private org.spigotmc.TickLimiter entityLimiter;
@@ -0,0 +0,0 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env) {
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env) {
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
+ this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName(), this.spigotConfig); // Paper
this.generator = gen;

Datei anzeigen

@ -59,7 +59,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ testImplementation("org.hamcrest:hamcrest-library:1.3")
+}
+
+val craftbukkitPackageVersion = "1_18_R2" // Paper
+val craftbukkitPackageVersion = "1_19_R1" // Paper
+tasks.jar {
+ archiveClassifier.set("dev")
+

Dateidiff unterdrückt, weil mindestens eine Zeile zu lang ist