diff --git a/patches/server/Adventure.patch b/patches/server/Adventure.patch index e26c9bcb5c..bd03943a2a 100644 --- a/patches/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -2709,22 +2709,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + @Override + public void sendMessage(final net.kyori.adventure.identity.Identity identity, final net.kyori.adventure.text.Component message, final net.kyori.adventure.audience.MessageType type) { + if (getHandle().connection == null) return; -+ // TODO this needs to be checked + final net.minecraft.core.Registry chatTypeRegistry = this.getHandle().level.registryAccess().registryOrThrow(net.minecraft.core.Registry.CHAT_TYPE_REGISTRY); -+ final net.minecraft.network.protocol.Packet packet; -+ if (identity.equals(net.kyori.adventure.identity.Identity.nil()) || type == net.kyori.adventure.audience.MessageType.SYSTEM) { -+ packet = new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(message, chatTypeRegistry.getId(chatTypeRegistry.get(net.minecraft.network.chat.ChatType.SYSTEM))); -+ } else { -+ final @Nullable Player source = this.getServer().getPlayer(identity.uuid()); -+ final ChatSender sender; -+ if (source != null) { -+ sender = ((CraftPlayer) source).getHandle().asChatSender(); -+ } else { -+ sender = new ChatSender(identity.uuid(), Component.empty(), null); -+ } -+ packet = new net.minecraft.network.protocol.game.ClientboundPlayerChatPacket(message, chatTypeRegistry.getId(chatTypeRegistry.get(net.minecraft.network.chat.ChatType.CHAT)), sender, java.time.Instant.now()); -+ } -+ this.getHandle().connection.send(packet); ++ this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(message, chatTypeRegistry.getId(chatTypeRegistry.get(net.minecraft.network.chat.ChatType.SYSTEM)))); + } + + @Override diff --git a/patches/server/Optimise-general-POI-access.patch b/patches/server/Optimise-general-POI-access.patch index addc18fd06..655c742798 100644 --- a/patches/server/Optimise-general-POI-access.patch +++ b/patches/server/Optimise-general-POI-access.patch @@ -229,7 +229,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + final PoiManager.Occupancy occupancy, + final boolean load, + final List ret) { -+ findClosestPoiDataRecords(poiStorage, villagePlaceType, (type, pos) -> positionPredicate.test(pos), sourcePosition, range, maxDistance, occupancy, load, ret); ++ final BiPredicate, BlockPos> predicate = positionPredicate != null ? (type, pos) -> positionPredicate.test(pos) : null; ++ findClosestPoiDataRecords(poiStorage, villagePlaceType, predicate, sourcePosition, range, maxDistance, occupancy, load, ret); + } + + public static void findClosestPoiDataRecords(final PoiManager poiStorage,