Make the wind generator item spin

This commit is contained in:
pupnewfster authored and Dave Smith committed 2019-03-17 11:27:47 -06:00
1 parent a6ac90e8e0
commit e2fd77fc1c
1 file changed
+9 -1
@@ -12,12 +12,20 @@ import net.minecraftforge.fml.relauncher.SideOnly;
public class RenderWindGeneratorItem {
private static ModelWindGenerator windGenerator = new ModelWindGenerator();
private static int angle = 0;
public static void renderStack() {
GlStateManager.pushMatrix();
GlStateManager.rotate(180F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(180F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(0.0F, 0.4F, 0.0F);
MekanismRenderer.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "WindGenerator.png"));
windGenerator.render(0.016F, 0);
//TODO: Only update angle if the player is not in a blacklisted dimension, one that has no "wind".
//The best way to do this would be to add an event listener for dimension change.
//The event is server side only so we would need to send a packet to clients to tell them if they are
//in a blacklisted dimension or not.
angle = (angle + 2) % 360;
windGenerator.render(0.016F, angle);
GlStateManager.popMatrix();
}
}