Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion paper-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ java {
}

val annotationsVersion = "26.0.2"
val adventureVersion = "4.25.0"
val adventureVersion = "5.0.0-SNAPSHOT"
val bungeeCordChatVersion = "1.21-R0.2-deprecated+build.21"
val slf4jVersion = "2.0.16"
val log4jVersion = "2.24.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ public void done(@Nullable String url) {
}
}

@Override
public void sendMessage(final @NotNull net.kyori.adventure.identity.Identity source, final @NotNull net.kyori.adventure.text.Component message, final @NotNull net.kyori.adventure.audience.MessageType type) {
net.kyori.adventure.audience.ForwardingAudience.super.sendMessage(source, message, type);
}

@NotNull
@Override
public Iterable<? extends net.kyori.adventure.audience.Audience> audiences() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,7 @@
import io.papermc.paper.util.TransformingRandomAccessList;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Stream;
import net.kyori.adventure.text.Component;
import net.kyori.examination.Examinable;
import net.kyori.examination.ExaminableProperty;
import net.kyori.examination.string.StringExaminer;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
Expand Down Expand Up @@ -241,7 +236,7 @@ private static List<Completion> fromStrings(final List<String> suggestions) {
/**
* A rich tab completion, consisting of a string suggestion, and a nullable {@link Component} tooltip.
*/
public interface Completion extends Examinable {
public interface Completion {

/**
* Get the suggestion string for this {@link Completion}.
Expand All @@ -257,11 +252,6 @@ public interface Completion extends Examinable {
*/
@Nullable Component tooltip();

@Override
default Stream<? extends ExaminableProperty> examinableProperties() {
return Stream.of(ExaminableProperty.of("suggestion", this.suggestion()), ExaminableProperty.of("tooltip", this.tooltip()));
}

/**
* Create a new {@link Completion} from a suggestion string.
*
Expand All @@ -287,47 +277,6 @@ static Completion completion(final String suggestion, final @Nullable Component
}

@ApiStatus.Internal
static final class CompletionImpl implements Completion {

private final String suggestion;
private final @Nullable Component tooltip;

CompletionImpl(final String suggestion, final @Nullable Component tooltip) {
this.suggestion = suggestion;
this.tooltip = tooltip;
}

@Override
public String suggestion() {
return this.suggestion;
}

@Override
public @Nullable Component tooltip() {
return this.tooltip;
}

@Override
public boolean equals(final @Nullable Object o) {
if (this == o) {
return true;
}
if (o == null || this.getClass() != o.getClass()) {
return false;
}
final CompletionImpl that = (CompletionImpl) o;
return this.suggestion.equals(that.suggestion)
&& Objects.equals(this.tooltip, that.tooltip);
}

@Override
public int hashCode() {
return Objects.hash(this.suggestion, this.tooltip);
}

@Override
public String toString() {
return StringExaminer.simpleEscaping().examine(this);
}
record CompletionImpl(String suggestion, @Nullable Component tooltip) implements Completion {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import net.kyori.adventure.text.serializer.plain.PlainComponentSerializer;
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
Expand Down Expand Up @@ -95,21 +94,6 @@ public static ComponentFlattener flattener() {
return Bukkit.getUnsafe().componentFlattener();
}

/**
* Get a serializer for {@link Component}s that will convert components to
* a plain-text string.
*
* <p>Implementations may provide a serializer capable of processing any
* information that requires access to implementation details.</p>
*
* @return a serializer to plain text
* @deprecated will be removed in adventure 5.0.0, use {@link PlainTextComponentSerializer#plainText()}
*/
@Deprecated(forRemoval = true, since = "1.18.1")
public static PlainComponentSerializer plainSerializer() {
return Bukkit.getUnsafe().plainComponentSerializer();
}

/**
* Get a serializer for {@link Component}s that will convert components to
* a plain-text string.
Expand Down
1 change: 0 additions & 1 deletion paper-api/src/main/java/org/bukkit/UnsafeValues.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
public interface UnsafeValues {
// Paper start
net.kyori.adventure.text.flattener.ComponentFlattener componentFlattener();
@Deprecated(forRemoval = true) net.kyori.adventure.text.serializer.plain.PlainComponentSerializer plainComponentSerializer();
@Deprecated(forRemoval = true) net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer plainTextSerializer();
@Deprecated(forRemoval = true) net.kyori.adventure.text.serializer.gson.GsonComponentSerializer gsonComponentSerializer();
@Deprecated(forRemoval = true) net.kyori.adventure.text.serializer.gson.GsonComponentSerializer colorDownsamplingGsonComponentSerializer();
Expand Down
15 changes: 4 additions & 11 deletions paper-api/src/main/java/org/bukkit/command/CommandSender.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package org.bukkit.command;

import java.util.UUID;
import net.kyori.adventure.audience.MessageType;
import net.kyori.adventure.identity.Identity;
import net.kyori.adventure.text.Component;
import org.bukkit.Server;
import org.bukkit.permissions.Permissible;
Expand Down Expand Up @@ -38,7 +36,7 @@ public interface CommandSender extends net.kyori.adventure.audience.Audience, Pe
*
* @param message Message to be displayed
* @param sender The sender of this message
* @see #sendMessage(net.kyori.adventure.identity.Identified, net.kyori.adventure.text.Component)
* @see #sendMessage(Component)
* @deprecated sender UUID is ignored
*/
@Deprecated // Paper
Expand All @@ -49,7 +47,7 @@ public interface CommandSender extends net.kyori.adventure.audience.Audience, Pe
*
* @param messages An array of messages to be displayed
* @param sender The sender of this message
* @see #sendMessage(net.kyori.adventure.identity.Identified, net.kyori.adventure.text.Component)
* @see #sendMessage(Component)
* @deprecated sender UUID is ignored
*/
@Deprecated // Paper
Expand Down Expand Up @@ -133,11 +131,6 @@ public void sendMessage(@Nullable UUID sender, @NotNull net.md_5.bungee.api.chat
*/
public net.kyori.adventure.text.@NotNull Component name();

@Override
default void sendMessage(final net.kyori.adventure.identity.@NotNull Identity identity, final net.kyori.adventure.text.@NotNull Component message, final net.kyori.adventure.audience.@NotNull MessageType type) {
this.sendMessage(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(message));
}

/**
* Sends a message with the MiniMessage format to the command sender.
* <p>
Expand Down Expand Up @@ -179,7 +172,7 @@ default void sendPlainMessage(final @NotNull String message) {
* the component will be sent as legacy text.</p>
*
* @param component the component to send
* @deprecated use {@link #sendMessage(Identity, Component, MessageType)} instead
* @deprecated use {@link #sendMessage(Component)} instead
*/
@Deprecated
default void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent component) {
Expand All @@ -193,7 +186,7 @@ default void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent compone
* the components will be sent as legacy text.</p>
*
* @param components the components to send
* @deprecated use {@link #sendMessage(Identity, Component, MessageType)} instead
* @deprecated use {@link #sendMessage(Component)} instead
*/
@Deprecated
default void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ public interface ProxiedCommandSender extends CommandSender, net.kyori.adventure
CommandSender getCallee();

// Paper start
@Override
default void sendMessage(final net.kyori.adventure.identity.@NotNull Identity source, final net.kyori.adventure.text.@NotNull Component message, final net.kyori.adventure.audience.@NotNull MessageType type) {
net.kyori.adventure.audience.ForwardingAudience.Single.super.sendMessage(source, message, type);
}

@NotNull
@Override
default net.kyori.adventure.audience.Audience audience() {
Expand Down
2 changes: 1 addition & 1 deletion paper-api/src/main/java/org/bukkit/entity/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ public class Spigot extends CommandSender.Spigot {
@NotNull
@Override
default net.kyori.adventure.text.event.HoverEvent<net.kyori.adventure.text.event.HoverEvent.ShowEntity> asHoverEvent(final @NotNull java.util.function.UnaryOperator<net.kyori.adventure.text.event.HoverEvent.ShowEntity> op) {
return net.kyori.adventure.text.event.HoverEvent.showEntity(op.apply(net.kyori.adventure.text.event.HoverEvent.ShowEntity.of(this.getType().getKey(), this.getUniqueId(), this.customName())));
return net.kyori.adventure.text.event.HoverEvent.showEntity(op.apply(net.kyori.adventure.text.event.HoverEvent.ShowEntity.showEntity(this.getType().getKey(), this.getUniqueId(), this.customName())));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion paper-api/src/main/java/org/bukkit/entity/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -3553,7 +3553,7 @@ default void openSign(Sign sign) {
// Paper start
@Override
default net.kyori.adventure.text.event.HoverEvent<net.kyori.adventure.text.event.HoverEvent.ShowEntity> asHoverEvent(final java.util.function.UnaryOperator<net.kyori.adventure.text.event.HoverEvent.ShowEntity> op) {
return net.kyori.adventure.text.event.HoverEvent.showEntity(op.apply(net.kyori.adventure.text.event.HoverEvent.ShowEntity.of(this.getType().getKey(), this.getUniqueId(), this.displayName())));
return net.kyori.adventure.text.event.HoverEvent.showEntity(op.apply(net.kyori.adventure.text.event.HoverEvent.ShowEntity.showEntity(this.getType().getKey(), this.getUniqueId(), this.displayName())));
}
// Paper end

Expand Down
Loading
Loading