Class DeathChestsState


  • public final class DeathChestsState
    extends net.minecraft.world.PersistentState
    Persistent death chests state.
    • Method Detail

      • fromTag

        public void fromTag​(net.minecraft.nbt.CompoundTag tag)
        Specified by:
        fromTag in class net.minecraft.world.PersistentState
      • toTag

        public net.minecraft.nbt.CompoundTag toTag​(net.minecraft.nbt.CompoundTag tag)
        Specified by:
        toTag in class net.minecraft.world.PersistentState
      • getDeathChestIdentifiers

        public Set<UUID> getDeathChestIdentifiers()
        Returns the identifiers of all placed death chests.
        Returns:
        a Set of UUIDs.
      • getDeathChestIdentifierStrings

        public Set<String> getDeathChestIdentifierStrings()
        Returns the identifier strings of all placed death chests.
        Returns:
        a Set of strings.
      • getDeathChest

        public @Nullable DeathChest getDeathChest​(UUID identifier)
        Returns the death chest with the specified identifier.
        Parameters:
        identifier - an identifier.
        Returns:
        the DeathChest with the specified identifier.
      • getExistingDeathChests

        public Collection<DeathChest> getExistingDeathChests()
        Returns all existing death chests.
        Returns:
        a Collection of all existing death chests.
      • getExistingDeathChest

        public @Nullable DeathChest getExistingDeathChest​(net.minecraft.util.math.BlockPos pos)
        Returns the existing death chest at the specified position.
        Parameters:
        pos - a position.
        Returns:
        the existing DeathChest at the specified BlockPos, or null if it does not exist.
      • addDeathChest

        public void addDeathChest​(DeathChest deathChest)
        Adds an existing death chest.
        Parameters:
        deathChest - a DeathChest.
      • getQueuedDeathChests

        public Queue<DeathChest> getQueuedDeathChests()
        Returns a queue of all unplaced death chests. Changes to this queue are kept.
        Returns:
        a queue of all unplaced death chests.
      • get

        public static DeathChestsState get​(net.minecraft.server.world.ServerWorld world)
        Returns the DeathChestsState instance for the specified world.
        Parameters:
        world - a ServerWorld.
        Returns:
        the DeathChestsState instance for the specified world.
      • onBlockEntityUnload

        public static void onBlockEntityUnload​(net.minecraft.block.entity.BlockEntity blockEntity,
                                               net.minecraft.server.world.ServerWorld world)
        Called when a block entity is unloaded.
        Parameters:
        blockEntity - a BlockEntity.
        world - a ServerWorld.