public class AnimatedModelComponent extends ModelComponent
AnimatedModelComponent allows animated parts to be rendered for a MalisisBlock without the need for a
TileEntitySpecialRenderer nor even a TileEntity.IAnimationLoader).RenderWorldLastEvent.Animation when loaded are automatically considered animated. The others are considered
static.| Modifier and Type | Class and Description |
|---|---|
class |
AnimatedModelComponent.AMC |
static interface |
AnimatedModelComponent.IStateCheck
The IStateCheck interface is the callback used for
onFirstRender(IStateCheck). |
model, resourceLocation| Constructor and Description |
|---|
AnimatedModelComponent(java.lang.String modelName)
Instantiates a new
AnimatedModelComponent. |
| Modifier and Type | Method and Description |
|---|---|
void |
checkState(net.minecraft.world.IBlockAccess world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.state.IBlockState state)
Triggers the
AnimatedModelComponent.IStateCheck callback. |
AnimatedModelComponent.AMC |
createRenderable(net.minecraft.world.IBlockAccess world,
net.minecraft.util.math.BlockPos pos) |
Timer |
forceStart(net.minecraft.util.math.BlockPos pos,
java.lang.String animation)
Starts the
Timer for the specified animation. |
Timer |
forceStart(net.minecraft.util.math.BlockPos pos,
java.lang.String animation,
Timer timer)
Start the animation with the specified
Timer. |
static AnimatedModelComponent |
get(IComponentProvider block)
Gets the
AnimatedModelComponent associated to the IComponentProvider. |
boolean |
isAnimating(net.minecraft.util.math.BlockPos pos,
java.lang.String animation)
Checks the specified animation is already running.
|
Timer |
link(net.minecraft.util.math.BlockPos pos,
java.lang.String stop,
java.lang.String start)
Links two animations together.
|
void |
onFirstRender(AnimatedModelComponent.IStateCheck stateCheck)
Register a callback for when a the block is first rendered.
|
void |
render(net.minecraft.block.Block block,
MalisisRenderer<net.minecraft.tileentity.TileEntity> renderer) |
Timer |
start(net.minecraft.util.math.BlockPos pos,
java.lang.String animation)
Starts the
Timer for the specified animation. |
Timer |
start(net.minecraft.util.math.BlockPos pos,
java.lang.String animation,
Timer timer)
Start the animation with the specified
Timer. |
Timer |
stop(net.minecraft.util.math.BlockPos pos,
java.lang.String animation)
Stops the animation.
|
getModel, loadModelclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisClientComponentgetComponent, getDependenciespublic AnimatedModelComponent(java.lang.String modelName)
AnimatedModelComponent.modelName - the model namepublic void onFirstRender(AnimatedModelComponent.IStateCheck stateCheck)
stateCheck - the state checkpublic void checkState(net.minecraft.world.IBlockAccess world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.state.IBlockState state)
AnimatedModelComponent.IStateCheck callback.world - the worldpos - the posstate - the statepublic Timer start(net.minecraft.util.math.BlockPos pos, java.lang.String animation)
Timer for the specified animation.pos - the posanimation - the animationpublic Timer start(net.minecraft.util.math.BlockPos pos, java.lang.String animation, Timer timer)
Timer.pos - the posanimation - the animationtimer - the timerpublic Timer forceStart(net.minecraft.util.math.BlockPos pos, java.lang.String animation)
Timer for the specified animation.pos - the posanimation - the animationpublic Timer forceStart(net.minecraft.util.math.BlockPos pos, java.lang.String animation, Timer timer)
Timer.pos - the posanimation - the animationtimer - the timerpublic Timer stop(net.minecraft.util.math.BlockPos pos, java.lang.String animation)
pos - the posanimation - the animationpublic Timer link(net.minecraft.util.math.BlockPos pos, java.lang.String stop, java.lang.String start)
Timer for start will depend on the time spent by the
stop animation.pos - the posstop - the stopstart - the startpublic boolean isAnimating(net.minecraft.util.math.BlockPos pos,
java.lang.String animation)
pos - the posanimation - the animationpublic void render(net.minecraft.block.Block block,
MalisisRenderer<net.minecraft.tileentity.TileEntity> renderer)
render in interface IRenderComponentrender in class ModelComponentpublic AnimatedModelComponent.AMC createRenderable(net.minecraft.world.IBlockAccess world, net.minecraft.util.math.BlockPos pos)
public static AnimatedModelComponent get(IComponentProvider block)
AnimatedModelComponent associated to the IComponentProvider.block - the block