From 88a3dac05734c1b9db0fd9a53afd449067f9e063 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 25 Apr 2024 18:51:28 -0700 Subject: [PATCH] some more compile fixes --- ...d-missing-structure-set-seed-configs.patch | 34 +++++++++++++++ .../server/Add-more-LimitedRegion-API.patch | 2 +- patches/server/Adventure.patch | 11 +++-- .../Expose-LootTable-of-DecoratedPot.patch | 6 +-- .../server/Fixup-NamespacedKey-handling.patch | 8 ++-- ...able-API-and-replenishable-lootables.patch | 13 ++++-- .../server/More-PotionEffectType-API.patch | 10 ++--- patches/server/More-Projectile-API.patch | 41 +++++++++++-------- patches/server/Properly-resend-entities.patch | 2 +- patches/server/Rewrite-chunk-system.patch | 2 +- ...apLike-spam-for-missing-key-selector.patch | 2 +- 11 files changed, 87 insertions(+), 44 deletions(-) diff --git a/patches/server/Add-missing-structure-set-seed-configs.patch b/patches/server/Add-missing-structure-set-seed-configs.patch index d72a021667..a9ee34dea3 100644 --- a/patches/server/Add-missing-structure-set-seed-configs.patch +++ b/patches/server/Add-missing-structure-set-seed-configs.patch @@ -147,6 +147,40 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return true; } } +diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java b/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/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 { + this.fixerUpper = dataFixer; + } + ++ // Paper start - add missing structure salt configs ++ @Nullable ++ private Integer getSaltOverride(Structure type) { ++ if (this.heightAccessor instanceof net.minecraft.server.level.ServerLevel serverLevel) { ++ if (type instanceof net.minecraft.world.level.levelgen.structure.structures.MineshaftStructure) { ++ return serverLevel.spigotConfig.mineshaftSeed; ++ } else if (type instanceof net.minecraft.world.level.levelgen.structure.structures.BuriedTreasureStructure) { ++ return serverLevel.spigotConfig.buriedTreasureSeed; ++ } ++ } ++ return null; ++ } ++ // Paper end - add missing structure seed configs ++ + public StructureCheckResult checkStart(ChunkPos pos, Structure type, StructurePlacement placement, boolean skipReferencedStructures) { + long l = pos.toLong(); + Object2IntMap object2IntMap = this.loadedChunks.get(l); +@@ -0,0 +0,0 @@ public class StructureCheck { + StructureCheckResult structureCheckResult = this.tryLoadFromStorage(pos, type, skipReferencedStructures, l); + if (structureCheckResult != null) { + return structureCheckResult; +- } else if (!placement.applyAdditionalChunkRestrictions(pos.x, pos.z, this.seed)) { ++ } else if (!placement.applyAdditionalChunkRestrictions(pos.x, pos.z, this.seed, this.getSaltOverride(type))) { // Paper - add missing structure seed configs + return StructureCheckResult.START_NOT_PRESENT; + } else { + boolean bl = this.featureChecks diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/placement/StructurePlacement.java b/src/main/java/net/minecraft/world/level/levelgen/structure/placement/StructurePlacement.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/levelgen/structure/placement/StructurePlacement.java diff --git a/patches/server/Add-more-LimitedRegion-API.patch b/patches/server/Add-more-LimitedRegion-API.patch index 1071bf5ead..544c598ef0 100644 --- a/patches/server/Add-more-LimitedRegion-API.patch +++ b/patches/server/Add-more-LimitedRegion-API.patch @@ -20,7 +20,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (!state.getBlockData().matches(getHandle().getBlockState(pos).createCraftBlockData())) { + throw new IllegalArgumentException("BlockData does not match! Expected " + state.getBlockData().getAsString(false) + ", got " + getHandle().getBlockState(pos).createCraftBlockData().getAsString(false)); + } -+ getHandle().getBlockEntity(pos).load(((org.bukkit.craftbukkit.block.CraftBlockEntityState) state).getSnapshotNBT()); ++ getHandle().getBlockEntity(pos).loadWithComponents(((org.bukkit.craftbukkit.block.CraftBlockEntityState) state).getSnapshotNBT(), this.getHandle().registryAccess()); + } + + @Override diff --git a/patches/server/Adventure.patch b/patches/server/Adventure.patch index eb5260a3c1..757a3b4ced 100644 --- a/patches/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -3624,7 +3624,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @Override + public void customName(final net.kyori.adventure.text.Component customName) { -+ this.getSnapshot().setCustomName(customName != null ? io.papermc.paper.adventure.PaperAdventure.asVanilla(customName) : null); ++ this.getSnapshot().name = (customName != null ? io.papermc.paper.adventure.PaperAdventure.asVanilla(customName) : null); + } + // Paper end + @@ -3642,7 +3642,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start + @Override + public net.kyori.adventure.text.Component customName() { -+ final EnchantmentTableBlockEntity be = this.getSnapshot(); ++ final EnchantingTableBlockEntity be = this.getSnapshot(); + return be.hasCustomName() ? io.papermc.paper.adventure.PaperAdventure.asAdventure(be.getCustomName()) : null; + } + @@ -4351,9 +4351,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + net.minecraft.core.Registry chatTypeRegistry = this.getHandle().level().registryAccess().registryOrThrow(net.minecraft.core.registries.Registries.CHAT_TYPE); + + return new net.minecraft.network.chat.ChatType.Bound( -+ chatTypeRegistry.get(io.papermc.paper.adventure.PaperAdventure.asVanilla(boundChatType.type().key())), ++ chatTypeRegistry.getHolderOrThrow(net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.CHAT_TYPE, io.papermc.paper.adventure.PaperAdventure.asVanilla(boundChatType.type().key()))), + io.papermc.paper.adventure.PaperAdventure.asVanilla(boundChatType.name()), -+ io.papermc.paper.adventure.PaperAdventure.asVanilla(boundChatType.target()) ++ Optional.ofNullable(io.papermc.paper.adventure.PaperAdventure.asVanilla(boundChatType.target())) + ); + } + @@ -4400,8 +4400,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @Override + public void sendActionBar(final net.kyori.adventure.text.Component message) { -+ final net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket packet = new net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket((net.minecraft.network.chat.Component) null); -+ packet.adventure$text = message; ++ final net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket packet = new net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket(io.papermc.paper.adventure.PaperAdventure.asVanillaNullToEmpty(message)); + this.getHandle().connection.send(packet); + } + diff --git a/patches/server/Expose-LootTable-of-DecoratedPot.patch b/patches/server/Expose-LootTable-of-DecoratedPot.patch index 689d1abf09..ee968db63e 100644 --- a/patches/server/Expose-LootTable-of-DecoratedPot.patch +++ b/patches/server/Expose-LootTable-of-DecoratedPot.patch @@ -20,7 +20,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @Override + public void setLootTable(org.bukkit.loot.LootTable table, long seed) { -+ net.minecraft.resources.ResourceLocation key = (table == null) ? null : org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(table.getKey()); ++ net.minecraft.resources.ResourceKey key = (table == null) ? null : net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.LOOT_TABLE, org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(table.getKey())); + this.getSnapshot().setLootTable(key, seed); + } + @@ -30,8 +30,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return null; + } + -+ net.minecraft.resources.ResourceLocation key = this.getSnapshot().getLootTable(); -+ return org.bukkit.Bukkit.getLootTable(org.bukkit.craftbukkit.util.CraftNamespacedKey.fromMinecraft(key)); ++ net.minecraft.resources.ResourceKey key = this.getSnapshot().getLootTable(); ++ return org.bukkit.Bukkit.getLootTable(org.bukkit.craftbukkit.util.CraftNamespacedKey.fromMinecraft(key.location())); + } + + @Override diff --git a/patches/server/Fixup-NamespacedKey-handling.patch b/patches/server/Fixup-NamespacedKey-handling.patch index ceedecdc39..3a06cb401a 100644 --- a/patches/server/Fixup-NamespacedKey-handling.patch +++ b/patches/server/Fixup-NamespacedKey-handling.patch @@ -12,8 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public org.bukkit.loot.LootTable getLootTable() { -- return entity.getLootTable() != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(entity.getLootTable())) : null; -+ return entity.getLootTable() != null && !entity.getLootTable().getPath().isEmpty() ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(entity.getLootTable())) : null; +- return entity.getLootTable() != null ? Optionull.map(entity.getLootTable(), rk -> Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(rk.location()))) : null; ++ return entity.getLootTable() != null && !entity.getLootTable().location().getPath().isEmpty() ? Optionull.map(entity.getLootTable(), rk -> Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(rk.location()))) : null; } @Override @@ -25,8 +25,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public org.bukkit.loot.LootTable getLootTable() { -- return tileEntityLootable.lootTable != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(tileEntityLootable.lootTable)) : null; -+ return tileEntityLootable.lootTable != null && !tileEntityLootable.lootTable.getPath().isEmpty() ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(tileEntityLootable.lootTable)) : null; +- return tileEntityLootable.lootTable != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(tileEntityLootable.lootTable.location())) : null; ++ return tileEntityLootable.lootTable != null && !tileEntityLootable.lootTable.location().getPath().isEmpty() ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(tileEntityLootable.lootTable.location())) : null; } @Override diff --git a/patches/server/LootTable-API-and-replenishable-lootables.patch b/patches/server/LootTable-API-and-replenishable-lootables.patch index 7fae07f171..8ed2e5b92a 100644 --- a/patches/server/LootTable-API-and-replenishable-lootables.patch +++ b/patches/server/LootTable-API-and-replenishable-lootables.patch @@ -23,6 +23,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ +package com.destroystokyo.paper.loottable; + ++import net.minecraft.Optionull; ++import net.minecraft.core.registries.Registries; ++import net.minecraft.resources.ResourceKey; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.vehicle.AbstractMinecartContainer; +import net.minecraft.world.entity.vehicle.ContainerEntity; @@ -40,7 +43,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @Override + public org.bukkit.loot.LootTable getLootTable() { -+ return entity.getLootTable() != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(entity.getLootTable())) : null; ++ return entity.getLootTable() != null ? Optionull.map(entity.getLootTable(), rk -> Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(rk.location()))) : null; + } + + @Override @@ -61,7 +64,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @Override + public void setLootTable(org.bukkit.loot.LootTable table) { -+ entity.setLootTable((table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey())); ++ entity.setLootTable((table == null) ? null : ResourceKey.create(Registries.LOOT_TABLE, CraftNamespacedKey.toMinecraft(table.getKey()))); + } + + @Override @@ -441,6 +444,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +package com.destroystokyo.paper.loottable; + +import io.papermc.paper.util.MCUtil; ++import net.minecraft.core.registries.Registries; ++import net.minecraft.resources.ResourceKey; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity; +import org.bukkit.Bukkit; @@ -455,7 +460,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @Override + public org.bukkit.loot.LootTable getLootTable() { -+ return tileEntityLootable.lootTable != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(tileEntityLootable.lootTable)) : null; ++ return tileEntityLootable.lootTable != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(tileEntityLootable.lootTable.location())) : null; + } + + @Override @@ -466,7 +471,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @Override + public void setLootTable(org.bukkit.loot.LootTable table) { -+ tileEntityLootable.lootTable = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey()); ++ tileEntityLootable.lootTable = (table == null) ? null : ResourceKey.create(Registries.LOOT_TABLE, CraftNamespacedKey.toMinecraft(table.getKey())); + } + + @Override diff --git a/patches/server/More-PotionEffectType-API.patch b/patches/server/More-PotionEffectType-API.patch index 301db76a96..332522a3d9 100644 --- a/patches/server/More-PotionEffectType-API.patch +++ b/patches/server/More-PotionEffectType-API.patch @@ -17,11 +17,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public java.util.Map getEffectAttributes() { + // re-create map each time because a nms MobEffect can have its attributes modified + final java.util.Map attributeMap = new java.util.HashMap<>(); -+ this.handle.getAttributeModifiers().forEach((attribute, attributeModifier) -> { ++ this.handle.attributeModifiers.forEach((attribute, attributeModifier) -> { + attributeMap.put( + org.bukkit.craftbukkit.attribute.CraftAttribute.stringToBukkit(attribute.toString()), + // use zero as amplifier to get the base amount, as it is amount = base * (amplifier + 1) -+ org.bukkit.craftbukkit.attribute.CraftAttributeInstance.convert(attributeModifier.create(0)) ++ org.bukkit.craftbukkit.attribute.CraftAttributeInstance.convert(attributeModifier.create(this.handle.getDescriptionId(), 0)) + ); + }); + return java.util.Map.copyOf(attributeMap); @@ -30,9 +30,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + @Override + public double getAttributeModifierAmount(org.bukkit.attribute.Attribute attribute, int effectAmplifier) { + com.google.common.base.Preconditions.checkArgument(effectAmplifier >= 0, "effectAmplifier must be greater than or equal to 0"); -+ net.minecraft.world.entity.ai.attributes.Attribute nmsAttribute = org.bukkit.craftbukkit.attribute.CraftAttribute.bukkitToMinecraft(attribute); -+ com.google.common.base.Preconditions.checkArgument(this.handle.getAttributeModifiers().containsKey(nmsAttribute), attribute + " is not present on " + this.getKey()); -+ return this.handle.getAttributeModifiers().get(nmsAttribute).create(effectAmplifier).getAmount(); ++ Holder nmsAttribute = org.bukkit.craftbukkit.attribute.CraftAttribute.bukkitToMinecraftHolder(attribute); ++ com.google.common.base.Preconditions.checkArgument(this.handle.attributeModifiers.containsKey(nmsAttribute), attribute + " is not present on " + this.getKey()); ++ return this.handle.attributeModifiers.get(nmsAttribute).create(effectAmplifier).getAmount(); + } + + @Override diff --git a/patches/server/More-Projectile-API.patch b/patches/server/More-Projectile-API.patch index ff6d98918b..e3bec0f739 100644 --- a/patches/server/More-Projectile-API.patch +++ b/patches/server/More-Projectile-API.patch @@ -19,6 +19,19 @@ public net.minecraft.world.entity.projectile.Projectile canHitEntity(Lnet/minecr Co-authored-by: Nassim Jahnke +diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +@@ -0,0 +0,0 @@ public abstract class Projectile extends Entity implements TraceableEntity { + } + + // CraftBukkit start - call projectile hit event +- protected ProjectileDeflection preHitTargetOrDeflectSelf(HitResult movingobjectposition) { ++ public ProjectileDeflection preHitTargetOrDeflectSelf(HitResult movingobjectposition) { // Paper - protected -> public + org.bukkit.event.entity.ProjectileHitEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition); + this.hitCancelled = event != null && event.isCancelled(); + if (movingobjectposition.getType() == HitResult.Type.BLOCK || !this.hitCancelled) { diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java @@ -98,12 +111,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @Override + public void hitEntity(org.bukkit.entity.Entity entity) { -+ this.getHandle().preOnHit(new net.minecraft.world.phys.EntityHitResult(((CraftEntity) entity).getHandle())); ++ this.getHandle().preHitTargetOrDeflectSelf(new net.minecraft.world.phys.EntityHitResult(((CraftEntity) entity).getHandle())); + } + + @Override + public void hitEntity(org.bukkit.entity.Entity entity, org.bukkit.util.Vector vector) { -+ this.getHandle().preOnHit(new net.minecraft.world.phys.EntityHitResult(((CraftEntity) entity).getHandle(), new net.minecraft.world.phys.Vec3(vector.getX(), vector.getY(), vector.getZ()))); ++ this.getHandle().preHitTargetOrDeflectSelf(new net.minecraft.world.phys.EntityHitResult(((CraftEntity) entity).getHandle(), new net.minecraft.world.phys.Vec3(vector.getX(), vector.getY(), vector.getZ()))); + } + + @Override @@ -158,19 +171,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public boolean isInBlock() { -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java -@@ -0,0 +0,0 @@ public class CraftArrow extends CraftAbstractArrow implements Arrow { - return false; +@@ -0,0 +0,0 @@ public class CraftAbstractArrow extends AbstractProjectile implements AbstractAr + public String toString() { + return "CraftArrow"; } - ++ + // Paper start + @Override -+ @org.jetbrains.annotations.NotNull + public org.bukkit.craftbukkit.inventory.CraftItemStack getItemStack() { -+ return org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(getHandle().getPickupItem()); ++ return org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(this.getHandle().getPickupItem()); + } + + @Override @@ -183,21 +192,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return this.getHandle().life; + } + -+ @org.jetbrains.annotations.NotNull + @Override + public org.bukkit.Sound getHitSound() { + return org.bukkit.craftbukkit.CraftSound.minecraftToBukkit(this.getHandle().soundEvent); + } + + @Override -+ public void setHitSound(@org.jetbrains.annotations.NotNull org.bukkit.Sound sound) { ++ public void setHitSound(org.bukkit.Sound sound) { + this.getHandle().setSoundEvent(org.bukkit.craftbukkit.CraftSound.bukkitToMinecraft(sound)); + } + // Paper end -+ - @Override - public boolean hasCustomEffects() { - return !this.getHandle().getPotionContents().customEffects().isEmpty(); + } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java @@ -482,7 +487,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start - Projectile API + @Override + public org.bukkit.inventory.meta.PotionMeta getPotionMeta() { -+ return (org.bukkit.inventory.meta.PotionMeta) CraftItemStack.getItemMeta(this.getHandle().getItemRaw(), Material.SPLASH_POTION); ++ return (org.bukkit.inventory.meta.PotionMeta) CraftItemStack.getItemMeta(this.getHandle().getItem(), Material.SPLASH_POTION); + } + + @Override diff --git a/patches/server/Properly-resend-entities.patch b/patches/server/Properly-resend-entities.patch index a95a6fc04f..1e9d43cea5 100644 --- a/patches/server/Properly-resend-entities.patch +++ b/patches/server/Properly-resend-entities.patch @@ -97,7 +97,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // Entity in bucket - SPIGOT-4048 and SPIGOT-6859a if ((entity instanceof Bucketable && entity instanceof LivingEntity && origItem != null && origItem.asItem() == Items.WATER_BUCKET) && (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelected() == null || ServerGamePacketListenerImpl.this.player.getInventory().getSelected().getItem() != origItem)) { - ServerGamePacketListenerImpl.this.send(new ClientboundAddEntityPacket(entity)); -+ entity.getEntityData().resendPossiblyDesyncedEntityData(player); // Paper - The entire mob gets deleted, so resend it. ++ entity.resendPossiblyDesyncedEntityData(ServerGamePacketListenerImpl.this.player); // Paper - The entire mob gets deleted, so resend it. ServerGamePacketListenerImpl.this.player.containerMenu.sendAllDataToRemote(); } diff --git a/patches/server/Rewrite-chunk-system.patch b/patches/server/Rewrite-chunk-system.patch index eae1fc8b26..d36d3de3dd 100644 --- a/patches/server/Rewrite-chunk-system.patch +++ b/patches/server/Rewrite-chunk-system.patch @@ -21338,7 +21338,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return this.checkStructureInfo(object2IntMap, type, skipReferencedStructures); } else { @@ -0,0 +0,0 @@ public class StructureCheck { - } else if (!placement.applyAdditionalChunkRestrictions(pos.x, pos.z, this.seed)) { + } else if (!placement.applyAdditionalChunkRestrictions(pos.x, pos.z, this.seed, this.getSaltOverride(type))) { // Paper - add missing structure seed configs return StructureCheckResult.START_NOT_PRESENT; } else { - boolean bl = this.featureChecks diff --git a/patches/server/fix-MapLike-spam-for-missing-key-selector.patch b/patches/server/fix-MapLike-spam-for-missing-key-selector.patch index fa101421d0..4c167fb8f4 100644 --- a/patches/server/fix-MapLike-spam-for-missing-key-selector.patch +++ b/patches/server/fix-MapLike-spam-for-missing-key-selector.patch @@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return instance.group(VibrationInfo.CODEC.lenientOptionalFieldOf("event").forGetter((vibrationsystem_a) -> { return Optional.ofNullable(vibrationsystem_a.currentVibration); - }), VibrationSelector.CODEC.fieldOf("selector").forGetter(VibrationSystem.Data::getSelectionStrategy), ExtraCodecs.NON_NEGATIVE_INT.fieldOf("event_delay").orElse(0).forGetter(VibrationSystem.Data::getTravelTimeInTicks)).apply(instance, (optional, vibrationselector, integer) -> { -+ }), Codec.optionalField("selector", VibrationSelector.CODEC).xmap(o -> o.orElseGet(VibrationSelector::new), Optional::of).forGetter(VibrationSystem.Data::getSelectionStrategy), ExtraCodecs.NON_NEGATIVE_INT.fieldOf("event_delay").orElse(0).forGetter(VibrationSystem.Data::getTravelTimeInTicks)).apply(instance, (optional, vibrationselector, integer) -> { // Paper - fix MapLike spam for missing "selector" in 1.19.2 ++ }), VibrationSelector.CODEC.optionalFieldOf("selector").xmap(o -> o.orElseGet(VibrationSelector::new), Optional::of).forGetter(VibrationSystem.Data::getSelectionStrategy), ExtraCodecs.NON_NEGATIVE_INT.fieldOf("event_delay").orElse(0).forGetter(VibrationSystem.Data::getTravelTimeInTicks)).apply(instance, (optional, vibrationselector, integer) -> { // Paper - fix MapLike spam for missing "selector" in 1.19.2 return new VibrationSystem.Data((VibrationInfo) optional.orElse(null), vibrationselector, integer, true); // CraftBukkit - decompile error }); });