Class BeaconMock
java.lang.Object
be.seeseemelk.mockbukkit.block.state.BlockStateMock
be.seeseemelk.mockbukkit.block.state.TileStateMock
be.seeseemelk.mockbukkit.block.state.BeaconMock
- All Implemented Interfaces:
LockableTileState
,Beacon
,BlockState
,Lockable
,TileState
,Metadatable
,Nameable
,PersistentDataHolder
Mock implementation of a
Beacon
.- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BeaconMock
(@NotNull BeaconMock state) Constructs a newBeaconMock
by cloning the data from an existing one.protected
BeaconMock
(@NotNull Block block) Constructs a newBeaconMock
for the providedBlock
.BeaconMock
(@NotNull Material material) Constructs a newBeaconMock
for the providedMaterial
. -
Method Summary
Modifier and TypeMethodDescription@Nullable net.kyori.adventure.text.Component
void
customName
(@Nullable net.kyori.adventure.text.Component customName) @Nullable String
double
@NotNull Collection<LivingEntity>
@NotNull String
getLock()
@Nullable PotionEffect
@Nullable PotionEffect
@NotNull BlockState
This returns a copy of thisBlockStateMock
.int
getTier()
boolean
isLocked()
void
void
setCustomName
(@Nullable String name) void
setEffectRange
(double range) void
void
setPrimaryEffect
(@Nullable PotionEffectType effect) void
setSecondaryEffect
(@Nullable PotionEffectType effect) void
setTier
(int tier) Sets the tier of the Beacon.void
Calculates the Beacon's tier based off the blocks below it, just as in vanilla.Methods inherited from class be.seeseemelk.mockbukkit.block.state.TileStateMock
getPersistentDataContainer, isSnapshot
Methods inherited from class be.seeseemelk.mockbukkit.block.state.BlockStateMock
checkType, checkType, checkType, checkType, 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, update
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.bukkit.block.BlockState
getBlock, getBlockData, getChunk, getData, getDrops, getDrops, getDrops, getLightLevel, getLocation, getLocation, getRawData, getType, getWorld, getX, getY, getZ, isCollidable, isPlaced, setBlockData, setData, setRawData, setType, update, update, update
Methods inherited from interface org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata
Methods inherited from interface org.bukkit.block.TileState
getPersistentDataContainer, isSnapshot
-
Constructor Details
-
BeaconMock
- Parameters:
material
- The material this state is for.
-
BeaconMock
- Parameters:
block
- The block this state is for.
-
BeaconMock
Constructs a newBeaconMock
by cloning the data from an existing one.- Parameters:
state
- The state to clone.
-
-
Method Details
-
getSnapshot
Description copied from class:BlockStateMock
This returns a copy of thisBlockStateMock
. Inheritents of this class should override this method!- Specified by:
getSnapshot
in classTileStateMock
- Returns:
- A snapshot of this
BlockStateMock
.
-
getEntitiesInRange
- Specified by:
getEntitiesInRange
in 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:
getPrimaryEffect
in interfaceBeacon
-
setPrimaryEffect
- Specified by:
setPrimaryEffect
in interfaceBeacon
-
getSecondaryEffect
- Specified by:
getSecondaryEffect
in interfaceBeacon
-
setSecondaryEffect
- Specified by:
setSecondaryEffect
in interfaceBeacon
-
getEffectRange
public double getEffectRange()- Specified by:
getEffectRange
in interfaceBeacon
-
setEffectRange
public void setEffectRange(double range) - Specified by:
setEffectRange
in interfaceBeacon
-
resetEffectRange
public void resetEffectRange()- Specified by:
resetEffectRange
in interfaceBeacon
-
customName
@Nullable public @Nullable net.kyori.adventure.text.Component customName()- Specified by:
customName
in interfaceNameable
-
customName
public void customName(@Nullable @Nullable net.kyori.adventure.text.Component customName) - Specified by:
customName
in interfaceNameable
-
getCustomName
- Specified by:
getCustomName
in interfaceNameable
-
setCustomName
- Specified by:
setCustomName
in interfaceNameable
-
isLocked
public boolean isLocked() -
getLock
-
setLock
-