Make hologram renderer variables volatile

This commit is contained in:
fullwall 2024-08-19 15:08:14 +08:00
parent e45f4b784d
commit d0f7ba7695

View File

@ -622,7 +622,7 @@ public class HologramTrait extends Trait {
}
public static class InteractionVehicleRenderer extends SingleEntityHologramRenderer {
private Vector3d lastOffset;
private volatile Vector3d lastOffset;
@Override
protected NPC createNPC(Entity base, String name, Vector3d offset) {
@ -746,7 +746,7 @@ public class HologramTrait extends Trait {
*/
// TODO: make view range part of hologram renderer?
public abstract static class SingleEntityHologramRenderer implements HologramRenderer {
protected NPC hologram;
protected volatile NPC hologram;
private NPCRegistry registry;
private int spawnWaitTicks;
protected String text;