Skip to content

Commit

Permalink
Fix compatibility with newer ProtocolLib
Browse files Browse the repository at this point in the history
  • Loading branch information
games647 committed Mar 31, 2023
1 parent 32cabfd commit 8d4a160
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 12 deletions.
4 changes: 1 addition & 3 deletions bukkit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.github.games647</groupId>
<artifactId>changeskin</artifactId>
<version>3.2</version>
<version>3.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -103,9 +103,7 @@
<artifactId>ProtocolLib</artifactId>
<version>5.0.0-SNAPSHOT</version>
<scope>provided</scope>
<optional>true</optional>
<exclusions>
<!-- Exclude contained spigot api -->
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.github.games647.changeskin.bukkit.ChangeSkinBukkit;
import com.github.games647.changeskin.core.message.ChannelMessage;
import com.github.games647.changeskin.core.message.ForwardMessage;
import com.google.common.base.Joiner;

import java.util.Optional;

Expand Down Expand Up @@ -36,7 +35,7 @@ protected void onBungeeCord(CommandSender sender, String commandName, String...
proxy = optPlayer.get();
}

ChannelMessage message = new ForwardMessage(commandName, Joiner.on(' ').join(args), isPlayer, sender.isOp());
ChannelMessage message = new ForwardMessage(commandName, String.join(" ",args), isPlayer, sender.isOp());
plugin.sendPluginMessage(proxy, message);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,13 @@ private void sendPacketsSelf(WrappedGameProfile gameProfile) {

private PacketContainer createAddPacket(PlayerInfoData playerInfoData) {
PacketContainer addInfo = new PacketContainer(PLAYER_INFO);
if (MinecraftVersion.atOrAbove(new MinecraftVersion(1, 19, 0))) {
if (new MinecraftVersion(1, 19, 0).atOrAbove()) {
addInfo.getPlayerInfoDataLists().write(1, Collections.singletonList(playerInfoData));
} else {
addInfo.getPlayerInfoDataLists().write(0, Arrays.asList(playerInfoData));
}

if (MinecraftVersion.atOrAbove(new MinecraftVersion(1, 19, 3))) {
if (new MinecraftVersion(1, 19, 3).atOrAbove()) {
addInfo.getPlayerInfoActions().write(0, EnumSet.of(PlayerInfoAction.ADD_PLAYER));
} else {
addInfo.getPlayerInfoAction().write(0, PlayerInfoAction.ADD_PLAYER);
Expand All @@ -291,7 +291,7 @@ private PacketContainer createAddPacket(PlayerInfoData playerInfoData) {

private PacketContainer createRemovePacket(PlayerInfoData playerInfoData) {
PacketContainer removeInfo;
if (MinecraftVersion.atOrAbove(new MinecraftVersion(1, 19, 3))) {
if (new MinecraftVersion(1, 19, 3).atOrAbove()) {
removeInfo = new PacketContainer(PLAYER_INFO_REMOVE);

List<UUID> removedPlayers = Collections.singletonList(receiver.getUniqueId());
Expand Down
2 changes: 1 addition & 1 deletion bungee/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.github.games647</groupId>
<artifactId>changeskin</artifactId>
<version>3.2</version>
<version>3.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.github.games647</groupId>
<artifactId>changeskin</artifactId>
<version>3.2</version>
<version>3.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<packaging>pom</packaging>

<name>ChangeSkin</name>
<version>3.2</version>
<version>3.2-SNAPSHOT</version>

<url>https://dev.bukkit.org/bukkit-plugins/changeskin/</url>
<description>
Expand Down
2 changes: 1 addition & 1 deletion sponge/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.github.games647</groupId>
<artifactId>changeskin</artifactId>
<version>3.2</version>
<version>3.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down

0 comments on commit 8d4a160

Please sign in to comment.