Fix the messages send incorrectly on Spigot platform

This commit is contained in:
Ghost_chu committed 2023-09-22 16:47:18 +08:00
1 parent 3f9ef2c215
commit e700f8fa7c
5 files changed
+136 -58

No files matched your search

@@ -8,6 +8,7 @@ import de.tr7zw.nbtapi.iface.ReadWriteNBTList;
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.minimessage.MiniMessage;
import net.kyori.adventure.text.serializer.bungeecord.BungeeComponentSerializer;
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.Bukkit;
@@ -128,7 +129,8 @@ public abstract class AbstractSpigotPlatform implements Platform {
if (this.audience == null) {
this.audience = BukkitAudiences.create(this.plugin);
}
this.audience.sender(sender).sendMessage(component);
//this.audience.sender(sender).sendMessage(component);
sender.spigot().sendMessage(BungeeComponentSerializer.get().serialize(component));
}
@Override
-15
View File
@@ -115,21 +115,6 @@
<include>de.themoep:minedown-adventure:*</include>
<include>io.papermc:paperlib:*</include>
<include>org.bstats:*</include>
<include>net.kyori:adventure-api</include>
<include>net.kyori:adventure-text-serializer-gson</include>
<include>net.kyori:adventure-platform-bukkit</include>
<include>net.kyori:adventure-text-minimessage</include>
<include>net.kyori:adventure-platform-api</include>
<include>net.kyori:adventure-platform-viaversion</include>
<include>net.kyori:adventure-platform-facet</include>
<include>net.kyori:adventure-nbt</include>
<include>net.kyori:adventure-key</include>
<include>net.kyori:examination-api</include>
<include>net.kyori:examination-string</include>
<include>net.kyori:adventure-text-serializer-legacy</include>
<include>net.kyori:adventure-text-serializer-bungeecord</include>
<include>net.kyori:adventure-text-serializer-craftbukkit</include>
<include>net.kyori:adventure-text-serializer-gson-legacy-impl</include>
</includes>
<!-- <excludes>-->
<!-- <exclude>org.apache.commons:commons-compress:*</exclude>-->
@@ -5,7 +5,6 @@ import com.ghostchu.quickshop.api.command.CommandParser;
import com.ghostchu.quickshop.api.shop.Shop;
import com.ghostchu.quickshop.api.shop.permission.BuiltInShopPermission;
import org.bukkit.entity.Player;
import org.bukkit.inventory.InventoryHolder;
import org.jetbrains.annotations.NotNull;
@@ -17,11 +16,6 @@ public class SubCommand_SilentPreview extends SubCommand_SilentBase {
@Override
protected void doSilentCommand(Player sender, @NotNull Shop shop, @NotNull CommandParser parser) {
if (!(shop instanceof InventoryHolder holder)) {
// This should never happen
plugin.text().of(sender, "not-looking-at-shop").send();
return;
}
if (shop.playerAuthorize(sender.getUniqueId(), BuiltInShopPermission.PREVIEW_SHOP)
|| plugin.perm().hasPermission(sender, "quickshop.other.preview")) {
shop.openPreview(sender);
+19 -6
View File
@@ -34,12 +34,25 @@ libraries:
- com.vdurmont:semver4j:3.1.0
- com.ghostchu.crowdin:crowdinota:1.0.3
- com.google.code.gson:gson:2.10.1
# - net.kyori:adventure-platform-bukkit:4.3.0
# - net.kyori:adventure-text-minimessage:4.13.1
# - net.kyori:adventure-text-serializer-gson:4.13.1
# - net.kyori:adventure-text-serializer-plain:4.13.1
# - net.kyori:adventure-text-serializer-legacy:4.13.1
# - org.slf4j:slf4j-nop:1.7.35
- net.kyori:adventure-api:4.14.0
- net.kyori:adventure-key:4.14.0
- net.kyori:adventure-nbt:4.14.0
- net.kyori:adventure-platform-api:4.3.0
- net.kyori:adventure-platform-bukkit:4.3.0
- net.kyori:adventure-platform-facet:4.3.0
- net.kyori:adventure-platform-viaversion:4.3.0
- net.kyori:adventure-serializer-configurate4:4.14.0
- net.kyori:adventure-text-logger-slf4j:4.14.0
- net.kyori:adventure-text-minimessage:4.14.0
- net.kyori:adventure-text-serializer-ansi:4.14.0
- net.kyori:adventure-text-serializer-bungeecord:4.3.0
- net.kyori:adventure-text-serializer-gson-legacy-impl:4.14.0
- net.kyori:adventure-text-serializer-json:4.14.0
- net.kyori:adventure-text-serializer-json-legacy-impl:4.14.0
- net.kyori:adventure-text-serializer-legacy:4.14.0
- net.kyori:adventure-text-serializer-plain:4.14.0
- net.kyori:examination-api:1.3.0
- net.kyori:examination-string:1.3.0
authors:
- Ghost_chu
- PotatoCraft Studio
+114 -30
View File
@@ -35,36 +35,6 @@
<version>2.10.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-platform-bukkit</artifactId>
<scope>compile</scope>
<version>4.3.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-minimessage</artifactId>
<scope>compile</scope>
<version>4.13.1</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-gson</artifactId>
<scope>compile</scope>
<version>4.13.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-plain</artifactId>
<scope>compile</scope>
<version>4.13.1</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-legacy</artifactId>
<scope>compile</scope>
<version>4.13.1</version>
</dependency>
<dependency>
<groupId>com.ghostchu</groupId>
<artifactId>simplereloadlib</artifactId>
@@ -89,6 +59,120 @@
<scope>compile</scope>
<version>1.24.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId>
<scope>compile</scope>
<version>4.14.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-key</artifactId>
<scope>compile</scope>
<version>4.14.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-nbt</artifactId>
<scope>compile</scope>
<version>4.14.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-platform-api</artifactId>
<scope>compile</scope>
<version>4.3.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-platform-bukkit</artifactId>
<scope>compile</scope>
<version>4.3.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-platform-facet</artifactId>
<scope>compile</scope>
<version>4.3.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-platform-viaversion</artifactId>
<scope>compile</scope>
<version>4.3.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-serializer-configurate4</artifactId>
<scope>compile</scope>
<version>4.14.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-logger-slf4j</artifactId>
<scope>compile</scope>
<version>4.14.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-minimessage</artifactId>
<scope>compile</scope>
<version>4.14.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-ansi</artifactId>
<scope>compile</scope>
<version>4.14.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-bungeecord</artifactId>
<scope>compile</scope>
<version>4.3.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-gson-legacy-impl</artifactId>
<scope>compile</scope>
<version>4.14.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-json</artifactId>
<scope>compile</scope>
<version>4.14.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-json-legacy-impl</artifactId>
<scope>compile</scope>
<version>4.14.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-legacy</artifactId>
<scope>compile</scope>
<version>4.14.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-plain</artifactId>
<scope>compile</scope>
<version>4.14.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>examination-api</artifactId>
<scope>compile</scope>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>examination-string</artifactId>
<scope>compile</scope>
<version>1.3.0</version>
</dependency>
</dependencies>
</project>