fix more compile errors
This commit is contained in:
@@ -120,7 +120,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
+import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
+import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||
+import net.minecraft.Util;
|
||||
+import net.minecraft.Optionull;
|
||||
+import net.minecraft.commands.CommandSourceStack;
|
||||
+import net.minecraft.network.chat.ChatDecorator;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
@@ -194,7 +194,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+
|
||||
+ private ChatDecorator.Result processModern(final ChatDecorator.Result input) {
|
||||
+ final @Nullable CraftPlayer player = Util.mapNullable(this.player, ServerPlayer::getBukkitEntity);
|
||||
+ final @Nullable CraftPlayer player = Optionull.map(this.player, ServerPlayer::getBukkitEntity);
|
||||
+
|
||||
+ final Component initialResult = input.message().component();
|
||||
+ final AsyncChatDecorateEvent event;
|
||||
@@ -280,6 +280,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import net.kyori.adventure.audience.ForwardingAudience;
|
||||
+import net.kyori.adventure.key.Key;
|
||||
+import net.kyori.adventure.text.Component;
|
||||
+import net.minecraft.Optionull;
|
||||
+import net.minecraft.Util;
|
||||
+import net.minecraft.core.registries.Registries;
|
||||
+import net.minecraft.network.chat.ChatDecorator;
|
||||
@@ -551,7 +552,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ if (acceptsNative(viewer)) {
|
||||
+ this.sendNative(viewer, chatType, msgFunction);
|
||||
+ } else {
|
||||
+ final net.minecraft.network.chat.@Nullable Component unsigned = Util.mapNullable(msgFunction, f -> f.apply(viewer));
|
||||
+ final net.minecraft.network.chat.@Nullable Component unsigned = Optionull.map(msgFunction, f -> f.apply(viewer));
|
||||
+ final PlayerChatMessage msg = unsigned == null ? ChatProcessor.this.message : ChatProcessor.this.message.withUnsignedContent(unsigned);
|
||||
+ viewer.sendMessage(msg.adventureView(), this.adventure(chatType));
|
||||
+ }
|
||||
@@ -601,7 +602,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ if (viewer instanceof ConsoleCommandSender) {
|
||||
+ this.sendToServer(chatType, msgFunction);
|
||||
+ } else if (viewer instanceof CraftPlayer craftPlayer) {
|
||||
+ craftPlayer.getHandle().sendChatMessage(ChatProcessor.this.outgoing, ChatProcessor.this.player.shouldFilterMessageTo(craftPlayer.getHandle()), chatType, Util.mapNullable(msgFunction, f -> f.apply(viewer)));
|
||||
+ craftPlayer.getHandle().sendChatMessage(ChatProcessor.this.outgoing, ChatProcessor.this.player.shouldFilterMessageTo(craftPlayer.getHandle()), chatType, Optionull.map(msgFunction, f -> f.apply(viewer)));
|
||||
+ } else if (viewer instanceof ForwardingAudience.Single single) {
|
||||
+ this.sendNative(single.audience(), chatType, msgFunction);
|
||||
+ } else {
|
||||
|
||||
Reference in New Issue
Block a user