Package noppes.npcs.api
Interface IBlock
-
- All Known Subinterfaces:
IBlockScripted
public interface IBlock
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canCollide()
boolean
canCollide(double maxVolume)
double
getBlockBoundsMaxX()
double
getBlockBoundsMaxY()
double
getBlockBoundsMaxZ()
double
getBlockBoundsMinX()
double
getBlockBoundsMinY()
double
getBlockBoundsMinZ()
IContainer
getContainer()
java.lang.String
getDisplayName()
net.minecraft.block.Block
getMCBlock()
net.minecraft.tileentity.TileEntity
getMCTileEntity()
java.lang.String
getName()
IPos
getPosition()
ITileEntity
getTileEntity()
INbt
getTileEntityNBT()
IWorld
getWorld()
int
getX()
int
getY()
int
getZ()
boolean
hasTileEntity()
boolean
isAir()
boolean
isContainer()
void
remove()
Deletes the block, setting it to air.IBlock
setBlock(java.lang.String blockName)
IBlock
setBlock(IBlock block)
void
setBounds(float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
boolean
setPosition(int x, int y, int z)
boolean
setPosition(int x, int y, int z, IWorld world)
boolean
setPosition(IPos pos)
boolean
setPosition(IPos pos, IWorld world)
Moves the block to a new position in the given world.void
setTileEntity(ITileEntity tileEntity)
-
-
-
Method Detail
-
getX
int getX()
-
getY
int getY()
-
getZ
int getZ()
-
getPosition
IPos getPosition()
- Returns:
- An IPos object with the block's XYZ position.
-
setPosition
boolean setPosition(IPos pos, IWorld world)
Moves the block to a new position in the given world. The old position is replaced with air.- Parameters:
pos
- The new position of the blockworld
- The destination world of the block- Returns:
- Whether the block was successfully placed
-
setPosition
boolean setPosition(IPos pos)
-
setPosition
boolean setPosition(int x, int y, int z, IWorld world)
-
setPosition
boolean setPosition(int x, int y, int z)
-
getName
java.lang.String getName()
- Returns:
- The block name as it appears in the block registry. Return example: "minecraft:stone"
-
remove
void remove()
Deletes the block, setting it to air.
-
isAir
boolean isAir()
-
setBlock
IBlock setBlock(java.lang.String blockName)
- Parameters:
blockName
- The name of the block to be set in place of this block.- Returns:
- The new block set in place of this block as an IBlock object.
-
setBlock
IBlock setBlock(IBlock block)
- Parameters:
block
- Input IBlock object to replace this block.- Returns:
- The new block set in place of the previous block.
-
isContainer
boolean isContainer()
- Returns:
- True if the block can contain items like a chest does.
-
getContainer
IContainer getContainer()
- Returns:
- The container object of this block. If this block is not a container, an exception will be thrown.
-
getWorld
IWorld getWorld()
- Returns:
- An IWorld object of the world this block is in.
-
hasTileEntity
boolean hasTileEntity()
- Returns:
- True if this block has a tile entity. Blocks with custom data like signs, player skulls, chests, etc. will have tile entities.
-
getTileEntity
ITileEntity getTileEntity()
- Returns:
- An ITileEntity object which can modify this block's tile entity.
-
setTileEntity
void setTileEntity(ITileEntity tileEntity)
- Parameters:
tileEntity
- Replaces this block's tile entity based on the data given by this parameter.
-
getMCTileEntity
net.minecraft.tileentity.TileEntity getMCTileEntity()
- Returns:
- An obfuscated MC object for the block's tile entity.
-
getMCBlock
net.minecraft.block.Block getMCBlock()
- Returns:
- An obfuscated MC block object.
-
getDisplayName
java.lang.String getDisplayName()
-
getTileEntityNBT
INbt getTileEntityNBT()
- Returns:
- An INbt object which can modify the block's tile entity's NBT data.
-
canCollide
boolean canCollide(double maxVolume)
- Parameters:
maxVolume
- The volume threshold to determine whether this block's bounding box collides, if it has one.- Returns:
- Whether this block can be collided with
-
canCollide
boolean canCollide()
-
setBounds
void setBounds(float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
-
getBlockBoundsMinX
double getBlockBoundsMinX()
-
getBlockBoundsMinY
double getBlockBoundsMinY()
-
getBlockBoundsMinZ
double getBlockBoundsMinZ()
-
getBlockBoundsMaxX
double getBlockBoundsMaxX()
-
getBlockBoundsMaxY
double getBlockBoundsMaxY()
-
getBlockBoundsMaxZ
double getBlockBoundsMaxZ()
-
-