mirror of
https://github.com/HibiscusMC/HMCCosmetics.git
synced 2025-12-27 19:09:19 +00:00
Fixed concurrent error
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user