Class CraftStructureBlock
java.lang.Object
org.bukkit.craftbukkit.v1_17_R1.block.CraftBlockState
com.github.shynixn.structureblocklib.bukkit.v1_17_R1.CraftStructureBlock
- All Implemented Interfaces:
com.github.shynixn.structureblocklib.api.block.StructureBlockAbstract,com.github.shynixn.structureblocklib.api.block.StructureBlockConstructionAbstract<org.bukkit.Location>,com.github.shynixn.structureblocklib.api.block.StructureBlockCornerAbstract,com.github.shynixn.structureblocklib.api.block.StructureBlockDataAbstract,com.github.shynixn.structureblocklib.api.block.StructureBlockLoadAbstract<org.bukkit.Location,org.bukkit.util.Vector>,com.github.shynixn.structureblocklib.api.block.StructureBlockSaveAbstract<org.bukkit.Location,org.bukkit.util.Vector>,com.github.shynixn.structureblocklib.api.bukkit.block.StructureBlock,com.github.shynixn.structureblocklib.api.bukkit.block.StructureBlockConstruction,com.github.shynixn.structureblocklib.api.bukkit.block.StructureBlockCorner,com.github.shynixn.structureblocklib.api.bukkit.block.StructureBlockData,com.github.shynixn.structureblocklib.api.bukkit.block.StructureBlockLoad,com.github.shynixn.structureblocklib.api.bukkit.block.StructureBlockSave,org.bukkit.block.BlockState,org.bukkit.metadata.Metadatable
public class CraftStructureBlock
extends org.bukkit.craftbukkit.v1_17_R1.block.CraftBlockState
implements com.github.shynixn.structureblocklib.api.bukkit.block.StructureBlockData, com.github.shynixn.structureblocklib.api.bukkit.block.StructureBlockSave, com.github.shynixn.structureblocklib.api.bukkit.block.StructureBlockLoad
-
Field Summary
FieldsModifier and TypeFieldDescriptioncom.github.shynixn.structureblocklib.api.service.TypeConversionServicecom.github.shynixn.structureblocklib.core.block.StructureBlockAbstractImpl<org.bukkit.Location,org.bukkit.util.Vector>net.minecraft.world.level.block.entity.StructureBlockEntityFields inherited from class org.bukkit.craftbukkit.v1_17_R1.block.CraftBlockState
data, flag, world -
Constructor Summary
ConstructorsConstructorDescriptionCraftStructureBlock(com.github.shynixn.structureblocklib.core.block.StructureBlockAbstractImpl<org.bukkit.Location,org.bukkit.util.Vector> structure, com.github.shynixn.structureblocklib.api.service.TypeConversionService conversionService, org.bukkit.block.Block block)Creates a new instance with dependencies. -
Method Summary
Modifier and TypeMethodDescription@Nullable StringReturns the author of the structure.@Nullable StringReturns the custom meta data.floatReturns the integrity of the structure.@NotNull com.github.shynixn.structureblocklib.api.enumeration.StructureMirrorReturns the mirrorType of the structure when getting load.@NotNull com.github.shynixn.structureblocklib.api.enumeration.StructureRotationReturns the rotation of the structure when getting load.@Nullable StringReturns the name of the save.longgetSeed()Returns the seed of the structure.intgetSizeX()Returns the size of the structure in X direction.intgetSizeY()Returns the size of the structure in Y direction.intgetSizeZ()Returns the size of the structure in Z direction.@Nullable org.bukkit.LocationReturns the location of the structure.@NotNull com.github.shynixn.structureblocklib.api.enumeration.StructureModeReturns the type of the structureBlock.booleanReturns if the boundingBox is visible.booleanShould entities which may or may not be included in the saved file be included in the loaded/saved structure.booleanReturns if invisibleBlocks are visible.@NotNull com.github.shynixn.structureblocklib.api.entity.StructureLoaderAbstract<org.bukkit.Location,org.bukkit.util.Vector>Creates a new instance ofStructureLoaderAbstractwhich contains the current block properties.@NotNull com.github.shynixn.structureblocklib.api.entity.StructureSaverAbstract<org.bukkit.Location,org.bukkit.util.Vector>Creates a new instance ofStructureSaverAbstractwhich contains the current block properties.voidSets the author of the structure.voidsetBlockNameMetaData(@Nullable String blockNameMetaData)Sets custom meta data.voidsetBoundingBoxVisible(boolean visible)Sets the boundingBoxVisibility.voidsetIncludeEntities(boolean flag)Should entities which may or may not be included in the saved file be included in the loaded/saved structure.voidsetIntegrity(float integrity)Sets the integrity of the structure.voidsetInvisibleBlocksEnabled(boolean flag)Sets if invisibleBlocks should be visible.voidsetMirrorType(@NotNull com.github.shynixn.structureblocklib.api.enumeration.StructureMirror mirrorType)Sets the mirrorType of the structure when getting load.voidsetRotationType(@NotNull com.github.shynixn.structureblocklib.api.enumeration.StructureRotation rotation)Sets the rotation of the structure when getting load.voidsetSaveName(@Nullable String name)Sets the name of the save.voidsetSeed(long seed)Sets the seed of the structure.voidsetSizeX(int sizeX)Changes the size of the structure in X direction.voidsetSizeY(int sizeY)Changes the size of the structure in Y direction.voidsetSizeZ(int sizeZ)Changes the size of the structure in Z direction.voidsetStructureLocation(@Nullable org.bukkit.Location location)Changes the location of the structure.voidsetStructureMode(@NotNull com.github.shynixn.structureblocklib.api.enumeration.StructureMode structureMode)Changes the type of the structureBlock.booleanupdate(boolean force, boolean applyPhysics)Updates the craft changes to the minecraft world.Methods inherited from class org.bukkit.craftbukkit.v1_17_R1.block.CraftBlockState
equals, getBlock, getBlockData, getBlockState, getBlockState, getChunk, getData, getFlag, getHandle, getLightLevel, getLocation, getLocation, getMetadata, getPosition, getRawData, getType, getWorld, getX, getY, getZ, hashCode, hasMetadata, isPlaced, removeMetadata, requirePlaced, setBlockData, setData, setData, setFlag, setMetadata, setRawData, setType, update, updateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bukkit.block.BlockState
getBlock, getBlockData, getChunk, getData, getLightLevel, getLocation, getLocation, getRawData, getType, getWorld, getX, getY, getZ, isPlaced, setBlockData, setData, setRawData, setType, update, updateMethods inherited from interface org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata
-
Field Details
-
internalBlock
public com.github.shynixn.structureblocklib.core.block.StructureBlockAbstractImpl<org.bukkit.Location,org.bukkit.util.Vector> internalBlock -
conversionService
public com.github.shynixn.structureblocklib.api.service.TypeConversionService conversionService -
tileEntityStructure
public net.minecraft.world.level.block.entity.StructureBlockEntity tileEntityStructure
-
-
Constructor Details
-
CraftStructureBlock
public CraftStructureBlock(com.github.shynixn.structureblocklib.core.block.StructureBlockAbstractImpl<org.bukkit.Location,org.bukkit.util.Vector> structure, com.github.shynixn.structureblocklib.api.service.TypeConversionService conversionService, org.bukkit.block.Block block)Creates a new instance with dependencies.- Parameters:
structure- dependency.block- dependency.
-
-
Method Details
-
update
public boolean update(boolean force, boolean applyPhysics)Updates the craft changes to the minecraft world.- Specified by:
updatein interfaceorg.bukkit.block.BlockState- Overrides:
updatein classorg.bukkit.craftbukkit.v1_17_R1.block.CraftBlockState- Parameters:
force- force update.applyPhysics- apply physics.- Returns:
- success.
-
setMirrorType
public void setMirrorType(@NotNull @NotNull com.github.shynixn.structureblocklib.api.enumeration.StructureMirror mirrorType)Sets the mirrorType of the structure when getting load.- Specified by:
setMirrorTypein interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockLoadAbstract<org.bukkit.Location,org.bukkit.util.Vector>- Parameters:
mirrorType- mirrorType.
-
setRotationType
public void setRotationType(@NotNull @NotNull com.github.shynixn.structureblocklib.api.enumeration.StructureRotation rotation)Sets the rotation of the structure when getting load.- Specified by:
setRotationTypein interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockLoadAbstract<org.bukkit.Location,org.bukkit.util.Vector>- Parameters:
rotation- rotation.
-
getRotationType
@NotNull public @NotNull com.github.shynixn.structureblocklib.api.enumeration.StructureRotation getRotationType()Returns the rotation of the structure when getting load.- Specified by:
getRotationTypein interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockLoadAbstract<org.bukkit.Location,org.bukkit.util.Vector>- Returns:
- rotation.
-
getMirrorType
@NotNull public @NotNull com.github.shynixn.structureblocklib.api.enumeration.StructureMirror getMirrorType()Returns the mirrorType of the structure when getting load.- Specified by:
getMirrorTypein interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockLoadAbstract<org.bukkit.Location,org.bukkit.util.Vector>- Returns:
- mirrorType.
-
setBoundingBoxVisible
public void setBoundingBoxVisible(boolean visible)Sets the boundingBoxVisibility.- Specified by:
setBoundingBoxVisiblein interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockLoadAbstract<org.bukkit.Location,org.bukkit.util.Vector>- Parameters:
visible- visible.
-
isBoundingBoxVisible
public boolean isBoundingBoxVisible()Returns if the boundingBox is visible.- Specified by:
isBoundingBoxVisiblein interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockLoadAbstract<org.bukkit.Location,org.bukkit.util.Vector>- Returns:
- visible.
-
setIntegrity
public void setIntegrity(float integrity)Sets the integrity of the structure.- Specified by:
setIntegrityin interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockLoadAbstract<org.bukkit.Location,org.bukkit.util.Vector>- Parameters:
integrity- integrity.
-
getIntegrity
public float getIntegrity()Returns the integrity of the structure.- Specified by:
getIntegrityin interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockLoadAbstract<org.bukkit.Location,org.bukkit.util.Vector>- Returns:
- integrity.
-
setSeed
public void setSeed(long seed)Sets the seed of the structure.- Specified by:
setSeedin interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockLoadAbstract<org.bukkit.Location,org.bukkit.util.Vector>- Parameters:
seed- seed.
-
getSeed
public long getSeed()Returns the seed of the structure.- Specified by:
getSeedin interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockLoadAbstract<org.bukkit.Location,org.bukkit.util.Vector>- Returns:
- seed.
-
setAuthor
Sets the author of the structure.- Specified by:
setAuthorin interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockConstructionAbstract<org.bukkit.Location>- Parameters:
author- author.
-
getAuthor
Returns the author of the structure.- Specified by:
getAuthorin interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockConstructionAbstract<org.bukkit.Location>- Returns:
- author.
-
setStructureLocation
public void setStructureLocation(@Nullable @Nullable org.bukkit.Location location)Changes the location of the structure.- Specified by:
setStructureLocationin interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockConstructionAbstract<org.bukkit.Location>- Parameters:
location- location.
-
getStructureLocation
@Nullable public @Nullable org.bukkit.Location getStructureLocation()Returns the location of the structure.- Specified by:
getStructureLocationin interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockConstructionAbstract<org.bukkit.Location>- Returns:
- location.
-
setIncludeEntities
public void setIncludeEntities(boolean flag)Should entities which may or may not be included in the saved file be included in the loaded/saved structure. Default false.- Specified by:
setIncludeEntitiesin interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockConstructionAbstract<org.bukkit.Location>- Parameters:
flag- flag.
-
isIncludeEntitiesEnabled
public boolean isIncludeEntitiesEnabled()Should entities which may or may not be included in the saved file be included in the loaded/saved structure. Default false.- Specified by:
isIncludeEntitiesEnabledin interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockConstructionAbstract<org.bukkit.Location>- Returns:
- false.
-
setSizeX
public void setSizeX(int sizeX)Changes the size of the structure in X direction.- Specified by:
setSizeXin interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockConstructionAbstract<org.bukkit.Location>- Parameters:
sizeX- sizeX.
-
setSizeY
public void setSizeY(int sizeY)Changes the size of the structure in Y direction.- Specified by:
setSizeYin interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockConstructionAbstract<org.bukkit.Location>- Parameters:
sizeY- sizeY.
-
setSizeZ
public void setSizeZ(int sizeZ)Changes the size of the structure in Z direction.- Specified by:
setSizeZin interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockConstructionAbstract<org.bukkit.Location>- Parameters:
sizeZ- sizeZ.
-
getSizeX
public int getSizeX()Returns the size of the structure in X direction.- Specified by:
getSizeXin interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockConstructionAbstract<org.bukkit.Location>- Returns:
- xSize.
-
getSizeY
public int getSizeY()Returns the size of the structure in Y direction.- Specified by:
getSizeYin interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockConstructionAbstract<org.bukkit.Location>- Returns:
- ySize.
-
getSizeZ
public int getSizeZ()Returns the size of the structure in Z direction.- Specified by:
getSizeZin interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockConstructionAbstract<org.bukkit.Location>- Returns:
- zSize.
-
setSaveName
Sets the name of the save.- Specified by:
setSaveNamein interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockCornerAbstract- Parameters:
name- name.
-
getSaveName
Returns the name of the save.- Specified by:
getSaveNamein interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockCornerAbstract- Returns:
- name.
-
setBlockNameMetaData
Sets custom meta data. Please use the minecraft documentation to find out more.- Specified by:
setBlockNameMetaDatain interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockDataAbstract- Parameters:
blockNameMetaData- customMeta.
-
getBlockNameMetaData
Returns the custom meta data.- Specified by:
getBlockNameMetaDatain interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockDataAbstract- Returns:
- customMeta
-
setInvisibleBlocksEnabled
public void setInvisibleBlocksEnabled(boolean flag)Sets if invisibleBlocks should be visible.- Specified by:
setInvisibleBlocksEnabledin interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockSaveAbstract<org.bukkit.Location,org.bukkit.util.Vector>- Parameters:
flag- flag.
-
isInvisibleBlocksEnabled
public boolean isInvisibleBlocksEnabled()Returns if invisibleBlocks are visible.- Specified by:
isInvisibleBlocksEnabledin interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockSaveAbstract<org.bukkit.Location,org.bukkit.util.Vector>- Returns:
- visible
-
setStructureMode
public void setStructureMode(@NotNull @NotNull com.github.shynixn.structureblocklib.api.enumeration.StructureMode structureMode)Changes the type of the structureBlock.- Specified by:
setStructureModein interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockAbstract- Parameters:
structureMode- structureMode.
-
getStructureMode
@NotNull public @NotNull com.github.shynixn.structureblocklib.api.enumeration.StructureMode getStructureMode()Returns the type of the structureBlock.- Specified by:
getStructureModein interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockAbstract- Returns:
- structureMode.
-
loadStructure
@NotNull public @NotNull com.github.shynixn.structureblocklib.api.entity.StructureLoaderAbstract<org.bukkit.Location,org.bukkit.util.Vector> loadStructure()Creates a new instance ofStructureLoaderAbstractwhich contains the current block properties.- Specified by:
loadStructurein interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockLoadAbstract<org.bukkit.Location,org.bukkit.util.Vector>- Returns:
- New instance.
-
saveStructure
@NotNull public @NotNull com.github.shynixn.structureblocklib.api.entity.StructureSaverAbstract<org.bukkit.Location,org.bukkit.util.Vector> saveStructure()Creates a new instance ofStructureSaverAbstractwhich contains the current block properties.- Specified by:
saveStructurein interfacecom.github.shynixn.structureblocklib.api.block.StructureBlockSaveAbstract<org.bukkit.Location,org.bukkit.util.Vector>- Returns:
- New instance.
-