public interface IPart extends IBoxProvider
Modifier and Type | Method and Description |
---|---|
void |
addToWorld()
called when your part is being added to the world.
|
int |
cableConnectionRenderTo() |
boolean |
canBePlacedOn(BusSupport what)
Used to determine which parts can be placed on what cables.
|
boolean |
canConnectRedstone() |
net.minecraft.util.IIcon |
getBreakingTexture() |
void |
getDrops(java.util.List<net.minecraft.item.ItemStack> drops,
boolean wrenched)
Add drops to the items being dropped into the world, if your item stores its contents when wrenched use the
wrenched boolean to control what data is saved vs dropped when it is broken.
|
IGridNode |
getExternalFacingNode()
used for tunnels.
|
IGridNode |
getGridNode()
get the Grid Node for the Bus, be sure your IGridBlock is NOT isWorldAccessible, if it is your going to cause
crashes.
|
net.minecraft.item.ItemStack |
getItemStack(PartItemStack type)
get an ItemStack that represents the bus, should contain the settings for whatever, can also be used in
conjunction with removePart to take a part off and drop it or something.
|
int |
getLightLevel() |
boolean |
isLadder(net.minecraft.entity.EntityLivingBase entity)
does this part act like a ladder?
|
int |
isProvidingStrongPower() |
int |
isProvidingWeakPower() |
boolean |
isSolid() |
boolean |
onActivate(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.util.Vec3 pos)
Called when you right click the part, very similar to Block.onActivateBlock
|
void |
onEntityCollision(net.minecraft.entity.Entity entity)
called when an entity collides with the bus.
|
void |
onNeighborChanged()
a block around the bus's host has been changed.
|
void |
onPlacement(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.item.ItemStack held,
net.minecraftforge.common.util.ForgeDirection side)
Called when placed in the world by a player, this happens before addWorld.
|
boolean |
onShiftActivate(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.util.Vec3 pos)
Called when you right click the part, very similar to Block.onActivateBlock
|
void |
randomDisplayTick(net.minecraft.world.World world,
int x,
int y,
int z,
java.util.Random r)
same as Block.randomDisplayTick, for but parts.
|
void |
readFromNBT(net.minecraft.nbt.NBTTagCompound data)
Read the previously written NBT Data.
|
boolean |
readFromStream(io.netty.buffer.ByteBuf data)
read data from bus packet.
|
void |
removeFromWorld()
called when your part is being removed from the world.
|
void |
renderDynamic(double x,
double y,
double z,
IPartRenderHelper rh,
net.minecraft.client.renderer.RenderBlocks renderer)
render TESR.
|
void |
renderInventory(IPartRenderHelper rh,
net.minecraft.client.renderer.RenderBlocks renderer)
render item form for inventory, or entity.
|
void |
renderStatic(int x,
int y,
int z,
IPartRenderHelper rh,
net.minecraft.client.renderer.RenderBlocks renderer)
render world renderer ( preferred )
|
boolean |
requireDynamicRender()
return true only if your part require dynamic rendering, must be consistent.
|
void |
setPartHostInfo(net.minecraftforge.common.util.ForgeDirection side,
IPartHost host,
net.minecraft.tileentity.TileEntity tile)
called by the Part host to keep your part informed.
|
void |
writeToNBT(net.minecraft.nbt.NBTTagCompound data)
Write the part information for saving, the part will be saved with getItemStack(false) and this method will be
called after to load settings, inventory or other values from the world.
|
void |
writeToStream(io.netty.buffer.ByteBuf data)
write data to bus packet.
|
getBoxes
net.minecraft.item.ItemStack getItemStack(PartItemStack type)
This is used to drop the bus, and to save the bus, when saving the bus, wrenched is false, and writeToNBT will be called to save important details about the part, if the part is wrenched include in your NBT Data any settings you might want to keep around, you can restore those settings when constructing your part.
type
- , what kind of ItemStack to return?void renderInventory(IPartRenderHelper rh, net.minecraft.client.renderer.RenderBlocks renderer)
GL Available
rh
- helperrenderer
- renderervoid renderStatic(int x, int y, int z, IPartRenderHelper rh, net.minecraft.client.renderer.RenderBlocks renderer)
GL is NOT Available
x
- x coordy
- y coordz
- z coordrh
- helperrenderer
- renderervoid renderDynamic(double x, double y, double z, IPartRenderHelper rh, net.minecraft.client.renderer.RenderBlocks renderer)
GL Available
x
- x coordy
- y coordz
- z coordrh
- helperrenderer
- renderernet.minecraft.util.IIcon getBreakingTexture()
boolean requireDynamicRender()
boolean isSolid()
boolean canConnectRedstone()
void writeToNBT(net.minecraft.nbt.NBTTagCompound data)
data
- to be written nbt datavoid readFromNBT(net.minecraft.nbt.NBTTagCompound data)
data
- to be read nbt dataint getLightLevel()
boolean isLadder(net.minecraft.entity.EntityLivingBase entity)
entity
- climbing entityvoid onNeighborChanged()
int isProvidingStrongPower()
int isProvidingWeakPower()
void writeToStream(io.netty.buffer.ByteBuf data) throws java.io.IOException
data
- to be written datajava.io.IOException
boolean readFromStream(io.netty.buffer.ByteBuf data) throws java.io.IOException
data
- to be read datajava.io.IOException
IGridNode getGridNode()
or null if you don't have a grid node.
void onEntityCollision(net.minecraft.entity.Entity entity)
entity
- colliding entityvoid removeFromWorld()
void addToWorld()
IGridNode getExternalFacingNode()
void setPartHostInfo(net.minecraftforge.common.util.ForgeDirection side, IPartHost host, net.minecraft.tileentity.TileEntity tile)
host
- part sidetile
- tile entity of partboolean onActivate(net.minecraft.entity.player.EntityPlayer player, net.minecraft.util.Vec3 pos)
player
- right clicking playerpos
- position of blockboolean onShiftActivate(net.minecraft.entity.player.EntityPlayer player, net.minecraft.util.Vec3 pos)
player
- shift right clicking playerpos
- position of blockvoid getDrops(java.util.List<net.minecraft.item.ItemStack> drops, boolean wrenched)
drops
- item drops if wrenchedwrenched
- control flag for wrenched vs brokenint cableConnectionRenderTo()
void randomDisplayTick(net.minecraft.world.World world, int x, int y, int z, java.util.Random r)
world
- world of blockx
- x coord of blocky
- y coord of blockz
- z coord of blockr
- randomvoid onPlacement(net.minecraft.entity.player.EntityPlayer player, net.minecraft.item.ItemStack held, net.minecraftforge.common.util.ForgeDirection side)
player
- placing playerheld
- held itemside
- placing sideboolean canBePlacedOn(BusSupport what)
what
- placed part