Class BeaconStateMock
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.BeaconStateMock
- All Implemented Interfaces:
LockableTileState,PersistentDataViewHolder,Beacon,BlockState,Lockable,TileState,Metadatable,Nameable,PersistentDataHolder
Mock implementation of a
Beacon.- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionBeaconStateMock(@NotNull Material material) Constructs a newBeaconStateMockfor the providedMaterial.protectedBeaconStateMock(@NotNull Block block) Constructs a newBeaconStateMockfor the providedBlock.protectedBeaconStateMock(@NotNull BeaconStateMock state) Constructs a newBeaconStateMockby cloning the data from an existing one. -
Method Summary
Modifier and TypeMethodDescription@NotNull BeaconStateMockcopy()This returns a copy of thisBlockStateMock.@Nullable net.kyori.adventure.text.ComponentvoidcustomName(@Nullable net.kyori.adventure.text.Component customName) @Nullable Stringdouble@NotNull Collection<LivingEntity> @NotNull StringgetLock()@Nullable PotionEffect@Nullable PotionEffect@NotNull BeaconStateMockThis returns a copy of thisBlockStateMock.intgetTier()booleanisLocked()voidvoidsetCustomName(@Nullable String name) voidsetEffectRange(double range) voidvoidsetPrimaryEffect(@Nullable PotionEffectType effect) voidsetSecondaryEffect(@Nullable PotionEffectType effect) voidsetTier(int tier) Sets the tier of the Beacon.protected StringProvides the contents ofBlockStateMock.toString().voidCalculates the Beacon's tier based off the blocks below it, just as in vanilla.Methods inherited from class org.mockbukkit.mockbukkit.block.state.LockableTileStateMock
setLockItemMethods inherited from class org.mockbukkit.mockbukkit.block.state.TileStateMock
equals, getPersistentDataContainer, hashCode, isSnapshotMethods inherited from class org.mockbukkit.mockbukkit.block.state.BlockStateMock
checkType, checkType, checkType, checkType, 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.block.BlockState
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
-
BeaconStateMock
- Parameters:
material- The material this state is for.
-
BeaconStateMock
- Parameters:
block- The block this state is for.
-
BeaconStateMock
Constructs a newBeaconStateMockby cloning the data from an existing one.- Parameters:
state- The state to clone.
-
-
Method Details
-
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.
-
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.
-
copy
Description copied from class:BlockStateMockThis returns a copy of thisBlockStateMock. Inheriters of this class must override this method!- Specified by:
copyin interfaceBlockState- Overrides:
copyin classBlockStateMock- Returns:
- A copy of this
BlockStateMock.
-
getEntitiesInRange
- Specified by:
getEntitiesInRangein interfaceBeacon
-
updateTier
public void updateTier()Calculates the Beacon's tier based off the blocks below it, just as in vanilla. -
setTier
@Test public void setTier(int tier) Sets the tier of the Beacon. Clamped between 1-4 (inclusive).- Parameters:
tier- The tier to set.
-
getTier
public int getTier() -
getPrimaryEffect
- Specified by:
getPrimaryEffectin interfaceBeacon
-
setPrimaryEffect
- Specified by:
setPrimaryEffectin interfaceBeacon
-
getSecondaryEffect
- Specified by:
getSecondaryEffectin interfaceBeacon
-
setSecondaryEffect
- Specified by:
setSecondaryEffectin interfaceBeacon
-
getEffectRange
public double getEffectRange()- Specified by:
getEffectRangein interfaceBeacon
-
setEffectRange
public void setEffectRange(double range) - Specified by:
setEffectRangein interfaceBeacon
-
resetEffectRange
public void resetEffectRange()- Specified by:
resetEffectRangein interfaceBeacon
-
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
-
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
-