Class ContainerStateMock
java.lang.Object
org.mockbukkit.mockbukkit.block.state.BlockStateMock
org.mockbukkit.mockbukkit.block.state.TileStateMock
org.mockbukkit.mockbukkit.block.state.LockableTileStateMock
org.mockbukkit.mockbukkit.block.state.ContainerStateMock
- All Implemented Interfaces:
LockableTileState,TileStateInventoryHolder,PersistentDataViewHolder,BlockState,Container,Lockable,TileState,BlockInventoryHolder,InventoryHolder,Metadatable,Nameable,PersistentDataHolder
- Direct Known Subclasses:
AbstractFurnaceStateMock,BarrelStateMock,BrewingStandStateMock,ChestStateMock,DispenserStateMock,DropperStateMock,HopperStateMock,LecternStateMock,ShulkerBoxStateMock
Mock implementation of a
Container.- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedContainerStateMock(@NotNull Material material) Constructs a newContainerStateMockfor the providedMaterial.protectedContainerStateMock(@NotNull Block block) Constructs a newContainerStateMockfor the providedBlock.protectedContainerStateMock(@NotNull ContainerStateMock state) Constructs a newContainerStateMockby cloning the data from an existing one. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract @NotNull InventoryMockprotected @NotNull InventoryMockcreateInventoryCopy(@NotNull Inventory inventory) @Nullable net.kyori.adventure.text.ComponentvoidcustomName(@Nullable net.kyori.adventure.text.Component customName) boolean@Nullable String@NotNull Inventory@NotNull StringgetLock()abstract @NotNull ContainerStateMockThis returns a copy of thisBlockStateMock.@NotNull InventoryinthashCode()booleanisLocked()voidsetCustomName(@Nullable String name) voidprotected StringProvides the contents ofBlockStateMock.toString().Methods inherited from class org.mockbukkit.mockbukkit.block.state.LockableTileStateMock
setLockItemMethods inherited from class org.mockbukkit.mockbukkit.block.state.TileStateMock
getPersistentDataContainer, isSnapshotMethods inherited from class org.mockbukkit.mockbukkit.block.state.BlockStateMock
checkType, checkType, checkType, checkType, copy, copy, getBlock, getBlockData, getChunk, getData, getDrops, getDrops, getDrops, getLightLevel, getLocation, getLocation, getMetadata, getRawData, getType, getWorld, getX, getY, getZ, hasMetadata, isCollidable, isPlaced, mockState, mockState, removeMetadata, setBlockData, setData, setMetadata, setRawData, setType, toString, update, update, updateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.bukkit.inventory.BlockInventoryHolder
getBlockMethods inherited from interface org.bukkit.block.BlockState
copy, copy, getBlock, getBlockData, getChunk, getData, getDrops, getDrops, getDrops, getLightLevel, getLocation, getLocation, getRawData, getType, getWorld, getX, getY, getZ, isCollidable, isPlaced, setBlockData, setData, setRawData, setType, update, update, updateMethods inherited from interface org.bukkit.block.Lockable
setLockItemMethods inherited from interface org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadataMethods inherited from interface org.bukkit.block.TileState
getPersistentDataContainer, isSnapshot
-
Constructor Details
-
ContainerStateMock
Constructs a newContainerStateMockfor the providedMaterial.- Parameters:
material- The material this state is for.
-
ContainerStateMock
Constructs a newContainerStateMockfor the providedBlock.- Parameters:
block- The block this state is for.
-
ContainerStateMock
Constructs a newContainerStateMockby cloning the data from an existing one.- Parameters:
state- The state to clone.
-
-
Method Details
-
createInventory
- Returns:
- A new inventory, of the correct type for the state.
-
createInventoryCopy
@NotNull protected @NotNull InventoryMock createInventoryCopy(@NotNull @NotNull Inventory inventory) - Parameters:
inventory- Inventory contents to copy.- Returns:
- A new inventory, of the correct type for the state with contents deep-copied from the given inventory.
-
getSnapshot
Description copied from class:BlockStateMockThis returns a copy of thisBlockStateMock. Inheriters of this class must override this method!- Specified by:
getSnapshotin classLockableTileStateMock- Returns:
- A snapshot of this
BlockStateMock.
-
isLocked
public boolean isLocked()- Specified by:
isLockedin interfaceLockable- Specified by:
isLockedin classLockableTileStateMock
-
getLock
- Specified by:
getLockin interfaceLockable- Specified by:
getLockin classLockableTileStateMock
-
setLock
- Specified by:
setLockin interfaceLockable- Specified by:
setLockin classLockableTileStateMock
-
customName
@Nullable public @Nullable net.kyori.adventure.text.Component customName()- Specified by:
customNamein interfaceNameable
-
customName
public void customName(@Nullable @Nullable net.kyori.adventure.text.Component customName) - Specified by:
customNamein interfaceNameable
-
getCustomName
- Specified by:
getCustomNamein interfaceNameable
-
setCustomName
- Specified by:
setCustomNamein interfaceNameable
-
getInventory
- Specified by:
getInventoryin interfaceInventoryHolder- Specified by:
getInventoryin interfaceTileStateInventoryHolder
-
getSnapshotInventory
- Specified by:
getSnapshotInventoryin interfaceTileStateInventoryHolder
-
equals
- Overrides:
equalsin classTileStateMock
-
hashCode
public int hashCode()- Overrides:
hashCodein classTileStateMock
-
toStringInternal
Description copied from class:BlockStateMockProvides the contents ofBlockStateMock.toString().Implementors must call super as in the following example.
@Override protected String toStringInternal() { return super.toStringInternal() + ", member1=" + member1 + ", member2=" + member2; }- Overrides:
toStringInternalin classTileStateMock- Returns:
- Comma separated list of properties and values.
-