mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-09 12:11:08 +00:00
Remove static hologram methods
This commit is contained in:
parent
1faac3854e
commit
7d9ff86dc5
@ -11,31 +11,6 @@ import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class Hologram {
|
||||
|
||||
private static final List<Hologram> HOLOGRAMS = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* @param armorStand Armor stand that's part of a hologram
|
||||
* @return Hologram, the armor stand is part of
|
||||
*/
|
||||
public static Hologram getHologram(ArmorStand armorStand) {
|
||||
for (Hologram hologram : HOLOGRAMS) {
|
||||
if (hologram.contains(armorStand)) {
|
||||
return hologram;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param armorStand Armor stand to check
|
||||
* @return Whether the armor stand is part of a hologram
|
||||
*/
|
||||
public static boolean isPartOfHologram(ArmorStand armorStand) {
|
||||
return getHologram(armorStand) != null;
|
||||
}
|
||||
|
||||
// concurrent since update task is in async thread
|
||||
// since this is a fake entity, hologram is hidden per default
|
||||
private final Set<UUID> viewers = Collections.newSetFromMap(new ConcurrentHashMap<UUID, Boolean>());
|
||||
@ -54,7 +29,6 @@ public class Hologram {
|
||||
}
|
||||
|
||||
this.exists = true;
|
||||
HOLOGRAMS.add(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -148,7 +122,6 @@ public class Hologram {
|
||||
wrappers.clear();
|
||||
|
||||
exists = false;
|
||||
HOLOGRAMS.remove(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user