Interface ItemDeviceQuery


public interface ItemDeviceQuery
Device query for an item stack.
See Also:
  • 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()
      The BlockEntity that holds the item this query is for.
      Returns:
      the BlockEntity hosting the device, if any.
    • getContainerEntity

      Optional<net.minecraft.world.entity.Entity> getContainerEntity()
      The Entity that holds the item this query is for.
      Returns:
      the Entity hosting 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.