Why mixins eat memory
Unsolved
Support
-
package net.ccbluex.liquidbounce.injection.forge.mixins.render; import net.ccbluex.liquidbounce.LiquidBounce; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelBox; import net.minecraft.client.model.ModelPlayer; import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.Entity; import net.wxdbie.alos.features.module.modules.render.CustomModel; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.asm.mixin.Shadow; @Mixin(ModelPlayer.class) public class MixinModelPlayer extends ModelBiped { @Shadow public ModelRenderer bipedLeftArmwear; @Shadow public ModelRenderer bipedRightArmwear; @Shadow public ModelRenderer bipedLeftLegwear; @Shadow public ModelRenderer bipedRightLegwear; @Shadow public ModelRenderer bipedBodyWear; /** * @author wxdbie * @reason ALOS */ @Overwrite public void render(Entity p_render_1_, float p_render_2_, float p_render_3_, float p_render_4_, float p_render_5_, float p_render_6_, float p_render_7_) { final CustomModel customModel = (CustomModel) LiquidBounce.moduleManager.getModule(CustomModel.class); GlStateManager.pushMatrix(); if (customModel.getState() && customModel.getModelMode().contains("First")) { ModelRenderer rightLeg = new ModelRenderer(this); rightLeg.setRotationPoint(-2.0f, 14.0f, 0.0f); rightLeg.cubeList.add(new ModelBox(rightLeg, 0, 36, -2.0f, 0.0f, -2.0f, 4, 10, 4, 0.0f, false)); rightLeg.render(p_render_7_); ModelRenderer leftLeg = new ModelRenderer(this); leftLeg.setRotationPoint(2.0f, 14.0f, 0.0f); leftLeg.cubeList.add(new ModelBox(leftLeg, 24, 24, -2.0f, 0.0f, -2.0f, 4, 10, 4, 0.0f, false)); leftLeg.render(p_render_7_); ModelRenderer body = new ModelRenderer(this); body.setRotationPoint(0.0f, 24.0f, 0.0f); this.setRotationAngle(body, 0.2618f, 0.0f, 0.0f); body.cubeList.add(new ModelBox(body, 0, 18, -4.0f, -23.1486f, 0.5266f, 8, 14, 4, 0.0f, false)); body.render(p_render_7_); ModelRenderer rightArm = new ModelRenderer(this); rightArm.setRotationPoint(0.0f, 24.0f, 0.0f); this.setRotationAngle(rightArm, -1.309f, 0.0f, 0.0f); rightArm.cubeList.add(new ModelBox(rightArm, 36, 0, -7.0f, -4.5f, -23.25f, 3, 12, 3, 0.0f, false)); rightArm.cubeList.add(new ModelBox(rightArm, 16, 36, -6.0f, 5.75f, -25.25f, 1, 2, 5, 0.0f, false)); rightArm.cubeList.add(new ModelBox(rightArm, 31, 15, -6.0f, 5.75f, -30.25f, 1, 2, 5, 0.0f, false)); rightArm.cubeList.add(new ModelBox(rightArm, 0, 0, -6.0f, 8.75f, -28.25f, 1, 1, 3, 0.0f, false)); rightArm.cubeList.add(new ModelBox(rightArm, 24, 18, -6.0f, 7.75f, -29.25f, 1, 1, 5, 0.0f, false)); rightArm.render(p_render_7_); ModelRenderer head = new ModelRenderer(this); head.setRotationPoint(0.0f, 1.0f, -3.0f); head.cubeList.add(new ModelBox(head, 0, 0, -5.0f, -9.75f, -5.0f, 10, 10, 8, 0.0f, false)); head.render(p_render_7_); ModelRenderer leftArm = new ModelRenderer(this); leftArm.setRotationPoint(4.0f, 3.0f, -3.0f); leftArm.cubeList.add(new ModelBox(leftArm, 37, 37, 0.0f, -1.75f, -1.5f, 3, 12, 3, 0.0f, false)); leftArm.render(p_render_7_); } else { super.render(p_render_1_, p_render_2_, p_render_3_, p_render_4_, p_render_5_, p_render_6_, p_render_7_); if (this.isChild) { float lvt_8_1_ = 2.0F; GlStateManager.scale(1.0F / lvt_8_1_, 1.0F / lvt_8_1_, 1.0F / lvt_8_1_); GlStateManager.translate(0.0F, 24.0F * p_render_7_, 0.0F); this.bipedLeftLegwear.render(p_render_7_); this.bipedRightLegwear.render(p_render_7_); this.bipedLeftArmwear.render(p_render_7_); this.bipedRightArmwear.render(p_render_7_); this.bipedBodyWear.render(p_render_7_); } else { if (p_render_1_.isSneaking()) { GlStateManager.translate(0.0F, 0.2F, 0.0F); } this.bipedLeftLegwear.render(p_render_7_); this.bipedRightLegwear.render(p_render_7_); this.bipedLeftArmwear.render(p_render_7_); this.bipedRightArmwear.render(p_render_7_); this.bipedBodyWear.render(p_render_7_); } } GlStateManager.popMatrix(); } public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; } }
-
@wxdbie said in Why mixins eat memory:
@Aftery said in Why mixins eat memory:
watch where you allocate memory
?
watch where you allocate memory?