Interface ItemDeviceQuery
public interface ItemDeviceQuery
Device query for an item stack.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionThe architecture of the machine this query is for.Optional<net.minecraft.world.level.block.entity.BlockEntity> TheBlockEntitythat holds the item this query is for.Optional<net.minecraft.world.entity.Entity> TheEntitythat holds the item this query is for.net.minecraft.world.item.ItemStackThe item stack this query is performed for.
-
Method Details
-
getArchitectureType
Optional<ArchitectureType> getArchitectureType()The architecture of the machine this query is for.Allows providers to select a different device implementation based on the architecture. This can be useful when different architectures are just so fundamentally different that the same device simply cannot work on both as-is, but from a gameplay perspective we still want to provide a seamless experience that "just works".
In some cases, e.g. for tooltip queries, this is left empty.
- Returns:
- the architecture the device would be built for, if any.
-
getContainerBlockEntity
Optional<net.minecraft.world.level.block.entity.BlockEntity> getContainerBlockEntity()TheBlockEntitythat holds the item this query is for.- Returns:
- the
BlockEntityhosting the device, if any.
-
getContainerEntity
Optional<net.minecraft.world.entity.Entity> getContainerEntity()TheEntitythat holds the item this query is for.- Returns:
- the
Entityhosting the device, if any.
-
getItemStack
net.minecraft.world.item.ItemStack getItemStack()The item stack this query is performed for.- Returns:
- the item stack to get a device for.
-