9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2025-12-28 03:19:15 +00:00

Fixed concurrent error

This commit is contained in:
MasterOfTheFish
2022-02-20 12:05:30 -05:00
parent 8fa606954e
commit f3b780e730
4 changed files with 4 additions and 3 deletions

View File

@@ -6,12 +6,13 @@ import org.bukkit.scheduler.BukkitTask;
import java.util.LinkedList;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
public class TaskManager {
private final HMCCosmetics plugin;
private BukkitTask timer;
private final Queue<Task> tasks = new LinkedList<>();
private final Queue<Task> tasks = new ConcurrentLinkedQueue<>();
public TaskManager(final HMCCosmetics plugin) {
this.plugin = plugin;

View File

@@ -15,7 +15,6 @@ import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.Nullable;
import javax.swing.text.html.Option;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;
@@ -135,7 +134,8 @@ public class Wardrobe extends User {
() -> {
PacketManager.sendPacket(
viewer,
PacketManager.getEntityDestroyPacket(this.getEntityId())
PacketManager.getEntityDestroyPacket(this.getEntityId()),
PacketManager.getRemovePlayerPacket(viewer, this.id, this.getEntityId())
// for spectator packets
// PacketManager.getEntityDestroyPacket(this.viewerId)
);