public interface UpgradeRenderer
render(net.minecraft.item.ItemStack, li.cil.oc.api.event.RobotRenderEvent.MountPoint, li.cil.oc.api.internal.Robot, float)
method
is called.
Note that these methods are only ever called on the client side.Modifier and Type | Interface and Description |
---|---|
static class |
UpgradeRenderer.MountPointName
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
computePreferredMountPoint(net.minecraft.item.ItemStack stack,
Robot robot,
java.util.Set<java.lang.String> availableMountPoints)
Returns which mount point this renderer wants to render the specified
upgrade in.
|
void |
render(net.minecraft.item.ItemStack stack,
RobotRenderEvent.MountPoint mountPoint,
Robot robot,
float pt)
Render the specified upgrade on a robot.
|
java.lang.String computePreferredMountPoint(net.minecraft.item.ItemStack stack, Robot robot, java.util.Set<java.lang.String> availableMountPoints)
UpgradeRenderer.MountPointName
, with the two special
values None and Any.
None means that the upgrade should not be rendered at all. This
can be the case when there is no slot remaining that the upgrade may be
rendered in. Returning null is equivalent to returning None.
Any means that the upgrade doesn't really care where it's being
rendered. Mount points not assigned by another upgrade preferring to be
rendered in it will be assigned to such upgrades in the order they are
installed in the robot.
Returning a mount point not in the list of available mount points will
be equivalent to returning None.stack
- the item stack of the upgrade to render.robot
- the robot the upgrade is rendered on.availableMountPoints
- the mount points available for rendering in.void render(net.minecraft.item.ItemStack stack, RobotRenderEvent.MountPoint mountPoint, Robot robot, float pt)
computePreferredMountPoint(net.minecraft.item.ItemStack, li.cil.oc.api.internal.Robot, java.util.Set<java.lang.String>)
, otherwise it will still consume a mount
point.
You usually won't need the robot parameter, but in case you do
need some contextual information, this should provide you with anything
you could need.stack
- the item stack of the upgrade to render.mountPoint
- the mount-point to render the upgrade at.robot
- the robot the upgrade is rendered on.pt
- partial tick time, e.g. for animations.