Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
Drive form rendering, aka no render player api
Browse files Browse the repository at this point in the history
  • Loading branch information
Wehavecookies56 committed May 22, 2016
1 parent ead0738 commit e780127
Show file tree
Hide file tree
Showing 21 changed files with 110 additions and 188 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
package uk.co.wehavecookies56.kk.client.core.handler;

import java.util.Random;

import net.minecraft.client.audio.PositionedSound;
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.RenderPlayerEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import uk.co.wehavecookies56.kk.client.render.LayerRendererDrive;
import uk.co.wehavecookies56.kk.common.lib.Reference;

import java.util.Random;

public class ClientEventHandler {
Random rand = new Random();
PositionedSound posSound;
Expand Down Expand Up @@ -424,4 +428,15 @@ public static int randomWithRange (int min, int max) {
int range = Math.abs(max - min) + 1;
return (int) (Math.random() * range) + (min <= max ? min : max);
}

static boolean hasLayer = false;

@SubscribeEvent
public void playerRender(RenderPlayerEvent.Pre event) {
LayerRenderer layerDrive = new LayerRendererDrive(event.getRenderer());
if(!hasLayer) {
event.getRenderer().addLayer(layerDrive);
hasLayer = true;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public void onRenderOverlayPost (RenderGameOverlayEvent event) {
GL11.glColor4f(100.0F, 1.0F, 1.0F, 1.0F);

if (DS.getActiveDriveName().equals(Strings.Form_Valor)) {
ResourceLocation texture = new ResourceLocation(Reference.MODID, "textures/armour/Valor_A.png");
ResourceLocation texture = new ResourceLocation(Reference.MODID, "textures/armour/Valor.png");
mc.renderEngine.bindTexture(texture);

GL11.glPushMatrix();
Expand All @@ -190,7 +190,7 @@ public void onRenderOverlayPost (RenderGameOverlayEvent event) {
GL11.glScalef(2, 1, 1);
GL11.glScalef(0.5f, 0.5f, 0.5f);
GL11.glScalef(scale, scale, scale);
this.drawTexturedModalRect(0, 0, 80, 160, 32, 80);
this.drawTexturedModalRect(0, 0, 80, 140, 32, 80);
}
GL11.glPopMatrix();

Expand All @@ -200,7 +200,7 @@ public void onRenderOverlayPost (RenderGameOverlayEvent event) {
GL11.glScalef(2, 1, 1);
GL11.glScalef(0.5f, 0.5f, 0.5f);
GL11.glScalef(scale, scale, scale);
this.drawTexturedModalRect(0, 0, 64, 160, 16, 80);
this.drawTexturedModalRect(0, 0, 64, 140, 16, 80);
}
GL11.glPopMatrix();

Expand All @@ -210,12 +210,12 @@ public void onRenderOverlayPost (RenderGameOverlayEvent event) {
GL11.glScalef(2, 1, 1);
GL11.glScalef(0.5f, 0.5f, 0.5f);
GL11.glScalef(scale, scale, scale);
this.drawTexturedModalRect(0, 0, 112, 160, 16, 80);
this.drawTexturedModalRect(0, 0, 112, 140, 16, 80);
}
GL11.glPopMatrix();

} else if (DS.getActiveDriveName().equals(Strings.Form_Wisdom)) {
ResourceLocation texture = new ResourceLocation(Reference.MODID, "textures/armour/Wisdom_A.png");
ResourceLocation texture = new ResourceLocation(Reference.MODID, "textures/armour/Wisdom.png");
mc.renderEngine.bindTexture(texture);

GL11.glPushMatrix();
Expand All @@ -224,7 +224,7 @@ public void onRenderOverlayPost (RenderGameOverlayEvent event) {
GL11.glScalef(2, 1, 1);
GL11.glScalef(0.5f, 0.5f, 0.5f);
GL11.glScalef(scale, scale, scale);
this.drawTexturedModalRect(0, 0, 80, 160, 32, 80);
this.drawTexturedModalRect(0, 0, 80, 140, 32, 80);
}
GL11.glPopMatrix();

Expand All @@ -234,7 +234,7 @@ public void onRenderOverlayPost (RenderGameOverlayEvent event) {
GL11.glScalef(2, 1, 1);
GL11.glScalef(0.5f, 0.5f, 0.5f);
GL11.glScalef(scale, scale, scale);
this.drawTexturedModalRect(0, 0, 64, 160, 16, 80);
this.drawTexturedModalRect(0, 0, 64, 140, 16, 80);
}
GL11.glPopMatrix();

Expand All @@ -244,11 +244,11 @@ public void onRenderOverlayPost (RenderGameOverlayEvent event) {
GL11.glScalef(2, 1, 1);
GL11.glScalef(0.5f, 0.5f, 0.5f);
GL11.glScalef(scale, scale, scale);
this.drawTexturedModalRect(0, 0, 112, 160, 16, 80);
this.drawTexturedModalRect(0, 0, 112, 140, 16, 80);
}
GL11.glPopMatrix();
} else if (DS.getActiveDriveName().equals(Strings.Form_Limit)) {
ResourceLocation texture = new ResourceLocation(Reference.MODID, "textures/armour/Limit_A.png");
ResourceLocation texture = new ResourceLocation(Reference.MODID, "textures/armour/Limit.png");
mc.renderEngine.bindTexture(texture);

GL11.glPushMatrix();
Expand All @@ -257,7 +257,7 @@ public void onRenderOverlayPost (RenderGameOverlayEvent event) {
GL11.glScalef(2, 1, 1);
GL11.glScalef(0.5f, 0.5f, 0.5f);
GL11.glScalef(scale, scale, scale);
this.drawTexturedModalRect(0, 0, 80, 160, 32, 80);
this.drawTexturedModalRect(0, 0, 80, 140, 32, 80);
}
GL11.glPopMatrix();

Expand All @@ -267,7 +267,7 @@ public void onRenderOverlayPost (RenderGameOverlayEvent event) {
GL11.glScalef(2, 1, 1);
GL11.glScalef(0.5f, 0.5f, 0.5f);
GL11.glScalef(scale, scale, scale);
this.drawTexturedModalRect(0, 0, 64, 160, 16, 80);
this.drawTexturedModalRect(0, 0, 64, 140, 16, 80);
}
GL11.glPopMatrix();

Expand All @@ -277,11 +277,11 @@ public void onRenderOverlayPost (RenderGameOverlayEvent event) {
GL11.glScalef(2, 1, 1);
GL11.glScalef(0.5f, 0.5f, 0.5f);
GL11.glScalef(scale, scale, scale);
this.drawTexturedModalRect(0, 0, 112, 160, 16, 80);
this.drawTexturedModalRect(0, 0, 112, 140, 16, 80);
}
GL11.glPopMatrix();
} else if (DS.getActiveDriveName().equals(Strings.Form_Master)) {
ResourceLocation texture = new ResourceLocation(Reference.MODID, "textures/armour/Master_A.png");
ResourceLocation texture = new ResourceLocation(Reference.MODID, "textures/armour/Master.png");
mc.renderEngine.bindTexture(texture);

GL11.glPushMatrix();
Expand All @@ -290,7 +290,7 @@ public void onRenderOverlayPost (RenderGameOverlayEvent event) {
GL11.glScalef(2, 1, 1);
GL11.glScalef(0.5f, 0.5f, 0.5f);
GL11.glScalef(scale, scale, scale);
this.drawTexturedModalRect(0, 0, 80, 160, 32, 80);
this.drawTexturedModalRect(0, 0, 80, 140, 32, 80);
}
GL11.glPopMatrix();

Expand All @@ -300,7 +300,7 @@ public void onRenderOverlayPost (RenderGameOverlayEvent event) {
GL11.glScalef(2, 1, 1);
GL11.glScalef(0.5f, 0.5f, 0.5f);
GL11.glScalef(scale, scale, scale);
this.drawTexturedModalRect(0, 0, 64, 160, 16, 80);
this.drawTexturedModalRect(0, 0, 64, 140, 16, 80);
}
GL11.glPopMatrix();

Expand All @@ -310,11 +310,11 @@ public void onRenderOverlayPost (RenderGameOverlayEvent event) {
GL11.glScalef(2, 1, 1);
GL11.glScalef(0.5f, 0.5f, 0.5f);
GL11.glScalef(scale, scale, scale);
this.drawTexturedModalRect(0, 0, 112, 160, 16, 80);
this.drawTexturedModalRect(0, 0, 112, 140, 16, 80);
}
GL11.glPopMatrix();
} else if (DS.getActiveDriveName().equals(Strings.Form_Final)) {
ResourceLocation texture = new ResourceLocation(Reference.MODID, "textures/armour/Final_A.png");
ResourceLocation texture = new ResourceLocation(Reference.MODID, "textures/armour/Final.png");
mc.renderEngine.bindTexture(texture);

GL11.glPushMatrix();
Expand All @@ -323,7 +323,7 @@ public void onRenderOverlayPost (RenderGameOverlayEvent event) {
GL11.glScalef(2, 1, 1);
GL11.glScalef(0.5f, 0.5f, 0.5f);
GL11.glScalef(scale, scale, scale);
this.drawTexturedModalRect(0, 0, 80, 160, 32, 80);
this.drawTexturedModalRect(0, 0, 80, 140, 32, 80);
}
GL11.glPopMatrix();

Expand All @@ -333,7 +333,7 @@ public void onRenderOverlayPost (RenderGameOverlayEvent event) {
GL11.glScalef(2, 1, 1);
GL11.glScalef(0.5f, 0.5f, 0.5f);
GL11.glScalef(scale, scale, scale);
this.drawTexturedModalRect(0, 0, 64, 160, 16, 80);
this.drawTexturedModalRect(0, 0, 64, 140, 16, 80);
}
GL11.glPopMatrix();

Expand All @@ -343,7 +343,7 @@ public void onRenderOverlayPost (RenderGameOverlayEvent event) {
GL11.glScalef(2, 1, 1);
GL11.glScalef(0.5f, 0.5f, 0.5f);
GL11.glScalef(scale, scale, scale);
this.drawTexturedModalRect(0, 0, 112, 160, 16, 80);
this.drawTexturedModalRect(0, 0, 112, 140, 16, 80);
}
GL11.glPopMatrix();
}
Expand Down

This file was deleted.

Loading

0 comments on commit e780127

Please sign in to comment.