- Баллы
- 31
У меня Paper 1.16.5, и у меня это уже 2 недели не получается сделать.
PHP:
Component parsed = MiniMessage.miniMessage().deserialize("Hello <rainbow>world</rainbow>, isn't <underlined>MiniMessage</underlined> fun?");
sender.sendMessage(parsed);
PHP:
Caused by: java.lang.NoClassDefFoundError: net/kyori/adventure/text/minimessage/MiniMessage
PHP:
package com.notcopter.notbedwars_1_16_5.commands;
import com.notcopter.notbedwars_1_16_5.NotBedwars;
import com.notcopter.notbedwars_1_16_5.commands.handlers.AbstractCommand;
import com.notcopter.notbedwars_1_16_5.game.GameSession;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.TextColor;
import net.kyori.adventure.text.minimessage.MiniMessage;
import org.bukkit.command.CommandSender;
import java.util.List;
public class FreeGameSessions extends AbstractCommand {
public FreeGameSessions(String command_name) { super(command_name); }
@Override
public boolean execute(CommandSender sender, String label, String[] args) {
List<GameSession> sessions = NotBedwars.lobbyHandler.getSessions();
Component parsed = MiniMessage.miniMessage().deserialize("Hello <rainbow>world</rainbow>, isn't <underlined>MiniMessage</underlined> fun?");
sender.sendMessage(parsed);
int counter = 0;
for (GameSession session : sessions) {
sender.sendMessage(String.format("§8%d. §fАрена: \"%s\" §7(%d/%d) %s§8 (Слот #%d)",
++counter, session.getMapName(), session.getPlayersCount(), session.getMaxPlayers(),
session.isFree() ? "§aСВОБОДНО" : "§cЗАНЯТО", session.getSlot()));
}
return true;
}
}
HTML:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.notcopter</groupId>
<artifactId>NotBedwars_1_16_5</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>NotBedwars_1_16_5</name>
<description>IDK</description>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<repositories>
<repository>
<id>papermc-repo</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
<repository>
<id>minecraft-libraries</id>
<url>https://libraries.minecraft.net</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.destroystokyo.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>com.mojang</groupId>
<artifactId>authlib</artifactId>
<version>1.5.25</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-minimessage</artifactId>
<version>4.14.0</version>
</dependency>
</dependencies>
</project>

