Package noppes.npcs.api.block
Interface IBlock
- All Known Subinterfaces:
IBlockFluidContainer
,IBlockScripted
,IBlockScriptedDoor
public interface IBlock
-
Method Summary
Modifier and Type Method Description void
blockEvent(int type, int data)
IContainer
getContainer()
java.lang.String
getDisplayName()
net.minecraft.block.Block
getMCBlock()
Expert users onlynet.minecraft.block.state.IBlockState
getMCBlockState()
Expert users onlynet.minecraft.tileentity.TileEntity
getMCTileEntity()
Expert users onlyint
getMetadata()
java.lang.String
getName()
IPos
getPos()
IData
getStoreddata()
Stored data persists through world restart.IData
getTempdata()
Temp data stores anything but only untill it's reloaded.INbt
getTileEntityNBT()
IWorld
getWorld()
int
getX()
int
getY()
int
getZ()
boolean
hasTileEntity()
void
interact(int side)
Simulates a player interacting with this block (can give weird results)boolean
isAir()
boolean
isContainer()
boolean
isRemoved()
void
remove()
Removes this blockIBlock
setBlock(java.lang.String name)
IBlock
setBlock(IBlock block)
void
setMetadata(int i)
void
setTileEntityNBT(INbt nbt)
-
Method Details
-
getX
int getX() -
getY
int getY() -
getZ
int getZ() -
getPos
IPos getPos() -
getMetadata
int getMetadata() -
setMetadata
void setMetadata(int i) -
getName
java.lang.String getName()- Returns:
- Returns this blocks name
-
remove
void remove()Removes this block -
isRemoved
boolean isRemoved()- Returns:
- Returns whether or not this block has been replaced by another
-
isAir
boolean isAir() -
setBlock
-
setBlock
- Parameters:
block
- Sets the block to replace this one- Returns:
- Returns the new block
-
hasTileEntity
boolean hasTileEntity() -
isContainer
boolean isContainer()- Returns:
- Returns whether it has items stored inside it (e.g. chests, droppers, hoppers, etc)
-
getContainer
IContainer getContainer() -
getTempdata
IData getTempdata()Temp data stores anything but only untill it's reloaded. (works only for customnpcs blocks) -
getStoreddata
IData getStoreddata()Stored data persists through world restart. Unlike tempdata only Strings and Numbers can be saved (works only for blocks with TileEntities) -
getWorld
IWorld getWorld() -
getTileEntityNBT
INbt getTileEntityNBT() -
setTileEntityNBT
-
getMCTileEntity
net.minecraft.tileentity.TileEntity getMCTileEntity()Expert users only- Returns:
- Returns minecrafts tilentity
-
getMCBlock
net.minecraft.block.Block getMCBlock()Expert users only- Returns:
- Returns minecrafts block
-
blockEvent
void blockEvent(int type, int data)- Parameters:
type
- Event typedata
- Event data Example: Chests - type:1 data:1 opens the lid, type:1 data:0 closes the lid Note block - type:(0-9) data:(0-24) plays different notes
-
getDisplayName
java.lang.String getDisplayName() -
getMCBlockState
net.minecraft.block.state.IBlockState getMCBlockState()Expert users only- Returns:
- Returns minecrafts iblockstate
-
interact
void interact(int side)Simulates a player interacting with this block (can give weird results)- Parameters:
side
- The side of the block interacted with
-