Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Juggernogking

Members
  • Joined

  • Last visited

  1. yes, that was the problem, thank you very much
  2. public static void renderFirstPerson(RenderHandEvent e) { LocalPlayer player = Minecraft.getInstance().player; if (player != null) { if (player.getMainHandItem().getItem() instanceof Item) { e.setCanceled(true); AimHandler.renderPartialTicks = e.getPartialTicks(); PoseStack mat = e.getPoseStack(); handler.animMan.update(); //Rendering arm mat.pushPose(); int i = e.getHand() == InteractionHand.MAIN_HAND ? 1 : -1; BufferSource impl = MultiBufferSource.immediate(Tesselator.getInstance().getBuilder()); RenderUtils.renderArm(mat, impl, e.getPackedLight(), 0, 1, HumanoidArm.RIGHT); impl.endBatch(); mat.popPose(); //Rendering gun mat.pushPose(); //Translating gun to item position mat.translate((double) ((float) i * 0.56F), (double) (-0.52F + e.getEquipProgress() * -0.6F), (double) -0.72F); //Doing recoil transformations float rec = handler.getRecHandler().getRecoil(e.getItemStack()); //mat.translate(0, 0, Math.sin(Math.PI*rec*0.01f)); //Debug aim //mat.translate(x, y, z); //mat.mulPose(new Quaternion(rx, ry, rz, false)); if(!handler.animMan.model.getTransforms().isEmpty()) { mat.translate( handler.model.getTransform("gun").data[0], handler.model.getTransform("gun").data[1], handler.model.getTransform("gun").data[2]); mat.mulPose(new Quaternion( handler.model.getTransform("gun").data[3], handler.model.getTransform("gun").data[4], handler.model.getTransform("gun").data[5], false)); } mat.translate(0, 0, Mth.lerp(rec, 0, 0.05f)); mat.mulPose(Vector3f.XP.rotation(Mth.lerp(rec, 0, 0.01f))); mat.mulPose(Vector3f.YP.rotation(Mth.lerp(rec, 0, Mth.randomBetween(new Random(), -0.008f, 0.008f)))); mat.mulPose(Vector3f.ZP.rotation(Mth.lerp(rec, 0, Mth.randomBetween(new Random(), -0.008f, 0.008f)))); mat.translate(Mth.lerp(handler.getAimHandler().getProgress(), 0, -0.231f), Mth.lerp(handler.getAimHandler().getProgress(), 0, 0.13f), 0); float sway = 0.3f; MouseTracker.tick(); mat.mulPose(Quaternion.fromXYZDegrees(new Vector3f(MouseTracker.dy*sway, MouseTracker.dx*sway, 0))); BakedModel model = ModelUtils.getModel(player.getMainHandItem().getItem()); model = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(mat, model, TransformType.FIRST_PERSON_RIGHT_HAND, false); mat.translate(-0.5D, -0.5D, -0.5D); VertexConsumer builder = ItemRenderer.getFoilBuffer(e.getMultiBufferSource(), Sheets.translucentItemSheet(), true, player.getMainHandItem().hasFoil()); //ItemRenderer //I have tried each of these methods and they all draw it 2 times //Minecraft.getInstance().getItemInHandRenderer().renderItem(player, player.getMainHandItem(), //TransformType.FIRST_PERSON_RIGHT_HAND, false, mat, e.getMultiBufferSource(), e.getPackedLight()); Minecraft.getInstance().getItemRenderer().renderQuadList(mat, builder, model.getQuads(null, null, null), player.getMainHandItem(), e.getPackedLight(), OverlayTexture.NO_OVERLAY); //Minecraft.getInstance().getItemRenderer().render(player.getMainHandItem() , //TransformType.FIRST_PERSON_RIGHT_HAND, false, mat, //e.getMultiBufferSource(), e.getPackedLight(), //OverlayTexture.NO_OVERLAY, model); //Minecraft.getInstance().getItemRenderer().renderModelLists(model, player.getMainHandItem(), e.getPackedLight(), //OverlayTexture.NO_OVERLAY, mat, builder); mat.popPose(); } } }
  3. Hello, I'm doing a gun mod, I'm canceling the render hand event and making my own rendering system, I can render the hands and everything is fine, but when I try to render the item (gun), it renders 2 times, I have also tried to render only 1 quad and still the problem, another gun and still the problem, another Minecraft vanilla item and still the problem. Here is the code Rendering code BakedModel model = ModelUtils.getModel(player.getMainHandItem().getItem()); model = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(mat, model, TransformType.FIRST_PERSON_RIGHT_HAND, false); mat.translate(-0.5D, -0.5D, -0.5D); VertexConsumer builder = ItemRenderer.getFoilBuffer(e.getMultiBufferSource(), Sheets.translucentItemSheet(), true, player.getMainHandItem().hasFoil()); //ItemRenderer //I have tried each of these methods and they all draw it 2 times Minecraft.getInstance().getItemInHandRenderer().renderItem(player, player.getMainHandItem(), TransformType.FIRST_PERSON_RIGHT_HAND, false, mat, e.getMultiBufferSource(), e.getPackedLight()); Minecraft.getInstance().getItemRenderer().renderQuadList(mat, builder, model.getQuads(null, null, null), player.getMainHandItem(), e.getPackedLight(), OverlayTexture.NO_OVERLAY); Minecraft.getInstance().getItemRenderer().render(player.getMainHandItem() , TransformType.FIRST_PERSON_RIGHT_HAND, false, mat, e.getMultiBufferSource(), e.getPackedLight(), OverlayTexture.NO_OVERLAY, model); Minecraft.getInstance().getItemRenderer().renderModelLists(model, player.getMainHandItem(), e.getPackedLight(), OverlayTexture.NO_OVERLAY, mat, builder); ModelUtils.getModel public static BakedModel getModel(String path) { return Minecraft.getInstance().getModelManager().getModel(new ModelResourceLocation(path, "inventory")); } public static BakedModel getModel(Item path) { return Minecraft.getInstance().getModelManager().getModel(new ModelResourceLocation(path.getRegistryName().toString(), "inventory")); } Here is an image of how it looks Another picture with Minecraft vanilla item
  4. I just wanted to be sure, thank you
  5. Hi, i just want to know if i modify the quads of a IBakedModel in a client, it also will be modified on other clients? Thanks
  6. Hello, sorry for my bad English, I am making a weapon mod and I want them to have animations, I need to modify the transformations of the items, I know how to do it, but that is what I want to know, if I modify the transformations of one item and another player has the same item, is he also changed to his item? This is the way i modify it https://github.com/TheGreyGhost/ItemTransformHelper/tree/master/src/main/java/itemtransformhelper

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.