Class ContainerMock
java.lang.Object
be.seeseemelk.mockbukkit.block.state.BlockStateMock
be.seeseemelk.mockbukkit.block.state.TileStateMock
be.seeseemelk.mockbukkit.block.state.ContainerMock
- All Implemented Interfaces:
io.papermc.paper.block.LockableTileState,org.bukkit.block.BlockState,org.bukkit.block.Container,org.bukkit.block.Lockable,org.bukkit.block.TileState,org.bukkit.inventory.BlockInventoryHolder,org.bukkit.inventory.InventoryHolder,org.bukkit.metadata.Metadatable,org.bukkit.Nameable,org.bukkit.persistence.PersistentDataHolder
- Direct Known Subclasses:
AbstractFurnaceMock,BarrelMock,BrewingStandMock,ChestMock,DispenserMock,DropperMock,HopperMock,LecternMock,ShulkerBoxMock
Mock implementation of a
Container.- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedContainerMock(@NotNull ContainerMock state) Constructs a newContainerMockby cloning the data from an existing one.protectedContainerMock(@NotNull org.bukkit.Material material) Constructs a newContainerMockfor the providedMaterial.protectedContainerMock(@NotNull org.bukkit.block.Block block) Constructs a newContainerMockfor the providedBlock. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract InventoryMock@Nullable net.kyori.adventure.text.ComponentvoidcustomName(@Nullable net.kyori.adventure.text.Component customName) @Nullable String@NotNull org.bukkit.inventory.Inventory@NotNull StringgetLock()abstract @NotNull org.bukkit.block.BlockStateThis returns a copy of thisBlockStateMock.@NotNull org.bukkit.inventory.InventorybooleanisLocked()voidsetCustomName(@Nullable String name) voidMethods inherited from class be.seeseemelk.mockbukkit.block.state.TileStateMock
getPersistentDataContainer, isSnapshotMethods inherited from class be.seeseemelk.mockbukkit.block.state.BlockStateMock
checkType, checkType, checkType, checkType, copy, copy, equals, getBlock, getBlockData, getChunk, getData, getDrops, getDrops, getDrops, getLightLevel, getLocation, getLocation, getMetadata, getRawData, getType, getWorld, getX, getY, getZ, hashCode, hasMetadata, isCollidable, isPlaced, mockState, removeMetadata, setBlockData, setData, setMetadata, setRawData, setType, update, update, updateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, 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.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadataMethods inherited from interface org.bukkit.block.TileState
getPersistentDataContainer, isSnapshot
-
Constructor Details
-
ContainerMock
protected ContainerMock(@NotNull @NotNull org.bukkit.Material material) Constructs a newContainerMockfor the providedMaterial.- Parameters:
material- The material this state is for.
-
ContainerMock
protected ContainerMock(@NotNull @NotNull org.bukkit.block.Block block) Constructs a newContainerMockfor the providedBlock.- Parameters:
block- The block this state is for.
-
ContainerMock
Constructs a newContainerMockby 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.
-
getSnapshot
@NotNull public abstract @NotNull org.bukkit.block.BlockState getSnapshot()Description copied from class:BlockStateMockThis returns a copy of thisBlockStateMock. Inheritents of this class should override this method!- Specified by:
getSnapshotin classTileStateMock- Returns:
- A snapshot of this
BlockStateMock.
-
isLocked
public boolean isLocked()- Specified by:
isLockedin interfaceorg.bukkit.block.Lockable
-
getLock
- Specified by:
getLockin interfaceorg.bukkit.block.Lockable
-
setLock
- Specified by:
setLockin interfaceorg.bukkit.block.Lockable
-
customName
@Nullable public @Nullable net.kyori.adventure.text.Component customName()- Specified by:
customNamein interfaceorg.bukkit.Nameable
-
customName
public void customName(@Nullable @Nullable net.kyori.adventure.text.Component customName) - Specified by:
customNamein interfaceorg.bukkit.Nameable
-
getCustomName
- Specified by:
getCustomNamein interfaceorg.bukkit.Nameable
-
setCustomName
- Specified by:
setCustomNamein interfaceorg.bukkit.Nameable
-
getInventory
@NotNull public @NotNull org.bukkit.inventory.Inventory getInventory()- Specified by:
getInventoryin interfaceorg.bukkit.block.Container- Specified by:
getInventoryin interfaceorg.bukkit.inventory.InventoryHolder
-
getSnapshotInventory
@NotNull public @NotNull org.bukkit.inventory.Inventory getSnapshotInventory()- Specified by:
getSnapshotInventoryin interfaceorg.bukkit.block.Container
-