Adventure

== AT ==
public net.minecraft.network.chat.HoverEvent$ItemStackInfo item
public net.minecraft.network.chat.HoverEvent$ItemStackInfo count
public net.minecraft.network.chat.HoverEvent$ItemStackInfo components
public net.minecraft.network.chat.contents.TranslatableContents filterAllowedArguments(Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;

Co-authored-by: zml <zml@stellardrift.ca>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
This commit is contained in:
Riley Park
2021-01-29 17:54:03 +01:00
parent b01c811c2f
commit 66779f5c86
103 changed files with 4975 additions and 392 deletions

View File

@@ -61,6 +61,19 @@ public class CraftServerLinks implements ServerLinks {
return link;
}
// Paper start - Adventure
@Override
public ServerLink addLink(net.kyori.adventure.text.Component displayName, URI url) {
Preconditions.checkArgument(displayName != null, "displayName cannot be null");
Preconditions.checkArgument(url != null, "url cannot be null");
CraftServerLink link = new CraftServerLink(net.minecraft.server.ServerLinks.Entry.custom(io.papermc.paper.adventure.PaperAdventure.asVanilla(displayName), url));
this.addLink(link);
return link;
}
// Paper end - Adventure
@Override
public ServerLink addLink(String displayName, URI url) {
Preconditions.checkArgument(displayName != null, "displayName cannot be null");
@@ -134,6 +147,13 @@ public class CraftServerLinks implements ServerLinks {
return CraftChatMessage.fromComponent(this.handle.displayName());
}
// Paper start - Adventure
@Override
public net.kyori.adventure.text.Component displayName() {
return io.papermc.paper.adventure.PaperAdventure.asAdventure(this.handle.displayName());
}
// Paper end - Adventure
@Override
public URI getUrl() {
return this.handle.link();