public class PointOfInterestSet extends Object implements DynamicSerializable
Modifier and Type | Field and Description |
---|---|
private static Logger |
LOGGER |
private it.unimi.dsi.fastutil.shorts.Short2ObjectMap<PointOfInterest> |
pointsOfInterestByPos |
private Map<PointOfInterestType,Set<PointOfInterest>> |
pointsOfInterestByType |
private Runnable |
updateListener |
private boolean |
valid |
Constructor and Description |
---|
PointOfInterestSet(Runnable updateListener) |
PointOfInterestSet(Runnable updateListener,
com.mojang.datafixers.Dynamic<T> dynamic) |
Modifier and Type | Method and Description |
---|---|
void |
add(BlockPos pos,
PointOfInterestType type) |
private boolean |
add(PointOfInterest poi) |
private void |
clear() |
Stream<PointOfInterest> |
get(Predicate<PointOfInterestType> predicate,
PointOfInterestStorage.OccupationStatus occupationStatus) |
Optional<PointOfInterestType> |
getType(BlockPos pos) |
(package private) boolean |
isValid() |
boolean |
releaseTicket(BlockPos pos) |
void |
remove(BlockPos pos) |
<T> T |
serialize(com.mojang.datafixers.types.DynamicOps<T> ops) |
boolean |
test(BlockPos pos,
Predicate<PointOfInterestType> predicate) |
void |
updatePointsOfInterest(Consumer<BiConsumer<BlockPos,PointOfInterestType>> consumer) |
private static final Logger LOGGER
private final it.unimi.dsi.fastutil.shorts.Short2ObjectMap<PointOfInterest> pointsOfInterestByPos
private final Map<PointOfInterestType,Set<PointOfInterest>> pointsOfInterestByType
private final Runnable updateListener
private boolean valid
public PointOfInterestSet(Runnable updateListener)
public PointOfInterestSet(Runnable updateListener, com.mojang.datafixers.Dynamic<T> dynamic)
public Stream<PointOfInterest> get(Predicate<PointOfInterestType> predicate, PointOfInterestStorage.OccupationStatus occupationStatus)
public void add(BlockPos pos, PointOfInterestType type)
private boolean add(PointOfInterest poi)
public void remove(BlockPos pos)
public boolean releaseTicket(BlockPos pos)
public boolean test(BlockPos pos, Predicate<PointOfInterestType> predicate)
public Optional<PointOfInterestType> getType(BlockPos pos)
public <T> T serialize(com.mojang.datafixers.types.DynamicOps<T> ops)
serialize
in interface DynamicSerializable
public void updatePointsOfInterest(Consumer<BiConsumer<BlockPos,PointOfInterestType>> consumer)
private void clear()
boolean isValid()