Skip to content

Commit

Permalink
NPC compilation error fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
retrooper committed Apr 9, 2021
1 parent 49c1287 commit 78b2eb0
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.bukkit.Location;
import org.bukkit.entity.Player;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
Expand Down Expand Up @@ -64,9 +63,7 @@ public void despawn(Player player) {
public void run() {
boolean spawned = spawnedForPlayerMap.getOrDefault(player.getUniqueId(), false);
if (spawned) {
List<WrappedPacketOutPlayerInfo.PlayerInfo> playerInfoList = new ArrayList<>();
playerInfoList.add(new WrappedPacketOutPlayerInfo.PlayerInfo(name, gameProfile, GameMode.SURVIVAL, 0));
WrappedPacketOutPlayerInfo playerInfo = new WrappedPacketOutPlayerInfo(WrappedPacketOutPlayerInfo.PlayerInfoAction.REMOVE_PLAYER, playerInfoList);
WrappedPacketOutPlayerInfo playerInfo = new WrappedPacketOutPlayerInfo(WrappedPacketOutPlayerInfo.PlayerInfoAction.REMOVE_PLAYER, new WrappedPacketOutPlayerInfo.PlayerInfo(name, gameProfile, GameMode.SURVIVAL, 0));
PacketEvents.get().getPlayerUtils().sendPacket(player, playerInfo);
}
spawnedForPlayerMap.remove(player.getUniqueId());
Expand All @@ -84,9 +81,7 @@ public void spawn(Player player) {
CompletableFuture.runAsync(new Runnable() {
@Override
public void run() {
List<WrappedPacketOutPlayerInfo.PlayerInfo> playerInfoList = new ArrayList<>();
playerInfoList.add(new WrappedPacketOutPlayerInfo.PlayerInfo(name, gameProfile, GameMode.SURVIVAL, 0));
WrappedPacketOutPlayerInfo playerInfo = new WrappedPacketOutPlayerInfo(WrappedPacketOutPlayerInfo.PlayerInfoAction.ADD_PLAYER, playerInfoList);
WrappedPacketOutPlayerInfo playerInfo = new WrappedPacketOutPlayerInfo(WrappedPacketOutPlayerInfo.PlayerInfoAction.ADD_PLAYER, new WrappedPacketOutPlayerInfo.PlayerInfo(name, gameProfile, GameMode.SURVIVAL, 0));
PacketEvents.get().getPlayerUtils().sendPacket(player, playerInfo);
}
}).thenRunAsync(new Runnable() {
Expand Down

0 comments on commit 78b2eb0

Please sign in to comment.