From caa4780282c5f5003b04cee03d8d7fa74eb54f8e Mon Sep 17 00:00:00 2001 From: Jake Potrebic <15055071+Machine-Maker@users.noreply.github.com> Date: Wed, 22 Sep 2021 11:34:40 -0700 Subject: [PATCH] Add more component name methods (#6578) --- patches/api/0007-Adventure.patch | 40 ++++++- patches/api/0010-Entity-Origin-API.patch | 4 +- ...t-sendMessage-methods-to-CommandSend.patch | 4 +- patches/api/0060-Entity-fromMobSpawner.patch | 4 +- patches/api/0121-Entity-getChunk-API.patch | 4 +- .../0174-Entity-getEntitySpawnReason.patch | 4 +- patches/api/0214-Add-entity-liquid-API.patch | 4 +- patches/api/0228-Entity-isTicking.patch | 4 +- ...docs-for-Entity.getEntitySpawnReason.patch | 4 +- patches/server/0011-Adventure.patch | 110 +++++++++++++++++- patches/server/0026-Entity-Origin-API.patch | 4 +- .../server/0147-Entity-fromMobSpawner.patch | 4 +- .../0316-Entity-getEntitySpawnReason.patch | 4 +- ...n-for-console-having-all-permissions.patch | 8 +- .../server/0481-Add-entity-liquid-API.patch | 4 +- patches/server/0529-Entity-isTicking.patch | 4 +- 16 files changed, 173 insertions(+), 37 deletions(-) diff --git a/patches/api/0007-Adventure.patch b/patches/api/0007-Adventure.patch index 49e5bdc1e..05e1579c9 100644 --- a/patches/api/0007-Adventure.patch +++ b/patches/api/0007-Adventure.patch @@ -1178,7 +1178,7 @@ index ab6b0ec328e94bf65a0dafd0403e5ee3b870296c..c8d37184d8e882a4084a1bfef85faa33 /** diff --git a/src/main/java/org/bukkit/command/CommandSender.java b/src/main/java/org/bukkit/command/CommandSender.java -index 284be63a125624a8ae43d2c164aede810ce6bfe5..511746ef9576e4c219e9ab35da3ab0727cb7ee7c 100644 +index 284be63a125624a8ae43d2c164aede810ce6bfe5..7c9a0c85c0e23d6a569c3583e87b005938923d95 100644 --- a/src/main/java/org/bukkit/command/CommandSender.java +++ b/src/main/java/org/bukkit/command/CommandSender.java @@ -6,12 +6,13 @@ import org.bukkit.permissions.Permissible; @@ -1260,18 +1260,42 @@ index 284be63a125624a8ae43d2c164aede810ce6bfe5..511746ef9576e4c219e9ab35da3ab072 public void sendMessage(@Nullable UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) { throw new UnsupportedOperationException("Not supported yet."); } -@@ -99,4 +111,11 @@ public interface CommandSender extends Permissible { +@@ -99,4 +111,18 @@ public interface CommandSender extends Permissible { @NotNull Spigot spigot(); // Spigot end + + // Paper start ++ /** ++ * Gets the name of this command sender ++ * ++ * @return Name of the sender ++ */ ++ public @NotNull Component name(); ++ + @Override + default void sendMessage(final @NotNull net.kyori.adventure.identity.Identity identity, final @NotNull net.kyori.adventure.text.Component message, final @NotNull net.kyori.adventure.audience.MessageType type) { + this.sendMessage(org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(message)); + } + // Paper end } +diff --git a/src/main/java/org/bukkit/command/MessageCommandSender.java b/src/main/java/org/bukkit/command/MessageCommandSender.java +index a7ef1f51c2b96617a32e6e7b1723e8770ba8a6a8..68daa56546d00089d7d6c13ee897d828c377bbc3 100644 +--- a/src/main/java/org/bukkit/command/MessageCommandSender.java ++++ b/src/main/java/org/bukkit/command/MessageCommandSender.java +@@ -49,6 +49,12 @@ public interface MessageCommandSender extends CommandSender { + default String getName() { + throw new NotImplementedException(); + } ++ // Paper start ++ @Override ++ default net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component name() { ++ throw new NotImplementedException(); ++ } ++ // Paper end + + @Override + default boolean isOp() { diff --git a/src/main/java/org/bukkit/command/ProxiedCommandSender.java b/src/main/java/org/bukkit/command/ProxiedCommandSender.java index fcc34b640265f4dccb46b9f09466ab8e1d96043e..74599b4ee0518481c0e3a5f6ab2f5302837f1ae3 100644 --- a/src/main/java/org/bukkit/command/ProxiedCommandSender.java @@ -1343,7 +1367,7 @@ index 9566e4306ada5e82dede0f002aa06da12c44996b..4d5f0837bd0e02a30c943d8969fb6b13 + // Paper end } diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 25a6f9313a1953def7470e411b53016f2ca14bef..d7a4cfed4f46b34f83fb2c07bdab5a71215d26bb 100644 +index 25a6f9313a1953def7470e411b53016f2ca14bef..03d8ac1b41659540d7eb3d7e218cdfaa4acb683b 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -25,7 +25,7 @@ import org.jetbrains.annotations.Nullable; @@ -1355,12 +1379,20 @@ index 25a6f9313a1953def7470e411b53016f2ca14bef..d7a4cfed4f46b34f83fb2c07bdab5a71 /** * Gets the entity's current position -@@ -648,4 +648,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent +@@ -648,4 +648,20 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent @Override Spigot spigot(); // Spigot end + + // Paper start ++ /** ++ * Gets the entity's display name formatted with their team prefix/suffix and ++ * the entity's default hover/click events. ++ * ++ * @return the team display name ++ */ ++ @NotNull net.kyori.adventure.text.Component teamDisplayName(); ++ + @NotNull + @Override + default net.kyori.adventure.text.event.HoverEvent asHoverEvent(final @NotNull java.util.function.UnaryOperator op) { diff --git a/patches/api/0010-Entity-Origin-API.patch b/patches/api/0010-Entity-Origin-API.patch index d34f06d5e..3feb6b236 100644 --- a/patches/api/0010-Entity-Origin-API.patch +++ b/patches/api/0010-Entity-Origin-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Entity Origin API diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index d7a4cfed4f46b34f83fb2c07bdab5a71215d26bb..8c93c640dd163ca99df81706715117094fea5738 100644 +index 03d8ac1b41659540d7eb3d7e218cdfaa4acb683b..7e0ec58ea1d23501f0273882ebae8e45513b02cf 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java -@@ -655,5 +655,15 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent +@@ -663,5 +663,15 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent default net.kyori.adventure.text.event.HoverEvent asHoverEvent(final @NotNull java.util.function.UnaryOperator 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()))); } diff --git a/patches/api/0022-Add-BaseComponent-sendMessage-methods-to-CommandSend.patch b/patches/api/0022-Add-BaseComponent-sendMessage-methods-to-CommandSend.patch index b8376a910..39b5170da 100644 --- a/patches/api/0022-Add-BaseComponent-sendMessage-methods-to-CommandSend.patch +++ b/patches/api/0022-Add-BaseComponent-sendMessage-methods-to-CommandSend.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add BaseComponent sendMessage methods to CommandSender diff --git a/src/main/java/org/bukkit/command/CommandSender.java b/src/main/java/org/bukkit/command/CommandSender.java -index c88418c7aa19b4fecdfa9af3d18ff202a5dc5763..fb0e608fa92dae99b9eee8fc1cbdf4b91a33e620 100644 +index 7c9a0c85c0e23d6a569c3583e87b005938923d95..39ce012fcf2b22471a2ace9218f4f696ec93f466 100644 --- a/src/main/java/org/bukkit/command/CommandSender.java +++ b/src/main/java/org/bukkit/command/CommandSender.java @@ -1,6 +1,9 @@ @@ -18,7 +18,7 @@ index c88418c7aa19b4fecdfa9af3d18ff202a5dc5763..fb0e608fa92dae99b9eee8fc1cbdf4b9 import org.bukkit.Server; import org.bukkit.permissions.Permissible; import org.jetbrains.annotations.NotNull; -@@ -117,5 +120,33 @@ public interface CommandSender extends net.kyori.adventure.audience.Audience, Pe +@@ -124,5 +127,33 @@ public interface CommandSender extends net.kyori.adventure.audience.Audience, Pe default void sendMessage(final @NotNull net.kyori.adventure.identity.Identity identity, final @NotNull net.kyori.adventure.text.Component message, final @NotNull net.kyori.adventure.audience.MessageType type) { this.sendMessage(org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(message)); } diff --git a/patches/api/0060-Entity-fromMobSpawner.patch b/patches/api/0060-Entity-fromMobSpawner.patch index 44c4dd6e6..222a4c507 100644 --- a/patches/api/0060-Entity-fromMobSpawner.patch +++ b/patches/api/0060-Entity-fromMobSpawner.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Entity#fromMobSpawner() diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 8c93c640dd163ca99df81706715117094fea5738..85478ed185a938aa8e95d450da8197c76f13106b 100644 +index 7e0ec58ea1d23501f0273882ebae8e45513b02cf..d794ed97bd14c67584af9190bad7d0cd07001b05 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java -@@ -665,5 +665,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent +@@ -673,5 +673,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent */ @Nullable Location getOrigin(); diff --git a/patches/api/0121-Entity-getChunk-API.patch b/patches/api/0121-Entity-getChunk-API.patch index a02bb6d15..87ce3a657 100644 --- a/patches/api/0121-Entity-getChunk-API.patch +++ b/patches/api/0121-Entity-getChunk-API.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Entity#getChunk API Get the chunk the entity is currently registered to diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 85478ed185a938aa8e95d450da8197c76f13106b..38d7685063bf47491c55c1911c6f2cb915f64202 100644 +index d794ed97bd14c67584af9190bad7d0cd07001b05..0f1e456c8b278d0fb45871e6f57baf2c6234ed51 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -3,6 +3,7 @@ package org.bukkit.entity; @@ -17,7 +17,7 @@ index 85478ed185a938aa8e95d450da8197c76f13106b..38d7685063bf47491c55c1911c6f2cb9 import org.bukkit.EntityEffect; import org.bukkit.Location; import org.bukkit.Nameable; -@@ -672,5 +673,16 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent +@@ -680,5 +681,16 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent * @return True if entity spawned from a mob spawner */ boolean fromMobSpawner(); diff --git a/patches/api/0174-Entity-getEntitySpawnReason.patch b/patches/api/0174-Entity-getEntitySpawnReason.patch index 0a38cac83..dbe7998a9 100644 --- a/patches/api/0174-Entity-getEntitySpawnReason.patch +++ b/patches/api/0174-Entity-getEntitySpawnReason.patch @@ -10,10 +10,10 @@ persistenting Living Entity, SPAWNER for spawners, or DEFAULT since data was not stored. diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 92927b9a90b2a4497dd572f6f752c40cf35dd8b8..4a6d58ef68b782291b4d26a8515be326481f5209 100644 +index 0207348eda9a5fcd3814e368a1bc61ae451a1aff..3bb7154a5be37e1943e4f94b5496019c07ca6937 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java -@@ -711,5 +711,11 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent +@@ -719,5 +719,11 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent // TODO remove impl here return getLocation().getChunk(); } diff --git a/patches/api/0214-Add-entity-liquid-API.patch b/patches/api/0214-Add-entity-liquid-API.patch index 2bf531eba..7411e3493 100644 --- a/patches/api/0214-Add-entity-liquid-API.patch +++ b/patches/api/0214-Add-entity-liquid-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add entity liquid API diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 4a6d58ef68b782291b4d26a8515be326481f5209..09dc74b0e10d075190009631c84a3710cc1f9177 100644 +index 3bb7154a5be37e1943e4f94b5496019c07ca6937..c729cb44290cd719e7684fd919bf74300484b883 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java -@@ -717,5 +717,35 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent +@@ -725,5 +725,35 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent */ @NotNull org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason getEntitySpawnReason(); diff --git a/patches/api/0228-Entity-isTicking.patch b/patches/api/0228-Entity-isTicking.patch index c4c93d0fd..de2af4535 100644 --- a/patches/api/0228-Entity-isTicking.patch +++ b/patches/api/0228-Entity-isTicking.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Entity#isTicking diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 09dc74b0e10d075190009631c84a3710cc1f9177..8cfe08cbc869e468edc0f0bdaa28d5bf1f6201a2 100644 +index c729cb44290cd719e7684fd919bf74300484b883..57717976b5281ecf316064793f300426d0983a32 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java -@@ -747,5 +747,10 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent +@@ -755,5 +755,10 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent * Check if entity is in lava */ public boolean isInLava(); diff --git a/patches/api/0229-Clarify-the-Javadocs-for-Entity.getEntitySpawnReason.patch b/patches/api/0229-Clarify-the-Javadocs-for-Entity.getEntitySpawnReason.patch index 69ed86641..f34361722 100644 --- a/patches/api/0229-Clarify-the-Javadocs-for-Entity.getEntitySpawnReason.patch +++ b/patches/api/0229-Clarify-the-Javadocs-for-Entity.getEntitySpawnReason.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Clarify the Javadocs for Entity.getEntitySpawnReason() diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 8cfe08cbc869e468edc0f0bdaa28d5bf1f6201a2..a9e455c5b3bbe4edbdb71f86f5c6eebc2f605547 100644 +index 57717976b5281ecf316064793f300426d0983a32..b02704b0535522c5535b560105eec2885fdd3e77 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java -@@ -713,7 +713,7 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent +@@ -721,7 +721,7 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent } /** diff --git a/patches/server/0011-Adventure.patch b/patches/server/0011-Adventure.patch index 8b22c0daa..506898df7 100644 --- a/patches/server/0011-Adventure.patch +++ b/patches/server/0011-Adventure.patch @@ -2060,11 +2060,43 @@ index 2509a39bec5edd38b54709fec241c7c18e0d1c26..6e89b039479a034d98d1ec183b06d541 public static Component[] sanitizeLines(String[] lines) { Component[] components = new Component[4]; +diff --git a/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java +index 83efca7144b4ce9cf7bd6bbbbf9c4426d2472315..bf4c5c83c3c6d710c9c40257087a2c744a7d00c6 100644 +--- a/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java ++++ b/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java +@@ -46,6 +46,13 @@ public class CraftBlockCommandSender extends ServerCommandSender implements Bloc + return this.block.getTextName(); + } + ++ // Paper start ++ @Override ++ public net.kyori.adventure.text.Component name() { ++ return io.papermc.paper.adventure.PaperAdventure.asAdventure(this.block.getDisplayName()); ++ } ++ // Paper end ++ + @Override + public boolean isOp() { + return true; diff --git a/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java -index f3cb4102ab223f379f60dac317df7da1fab812a8..b41452c3ed833f0e6c3b03a56fe5773e7b68a8e6 100644 +index f3cb4102ab223f379f60dac317df7da1fab812a8..269738c499c6aab6f8c39ba4ffd12fa09f0d79dc 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java +++ b/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java -@@ -80,4 +80,11 @@ public class CraftConsoleCommandSender extends ServerCommandSender implements Co +@@ -46,6 +46,13 @@ public class CraftConsoleCommandSender extends ServerCommandSender implements Co + return "CONSOLE"; + } + ++ // Paper start ++ @Override ++ public net.kyori.adventure.text.Component name() { ++ return net.kyori.adventure.text.Component.text(this.getName()); ++ } ++ // Paper end ++ + @Override + public boolean isOp() { + return true; +@@ -80,4 +87,11 @@ public class CraftConsoleCommandSender extends ServerCommandSender implements Co public boolean isConversing() { return this.conversationTracker.isConversing(); } @@ -2076,6 +2108,42 @@ index f3cb4102ab223f379f60dac317df7da1fab812a8..b41452c3ed833f0e6c3b03a56fe5773e + } + // Paper end } +diff --git a/src/main/java/org/bukkit/craftbukkit/command/CraftRemoteConsoleCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/CraftRemoteConsoleCommandSender.java +index 02a8c522a25f1c3c8eb0245560757772e627d31e..07f7effaa46afdd8766e3e6bfd8cb923e55f68cf 100644 +--- a/src/main/java/org/bukkit/craftbukkit/command/CraftRemoteConsoleCommandSender.java ++++ b/src/main/java/org/bukkit/craftbukkit/command/CraftRemoteConsoleCommandSender.java +@@ -30,6 +30,13 @@ public class CraftRemoteConsoleCommandSender extends ServerCommandSender impleme + return "Rcon"; + } + ++ // Paper start ++ @Override ++ public net.kyori.adventure.text.Component name() { ++ return net.kyori.adventure.text.Component.text(this.getName()); ++ } ++ // Paper end ++ + @Override + public boolean isOp() { + return true; +diff --git a/src/main/java/org/bukkit/craftbukkit/command/ProxiedNativeCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/ProxiedNativeCommandSender.java +index 53d6950ad270ba901de5226b9daecb683248ad05..3e7d14564f11a3ed0b0766444e9d681804597e9a 100644 +--- a/src/main/java/org/bukkit/craftbukkit/command/ProxiedNativeCommandSender.java ++++ b/src/main/java/org/bukkit/craftbukkit/command/ProxiedNativeCommandSender.java +@@ -67,6 +67,13 @@ public class ProxiedNativeCommandSender implements ProxiedCommandSender { + return this.getCallee().getName(); + } + ++ // Paper start ++ @Override ++ public net.kyori.adventure.text.Component name() { ++ return this.getCallee().name(); ++ } ++ // Paper end ++ + @Override + public boolean isPermissionSet(String name) { + return this.getCaller().isPermissionSet(name); diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java index cf69a45f038c2b8336010f5fe277313fd0513b5b..eb99e0c2462a2d1ab4508a5c3f1580b6e31d7465 100644 --- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java @@ -2094,7 +2162,7 @@ index cf69a45f038c2b8336010f5fe277313fd0513b5b..eb99e0c2462a2d1ab4508a5c3f1580b6 public net.minecraft.world.item.enchantment.Enchantment getHandle() { return this.target; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index f13410c3376c7c5b666c803666ba23a40fbea8a0..3f7e976d5490768d71e8ce5344d3d150039cdc21 100644 +index f13410c3376c7c5b666c803666ba23a40fbea8a0..a120193418f0edff022752defb5b62663643f0f9 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -815,6 +815,19 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -2117,6 +2185,24 @@ index f13410c3376c7c5b666c803666ba23a40fbea8a0..3f7e976d5490768d71e8ce5344d3d150 @Override public void setCustomName(String name) { // sane limit for name length +@@ -870,6 +883,17 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { + public String getName() { + return CraftChatMessage.fromComponent(this.getHandle().getName()); + } ++ // Paper start ++ @Override ++ public net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component name() { ++ return io.papermc.paper.adventure.PaperAdventure.asAdventure(this.getHandle().getName()); ++ } ++ ++ @Override ++ public net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component teamDisplayName() { ++ return io.papermc.paper.adventure.PaperAdventure.asAdventure(this.getHandle().getDisplayName()); ++ } ++ // Paper end + + @Override + public boolean isPermissionSet(String name) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java index 042691349dd5659e8db526199641cbcfa21c6005..841dbf4a86b19d7c8ea41930ecb1f88c660fa117 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -2151,6 +2237,24 @@ index 042691349dd5659e8db526199641cbcfa21c6005..841dbf4a86b19d7c8ea41930ecb1f88c player.containerMenu = container; player.initMenu(container); } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java +index 446fdca49a5a6999626a7ee3a1d5c168b15a09dd..f9863e138994f6c7a7975a852f106faa96d52315 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java +@@ -65,6 +65,13 @@ public class CraftMinecartCommand extends CraftMinecart implements CommandMineca + return CraftChatMessage.fromComponent(this.getHandle().getCommandBlock().getName()); + } + ++ // Paper start ++ @Override ++ public net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component name() { ++ return io.papermc.paper.adventure.PaperAdventure.asAdventure(this.getHandle().getCommandBlock().getName()); ++ } ++ // Paper end ++ + @Override + public boolean isOp() { + return true; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index cdc13a38400e1e564c1d2388f0fb46e6d66f55d1..2f604c883ee1341ad3896b74de01f4dc9537ecfa 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/patches/server/0026-Entity-Origin-API.patch b/patches/server/0026-Entity-Origin-API.patch index c4df249d1..ceb5a51e2 100644 --- a/patches/server/0026-Entity-Origin-API.patch +++ b/patches/server/0026-Entity-Origin-API.patch @@ -132,10 +132,10 @@ index 394164f50256ad9a167e15531a9202875abb6cb6..8ad1b3cb16533d62deda643ce0cdda30 @Nullable diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 3f7e976d5490768d71e8ce5344d3d150039cdc21..118ba56a539471bded0cb42334576d5394aee4ab 100644 +index a120193418f0edff022752defb5b62663643f0f9..8afa6d638d12ddbabb5db11ada314b4d111e5e11 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1121,4 +1121,21 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1132,4 +1132,21 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return this.spigot; } // Spigot end diff --git a/patches/server/0147-Entity-fromMobSpawner.patch b/patches/server/0147-Entity-fromMobSpawner.patch index 428499a9e..5937dd597 100644 --- a/patches/server/0147-Entity-fromMobSpawner.patch +++ b/patches/server/0147-Entity-fromMobSpawner.patch @@ -49,10 +49,10 @@ index 037dafb59e54047d1d54474c44897d35b8f46c98..e310c1eb1108780bcff4d7ba9d49cefa if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) { Entity vehicle = entity.getVehicle(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 7e50d589724c15ce30424cf1d82eb56e84acd28b..edf381a0fd8a568fb2095a0369c3eb062e9a566b 100644 +index b5e44370c847d4a2e51e610a6b6aca5586b17cad..60d7bb2aa29032f278d9e4ba054bad6b1ea1bb36 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1167,5 +1167,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1178,5 +1178,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { //noinspection ConstantConditions return originVector.toLocation(world); } diff --git a/patches/server/0316-Entity-getEntitySpawnReason.patch b/patches/server/0316-Entity-getEntitySpawnReason.patch index 1c119711d..e8cdcb7ee 100644 --- a/patches/server/0316-Entity-getEntitySpawnReason.patch +++ b/patches/server/0316-Entity-getEntitySpawnReason.patch @@ -105,10 +105,10 @@ index 494174608c0c6d0e0d9820ad4f263bef90c3dfdf..fe5e691ebbe930662f8a4f00811fdd8e // Spigot Start if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index f1fdf5fdaf3a590e8a011db0c5c741be4bfefc9c..08c83c9cbfc0c23617117e4905469dc91fc516ec 100644 +index f635962e99e1a078171037e3e41c9c413dff66fd..4b9e73536b75ae805bf306ed262011a2d9dc7456 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1205,5 +1205,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1216,5 +1216,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { public boolean fromMobSpawner() { return getHandle().spawnedViaMobSpawner; } diff --git a/patches/server/0445-Add-option-for-console-having-all-permissions.patch b/patches/server/0445-Add-option-for-console-having-all-permissions.patch index f0f516c73..65f1811c7 100644 --- a/patches/server/0445-Add-option-for-console-having-all-permissions.patch +++ b/patches/server/0445-Add-option-for-console-having-all-permissions.patch @@ -19,10 +19,10 @@ index 155fa55eb859da90d59d01b21ae422bf99ccfa87..ddf9b5592e2203315d239ab28a338633 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java -index b41452c3ed833f0e6c3b03a56fe5773e7b68a8e6..9383e2fd8469d3203e0fe91dfbb05eb8192bc082 100644 +index 269738c499c6aab6f8c39ba4ffd12fa09f0d79dc..dbff1eda25b02b16ec123515338d470489f3b3c4 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java +++ b/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java -@@ -86,5 +86,15 @@ public class CraftConsoleCommandSender extends ServerCommandSender implements Co +@@ -93,5 +93,15 @@ public class CraftConsoleCommandSender extends ServerCommandSender implements Co public void sendMessage(final net.kyori.adventure.identity.Identity identity, final net.kyori.adventure.text.Component message, final net.kyori.adventure.audience.MessageType type) { this.sendRawMessage(io.papermc.paper.adventure.PaperAdventure.LEGACY_SECTION_UXRC.serialize(message)); } @@ -39,10 +39,10 @@ index b41452c3ed833f0e6c3b03a56fe5773e7b68a8e6..9383e2fd8469d3203e0fe91dfbb05eb8 // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/command/CraftRemoteConsoleCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/CraftRemoteConsoleCommandSender.java -index 02a8c522a25f1c3c8eb0245560757772e627d31e..a3194c8a425d1d808c76ebef9997478f4d399fe0 100644 +index 07f7effaa46afdd8766e3e6bfd8cb923e55f68cf..54e358ffb9c89469a7cd0df6493caf6162a37a21 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/CraftRemoteConsoleCommandSender.java +++ b/src/main/java/org/bukkit/craftbukkit/command/CraftRemoteConsoleCommandSender.java -@@ -39,4 +39,16 @@ public class CraftRemoteConsoleCommandSender extends ServerCommandSender impleme +@@ -46,4 +46,16 @@ public class CraftRemoteConsoleCommandSender extends ServerCommandSender impleme public void setOp(boolean value) { throw new UnsupportedOperationException("Cannot change operator status of remote controller."); } diff --git a/patches/server/0481-Add-entity-liquid-API.patch b/patches/server/0481-Add-entity-liquid-API.patch index 66c238d10..6c16c9813 100644 --- a/patches/server/0481-Add-entity-liquid-API.patch +++ b/patches/server/0481-Add-entity-liquid-API.patch @@ -17,10 +17,10 @@ index 19a6b2c686e6421624282d0536dfdd3320da4ec6..3e1f34ed8c3b4bd4f6c3624332a5f2be return this.isInWater() || this.isInRain() || this.isInBubbleColumn(); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 08c83c9cbfc0c23617117e4905469dc91fc516ec..2ae9392961383cbce07835234b95f415094c11fc 100644 +index 4b9e73536b75ae805bf306ed262011a2d9dc7456..e43552590253e6662cd72bdb114185217539ffa4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1210,5 +1210,29 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1221,5 +1221,29 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { public org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason getEntitySpawnReason() { return getHandle().spawnReason; } diff --git a/patches/server/0529-Entity-isTicking.patch b/patches/server/0529-Entity-isTicking.patch index d63fd95a5..04e464ec5 100644 --- a/patches/server/0529-Entity-isTicking.patch +++ b/patches/server/0529-Entity-isTicking.patch @@ -27,10 +27,10 @@ index 9e6a2c5fc55674ab144ebd46da6152e51d3c1dba..9524771be6268b28f14618523d59cff0 // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 1f41d39fe3378bccc6c005d20e41d98f903762cc..0e1dcfdf846f978340380352e092375ffa089cb0 100644 +index 5400bbbe231bf7ac3227acd8060a520cebfdeb0a..b4e08dcdf2d94935b58eb90c7ff84511ef525f52 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1234,5 +1234,9 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1245,5 +1245,9 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { public boolean isInLava() { return getHandle().isInLava(); }