Class CraftStructureBlock

java.lang.Object
org.bukkit.craftbukkit.v1_10_R1.block.CraftBlockState
com.github.shynixn.structureblocklib.bukkit.v1_10_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_10_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

    Fields
    Modifier and Type
    Field
    Description
    com.github.shynixn.structureblocklib.api.service.TypeConversionService
     
    com.github.shynixn.structureblocklib.core.block.StructureBlockAbstractImpl<org.bukkit.Location,org.bukkit.util.Vector>
     
    net.minecraft.server.v1_10_R1.TileEntityStructure
     

    Fields inherited from class org.bukkit.craftbukkit.v1_10_R1.block.CraftBlockState

    data, flag, type
  • Constructor Summary

    Constructors
    Constructor
    Description
    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.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable String
    Returns the author of the structure.
    @Nullable String
    Returns the custom meta data.
    float
    Returns the integrity of the structure.
    @NotNull com.github.shynixn.structureblocklib.api.enumeration.StructureMirror
    Returns the mirrorType of the structure when getting load.
    @NotNull com.github.shynixn.structureblocklib.api.enumeration.StructureRotation
    Returns the rotation of the structure when getting load.
    @Nullable String
    Returns the name of the save.
    long
    Returns the seed of the structure.
    int
    Returns the size of the structure in X direction.
    int
    Returns the size of the structure in Y direction.
    int
    Returns the size of the structure in Z direction.
    @Nullable org.bukkit.Location
    Returns the location of the structure.
    @NotNull com.github.shynixn.structureblocklib.api.enumeration.StructureMode
    Returns the type of the structureBlock.
    boolean
    Returns if the boundingBox is visible.
    boolean
    Should entities which may or may not be included in the saved file be included in the loaded/saved structure.
    boolean
    Returns if invisibleBlocks are visible.
    @NotNull com.github.shynixn.structureblocklib.api.entity.StructureLoaderAbstract<org.bukkit.Location,org.bukkit.util.Vector>
    Creates a new instance of StructureLoaderAbstract which contains the current block properties.
    @NotNull com.github.shynixn.structureblocklib.api.entity.StructureSaverAbstract<org.bukkit.Location,org.bukkit.util.Vector>
    Creates a new instance of StructureSaverAbstract which contains the current block properties.
    void
    setAuthor(@Nullable String author)
    Sets the author of the structure.
    void
    setBlockNameMetaData(@Nullable String blockNameMetaData)
    Sets custom meta data.
    void
    setBoundingBoxVisible(boolean visible)
    Sets the boundingBoxVisibility.
    void
    setIncludeEntities(boolean flag)
    Should entities which may or may not be included in the saved file be included in the loaded/saved structure.
    void
    setIntegrity(float integrity)
    Sets the integrity of the structure.
    void
    Sets if invisibleBlocks should be visible.
    void
    setMirrorType(@NotNull com.github.shynixn.structureblocklib.api.enumeration.StructureMirror mirrorType)
    Sets the mirrorType of the structure when getting load.
    void
    setRotationType(@NotNull com.github.shynixn.structureblocklib.api.enumeration.StructureRotation rotation)
    Sets the rotation of the structure when getting load.
    void
    setSaveName(@Nullable String name)
    Sets the name of the save.
    void
    setSeed(long seed)
    Sets the seed of the structure.
    void
    setSizeX(int sizeX)
    Changes the size of the structure in X direction.
    void
    setSizeY(int sizeY)
    Changes the size of the structure in Y direction.
    void
    setSizeZ(int sizeZ)
    Changes the size of the structure in Z direction.
    void
    setStructureLocation(@Nullable org.bukkit.Location location)
    Changes the location of the structure.
    void
    setStructureMode(@NotNull com.github.shynixn.structureblocklib.api.enumeration.StructureMode structureMode)
    Changes the type of the structureBlock.
    boolean
    update(boolean force, boolean applyPhysics)
    Updates the craft changes to the minecraft world.

    Methods inherited from class org.bukkit.craftbukkit.v1_10_R1.block.CraftBlockState

    equals, getBlock, getBlockState, getBlockState, getChunk, getData, getFlag, getLightLevel, getLocation, getLocation, getMetadata, getRawData, getTileEntity, getType, getTypeId, getWorld, getX, getY, getZ, hashCode, hasMetadata, isPlaced, removeMetadata, requirePlaced, setData, setFlag, setMetadata, setRawData, setType, setTypeId, 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, getChunk, getData, getLightLevel, getLocation, getLocation, getRawData, getType, getTypeId, getWorld, getX, getY, getZ, isPlaced, setData, setRawData, setType, setTypeId, update, update

    Methods 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.server.v1_10_R1.TileEntityStructure 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:
      update in interface org.bukkit.block.BlockState
      Overrides:
      update in class org.bukkit.craftbukkit.v1_10_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:
      setMirrorType in interface com.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:
      setRotationType in interface com.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:
      getRotationType in interface com.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:
      getMirrorType in interface com.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:
      setBoundingBoxVisible in interface com.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:
      isBoundingBoxVisible in interface com.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:
      setIntegrity in interface com.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:
      getIntegrity in interface com.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:
      setSeed in interface com.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:
      getSeed in interface com.github.shynixn.structureblocklib.api.block.StructureBlockLoadAbstract<org.bukkit.Location,org.bukkit.util.Vector>
      Returns:
      seed.
    • setAuthor

      public void setAuthor(@Nullable @Nullable String author)
      Sets the author of the structure.
      Specified by:
      setAuthor in interface com.github.shynixn.structureblocklib.api.block.StructureBlockConstructionAbstract<org.bukkit.Location>
      Parameters:
      author - author.
    • getAuthor

      @Nullable public @Nullable String getAuthor()
      Returns the author of the structure.
      Specified by:
      getAuthor in interface com.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:
      setStructureLocation in interface com.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:
      getStructureLocation in interface com.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:
      setIncludeEntities in interface com.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:
      isIncludeEntitiesEnabled in interface com.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:
      setSizeX in interface com.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:
      setSizeY in interface com.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:
      setSizeZ in interface com.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:
      getSizeX in interface com.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:
      getSizeY in interface com.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:
      getSizeZ in interface com.github.shynixn.structureblocklib.api.block.StructureBlockConstructionAbstract<org.bukkit.Location>
      Returns:
      zSize.
    • setSaveName

      public void setSaveName(@Nullable @Nullable String name)
      Sets the name of the save.
      Specified by:
      setSaveName in interface com.github.shynixn.structureblocklib.api.block.StructureBlockCornerAbstract
      Parameters:
      name - name.
    • getSaveName

      @Nullable public @Nullable String getSaveName()
      Returns the name of the save.
      Specified by:
      getSaveName in interface com.github.shynixn.structureblocklib.api.block.StructureBlockCornerAbstract
      Returns:
      name.
    • setBlockNameMetaData

      public void setBlockNameMetaData(@Nullable @Nullable String blockNameMetaData)
      Sets custom meta data. Please use the minecraft documentation to find out more.
      Specified by:
      setBlockNameMetaData in interface com.github.shynixn.structureblocklib.api.block.StructureBlockDataAbstract
      Parameters:
      blockNameMetaData - customMeta.
    • getBlockNameMetaData

      @Nullable public @Nullable String getBlockNameMetaData()
      Returns the custom meta data.
      Specified by:
      getBlockNameMetaData in interface com.github.shynixn.structureblocklib.api.block.StructureBlockDataAbstract
      Returns:
      customMeta
    • setInvisibleBlocksEnabled

      public void setInvisibleBlocksEnabled(boolean flag)
      Sets if invisibleBlocks should be visible.
      Specified by:
      setInvisibleBlocksEnabled in interface com.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:
      isInvisibleBlocksEnabled in interface com.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:
      setStructureMode in interface com.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:
      getStructureMode in interface com.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 of StructureLoaderAbstract which contains the current block properties.
      Specified by:
      loadStructure in interface com.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 of StructureSaverAbstract which contains the current block properties.
      Specified by:
      saveStructure in interface com.github.shynixn.structureblocklib.api.block.StructureBlockSaveAbstract<org.bukkit.Location,org.bukkit.util.Vector>
      Returns:
      New instance.