Class ItemSocket<T>

java.lang.Object
net.ixdarklord.coolcatcanvas.api.client.armature.render.ItemSocket<T>

public final class ItemSocket<T> extends Object
An item shown at a point of an armature-driven mob: a held sword, a hat, a lantern on a belt. The stack is asked for each frame, so it follows the entity's equipment.
renderer.socket(new ItemSocket<Golem>("back", golem -> golem.getCarriedItem(), ItemDisplayContext.FIXED)
        .offset(0, 2, 1).rotate(0, 180, 0).scale(0.75F));
  • Constructor Details

    • ItemSocket

      public ItemSocket(String point, Function<T, net.minecraft.world.item.ItemStack> stack, net.minecraft.world.item.ItemDisplayContext display)
  • Method Details

    • held

      public ItemSocket<T> held()
      Holds it as a vanilla hand does, for a point at the hand of an arm hanging down at rest.
    • offset

      public ItemSocket<T> offset(float x, float y, float z)
      Moves it from the point, in pixels along the point's own axes.
    • rotate

      public ItemSocket<T> rotate(float x, float y, float z)
      Turns it at the point, in degrees.
    • scale

      public ItemSocket<T> scale(float scale)
    • point

      public String point()
    • stack

      public Function<T, net.minecraft.world.item.ItemStack> stack()
    • display

      public net.minecraft.world.item.ItemDisplayContext display()