Can't import net.minecraft.client.renderer.GlStatemanager

Started by AlexTron on

Topic category: Advanced modding

Last seen on 13:58, 16. Aug 2021
Joined Sep 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can't import net.minecraft.client.renderer.GlStatemanager

I was writing some render code for a custom mod that used the GlStateManager class for rotation and translation:

public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch,
				float scale) {
			GlStateManager.pushMatrix();
			GlStateManager.scaled(2.0F, 2.0F, 2.0F);
			GlStateManager.translated(0.0F, -0.5F, 0.0F);
			GlStateManager.rotate(limbSwingAmount, 0.0F, 1.0F, 0.0F);
			GlStateManager.translated(0.0F, 0.8F + ageInTicks, 0.0F);
			GlStateManager.rotate(60.0F, 0.7071F, 0.0F, 0.7071F);
			this.glass.render(scale);
			float f = 0.875F;
			GlStateManager.scaled(0.875F, 0.875F, 0.875F);
			GlStateManager.rotate(60.0F, 0.7071F, 0.0F, 0.7071F);
			GlStateManager.rotate(limbSwingAmount, 0.0F, 1.0F, 0.0F);
			this.glass.render(scale);
			GlStateManager.scaled(0.875F, 0.875F, 0.875F);
			GlStateManager.rotate(60.0F, 0.7071F, 0.0F, 0.7071F);
			GlStateManager.rotate(limbSwingAmount, 0.0F, 1.0F, 0.0F);
			this.cube.render(scale);
			GlStateManager.popMatrix();
		}

However, I have had errors importing net.minecraft.client.renderer.GlStateManager

 

I looked at the decompiled classes in the file viewer and noticed that the GlStateManager class is not listed. 

 

Is there any way to use this class in my code?

Use 1.14.4 models for 1.14.4…
Thu, 05/14/2020 - 19:38

Use 1.14.4 models for 1.14.4 and 1.15.2 models for 1.15.2. 

Blockbench: File -> Project

Last seen on 13:58, 16. Aug 2021
Joined Sep 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
That is a copy of the ender…
Thu, 05/14/2020 - 22:29

That is a copy of the ender crystal render code, and as such I don't see another way to make it rotate every tick by a controlled amount.

Last seen on 13:58, 16. Aug 2021
Joined Sep 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I shall look into other ways…
Thu, 05/14/2020 - 22:31

I shall look into other ways to make this model. Thanks.