public interface IPart extends IBoxProvider, ICustomCableConnection
| Modifier and Type | Method and Description |
|---|---|
void |
addToWorld()
called when your part is being added to the world.
|
boolean |
canBePlacedOn(BusSupport what)
Used to determine which parts can be placed on what cables.
|
boolean |
canConnectRedstone() |
float |
getCableConnectionLength(AECableType cable) |
default <T> T |
getCapability(net.minecraftforge.common.capabilities.Capability<T> capabilityClass)
Implement this method if your part exposes capabilitys.
|
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() |
default java.lang.Long |
getRenderFlag()
Flag to be passed to the renderer.
|
default IPartModel |
getStaticModels()
This method is used when a chunk is rebuilt to determine how this part should be rendered.
|
default boolean |
hasCapability(net.minecraftforge.common.capabilities.Capability<?> capabilityClass)
Implement this method if your part exposes capabilitys.
|
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.EnumHand hand,
net.minecraft.util.math.Vec3d pos)
Called when you right click the part, very similar to Block.onActivateBlock
|
default boolean |
onClicked(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.util.EnumHand hand,
net.minecraft.util.math.Vec3d pos)
Called when you left click the part, very similar to Block.onBlockClicked
|
void |
onEntityCollision(net.minecraft.entity.Entity entity)
called when an entity collides with the bus.
|
void |
onNeighborChanged(net.minecraft.world.IBlockAccess w,
net.minecraft.util.math.BlockPos pos,
net.minecraft.util.math.BlockPos neighbor)
a block around the bus's host has been changed.
|
void |
onPlacement(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.util.EnumHand hand,
net.minecraft.item.ItemStack held,
AEPartLocation 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.EnumHand hand,
net.minecraft.util.math.Vec3d pos)
Called when you right click the part, very similar to Block.onActivateBlock
|
default boolean |
onShiftClicked(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.util.EnumHand hand,
net.minecraft.util.math.Vec3d pos)
Called when you shift-left click the part, very similar to Block.onBlockClicked
|
void |
randomDisplayTick(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
java.util.Random r)
same as Block.randomDisplayTick, for but parts.
|
void |
readFromNBT(net.minecraft.nbt.NBTTagCompound data)
Read the previously written NBT Data. this is the mirror for writeToNBT
|
boolean |
readFromStream(io.netty.buffer.ByteBuf data)
read data from bus packet.
|
void |
removeFromWorld()
called when your part is being removed from the world.
|
default void |
renderDynamic(double x,
double y,
double z,
float partialTicks,
int destroyStage)
Render dynamic portions of this part, as part of the cable bus TESR.
|
boolean |
requireDynamicRender()
return true only if your part require dynamic rendering, must be consistent.
|
void |
setPartHostInfo(AEPartLocation 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.
|
getBoxesnet.minecraft.item.ItemStack getItemStack(PartItemStack type)
type - , what kind of ItemStack to return?default void renderDynamic(double x,
double y,
double z,
float partialTicks,
int destroyStage)
requireDynamicRender() in order for
this method to be called.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(net.minecraft.world.IBlockAccess w,
net.minecraft.util.math.BlockPos pos,
net.minecraft.util.math.BlockPos neighbor)
int isProvidingStrongPower()
int isProvidingWeakPower()
void writeToStream(io.netty.buffer.ByteBuf data)
throws java.io.IOException
data - to be written datajava.io.IOExceptionboolean readFromStream(io.netty.buffer.ByteBuf data)
throws java.io.IOException
data - to be read datajava.io.IOExceptionIGridNode getGridNode()
void onEntityCollision(net.minecraft.entity.Entity entity)
entity - colliding entityvoid removeFromWorld()
void addToWorld()
IGridNode getExternalFacingNode()
void setPartHostInfo(AEPartLocation 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.EnumHand hand,
net.minecraft.util.math.Vec3d pos)
player - right clicking playerhand - hand usedpos - position of blockboolean onShiftActivate(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.util.EnumHand hand,
net.minecraft.util.math.Vec3d pos)
player - shift right clicking playerhand - hand usedpos - position of blockdefault boolean onClicked(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.util.EnumHand hand,
net.minecraft.util.math.Vec3d pos)
player - left clicking playerhand - hand usedpos - position of blockdefault boolean onShiftClicked(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.util.EnumHand hand,
net.minecraft.util.math.Vec3d pos)
player - shift-left clicking playerhand - hand usedpos - position of blockvoid getDrops(java.util.List<net.minecraft.item.ItemStack> drops,
boolean wrenched)
drops - item drops if wrenchedwrenched - control flag for wrenched vs brokenfloat getCableConnectionLength(AECableType cable)
getCableConnectionLength in interface ICustomCableConnectionvoid randomDisplayTick(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
java.util.Random r)
world - world of blockpos - location of blockr - randomvoid onPlacement(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.util.EnumHand hand,
net.minecraft.item.ItemStack held,
AEPartLocation side)
player - placing playerheld - held itemside - placing sideboolean canBePlacedOn(BusSupport what)
what - placed part@Nonnull default IPartModel getStaticModels()
dark variant color of the cable that this part is attached to.color of the cable that this part is attached to.bright variant color of the cable that this part is attached to.color and its
bright variant.IPartModels API before use.default boolean hasCapability(net.minecraftforge.common.capabilities.Capability<?> capabilityClass)
TileEntity.hasCapability(Capability, EnumFacing)default <T> T getCapability(net.minecraftforge.common.capabilities.Capability<T> capabilityClass)
TileEntity.getCapability(Capability, EnumFacing)default java.lang.Long getRenderFlag()