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.IRenderCallback
The IRenderCallback interface is the callback used for
onRender(IRenderCallback) |
ModelComponent.IVisibilityProvidermodel, modelIconProvider, renderParameters, resourceLocation, visibilityProvider| Constructor and Description |
|---|
AnimatedModelComponent(java.lang.String modelName)
Instantiates a new
AnimatedModelComponent. |
| Modifier and Type | Method and Description |
|---|---|
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(java.lang.Object block)
Gets the
AnimatedModelComponent associated to the IComponentProvider. |
java.util.Optional<IAnimatedRenderable> |
getRenderable(net.minecraft.util.math.BlockPos pos) |
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 |
onRender(AnimatedModelComponent.IRenderCallback renderCallback)
Register a callback for when a the block is rendered.
|
void |
render(net.minecraft.block.Block block,
MalisisRenderer<? extends net.minecraft.tileentity.TileEntity> renderer)
Only called for BLOCK and ITEM render type
|
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, loadModel, onComponentAdded, setIconProviderclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisClientComponentgetComponent, getDependenciespublic AnimatedModelComponent(java.lang.String modelName)
AnimatedModelComponent.modelName - the model namepublic java.util.Optional<IAnimatedRenderable> getRenderable(net.minecraft.util.math.BlockPos pos)
public void onRender(AnimatedModelComponent.IRenderCallback renderCallback)
renderCallback - the state checkpublic 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<? extends 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(java.lang.Object block)
AnimatedModelComponent associated to the IComponentProvider.block - the block