Class DeathChestsState
- java.lang.Object
-
- net.minecraft.world.PersistentState
-
- com.therandomlabs.vanilladeathchest.world.DeathChestsState
-
public final class DeathChestsState extends net.minecraft.world.PersistentStatePersistent death chests state.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDeathChest(DeathChest deathChest)Adds an existing death chest.voidfromTag(net.minecraft.nbt.CompoundTag tag)static DeathChestsStateget(net.minecraft.server.world.ServerWorld world)Returns theDeathChestsStateinstance for the specified world.@Nullable DeathChestgetDeathChest(UUID identifier)Returns the death chest with the specified identifier.Set<UUID>getDeathChestIdentifiers()Returns the identifiers of all placed death chests.Set<String>getDeathChestIdentifierStrings()Returns the identifier strings of all placed death chests.Collection<DeathChest>getDeathChests()Returns all placed death chests.@Nullable DeathChestgetExistingDeathChest(net.minecraft.util.math.BlockPos pos)Returns the existing death chest at the specified position.Collection<DeathChest>getExistingDeathChests()Returns all existing death chests.Queue<DeathChest>getQueuedDeathChests()Returns a queue of all unplaced death chests.static voidonBlockEntityUnload(net.minecraft.block.entity.BlockEntity blockEntity, net.minecraft.server.world.ServerWorld world)Called when a block entity is unloaded.net.minecraft.nbt.CompoundTagtoTag(net.minecraft.nbt.CompoundTag tag)
-
-
-
Method Detail
-
fromTag
public void fromTag(net.minecraft.nbt.CompoundTag tag)
- Specified by:
fromTagin classnet.minecraft.world.PersistentState
-
toTag
public net.minecraft.nbt.CompoundTag toTag(net.minecraft.nbt.CompoundTag tag)
- Specified by:
toTagin classnet.minecraft.world.PersistentState
-
getDeathChestIdentifiers
public Set<UUID> getDeathChestIdentifiers()
Returns the identifiers of all placed death chests.
-
getDeathChestIdentifierStrings
public Set<String> getDeathChestIdentifierStrings()
Returns the identifier strings of all placed death chests.- Returns:
- a
Setof strings.
-
getDeathChests
public Collection<DeathChest> getDeathChests()
Returns all placed death chests.- Returns:
- a
Collectionof all placed death chests.
-
getDeathChest
public @Nullable DeathChest getDeathChest(UUID identifier)
Returns the death chest with the specified identifier.- Parameters:
identifier- an identifier.- Returns:
- the
DeathChestwith the specified identifier.
-
getExistingDeathChests
public Collection<DeathChest> getExistingDeathChests()
Returns all existing death chests.- Returns:
- a
Collectionof 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
DeathChestat the specifiedBlockPos, ornullif it does not exist.
-
addDeathChest
public void addDeathChest(DeathChest deathChest)
Adds an existing death chest.- Parameters:
deathChest- aDeathChest.
-
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 theDeathChestsStateinstance for the specified world.- Parameters:
world- aServerWorld.- Returns:
- the
DeathChestsStateinstance 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- aBlockEntity.world- aServerWorld.
-
-