Sometimes the color is white, while it supposed to be colored.
I tried multiple code from the api, async, not async, entity list ect... same error
I have tested with the official glowapi version and everything is fine :)
List<Entity> entities = new ArrayList<>();
private ChatColor color;
@Override
public void description() {
super.description();
Item3D i = getLastSelected();
this.color = ChatColor.valueOf(ChatColor.stripColor(i.getDisplayName().getTitle().toUpperCase()));
List<Projector> list = nightClub.getProjectors(color);
list.forEach(pr -> entities.add(pr.getProjector().getBukkitEntity()));
GlowAPI.setGlowing(entities,GlowAPI.Color.valueOf(color.name()), player);
}
@Override
public void undescription() {
super.undescription();
if(color != null)
entities.forEach(e -> {
GlowAPI.setGlowing(e,false,player);
});
entities.clear();
color = null;
}
@Override
public void closeGui() {
super.closeGui();
if(color != null)
entities.forEach(e -> {
GlowAPI.setGlowing(e,false,player);
});
entities.clear();
color = null;
}`