Package top.girlkisser.lazuli.api.block
Interface IZonedBE
- All Superinterfaces:
IBE
A block entity with a "working zone."
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Predicate<net.minecraft.world.entity.LivingEntity> Returns `true` when the entity is an animal and is an adult.static final Predicate<net.minecraft.world.entity.LivingEntity> Returns `true` when the entity is a baby.static final Predicate<net.minecraft.world.entity.LivingEntity> Returns `true` when the entity is an animal and is a baby.static final Predicate<net.minecraft.world.entity.Entity> Returns `true` when the entity is anItemEntity.static final Predicate<net.minecraft.world.entity.Entity> Returns `true` when the entity is aPlayer.static final Predicate<net.minecraft.world.entity.LivingEntity> Returns `true` when the entity is **NOT** a baby.static final Predicate<net.minecraft.world.entity.Entity> Returns `true` when the entity is **NOT**Player.static final Predicate<net.minecraft.world.entity.Entity> Returns `true` when the entity is **NOT** aPlayer. -
Method Summary
Modifier and TypeMethodDescriptionnet.neoforged.neoforge.common.util.Lazy<net.minecraft.world.phys.AABB> Get the cached work zone for the block entity.default <T extends net.minecraft.world.entity.Entity>
List<T> getEntitiesInWorkZone(Class<T> class_, Predicate<T> filter) Get all entities in the work zone that are ofclass_and matchfilter.default <T extends net.minecraft.world.entity.Entity>
Optional<T> getFirstEntityInWorkZone(Class<T> class_, Predicate<T> filter) Finds the first entity within the work zone.default net.minecraft.world.phys.AABBGets the work zone for the block entity.default intGet the work zoneAABB's height in blocks.default intGet the work zoneAABB's range in blocks.default voidInvalidates the cached work zone.Methods inherited from interface top.girlkisser.lazuli.api.block.IBE
getBlockPos, getBlockState, getLevel, setChanged
-
Field Details
-
IS_PLAYER
Returns `true` when the entity is aPlayer. -
NOT_PLAYER
Returns `true` when the entity is **NOT** aPlayer. -
IS_ITEM
Returns `true` when the entity is anItemEntity. -
NOT_ITEM
Returns `true` when the entity is **NOT**Player. -
IS_BABY
Returns `true` when the entity is a baby. -
NOT_BABY
Returns `true` when the entity is **NOT** a baby. -
IS_ADULT_ANIMAL
Returns `true` when the entity is an animal and is an adult. -
IS_BABY_ANIMAL
Returns `true` when the entity is an animal and is a baby.
-
-
Method Details
-
getWorkZone
default net.minecraft.world.phys.AABB getWorkZone()Gets the work zone for the block entity. Generally you should prefergetCachedWorkZone()- Returns:
- The work zone for the block entity.
-
getWorkZoneRange
default int getWorkZoneRange()Get the work zoneAABB's range in blocks.- Returns:
- The range.
-
getWorkZoneHeight
default int getWorkZoneHeight()Get the work zoneAABB's height in blocks.- Returns:
- The height.
-
getCachedWorkZone
net.neoforged.neoforge.common.util.Lazy<net.minecraft.world.phys.AABB> getCachedWorkZone()Get the cached work zone for the block entity.- Returns:
- The AABB.
-
invalidateWorkZone
default void invalidateWorkZone()Invalidates the cached work zone. -
getFirstEntityInWorkZone
default <T extends net.minecraft.world.entity.Entity> Optional<T> getFirstEntityInWorkZone(Class<T> class_, @Nullable Predicate<T> filter) Finds the first entity within the work zone.- Type Parameters:
T- The entity type to find.- Parameters:
class_- The entity class to find. UseEntity.classfor "any."filter- A filter to apply.- Returns:
- The first entity, if any.
-
getEntitiesInWorkZone
default <T extends net.minecraft.world.entity.Entity> List<T> getEntitiesInWorkZone(Class<T> class_, @Nullable Predicate<T> filter) Get all entities in the work zone that are ofclass_and matchfilter.
**This method will throw an exception if the level is null.**- Type Parameters:
T- The entity type to find.- Parameters:
class_- The entity class to find. UseEntity.classfor "any."filter- A filter to apply.- Returns:
- The first entity, if any.
-