Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AzureDoom/ec4f8bdf600f1373ccdcdc14e52ac2d8 to your computer and use it in GitHub Desktop.
Save AzureDoom/ec4f8bdf600f1373ccdcdc14e52ac2d8 to your computer and use it in GitHub Desktop.
private static final ItemStack chaingun = new ItemStack(DoomItems.CHAINGUN.get());
private IRenderTypeBuffer rtb;
private ResourceLocation whTexture;
@Override
public void renderEarly(ChaingunnerEntity animatable, MatrixStack stackIn, float ticks,
IRenderTypeBuffer renderTypeBuffer, IVertexBuilder vertexBuilder, int packedLightIn, int packedOverlayIn,
float red, float green, float blue, float partialTicks) {
this.rtb = renderTypeBuffer;
this.whTexture = this.getTextureLocation(animatable);
super.renderEarly(animatable, stackIn, ticks, renderTypeBuffer, vertexBuilder, packedLightIn, packedOverlayIn, red,
green, blue, partialTicks);
}
@Override
public void renderRecursively(GeoBone arg0, MatrixStack arg1, IVertexBuilder arg2, int arg3, int arg4, float arg5,
float arg6, float arg7, float arg8) {
if (arg0.getName().equals("right_hand")) {
arg1.push();
arg1.rotate(Vector3f.XP.rotationDegrees(-140));
arg1.rotate(Vector3f.YP.rotationDegrees(5));
arg1.rotate(Vector3f.ZP.rotationDegrees(15));
arg1.translate(0.05D, -0.8D, 0.5D);
arg1.scale(1.0f, 1.0f, 1.0f);
Minecraft.getInstance().getItemRenderer().renderItem(chaingun, TransformType.THIRD_PERSON_RIGHT_HAND, arg3,
arg4, arg1, this.rtb);
arg1.pop();
arg2 = rtb.getBuffer(RenderType.getEntitySmoothCutout(whTexture));
}
super.renderRecursively(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment