mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-22 20:47:59 +01:00
Make PlaneRenderer extend ModelRenderer
This commit is contained in:
parent
ed8bdbac9a
commit
0ce565233c
1 changed files with 8 additions and 22 deletions
|
@ -1,6 +1,11 @@
|
||||||
package com.brohoof.minelittlepony.renderer;
|
package com.brohoof.minelittlepony.renderer;
|
||||||
|
|
||||||
import static net.minecraft.client.renderer.GlStateManager.*;
|
import static net.minecraft.client.renderer.GlStateManager.callList;
|
||||||
|
import static net.minecraft.client.renderer.GlStateManager.popMatrix;
|
||||||
|
import static net.minecraft.client.renderer.GlStateManager.pushMatrix;
|
||||||
|
import static net.minecraft.client.renderer.GlStateManager.rotate;
|
||||||
|
import static net.minecraft.client.renderer.GlStateManager.translate;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import net.minecraft.client.model.ModelBase;
|
import net.minecraft.client.model.ModelBase;
|
||||||
|
@ -11,7 +16,7 @@ import net.minecraft.client.renderer.GLAllocation;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.WorldRenderer;
|
import net.minecraft.client.renderer.WorldRenderer;
|
||||||
|
|
||||||
public class PlaneRenderer {
|
public class PlaneRenderer extends ModelRenderer {
|
||||||
public float textureWidth;
|
public float textureWidth;
|
||||||
public float textureHeight;
|
public float textureHeight;
|
||||||
private PositionTextureVertex[] corners;
|
private PositionTextureVertex[] corners;
|
||||||
|
@ -33,6 +38,7 @@ public class PlaneRenderer {
|
||||||
public boolean isHidden = false;
|
public boolean isHidden = false;
|
||||||
|
|
||||||
public PlaneRenderer(ModelBase modelbase, int offsetX, int offsetY) {
|
public PlaneRenderer(ModelBase modelbase, int offsetX, int offsetY) {
|
||||||
|
super(modelbase, offsetX, offsetY);
|
||||||
this.textureOffsetX = offsetX;
|
this.textureOffsetX = offsetX;
|
||||||
this.textureOffsetY = offsetY;
|
this.textureOffsetY = offsetY;
|
||||||
this.textureWidth = modelbase.textureWidth;
|
this.textureWidth = modelbase.textureWidth;
|
||||||
|
@ -283,12 +289,6 @@ public class PlaneRenderer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRotationPoint(float f, float f1, float f2) {
|
|
||||||
this.rotationPointX = f;
|
|
||||||
this.rotationPointY = f1;
|
|
||||||
this.rotationPointZ = f2;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void render(float f) {
|
public void render(float f) {
|
||||||
if (!this.isHidden) {
|
if (!this.isHidden) {
|
||||||
if (this.showModel) {
|
if (this.showModel) {
|
||||||
|
@ -397,18 +397,4 @@ public class PlaneRenderer {
|
||||||
this.compiled = true;
|
this.compiled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PlaneRenderer setTextureSize(int i, int j) {
|
|
||||||
this.textureWidth = i;
|
|
||||||
this.textureHeight = j;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setToModel(ModelRenderer modelrenderer) {
|
|
||||||
this.rotationPointX = modelrenderer.rotationPointX;
|
|
||||||
this.rotationPointY = modelrenderer.rotationPointY;
|
|
||||||
this.rotationPointZ = modelrenderer.rotationPointZ;
|
|
||||||
this.rotateAngleX = modelrenderer.rotateAngleX;
|
|
||||||
this.rotateAngleY = modelrenderer.rotateAngleY;
|
|
||||||
this.rotateAngleZ = modelrenderer.rotateAngleZ;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue