Interface SecurityPolicyContainerItem

All Known Implementing Classes:
FallbackSecurityCardItem, SecurityCardItem

@API(status=STABLE, since="2.0.0-milestone.3.5") public interface SecurityPolicyContainerItem
Represents an item that can contain a SecurityPolicy. Typically, a Security Card.
  • Method Details

    • isValid

      boolean isValid(net.minecraft.world.item.ItemStack stack)
    • getActor

      Optional<SecurityActor> getActor(net.minecraft.world.item.ItemStack stack)
    • getPolicy

      Optional<SecurityPolicy> getPolicy(net.minecraft.world.item.ItemStack stack)
      Returns a SecurityPolicy containing all the permissions that this SecurityPolicyContainerItem permits. It is important to have all the relevant permissions in the SecurityPolicy, even the ones that are "allowed by default" via PlatformPermission.isAllowedByDefault(). If not, even a permission that is allowed by default will not be allowed.
      Parameters:
      stack - the stack
      Returns:
      the policy, if present
    • getEnergyUsage

      long getEnergyUsage()