Class DexBlock
java.lang.Object
me.c7dev.dexterity.util.DexBlock
Provides a wrapper for a
BlockDisplay
entity that holds data about its DexTransformation
, roll offset, and more-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDexBlock
(DexBlockState state) Spawn a block display wrapper based on a previously recorded stateDexBlock
(DexBlockState state, Vector offset) Spawn a block display wrapper based on a previously recorded stateDexBlock
(Block block, DexterityDisplay d) Convert a block into block displayDexBlock
(BlockDisplay bd, DexterityDisplay d) Create a wrapper for a block display that is part of a selectionDexBlock
(BlockDisplay bd, DexterityDisplay d, float roll) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Roll-offset adjusted location of the center of the block display entity.float
getRoll()
Gets the roll in degrees.getState()
Get the temporary vector, used in processingint
hashCode()
void
loadRoll()
Calculate the roll, recommended to do async (done automatically when plugin is enabled)void
loadRoll
(HashMap<OrientationKey, RollOffset> cache) Calculate the roll, recommended to do async (done automatically when plugin is enabled)void
loadState
(DexBlockState state) Loads in another state without spawning a new entityvoid
Sets up the Block Display's transformation to follow Dexterity convention, centers the block display, and loads roll datavoid
move
(double x, double y, double z) Move the block display entity by an offsetvoid
Move the block display entity by an offsetvoid
remove()
Kill entity and unregister from selectionvoid
Deprecated.void
setRoll
(float f) Set a new transformation for the given rollvoid
Set the temporary vector, used in processingvoid
Sets the transformation wrapper and updates the entityvoid
void
Updates the entity's transformation to the current values of its mutableDexTransformation
-
Field Details
-
TELEPORT_DURATION
public static final int TELEPORT_DURATION- See Also:
-
-
Constructor Details
-
DexBlock
Convert a block into block display- Parameters:
block
- The block to convertd
- The selection to register the new block display under
-
DexBlock
Create a wrapper for a block display that is part of a selection- Parameters:
bd
- The block display to registerd
- The selection to register the new block display under
-
DexBlock
Deprecated.Create a wrapper for a block display that is part of a selection. Must manually subtract theRollOffset
afterwards- Parameters:
bd
- The block display to registerd
- The selection to register the new block display underroll
- The roll, in degrees, that will forced into the wrapper
-
DexBlock
Spawn a block display wrapper based on a previously recorded state- Parameters:
state
-
-
DexBlock
Spawn a block display wrapper based on a previously recorded state- Parameters:
state
-offset
- Translation to put block at a different location
-
-
Method Details
-
getUniqueId
-
loadRoll
Calculate the roll, recommended to do async (done automatically when plugin is enabled)- Parameters:
cache
- Modifyable cache for similar rotation orientations
-
loadRoll
public void loadRoll()Calculate the roll, recommended to do async (done automatically when plugin is enabled) -
loadTransformationAndRoll
public void loadTransformationAndRoll()Sets up the Block Display's transformation to follow Dexterity convention, centers the block display, and loads roll data -
getEntity
-
getTempVector
Get the temporary vector, used in processing -
setTempVector
Set the temporary vector, used in processing -
setDexterityDisplay
Deprecated. -
getRoll
public float getRoll()Gets the roll in degrees. Yaw and pitch can be retrieved from the entity's location- Returns:
- The roll in degrees
-
setRoll
public void setRoll(float f) Set a new transformation for the given roll- Parameters:
f
- The roll in degrees
-
getDexterityDisplay
-
getTransformation
-
getState
-
loadState
Loads in another state without spawning a new entity- Parameters:
state
-
-
setTransformation
Sets the transformation wrapper and updates the entity- Parameters:
dt
-
-
updateTransformation
public void updateTransformation()Updates the entity's transformation to the current values of its mutableDexTransformation
-
teleport
-
move
-
move
public void move(double x, double y, double z) Move the block display entity by an offset- Parameters:
x
- Distance in blocksy
- Distance in blocksz
- Distance in blocks
-
remove
public void remove()Kill entity and unregister from selection -
hashCode
-
equals
-
getLocation
Roll-offset adjusted location of the center of the block display entity. This is not necessarily the entity's location if other plugins are being used.- Returns:
- Unmodifiable location of the center of the block display
-