Update texture management, singleplayer skins
BIN
resources/skins/01.default_steve.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
resources/skins/02.tennis_steve.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
resources/skins/03.tuxedo_steve.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
resources/skins/04.athlete_steve.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
resources/skins/05.cyclist_steve.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
resources/skins/06.boxer_steve.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
resources/skins/07.prisoner_steve.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
resources/skins/08.scottish_steve.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
resources/skins/09.dev_steve.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
resources/skins/10.herobrine.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
resources/skins/11.slime.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
resources/skins/12.trump.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
resources/skins/13.notch.png
Normal file
After Width: | Height: | Size: 950 B |
BIN
resources/skins/14.creeper.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
resources/skins/15.zombie.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
resources/skins/16.pig.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
resources/skins/17.squid.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
resources/skins/18.mooshroom.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
|
@ -5341,7 +5341,7 @@ public class GL11_1 {
|
|||
}
|
||||
public static final byte[] loadLocalStorage(String key) {
|
||||
try {
|
||||
File f = new File("_eaglercraft_beta."+key+".dat");
|
||||
File f = new File("filesystem/_eaglercraft_beta."+key+".dat");
|
||||
byte[] b = new byte[(int)f.length()];
|
||||
FileInputStream s = new FileInputStream(f);
|
||||
s.read(b);
|
||||
|
@ -5353,7 +5353,7 @@ public class GL11_1 {
|
|||
}
|
||||
public static final void saveLocalStorage(String key, byte[] data) {
|
||||
try {
|
||||
FileOutputStream f = new FileOutputStream(new File("_eaglercraft_beta."+key+".dat"));
|
||||
FileOutputStream f = new FileOutputStream(new File("filesystem/_eaglercraft_beta."+key+".dat"));
|
||||
f.write(data);
|
||||
f.close();
|
||||
} catch (IOException e) {
|
||||
|
|
|
@ -3,16 +3,74 @@ package net.PeytonPlayz585.profile;
|
|||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.src.CompressedStreamTools;
|
||||
import net.minecraft.src.NBTTagCompound;
|
||||
|
||||
public class Profile {
|
||||
|
||||
public static class EaglerProfileSkin {
|
||||
public String name;
|
||||
public byte[] data;
|
||||
public boolean slim;
|
||||
public int glTex;
|
||||
public EaglerProfileSkin(String name, byte[] data, boolean slim, int glTex) {
|
||||
this.name = name;
|
||||
this.data = data;
|
||||
this.slim = slim;
|
||||
this.glTex = glTex;
|
||||
}
|
||||
}
|
||||
|
||||
public static int presetSkinId;
|
||||
public static final int SKIN_DATA_SIZE = 64*32*4;
|
||||
public static ArrayList<EaglerProfileSkin> skins = new ArrayList();
|
||||
|
||||
private static String username = "";
|
||||
|
||||
public static byte[] getSelfSkinPacket() {
|
||||
return new byte[] { (byte)0, (byte)presetSkinId };
|
||||
}
|
||||
|
||||
private static class CachedSkin {
|
||||
|
||||
protected final String username;
|
||||
protected UserPresetSkin skin;
|
||||
protected long age;
|
||||
|
||||
protected CachedSkin(String username, UserPresetSkin skin) {
|
||||
this.username = username;
|
||||
this.skin = skin;
|
||||
this.age = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class UserPresetSkin {
|
||||
|
||||
protected final int skinType;
|
||||
|
||||
protected UserPresetSkin(int skin) {
|
||||
this.skinType = skin;
|
||||
}
|
||||
|
||||
public int getSkin() {
|
||||
return skinType;
|
||||
}
|
||||
|
||||
public int getTexture() {
|
||||
return (skinType >= defaultOptionsTextures.length || skinType < 0) ? -1 : defaultOptionsTextures[skinType].getTexturePointer();
|
||||
}
|
||||
|
||||
public void free() {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static String getName() {
|
||||
return username;
|
||||
}
|
||||
|
@ -25,6 +83,33 @@ public class Profile {
|
|||
}
|
||||
}
|
||||
|
||||
public static void loadSkins() {
|
||||
readSkinData(GL11.EaglerAdapterImpl2.loadLocalStorage("SKINS"));
|
||||
}
|
||||
|
||||
public static void readSkinData(byte[] data) {
|
||||
if (data == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
NBTTagCompound profile;
|
||||
try {
|
||||
profile = CompressedStreamTools.func_1138_a(new ByteArrayInputStream(data));
|
||||
}catch(IOException ex) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (profile == null || profile.hasNoTags()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(!profile.hasKey("skin")) {
|
||||
return;
|
||||
}
|
||||
|
||||
presetSkinId = profile.getInteger("skin");
|
||||
}
|
||||
|
||||
public static void read() {
|
||||
read(GL11.EaglerAdapterImpl2.loadLocalStorage("P"));
|
||||
}
|
||||
|
@ -71,8 +156,49 @@ public class Profile {
|
|||
}
|
||||
}
|
||||
|
||||
static {
|
||||
read();
|
||||
private static byte[] writeSkin() {
|
||||
NBTTagCompound profile = new NBTTagCompound();
|
||||
profile.setInteger("skin", presetSkinId);
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
try {
|
||||
CompressedStreamTools.writeGzippedCompoundToOutputStream(profile, baos);
|
||||
} catch (IOException e) {
|
||||
return null;
|
||||
}
|
||||
return baos.toByteArray();
|
||||
}
|
||||
|
||||
public static void saveSkin() {
|
||||
byte[] b = writeSkin();
|
||||
if(b != null) {
|
||||
GL11.EaglerAdapterImpl2.saveLocalStorage("SKINS", b);
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
read();
|
||||
loadSkins();
|
||||
}
|
||||
|
||||
public static final TextureLocation[] defaultOptionsTextures = new TextureLocation[] {
|
||||
new TextureLocation("/skins/01.default_steve.png"),
|
||||
new TextureLocation("/skins/02.tennis_steve.png"),
|
||||
new TextureLocation("/skins/03.tuxedo_steve.png"),
|
||||
new TextureLocation("/skins/04.athlete_steve.png"),
|
||||
new TextureLocation("/skins/05.cyclist_steve.png"),
|
||||
new TextureLocation("/skins/06.boxer_steve.png"),
|
||||
new TextureLocation("/skins/07.prisoner_steve.png"),
|
||||
new TextureLocation("/skins/08.scottish_steve.png"),
|
||||
new TextureLocation("/skins/09.dev_steve.png"),
|
||||
new TextureLocation("/skins/10.herobrine.png"),
|
||||
new TextureLocation("/skins/11.slime.png"),
|
||||
new TextureLocation("/skins/12.trump.png"),
|
||||
new TextureLocation("/skins/13.notch.png"),
|
||||
new TextureLocation("/skins/14.creeper.png"),
|
||||
new TextureLocation("/skins/15.zombie.png"),
|
||||
new TextureLocation("/skins/16.pig.png"),
|
||||
new TextureLocation("/skins/17.squid.png"),
|
||||
new TextureLocation("/skins/18.mooshroom.png")
|
||||
};
|
||||
|
||||
}
|
|
@ -22,7 +22,7 @@ public class TextureLocation {
|
|||
}
|
||||
}
|
||||
|
||||
public void bindTexture() {
|
||||
public int getTexturePointer() {
|
||||
RenderEngine r = Minecraft.getMinecraft().renderEngine;
|
||||
if (glObject == -1) {
|
||||
glObject = r.getTexture(path);
|
||||
|
@ -30,7 +30,15 @@ public class TextureLocation {
|
|||
System.err.println("could not load: " + path);
|
||||
}
|
||||
}
|
||||
r.bindTexture(glObject);
|
||||
return glObject;
|
||||
}
|
||||
|
||||
public void bindTexture() {
|
||||
RenderEngine r = Minecraft.getMinecraft().renderEngine;
|
||||
int i = getTexturePointer();
|
||||
if(i != -1) {
|
||||
r.bindTexture(i);
|
||||
}
|
||||
}
|
||||
|
||||
private static final ArrayList<TextureLocation> locations = new ArrayList();
|
||||
|
|
317
src/main/java/net/lax1dude/eaglercraft/GuiScreenEditProfile.java
Normal file
|
@ -0,0 +1,317 @@
|
|||
package net.lax1dude.eaglercraft;
|
||||
|
||||
import net.PeytonPlayz585.input.Keyboard;
|
||||
import net.PeytonPlayz585.input.Mouse;
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.profile.Profile;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.src.GuiButton;
|
||||
import net.minecraft.src.GuiScreen;
|
||||
import net.minecraft.src.ModelBiped;
|
||||
import net.minecraft.src.RenderHelper;
|
||||
import net.minecraft.src.StringTranslate;
|
||||
|
||||
public class GuiScreenEditProfile extends GuiScreen {
|
||||
|
||||
private GuiScreen parent;
|
||||
|
||||
private boolean dropDownOpen = false;
|
||||
private String[] dropDownOptions;
|
||||
private int slotsVisible = 0;
|
||||
private int selectedSlot = 0;
|
||||
private int scrollPos = -1;
|
||||
private int skinsHeight = 0;
|
||||
private boolean dragging = false;
|
||||
private int mousex = 0;
|
||||
private int mousey = 0;
|
||||
|
||||
private static final TextureLocation gui = new TextureLocation("/gui/gui.png");
|
||||
|
||||
public static final String[] defaultOptions = new String[] {
|
||||
"Default Steve",
|
||||
"Tennis Steve",
|
||||
"Tuxedo Steve",
|
||||
"Athlete Steve",
|
||||
"Cyclist Steve",
|
||||
"Boxer Steve",
|
||||
"Prisoner Steve",
|
||||
"Scottish Steve",
|
||||
"Developer Steve",
|
||||
"Herobrine",
|
||||
"Slime",
|
||||
"Trump",
|
||||
"Notch",
|
||||
"Creeper",
|
||||
"Zombie",
|
||||
"Pig",
|
||||
"Squid",
|
||||
"Mooshroom"
|
||||
};
|
||||
|
||||
public static final TextureLocation[] defaultOptionsTextures = new TextureLocation[] {
|
||||
new TextureLocation("/skins/01.default_steve.png"),
|
||||
new TextureLocation("/skins/02.tennis_steve.png"),
|
||||
new TextureLocation("/skins/03.tuxedo_steve.png"),
|
||||
new TextureLocation("/skins/04.athlete_steve.png"),
|
||||
new TextureLocation("/skins/05.cyclist_steve.png"),
|
||||
new TextureLocation("/skins/06.boxer_steve.png"),
|
||||
new TextureLocation("/skins/07.prisoner_steve.png"),
|
||||
new TextureLocation("/skins/08.scottish_steve.png"),
|
||||
new TextureLocation("/skins/09.dev_steve.png"),
|
||||
new TextureLocation("/skins/10.herobrine.png"),
|
||||
new TextureLocation("/skins/11.slime.png"),
|
||||
new TextureLocation("/skins/12.trump.png"),
|
||||
new TextureLocation("/skins/13.notch.png"),
|
||||
new TextureLocation("/skins/14.creeper.png"),
|
||||
new TextureLocation("/skins/15.zombie.png"),
|
||||
new TextureLocation("/skins/16.pig.png"),
|
||||
new TextureLocation("/skins/17.squid.png"),
|
||||
new TextureLocation("/skins/18.mooshroom.png")
|
||||
};
|
||||
|
||||
protected String screenTitle = "Edit Profile";
|
||||
|
||||
public GuiScreenEditProfile(GuiScreen parent) {
|
||||
this.parent = parent;
|
||||
this.dropDownOptions = defaultOptions;
|
||||
}
|
||||
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
Keyboard.enableRepeatEvents(true);
|
||||
StringTranslate var1 = StringTranslate.getInstance();
|
||||
selectedSlot = (Profile.presetSkinId + Profile.skins.size());
|
||||
this.controlList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, var1.translateKey("gui.done")));
|
||||
}
|
||||
|
||||
private static ModelBiped playerModel = null;
|
||||
|
||||
public void drawScreen(int mx, int my, float par3) {
|
||||
StringTranslate var1 = StringTranslate.getInstance();
|
||||
this.drawDefaultBackground();
|
||||
this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 15, 16777215);
|
||||
this.drawString(this.fontRenderer, var1.translateKey("Select Skin"), this.width / 2 - 20, this.height / 6 + 40, 10526880);
|
||||
|
||||
mousex = mx;
|
||||
mousey = my;
|
||||
|
||||
int skinX = this.width / 2 - 120;
|
||||
int skinY = this.height / 6 + 8;
|
||||
int skinWidth = 80;
|
||||
int skinHeight = 130;
|
||||
|
||||
drawRect(skinX, skinY, skinX + skinWidth, skinY + skinHeight, -6250336);
|
||||
drawRect(skinX + 1, skinY + 1, skinX + skinWidth - 1, skinY + skinHeight - 1, 0xff000015);
|
||||
|
||||
if(dropDownOpen) {
|
||||
super.drawScreen(0, 0, par3);
|
||||
}else {
|
||||
super.drawScreen(mx, my, par3);
|
||||
}
|
||||
|
||||
skinX = this.width / 2 - 20;
|
||||
skinY = this.height / 6 + 60;
|
||||
skinWidth = 140;
|
||||
skinHeight = 22;
|
||||
|
||||
drawRect(skinX, skinY, skinX + skinWidth, skinY + skinHeight, -6250336);
|
||||
drawRect(skinX + 1, skinY + 1, skinX + skinWidth - 21, skinY + skinHeight - 1, -16777216);
|
||||
drawRect(skinX + skinWidth - 20, skinY + 1, skinX + skinWidth - 1, skinY + skinHeight - 1, -16777216);
|
||||
|
||||
GL11.glColor4f(1f, 1f, 1f, 1f);
|
||||
gui.bindTexture();
|
||||
drawTexturedModalRect(skinX + skinWidth - 18, skinY + 3, 0, 240, 16, 16);
|
||||
|
||||
this.fontRenderer.drawStringWithShadow(dropDownOptions[selectedSlot], skinX + 5, skinY + 7, 14737632);
|
||||
|
||||
skinX = this.width / 2 - 20;
|
||||
skinY = this.height / 6 + 83;
|
||||
skinWidth = 140;
|
||||
skinHeight = (this.height - skinY - 10);
|
||||
slotsVisible = (skinHeight / 10);
|
||||
if(slotsVisible > dropDownOptions.length) slotsVisible = dropDownOptions.length;
|
||||
skinHeight = slotsVisible * 10 + 7;
|
||||
skinsHeight = skinHeight;
|
||||
if(scrollPos == -1) {
|
||||
scrollPos = selectedSlot - 2;
|
||||
}
|
||||
if(scrollPos > (dropDownOptions.length - slotsVisible)) {
|
||||
scrollPos = (dropDownOptions.length - slotsVisible);
|
||||
}
|
||||
if(scrollPos < 0) {
|
||||
scrollPos = 0;
|
||||
}
|
||||
if(dropDownOpen) {
|
||||
drawRect(skinX, skinY, skinX + skinWidth, skinY + skinHeight, -6250336);
|
||||
drawRect(skinX + 1, skinY + 1, skinX + skinWidth - 1, skinY + skinHeight - 1, -16777216);
|
||||
for(int i = 0; i < slotsVisible; i++) {
|
||||
if(i + scrollPos < dropDownOptions.length) {
|
||||
if(selectedSlot == i + scrollPos) {
|
||||
drawRect(skinX + 1, skinY + i*10 + 4, skinX + skinWidth - 1, skinY + i*10 + 14, 0x77ffffff);
|
||||
}else if(mx >= skinX && mx < (skinX + skinWidth - 10) && my >= (skinY + i*10 + 5) && my < (skinY + i*10 + 15)) {
|
||||
drawRect(skinX + 1, skinY + i*10 + 4, skinX + skinWidth - 1, skinY + i*10 + 14, 0x55ffffff);
|
||||
}
|
||||
this.fontRenderer.drawStringWithShadow(dropDownOptions[i + scrollPos], skinX + 5, skinY + 5 + i*10, 14737632);
|
||||
}
|
||||
}
|
||||
int scrollerSize = skinHeight * slotsVisible / dropDownOptions.length;
|
||||
int scrollerPos = skinHeight * scrollPos / dropDownOptions.length;
|
||||
drawRect(skinX + skinWidth - 4, skinY + scrollerPos + 1, skinX + skinWidth - 1, skinY + scrollerPos + scrollerSize, 0xff888888);
|
||||
}
|
||||
|
||||
int xx = this.width / 2 - 80;
|
||||
int yy = this.height / 6 + 130;
|
||||
skinX = this.width / 2 - 120;
|
||||
skinY = this.height / 6 + 8;
|
||||
skinWidth = 80;
|
||||
skinHeight = 130;
|
||||
|
||||
int id = selectedSlot - Profile.skins.size();
|
||||
|
||||
if(id < 0) {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(Profile.skins.get(selectedSlot).glTex);
|
||||
}else {
|
||||
defaultOptionsTextures[id].bindTexture();
|
||||
}
|
||||
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) xx, (float) (yy - 80), 100.0F);
|
||||
GL11.glScalef(50.0f, 50.0f, 50.0f);
|
||||
GL11.glRotatef(180.0f, 1.0f, 0.0f, 0.0f);
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
GL11.glScalef(1.0F, -1.0F, 1.0F);
|
||||
GL11.glTranslatef(0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(((yy - my) * -0.06f), 1.0f, 0.0f, 0.0f);
|
||||
GL11.glRotatef(((xx - mx) * 0.06f), 0.0f, 1.0f, 0.0f);
|
||||
GL11.glTranslatef(0.0F, -1.0F, 0.0F);
|
||||
|
||||
if(playerModel == null) {
|
||||
playerModel = new ModelBiped(0.0f);
|
||||
}
|
||||
|
||||
playerModel.render(0.0f, 0.0f, (float)(System.currentTimeMillis() % 100000) / 50f, ((xx - mx) * 0.06f), ((yy - my) * -0.1f), 0.0625F);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
|
||||
}
|
||||
|
||||
public void handleMouseInput() {
|
||||
super.handleMouseInput();
|
||||
if(dropDownOpen) {
|
||||
int var1 = Mouse.getEventDWheel();
|
||||
if(var1 < 0) {
|
||||
scrollPos += 3;
|
||||
}
|
||||
if(var1 > 0) {
|
||||
scrollPos -= 3;
|
||||
}
|
||||
if(scrollPos < 0) {
|
||||
scrollPos = 0;
|
||||
}
|
||||
if(scrollPos > defaultOptions.length + Profile.skins.size()) {
|
||||
scrollPos = defaultOptions.length + Profile.skins.size();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void save() {
|
||||
Profile.presetSkinId = selectedSlot - Profile.skins.size();
|
||||
Profile.saveSkin();
|
||||
}
|
||||
|
||||
protected void actionPerformed(GuiButton par1GuiButton) {
|
||||
if(!dropDownOpen) {
|
||||
if(par1GuiButton.id == 200) {
|
||||
save();
|
||||
this.mc.displayGuiScreen((GuiScreen) parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void updateScreen() {
|
||||
if(dropDownOpen) {
|
||||
if(Mouse.isButtonDown(0)) {
|
||||
int skinX = this.width / 2 - 20;
|
||||
int skinY = this.height / 6 + 103;
|
||||
int skinWidth = 140;
|
||||
if(mousex >= (skinX + skinWidth - 10) && mousex < (skinX + skinWidth) && mousey >= skinY && mousey < (skinY + skinsHeight)) {
|
||||
dragging = true;
|
||||
}
|
||||
if(dragging) {
|
||||
int scrollerSize = skinsHeight * slotsVisible / dropDownOptions.length;
|
||||
scrollPos = (mousey - skinY - (scrollerSize / 2)) * dropDownOptions.length / skinsHeight;
|
||||
}
|
||||
}else {
|
||||
dragging = false;
|
||||
}
|
||||
}else {
|
||||
dragging = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void onGuiClosed() {
|
||||
Keyboard.enableRepeatEvents(false);
|
||||
}
|
||||
|
||||
|
||||
protected void keyTyped(char par1, int par2) {
|
||||
if(par2 == 200 && selectedSlot > 0) {
|
||||
--selectedSlot;
|
||||
scrollPos = selectedSlot - 2;
|
||||
}
|
||||
if(par2 == 208 && selectedSlot < (dropDownOptions.length - 1)) {
|
||||
++selectedSlot;
|
||||
scrollPos = selectedSlot - 2;
|
||||
}
|
||||
}
|
||||
|
||||
protected void mouseClicked(int par1, int par2, int par3) {
|
||||
super.mouseClicked(par1, par2, par3);
|
||||
|
||||
if (par3 == 0) {
|
||||
int skinX = this.width / 2 + 140 - 40;
|
||||
int skinY = this.height / 6 + 62;
|
||||
|
||||
if(par1 >= skinX && par1 < (skinX + 20) && par2 >= skinY && par2 < (skinY + 22)) {
|
||||
dropDownOpen = !dropDownOpen;
|
||||
}
|
||||
|
||||
skinX = this.width / 2 - 20;
|
||||
skinY = this.height / 6 + 62;
|
||||
int skinWidth = 140;
|
||||
int skinHeight = skinsHeight;
|
||||
|
||||
if(!(par1 >= skinX && par1 < (skinX + skinWidth) && par2 >= skinY && par2 < (skinY + skinHeight + 22))) {
|
||||
dropDownOpen = false;
|
||||
dragging = false;
|
||||
}
|
||||
|
||||
skinY += 21;
|
||||
|
||||
if(dropDownOpen && !dragging) {
|
||||
for(int i = 0; i < slotsVisible; i++) {
|
||||
if(i + scrollPos < dropDownOptions.length) {
|
||||
if(selectedSlot != i + scrollPos) {
|
||||
if(par1 >= skinX && par1 < (skinX + skinWidth - 10) && par2 >= (skinY + i*10 + 5) && par2 < (skinY + i*10 + 15) && selectedSlot != i + scrollPos) {
|
||||
selectedSlot = i + scrollPos;
|
||||
dropDownOpen = false;
|
||||
dragging = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -4,6 +4,8 @@ import net.PeytonPlayz585.input.Keyboard;
|
|||
import net.PeytonPlayz585.input.Mouse;
|
||||
import net.PeytonPlayz585.opengl.Display;
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
import net.lax1dude.eaglercraft.GuiScreenEditProfile;
|
||||
import net.lax1dude.eaglercraft.TextureNewClockFX;
|
||||
import net.lax1dude.eaglercraft.TextureNewCompassFX;
|
||||
import net.minecraft.src.AchievementList;
|
||||
|
@ -130,6 +132,8 @@ public class Minecraft implements Runnable {
|
|||
|
||||
public static int debugFPS;
|
||||
|
||||
private static final TextureLocation terrainTexture = new TextureLocation("/terrain.png");
|
||||
|
||||
public Minecraft() {
|
||||
StatList.func_27360_a();
|
||||
this.tempDisplayHeight = GL11.EaglerAdapterImpl2.getCanvasHeight();
|
||||
|
@ -196,7 +200,7 @@ public class Minecraft implements Runnable {
|
|||
|
||||
GL11.anisotropicPatch(GL11.EaglerAdapterImpl2.glNeedsAnisotropicFix());
|
||||
|
||||
this.displayGuiScreen(new GuiMainMenu());
|
||||
this.displayGuiScreen(new GuiScreenEditProfile(new GuiMainMenu()));
|
||||
}
|
||||
|
||||
private void loadScreen() {
|
||||
|
@ -719,7 +723,7 @@ public class Minecraft implements Runnable {
|
|||
this.playerController.updateController();
|
||||
}
|
||||
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.renderEngine.getTexture("/terrain.png"));
|
||||
terrainTexture.bindTexture();
|
||||
if(!this.isGamePaused) {
|
||||
this.renderEngine.updateDynamicTextures();
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class EffectRenderer {
|
||||
protected World worldObj;
|
||||
|
@ -11,6 +12,10 @@ public class EffectRenderer {
|
|||
private RenderEngine renderer;
|
||||
private Random rand = new Random();
|
||||
|
||||
private static final TextureLocation particlesTexture = new TextureLocation("/particles.png");
|
||||
private static final TextureLocation terrainTexture = new TextureLocation("/terrain.png");
|
||||
private static final TextureLocation itemsTexture = new TextureLocation("/gui/items.png");
|
||||
|
||||
public EffectRenderer(World var1, RenderEngine var2) {
|
||||
if(var1 != null) {
|
||||
this.worldObj = var1;
|
||||
|
@ -58,20 +63,18 @@ public class EffectRenderer {
|
|||
|
||||
for(int var8 = 0; var8 < 3; ++var8) {
|
||||
if(this.fxLayers[var8].size() != 0) {
|
||||
int var9 = 0;
|
||||
if(var8 == 0) {
|
||||
var9 = this.renderer.getTexture("/particles.png");
|
||||
particlesTexture.bindTexture();
|
||||
}
|
||||
|
||||
if(var8 == 1) {
|
||||
var9 = this.renderer.getTexture("/terrain.png");
|
||||
terrainTexture.bindTexture();
|
||||
}
|
||||
|
||||
if(var8 == 2) {
|
||||
var9 = this.renderer.getTexture("/gui/items.png");
|
||||
itemsTexture.bindTexture();
|
||||
}
|
||||
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, var9);
|
||||
Tessellator var10 = Tessellator.instance;
|
||||
var10.startDrawingQuads();
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ public class EntityChicken extends EntityAnimal {
|
|||
|
||||
public EntityChicken(World var1) {
|
||||
super(var1);
|
||||
this.texture = "/mob/chicken.png";
|
||||
this.setSize(0.3F, 0.4F);
|
||||
this.health = 4;
|
||||
this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000;
|
||||
|
|
|
@ -3,7 +3,6 @@ package net.minecraft.src;
|
|||
public class EntityCow extends EntityAnimal {
|
||||
public EntityCow(World var1) {
|
||||
super(var1);
|
||||
this.texture = "/mob/cow.png";
|
||||
this.setSize(0.9F, 1.3F);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ public class EntityCreeper extends EntityMob {
|
|||
|
||||
public EntityCreeper(World var1) {
|
||||
super(var1);
|
||||
this.texture = "/mob/creeper.png";
|
||||
}
|
||||
|
||||
protected void entityInit() {
|
||||
|
|
|
@ -12,7 +12,6 @@ public class EntityGhast extends EntityFlying implements IMob {
|
|||
|
||||
public EntityGhast(World var1) {
|
||||
super(var1);
|
||||
this.texture = "/mob/ghast.png";
|
||||
this.setSize(4.0F, 4.0F);
|
||||
this.isImmuneToFire = true;
|
||||
}
|
||||
|
@ -25,7 +24,6 @@ public class EntityGhast extends EntityFlying implements IMob {
|
|||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
byte var1 = this.dataWatcher.getWatchableObjectByte(16);
|
||||
this.texture = var1 == 1 ? "/mob/ghast_fire.png" : "/mob/ghast.png";
|
||||
}
|
||||
|
||||
protected void updatePlayerActionState() {
|
||||
|
|
|
@ -3,7 +3,6 @@ package net.minecraft.src;
|
|||
public class EntityGiantZombie extends EntityMob {
|
||||
public EntityGiantZombie(World var1) {
|
||||
super(var1);
|
||||
this.texture = "/mob/zombie.png";
|
||||
this.moveSpeed = 0.5F;
|
||||
this.attackStrength = 50;
|
||||
this.health *= 10;
|
||||
|
|
|
@ -13,7 +13,6 @@ public abstract class EntityLiving extends Entity {
|
|||
protected float field_9360_w;
|
||||
protected float field_9359_x;
|
||||
protected boolean field_9358_y = true;
|
||||
protected String texture = "/mob/char.png";
|
||||
protected boolean field_9355_A = true;
|
||||
protected float field_9353_B = 0.0F;
|
||||
protected String field_9351_C = null;
|
||||
|
@ -74,10 +73,6 @@ public abstract class EntityLiving extends Entity {
|
|||
return this.worldObj.rayTraceBlocks(Vec3D.createVector(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ), Vec3D.createVector(var1.posX, var1.posY + (double)var1.getEyeHeight(), var1.posZ)) == null;
|
||||
}
|
||||
|
||||
public String getEntityTexture() {
|
||||
return this.texture;
|
||||
}
|
||||
|
||||
public boolean canBeCollidedWith() {
|
||||
return !this.isDead;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package net.minecraft.src;
|
|||
public class EntityPig extends EntityAnimal {
|
||||
public EntityPig(World var1) {
|
||||
super(var1);
|
||||
this.texture = "/mob/pig.png";
|
||||
this.setSize(0.9F, 0.9F);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ public class EntityPigZombie extends EntityZombie {
|
|||
|
||||
public EntityPigZombie(World var1) {
|
||||
super(var1);
|
||||
this.texture = "/mob/pigzombie.png";
|
||||
this.moveSpeed = 0.5F;
|
||||
this.attackStrength = 5;
|
||||
this.isImmuneToFire = true;
|
||||
|
|
|
@ -48,7 +48,6 @@ public abstract class EntityPlayer extends EntityLiving {
|
|||
this.field_9351_C = "humanoid";
|
||||
this.field_9353_B = 180.0F;
|
||||
this.fireResistance = 20;
|
||||
this.texture = "/mob/char.png";
|
||||
}
|
||||
|
||||
protected void entityInit() {
|
||||
|
|
|
@ -5,7 +5,6 @@ public class EntitySheep extends EntityAnimal {
|
|||
|
||||
public EntitySheep(World var1) {
|
||||
super(var1);
|
||||
this.texture = "/mob/sheep.png";
|
||||
this.setSize(0.9F, 1.3F);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ public class EntitySkeleton extends EntityMob {
|
|||
|
||||
public EntitySkeleton(World var1) {
|
||||
super(var1);
|
||||
this.texture = "/mob/skeleton.png";
|
||||
}
|
||||
|
||||
protected String getLivingSound() {
|
||||
|
|
|
@ -7,7 +7,6 @@ public class EntitySlime extends EntityLiving implements IMob {
|
|||
|
||||
public EntitySlime(World var1) {
|
||||
super(var1);
|
||||
this.texture = "/mob/slime.png";
|
||||
int var2 = 1 << this.rand.nextInt(3);
|
||||
this.yOffset = 0.0F;
|
||||
this.slimeJumpDelay = this.rand.nextInt(20) + 10;
|
||||
|
|
|
@ -3,7 +3,6 @@ package net.minecraft.src;
|
|||
public class EntitySpider extends EntityMob {
|
||||
public EntitySpider(World var1) {
|
||||
super(var1);
|
||||
this.texture = "/mob/spider.png";
|
||||
this.setSize(1.4F, 0.9F);
|
||||
this.moveSpeed = 0.8F;
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ public class EntitySquid extends EntityWaterMob {
|
|||
|
||||
public EntitySquid(World var1) {
|
||||
super(var1);
|
||||
this.texture = "/mob/squid.png";
|
||||
this.setSize(0.95F, 0.95F);
|
||||
this.field_21080_l = 1.0F / (this.rand.nextFloat() + 1.0F) * 0.2F;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ public class EntityWolf extends EntityAnimal {
|
|||
|
||||
public EntityWolf(World var1) {
|
||||
super(var1);
|
||||
this.texture = "/mob/wolf.png";
|
||||
this.setSize(0.8F, 0.8F);
|
||||
this.moveSpeed = 1.1F;
|
||||
this.health = 8;
|
||||
|
|
|
@ -3,7 +3,6 @@ package net.minecraft.src;
|
|||
public class EntityZombie extends EntityMob {
|
||||
public EntityZombie(World var1) {
|
||||
super(var1);
|
||||
this.texture = "/mob/zombie.png";
|
||||
this.moveSpeed = 0.5F;
|
||||
this.attackStrength = 5;
|
||||
}
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public class GuiButton extends Gui {
|
||||
|
||||
private static final TextureLocation buttonsTexture = new TextureLocation("/gui/gui.png");
|
||||
|
||||
protected int width;
|
||||
protected int height;
|
||||
public int xPosition;
|
||||
|
@ -44,7 +48,7 @@ public class GuiButton extends Gui {
|
|||
public void drawButton(Minecraft var1, int var2, int var3) {
|
||||
if(this.enabled2) {
|
||||
FontRenderer var4 = var1.fontRenderer;
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, var1.renderEngine.getTexture("/gui/gui.png"));
|
||||
buttonsTexture.bindTexture();
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
boolean var5 = var2 >= this.xPosition && var3 >= this.yPosition && var2 < this.xPosition + this.width && var3 < this.yPosition + this.height;
|
||||
int var6 = this.getHoverState(var5);
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class GuiChest extends GuiContainer {
|
||||
|
||||
private static final TextureLocation containerTexture = new TextureLocation("/gui/container.png");
|
||||
|
||||
private IInventory upperChestInventory;
|
||||
private IInventory lowerChestInventory;
|
||||
private int inventoryRows = 0;
|
||||
|
@ -24,9 +28,8 @@ public class GuiChest extends GuiContainer {
|
|||
}
|
||||
|
||||
protected void drawGuiContainerBackgroundLayer(float var1) {
|
||||
int var2 = this.mc.renderEngine.getTexture("/gui/container.png");
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.renderEngine.bindTexture(var2);
|
||||
containerTexture.bindTexture();
|
||||
int var3 = (this.width - this.xSize) / 2;
|
||||
int var4 = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(var3, var4, 0, 0, this.xSize, this.inventoryRows * 18 + 17);
|
||||
|
|
|
@ -3,8 +3,12 @@ package net.minecraft.src;
|
|||
import net.PeytonPlayz585.input.Keyboard;
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.opengl.GL12;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public abstract class GuiContainer extends GuiScreen {
|
||||
|
||||
private static final TextureLocation itemTexture = new TextureLocation("/gui/items.png");
|
||||
|
||||
private static RenderItem itemRenderer = new RenderItem();
|
||||
protected int xSize = 176;
|
||||
protected int ySize = 166;
|
||||
|
@ -93,7 +97,7 @@ public abstract class GuiContainer extends GuiScreen {
|
|||
int var5 = var1.getBackgroundIconIndex();
|
||||
if(var5 >= 0) {
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture("/gui/items.png"));
|
||||
itemTexture.bindTexture();
|
||||
this.drawTexturedModalRect(var2, var3, var5 % 16 * 16, var5 / 16 * 16, 16, 16);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
return;
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class GuiCrafting extends GuiContainer {
|
||||
|
||||
private static final TextureLocation containerTexture = new TextureLocation("/gui/crafting.png");
|
||||
|
||||
public GuiCrafting(InventoryPlayer var1, World var2, int var3, int var4, int var5) {
|
||||
super(new ContainerWorkbench(var1, var2, var3, var4, var5));
|
||||
}
|
||||
|
@ -18,9 +22,8 @@ public class GuiCrafting extends GuiContainer {
|
|||
}
|
||||
|
||||
protected void drawGuiContainerBackgroundLayer(float var1) {
|
||||
int var2 = this.mc.renderEngine.getTexture("/gui/crafting.png");
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.renderEngine.bindTexture(var2);
|
||||
containerTexture.bindTexture();
|
||||
int var3 = (this.width - this.xSize) / 2;
|
||||
int var4 = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(var3, var4, 0, 0, this.xSize, this.ySize);
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class GuiDispenser extends GuiContainer {
|
||||
|
||||
private static final TextureLocation containerTexture = new TextureLocation("/gui/trap.png");
|
||||
|
||||
public GuiDispenser(InventoryPlayer var1, TileEntityDispenser var2) {
|
||||
super(new ContainerDispenser(var1, var2));
|
||||
}
|
||||
|
@ -13,9 +17,8 @@ public class GuiDispenser extends GuiContainer {
|
|||
}
|
||||
|
||||
protected void drawGuiContainerBackgroundLayer(float var1) {
|
||||
int var2 = this.mc.renderEngine.getTexture("/gui/trap.png");
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.renderEngine.bindTexture(var2);
|
||||
containerTexture.bindTexture();
|
||||
int var3 = (this.width - this.xSize) / 2;
|
||||
int var4 = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(var3, var4, 0, 0, this.xSize, this.ySize);
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class GuiFurnace extends GuiContainer {
|
||||
|
||||
private static final TextureLocation containerTexture = new TextureLocation("/gui/furnace.png");
|
||||
|
||||
private TileEntityFurnace furnaceInventory;
|
||||
|
||||
public GuiFurnace(InventoryPlayer var1, TileEntityFurnace var2) {
|
||||
|
@ -16,9 +20,8 @@ public class GuiFurnace extends GuiContainer {
|
|||
}
|
||||
|
||||
protected void drawGuiContainerBackgroundLayer(float var1) {
|
||||
int var2 = this.mc.renderEngine.getTexture("/gui/furnace.png");
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.renderEngine.bindTexture(var2);
|
||||
containerTexture.bindTexture();
|
||||
int var3 = (this.width - this.xSize) / 2;
|
||||
int var4 = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(var3, var4, 0, 0, this.xSize, this.ySize);
|
||||
|
|
|
@ -6,6 +6,7 @@ import java.util.List;
|
|||
import net.PeytonPlayz585.awt.Color;
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.opengl.GL12;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public class GuiIngame extends Gui {
|
||||
|
@ -21,6 +22,12 @@ public class GuiIngame extends Gui {
|
|||
public float damageGuiPartialTime;
|
||||
float prevVignetteBrightness = 1.0F;
|
||||
|
||||
private static final TextureLocation guiTexture = new TextureLocation("/gui/gui.png");
|
||||
private static final TextureLocation iconsTexture = new TextureLocation("/gui/icons.png");
|
||||
private static final TextureLocation pumpkinBlur = new TextureLocation("%blur%/misc/pumpkinblur.png");
|
||||
private static final TextureLocation vignette = new TextureLocation("%blur%/misc/vignette.png");
|
||||
private static final TextureLocation terrainTexture = new TextureLocation("/terrain.png");
|
||||
|
||||
public GuiIngame(Minecraft var1) {
|
||||
this.mc = var1;
|
||||
}
|
||||
|
@ -44,12 +51,12 @@ public class GuiIngame extends Gui {
|
|||
}
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/gui.png"));
|
||||
guiTexture.bindTexture();
|
||||
InventoryPlayer var11 = this.mc.thePlayer.inventory;
|
||||
this.zLevel = -90.0F;
|
||||
this.drawTexturedModalRect(var6 / 2 - 91, var7 - 22, 0, 0, 182, 22);
|
||||
this.drawTexturedModalRect(var6 / 2 - 91 - 1 + var11.currentItem * 20, var7 - 22 - 1, 0, 22, 24, 22);
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/icons.png"));
|
||||
iconsTexture.bindTexture();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
boolean var12 = this.mc.thePlayer.heartsLife / 3 % 2 == 1;
|
||||
if(this.mc.thePlayer.heartsLife < 10) {
|
||||
|
@ -257,7 +264,7 @@ public class GuiIngame extends Gui {
|
|||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("%blur%/misc/pumpkinblur.png"));
|
||||
pumpkinBlur.bindTexture();
|
||||
Tessellator var3 = Tessellator.instance;
|
||||
var3.startDrawingQuads();
|
||||
var3.addVertexWithUV(0.0D, (double)var2, -90.0D, 0.0D, 1.0D);
|
||||
|
@ -287,7 +294,7 @@ public class GuiIngame extends Gui {
|
|||
GL11.glDepthMask(false);
|
||||
GL11.glBlendFunc(GL11.GL_ZERO, GL11.GL_ONE_MINUS_SRC_COLOR);
|
||||
GL11.glColor4f(this.prevVignetteBrightness, this.prevVignetteBrightness, this.prevVignetteBrightness, 1.0F);
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("%blur%/misc/vignette.png"));
|
||||
vignette.bindTexture();
|
||||
Tessellator var4 = Tessellator.instance;
|
||||
var4.startDrawingQuads();
|
||||
var4.addVertexWithUV(0.0D, (double)var3, -90.0D, 0.0D, 1.0D);
|
||||
|
@ -313,7 +320,7 @@ public class GuiIngame extends Gui {
|
|||
GL11.glDepthMask(false);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, var1);
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png"));
|
||||
terrainTexture.bindTexture();
|
||||
float var4 = (float)(Block.portal.blockIndexInTexture % 16) / 16.0F;
|
||||
float var5 = (float)(Block.portal.blockIndexInTexture / 16) / 16.0F;
|
||||
float var6 = (float)(Block.portal.blockIndexInTexture % 16 + 1) / 16.0F;
|
||||
|
@ -400,7 +407,7 @@ public class GuiIngame extends Gui {
|
|||
}
|
||||
|
||||
public void renderCrossHairs(int w, int h) {
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/icons.png"));
|
||||
iconsTexture.bindTexture();
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
|
|
|
@ -2,8 +2,12 @@ package net.minecraft.src;
|
|||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.opengl.GL12;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class GuiInventory extends GuiContainer {
|
||||
|
||||
private static final TextureLocation containerTexture = new TextureLocation("/gui/inventory.png");
|
||||
|
||||
private float xSize_lo;
|
||||
private float ySize_lo;
|
||||
|
||||
|
@ -28,9 +32,8 @@ public class GuiInventory extends GuiContainer {
|
|||
}
|
||||
|
||||
protected void drawGuiContainerBackgroundLayer(float var1) {
|
||||
int var2 = this.mc.renderEngine.getTexture("/gui/inventory.png");
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.renderEngine.bindTexture(var2);
|
||||
containerTexture.bindTexture();
|
||||
int var3 = (this.width - this.xSize) / 2;
|
||||
int var4 = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(var3, var4, 0, 0, this.xSize, this.ySize);
|
||||
|
|
|
@ -8,8 +8,12 @@ import java.util.Calendar;
|
|||
import java.util.Date;
|
||||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class GuiMainMenu extends GuiScreen {
|
||||
|
||||
private static final TextureLocation logoTexture = new TextureLocation("/title/mclogo.png");
|
||||
|
||||
private static final Random rand = new Random();
|
||||
private float updateCounter = 0.0F;
|
||||
private String splashText = "missingno";
|
||||
|
@ -83,7 +87,7 @@ public class GuiMainMenu extends GuiScreen {
|
|||
short var5 = 274;
|
||||
int var6 = this.width / 2 - var5 / 2;
|
||||
byte var7 = 30;
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/title/mclogo.png"));
|
||||
logoTexture.bindTexture();
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.drawTexturedModalRect(var6 + 0, var7 + 0, 0, 0, 155, 44);
|
||||
this.drawTexturedModalRect(var6 + 155, var7 + 0, 0, 45, 155, 44);
|
||||
|
|
|
@ -6,6 +6,7 @@ import java.util.List;
|
|||
import net.PeytonPlayz585.input.Keyboard;
|
||||
import net.PeytonPlayz585.input.Mouse;
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public class GuiScreen extends Gui {
|
||||
|
@ -18,6 +19,8 @@ public class GuiScreen extends Gui {
|
|||
public GuiParticle field_25091_h;
|
||||
private GuiButton selectedButton = null;
|
||||
|
||||
private static final TextureLocation backgroundTexture = new TextureLocation("/gui/background.png");
|
||||
|
||||
public void drawScreen(int var1, int var2, float var3) {
|
||||
for(int var4 = 0; var4 < this.controlList.size(); ++var4) {
|
||||
GuiButton var5 = (GuiButton)this.controlList.get(var4);
|
||||
|
@ -137,7 +140,7 @@ public class GuiScreen extends Gui {
|
|||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_FOG);
|
||||
Tessellator var2 = Tessellator.instance;
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/background.png"));
|
||||
backgroundTexture.bindTexture();
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
float var3 = 32.0F;
|
||||
var2.startDrawingQuads();
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||
|
||||
import net.PeytonPlayz585.input.Mouse;
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public abstract class GuiSlot {
|
||||
|
@ -26,6 +27,8 @@ public abstract class GuiSlot {
|
|||
private boolean field_27262_q;
|
||||
private int field_27261_r;
|
||||
|
||||
private static final TextureLocation backgroundTexture = new TextureLocation("/gui/background.png");
|
||||
|
||||
public GuiSlot(Minecraft var1, int var2, int var3, int var4, int var5, int var6) {
|
||||
this.mc = var1;
|
||||
this.width = var2;
|
||||
|
@ -186,7 +189,7 @@ public abstract class GuiSlot {
|
|||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_FOG);
|
||||
Tessellator var16 = Tessellator.instance;
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/background.png"));
|
||||
backgroundTexture.bindTexture();
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
float var17 = 32.0F;
|
||||
var16.startDrawingQuads();
|
||||
|
@ -302,7 +305,7 @@ public abstract class GuiSlot {
|
|||
|
||||
private void overlayBackground(int var1, int var2, int var3, int var4) {
|
||||
Tessellator var5 = Tessellator.instance;
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/background.png"));
|
||||
backgroundTexture.bindTexture();
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
float var6 = 32.0F;
|
||||
var5.startDrawingQuads();
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.awt.image.BufferedImage;
|
||||
|
||||
public class IsoImageBuffer {
|
||||
public BufferedImage field_1348_a;
|
||||
public World worldObj;
|
||||
public int field_1354_c;
|
||||
public int field_1353_d;
|
||||
public boolean field_1352_e = false;
|
||||
public boolean field_1351_f = false;
|
||||
public int field_1350_g = 0;
|
||||
public boolean field_1349_h = false;
|
||||
|
||||
public IsoImageBuffer(World var1, int var2, int var3) {
|
||||
this.worldObj = var1;
|
||||
this.func_889_a(var2, var3);
|
||||
}
|
||||
|
||||
public void func_889_a(int var1, int var2) {
|
||||
this.field_1352_e = false;
|
||||
this.field_1354_c = var1;
|
||||
this.field_1353_d = var2;
|
||||
this.field_1350_g = 0;
|
||||
this.field_1349_h = false;
|
||||
}
|
||||
|
||||
public void func_888_a(World var1, int var2, int var3) {
|
||||
this.worldObj = var1;
|
||||
this.func_889_a(var2, var3);
|
||||
}
|
||||
}
|
|
@ -2,9 +2,15 @@ package net.minecraft.src;
|
|||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.opengl.GL12;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public class ItemRenderer {
|
||||
|
||||
private static final TextureLocation terrainTexture = new TextureLocation("/terrain.png");
|
||||
private static final TextureLocation itemsTextures = new TextureLocation("/gui/items.png");
|
||||
private static final TextureLocation waterTexture = new TextureLocation("/misc/water.png");
|
||||
|
||||
private Minecraft mc;
|
||||
private ItemStack itemToRender = null;
|
||||
private float equippedProgress = 0.0F;
|
||||
|
@ -21,13 +27,13 @@ public class ItemRenderer {
|
|||
public void renderItem(EntityLiving var1, ItemStack var2) {
|
||||
GL11.glPushMatrix();
|
||||
if(var2.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var2.itemID].getRenderType())) {
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png"));
|
||||
terrainTexture.bindTexture();
|
||||
this.renderBlocksInstance.renderBlockOnInventory(Block.blocksList[var2.itemID], var2.getItemDamage(), var1.getEntityBrightness(1.0F));
|
||||
} else {
|
||||
if(var2.itemID < 256) {
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png"));
|
||||
terrainTexture.bindTexture();
|
||||
} else {
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/items.png"));
|
||||
itemsTextures.bindTexture();
|
||||
}
|
||||
|
||||
Tessellator var3 = Tessellator.instance;
|
||||
|
@ -279,8 +285,7 @@ public class ItemRenderer {
|
|||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
int var2;
|
||||
if(this.mc.thePlayer.isBurning()) {
|
||||
var2 = this.mc.renderEngine.getTexture("/terrain.png");
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, var2);
|
||||
terrainTexture.bindTexture();
|
||||
this.renderFireInFirstPerson(var1);
|
||||
}
|
||||
|
||||
|
@ -288,8 +293,7 @@ public class ItemRenderer {
|
|||
var2 = MathHelper.floor_double(this.mc.thePlayer.posX);
|
||||
int var3 = MathHelper.floor_double(this.mc.thePlayer.posY);
|
||||
int var4 = MathHelper.floor_double(this.mc.thePlayer.posZ);
|
||||
int var5 = this.mc.renderEngine.getTexture("/terrain.png");
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, var5);
|
||||
terrainTexture.bindTexture();
|
||||
int var6 = this.mc.theWorld.getBlockId(var2, var3, var4);
|
||||
if(this.mc.theWorld.isBlockNormalCube(var2, var3, var4)) {
|
||||
this.renderInsideOfBlock(var1, Block.blocksList[var6].getBlockTextureFromSide(2));
|
||||
|
@ -313,8 +317,7 @@ public class ItemRenderer {
|
|||
}
|
||||
|
||||
if(this.mc.thePlayer.isInsideOfMaterial(Material.water)) {
|
||||
var2 = this.mc.renderEngine.getTexture("/misc/water.png");
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, var2);
|
||||
waterTexture.bindTexture();
|
||||
this.renderWarpedTextureOverlay(var1);
|
||||
}
|
||||
|
||||
|
|
|
@ -134,10 +134,12 @@ public class NetworkManager {
|
|||
readChunks.add(oldChunkBuffer);
|
||||
}
|
||||
|
||||
if(this.networkSocket.socketOpen()) {
|
||||
byte[] packet;
|
||||
while((packet = this.networkSocket.read()) != null) {
|
||||
readChunks.add(ByteBuffer.wrap(packet));
|
||||
}
|
||||
}
|
||||
|
||||
if(!readChunks.isEmpty()) {
|
||||
int cap = 0;
|
||||
|
@ -186,6 +188,7 @@ public class NetworkManager {
|
|||
}
|
||||
|
||||
private void onNetworkError(Exception var1) {
|
||||
var1.printStackTrace();
|
||||
this.networkShutdown("disconnect.genericReason", new Object[]{"Internal exception: " + var1.toString()});
|
||||
}
|
||||
|
||||
|
@ -198,7 +201,6 @@ public class NetworkManager {
|
|||
|
||||
try {
|
||||
this.networkSocket.close();
|
||||
this.networkSocket = null;
|
||||
} catch (Throwable var4) {
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public abstract class Render {
|
||||
|
||||
private static final TextureLocation terrainTexture = new TextureLocation("/terrain.png");
|
||||
private static final TextureLocation shadowTexture = new TextureLocation("%clamp%/misc/shadow.png");
|
||||
|
||||
protected RenderManager renderManager;
|
||||
private ModelBase modelBase = new ModelBiped();
|
||||
private RenderBlocks renderBlocks = new RenderBlocks();
|
||||
|
@ -11,21 +16,13 @@ public abstract class Render {
|
|||
|
||||
public abstract void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9);
|
||||
|
||||
@Deprecated
|
||||
protected void loadTexture(String var1) {
|
||||
RenderEngine var2 = this.renderManager.renderEngine;
|
||||
var2.bindTexture(var2.getTexture(var1));
|
||||
}
|
||||
|
||||
protected boolean loadDownloadableImageTexture(String var1, String var2) {
|
||||
RenderEngine var3 = this.renderManager.renderEngine;
|
||||
int var4 = var3.getTextureForDownloadableImage(var1, var2);
|
||||
if(var4 >= 0) {
|
||||
var3.bindTexture(var4);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
protected abstract boolean loadDownloadableImageTexture(String s, String s1);
|
||||
|
||||
private void renderEntityOnFire(Entity var1, double var2, double var4, double var6, float var8) {
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
@ -40,7 +37,7 @@ public abstract class Render {
|
|||
GL11.glTranslatef((float)var2, (float)var4, (float)var6);
|
||||
float var16 = var1.width * 1.4F;
|
||||
GL11.glScalef(var16, var16, var16);
|
||||
this.loadTexture("/terrain.png");
|
||||
terrainTexture.bindTexture();
|
||||
Tessellator var17 = Tessellator.instance;
|
||||
float var18 = 0.5F;
|
||||
float var19 = 0.0F;
|
||||
|
@ -92,7 +89,7 @@ public abstract class Render {
|
|||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
RenderEngine var10 = this.renderManager.renderEngine;
|
||||
var10.bindTexture(var10.getTexture("%clamp%/misc/shadow.png"));
|
||||
shadowTexture.bindTexture();
|
||||
World var11 = this.getWorldFromRenderManager();
|
||||
GL11.glDepthMask(false);
|
||||
float var12 = this.shadowSize;
|
||||
|
|
|
@ -2,11 +2,15 @@ package net.minecraft.src;
|
|||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.opengl.GL12;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class RenderArrow extends Render {
|
||||
|
||||
private static final TextureLocation arrowsTexture = new TextureLocation("/item/arrows.png");
|
||||
|
||||
public void renderArrow(EntityArrow var1, double var2, double var4, double var6, float var8, float var9) {
|
||||
if(var1.prevRotationYaw != 0.0F || var1.prevRotationPitch != 0.0F) {
|
||||
this.loadTexture("/item/arrows.png");
|
||||
arrowsTexture.bindTexture();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)var2, (float)var4, (float)var6);
|
||||
GL11.glRotatef(var1.prevRotationYaw + (var1.rotationYaw - var1.prevRotationYaw) * var9 - 90.0F, 0.0F, 1.0F, 0.0F);
|
||||
|
@ -66,4 +70,9 @@ public class RenderArrow extends Render {
|
|||
public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
|
||||
this.renderArrow((EntityArrow)var1, var2, var4, var6, var8, var9);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,17 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class RenderBiped extends RenderLiving {
|
||||
protected ModelBiped modelBipedMain;
|
||||
|
||||
public RenderBiped(ModelBiped var1, float var2) {
|
||||
protected TextureLocation texture;
|
||||
|
||||
public RenderBiped(ModelBiped var1, float var2, String tex) {
|
||||
super(var1, var2);
|
||||
this.modelBipedMain = var1;
|
||||
texture = new TextureLocation(tex);
|
||||
}
|
||||
|
||||
protected void renderEquippedItems(EntityLiving var1, float var2) {
|
||||
|
@ -44,4 +48,10 @@ public class RenderBiped extends RenderLiving {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
texture.bindTexture();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class RenderBoat extends Render {
|
||||
|
||||
private static final TextureLocation terrainTexture = new TextureLocation("/terrain.png");
|
||||
private static final TextureLocation boatTexture = new TextureLocation("/item/boat.png");
|
||||
|
||||
protected ModelBase modelBoat;
|
||||
|
||||
public RenderBoat() {
|
||||
|
@ -24,11 +29,11 @@ public class RenderBoat extends Render {
|
|||
GL11.glRotatef(MathHelper.sin(var10) * var10 * var11 / 10.0F * (float)var1.boatRockDirection, 1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
this.loadTexture("/terrain.png");
|
||||
terrainTexture.bindTexture();
|
||||
float var12 = 12.0F / 16.0F;
|
||||
GL11.glScalef(var12, var12, var12);
|
||||
GL11.glScalef(1.0F / var12, 1.0F / var12, 1.0F / var12);
|
||||
this.loadTexture("/item/boat.png");
|
||||
boatTexture.bindTexture();
|
||||
GL11.glScalef(-1.0F, -1.0F, 1.0F);
|
||||
this.modelBoat.render(0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 1.0F / 16.0F);
|
||||
GL11.glPopMatrix();
|
||||
|
@ -37,4 +42,9 @@ public class RenderBoat extends Render {
|
|||
public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
|
||||
this.func_157_a((EntityBoat)var1, var2, var4, var6, var8, var9);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class RenderChicken extends RenderLiving {
|
||||
public RenderChicken(ModelBase var1, float var2) {
|
||||
super(var1, var2);
|
||||
|
@ -26,4 +28,12 @@ public class RenderChicken extends RenderLiving {
|
|||
public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
|
||||
this.renderChicken((EntityChicken)var1, var2, var4, var6, var8, var9);
|
||||
}
|
||||
|
||||
private static final TextureLocation texture = new TextureLocation("/mob/chicken.png");
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
texture.bindTexture();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class RenderCow extends RenderLiving {
|
||||
public RenderCow(ModelBase var1, float var2) {
|
||||
super(var1, var2);
|
||||
|
@ -16,4 +18,12 @@ public class RenderCow extends RenderLiving {
|
|||
public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
|
||||
this.renderCow((EntityCow)var1, var2, var4, var6, var8, var9);
|
||||
}
|
||||
|
||||
private static final TextureLocation texture = new TextureLocation("/mob/cow.png");
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
texture.bindTexture();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class RenderCreeper extends RenderLiving {
|
||||
private ModelBase field_27008_a = new ModelCreeper(2.0F);
|
||||
|
@ -99,4 +100,12 @@ public class RenderCreeper extends RenderLiving {
|
|||
protected boolean func_27005_b(EntityLiving var1, int var2, float var3) {
|
||||
return this.func_27007_b((EntityCreeper)var1, var2, var3);
|
||||
}
|
||||
|
||||
private static final TextureLocation texture = new TextureLocation("/mob/creeper.png");
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
texture.bindTexture();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,9 @@ import java.util.Map;
|
|||
|
||||
import net.PeytonPlayz585.awt.image.BufferedImage;
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.profile.Profile;
|
||||
import net.lax1dude.eaglercraft.SpriteSheetTexture;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public class RenderEngine {
|
||||
public static boolean useMipmaps = false;
|
||||
|
@ -21,7 +23,6 @@ public class RenderEngine {
|
|||
private HashMap field_28151_c = new HashMap();
|
||||
private HashMap textureNameToImageMap = new HashMap();
|
||||
private IntBuffer singleIntBuffer = GLAllocation.createDirectIntBuffer(1);
|
||||
private ByteBuffer imageData = GLAllocation.createDirectByteBuffer(4194304 * 2); //Large enough (Maybe!?!?)
|
||||
private List textureList = new ArrayList();
|
||||
private GameSettings options;
|
||||
private boolean clampTexture = false;
|
||||
|
@ -29,7 +30,8 @@ public class RenderEngine {
|
|||
private List<SpriteSheetTexture> textureSpriteList = new ArrayList();
|
||||
private TexturePackList texturePack;
|
||||
private BufferedImage missingTextureImage;
|
||||
private IntBuffer imageDataB1 = GLAllocation.createDirectIntBuffer(4194304 * 2); //:> !?!?!?!?
|
||||
private ByteBuffer imageDataB1 = GLAllocation.createDirectByteBuffer(4194304 * 2);
|
||||
private ByteBuffer imageDataB2 = GLAllocation.createDirectByteBuffer(4194304 * 2);
|
||||
private int textureWidth;
|
||||
|
||||
public RenderEngine(TexturePackList var1, GameSettings var2) {
|
||||
|
@ -52,57 +54,6 @@ public class RenderEngine {
|
|||
}
|
||||
}
|
||||
|
||||
public int[] func_28149_a(String var1) {
|
||||
TexturePackBase var2 = this.texturePack.selectedTexturePack;
|
||||
int[] var3 = (int[])this.field_28151_c.get(var1);
|
||||
if(var3 != null) {
|
||||
return var3;
|
||||
} else {
|
||||
try {
|
||||
Object var6 = null;
|
||||
if(var1.startsWith("%clamp%")) {
|
||||
this.clampTexture = true;
|
||||
var3 = this.func_28148_b(this.readTextureImage(var2.getResourceAsStream(var1.substring(7))));
|
||||
this.clampTexture = false;
|
||||
} else if(var1.startsWith("%blur%")) {
|
||||
this.blurTexture = true;
|
||||
var3 = this.func_28148_b(this.readTextureImage(var2.getResourceAsStream(var1.substring(6))));
|
||||
this.blurTexture = false;
|
||||
} else {
|
||||
InputStream var7 = var2.getResourceAsStream(var1);
|
||||
if(var7 == null) {
|
||||
var3 = this.func_28148_b(this.missingTextureImage);
|
||||
} else {
|
||||
var3 = this.func_28148_b(this.readTextureImage(var7));
|
||||
}
|
||||
}
|
||||
|
||||
this.field_28151_c.put(var1, var3);
|
||||
return var3;
|
||||
} catch (IOException var5) {
|
||||
var5.printStackTrace();
|
||||
int[] var4 = this.func_28148_b(this.missingTextureImage);
|
||||
this.field_28151_c.put(var1, var4);
|
||||
return var4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int[] func_28148_b(BufferedImage var1) {
|
||||
int var2 = var1.getWidth();
|
||||
int var3 = var1.getHeight();
|
||||
int[] var4 = new int[var2 * var3];
|
||||
var1.getRGB(0, 0, var2, var3, var4, 0, var2);
|
||||
return var4;
|
||||
}
|
||||
|
||||
private int[] func_28147_a(BufferedImage var1, int[] var2) {
|
||||
int var3 = var1.getWidth();
|
||||
int var4 = var1.getHeight();
|
||||
var1.getRGB(0, 0, var3, var4, var2, 0, var3);
|
||||
return var2;
|
||||
}
|
||||
|
||||
public int getTexture(String var1) {
|
||||
TexturePackBase var2 = this.texturePack.selectedTexturePack;
|
||||
Integer var3 = (Integer)this.textureMap.get(var1);
|
||||
|
@ -122,12 +73,16 @@ public class RenderEngine {
|
|||
this.setupTexture(this.readTextureImage(var2.getResourceAsStream(var1.substring(6))), var6);
|
||||
this.blurTexture = false;
|
||||
} else {
|
||||
if(var1.equals("/terrain.png")) {
|
||||
useMipmaps = true;
|
||||
}
|
||||
InputStream var7 = var2.getResourceAsStream(var1);
|
||||
if(var7 == null) {
|
||||
this.setupTexture(this.missingTextureImage, var6);
|
||||
} else {
|
||||
this.setupTexture(this.readTextureImage(var7), var6);
|
||||
}
|
||||
useMipmaps = false;
|
||||
}
|
||||
|
||||
this.textureMap.put(var1, Integer.valueOf(var6));
|
||||
|
@ -152,88 +107,95 @@ public class RenderEngine {
|
|||
return var2;
|
||||
}
|
||||
|
||||
public int allocateAndSetupTexture(byte[] data, int w, int h) {
|
||||
int i = GL11.glGenTextures();
|
||||
bindTexture(i);
|
||||
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, 10241 /* GL_TEXTURE_MIN_FILTER */, 9729 /* GL_LINEAR */);
|
||||
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, 10240 /* GL_TEXTURE_MAG_FILTER */, 9728 /* GL_NEAREST */);
|
||||
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, 10242 /* GL_TEXTURE_WRAP_S */, 10497 /* GL_REPEAT */);
|
||||
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, 10243 /* GL_TEXTURE_WRAP_T */, 10497 /* GL_REPEAT */);
|
||||
imageDataB1.clear();
|
||||
imageDataB1.put(data);
|
||||
imageDataB1.position(0).limit(data.length);
|
||||
GL11.glTexImage2D(3553 /* GL_TEXTURE_2D */, 0, 6408 /* GL_RGBA */, w, h, 0, 6408 /* GL_RGBA */,
|
||||
5121 /* GL_UNSIGNED_BYTE */, imageDataB1);
|
||||
return i;
|
||||
}
|
||||
|
||||
public void setupTexture(BufferedImage var1, int var2) {
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, var2);
|
||||
bindTexture(var2);
|
||||
if (useMipmaps) {
|
||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST_MIPMAP_LINEAR);
|
||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
|
||||
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, 10241 /* GL_TEXTURE_MIN_FILTER */, GL11.GL_NEAREST_MIPMAP_LINEAR);
|
||||
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, 10240 /* GL_TEXTURE_MAG_FILTER */, GL11.GL_NEAREST /* GL_LINEAR */);
|
||||
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, GL11.GL_TEXTURE_MAX_LEVEL, 4);
|
||||
} else {
|
||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);
|
||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
|
||||
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, 10241 /* GL_TEXTURE_MIN_FILTER */, 9728 /* GL_NEAREST */);
|
||||
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, 10240 /* GL_TEXTURE_MAG_FILTER */, 9728 /* GL_NEAREST */);
|
||||
}
|
||||
|
||||
if(this.blurTexture) {
|
||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
|
||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
|
||||
if (blurTexture) {
|
||||
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, 10241 /* GL_TEXTURE_MIN_FILTER */, 9729 /* GL_LINEAR */);
|
||||
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, 10240 /* GL_TEXTURE_MAG_FILTER */, 9729 /* GL_LINEAR */);
|
||||
}
|
||||
|
||||
if(this.clampTexture) {
|
||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP);
|
||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP);
|
||||
if (clampTexture) {
|
||||
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, 10242 /* GL_TEXTURE_WRAP_S */, 10496 /* GL_CLAMP */);
|
||||
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, 10243 /* GL_TEXTURE_WRAP_T */, 10496 /* GL_CLAMP */);
|
||||
} else {
|
||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT);
|
||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT);
|
||||
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, 10242 /* GL_TEXTURE_WRAP_S */, 10497 /* GL_REPEAT */);
|
||||
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, 10243 /* GL_TEXTURE_WRAP_T */, 10497 /* GL_REPEAT */);
|
||||
}
|
||||
|
||||
int var3 = var1.getWidth();
|
||||
int var4 = var1.getHeight();
|
||||
int[] var5 = new int[var3 * var4];
|
||||
byte[] var6 = new byte[var3 * var4 * 4];
|
||||
var1.getRGB(0, 0, var3, var4, var5, 0, var3);
|
||||
|
||||
int var7;
|
||||
int var8;
|
||||
int var9;
|
||||
int var10;
|
||||
int var11;
|
||||
int var12;
|
||||
int var13;
|
||||
int var14;
|
||||
for(var7 = 0; var7 < var5.length; ++var7) {
|
||||
var8 = var5[var7] >> 24 & 255;
|
||||
var9 = var5[var7] >> 16 & 255;
|
||||
var10 = var5[var7] >> 8 & 255;
|
||||
var11 = var5[var7] & 255;
|
||||
if(this.options != null && this.options.anaglyph) {
|
||||
var12 = (var9 * 30 + var10 * 59 + var11 * 11) / 100;
|
||||
var13 = (var9 * 30 + var10 * 70) / 100;
|
||||
var14 = (var9 * 30 + var11 * 70) / 100;
|
||||
var9 = var12;
|
||||
var10 = var13;
|
||||
var11 = var14;
|
||||
int j = var1.getWidth();
|
||||
int k = var1.getHeight();
|
||||
int ai[] = var1.getData();
|
||||
byte abyte0[] = new byte[j * k * 4];
|
||||
for (int l = 0; l < ai.length; l++) {
|
||||
int j1 = ai[l] >> 24 & 0xff;
|
||||
int l1 = ai[l] >> 16 & 0xff;
|
||||
int j2 = ai[l] >> 8 & 0xff;
|
||||
int l2 = ai[l] >> 0 & 0xff;
|
||||
if (options != null && options.anaglyph) {
|
||||
int j3 = (l1 * 30 + j2 * 59 + l2 * 11) / 100;
|
||||
int l3 = (l1 * 30 + j2 * 70) / 100;
|
||||
int j4 = (l1 * 30 + l2 * 70) / 100;
|
||||
l1 = j3;
|
||||
j2 = l3;
|
||||
l2 = j4;
|
||||
}
|
||||
|
||||
var6[var7 * 4 + 0] = (byte)var9;
|
||||
var6[var7 * 4 + 1] = (byte)var10;
|
||||
var6[var7 * 4 + 2] = (byte)var11;
|
||||
var6[var7 * 4 + 3] = (byte)var8;
|
||||
abyte0[l * 4 + 0] = (byte) l1;
|
||||
abyte0[l * 4 + 1] = (byte) j2;
|
||||
abyte0[l * 4 + 2] = (byte) l2;
|
||||
abyte0[l * 4 + 3] = (byte) j1;
|
||||
}
|
||||
|
||||
this.imageData.clear();
|
||||
this.imageData.put(var6);
|
||||
this.imageData.position(0).limit(var6.length);
|
||||
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, var3, var4, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)this.imageData);
|
||||
imageDataB1.clear();
|
||||
imageDataB1.put(abyte0);
|
||||
imageDataB1.position(0).limit(abyte0.length);
|
||||
GL11.glTexImage2D(3553 /* GL_TEXTURE_2D */, 0, 6408 /* GL_RGBA */, j, k, 0, 6408 /* GL_RGBA */,
|
||||
5121 /* GL_UNSIGNED_BYTE */, imageDataB1);
|
||||
if (useMipmaps) {
|
||||
for(var7 = 1; var7 <= 4; ++var7) {
|
||||
var8 = var3 >> var7 - 1;
|
||||
var9 = var3 >> var7;
|
||||
var10 = var4 >> var7;
|
||||
|
||||
for(var11 = 0; var11 < var9; ++var11) {
|
||||
for(var12 = 0; var12 < var10; ++var12) {
|
||||
var13 = this.imageData.getInt((var11 * 2 + 0 + (var12 * 2 + 0) * var8) * 4);
|
||||
var14 = this.imageData.getInt((var11 * 2 + 1 + (var12 * 2 + 0) * var8) * 4);
|
||||
int var15 = this.imageData.getInt((var11 * 2 + 1 + (var12 * 2 + 1) * var8) * 4);
|
||||
int var16 = this.imageData.getInt((var11 * 2 + 0 + (var12 * 2 + 1) * var8) * 4);
|
||||
int var17 = this.weightedAverageColor(this.weightedAverageColor(var13, var14), this.weightedAverageColor(var15, var16));
|
||||
this.imageData.putInt((var11 + var12 * var9) * 4, var17);
|
||||
}
|
||||
for (int i1 = 1; i1 <= 4; i1++) {
|
||||
int k1 = j >> i1 - 1;
|
||||
int i2 = j >> i1;
|
||||
int k2 = k >> i1;
|
||||
imageDataB2.clear();
|
||||
for (int i3 = 0; i3 < i2; i3++) {
|
||||
for (int k3 = 0; k3 < k2; k3++) {
|
||||
int i4 = imageDataB1.getInt((i3 * 2 + 0 + (k3 * 2 + 0) * k1) * 4);
|
||||
int k4 = imageDataB1.getInt((i3 * 2 + 1 + (k3 * 2 + 0) * k1) * 4);
|
||||
int l4 = imageDataB1.getInt((i3 * 2 + 1 + (k3 * 2 + 1) * k1) * 4);
|
||||
int i5 = imageDataB1.getInt((i3 * 2 + 0 + (k3 * 2 + 1) * k1) * 4);
|
||||
int j5 = averageColor(averageColor(i4, k4), averageColor(l4, i5));
|
||||
imageDataB2.putInt((i3 + k3 * i2) * 4, j5);
|
||||
}
|
||||
|
||||
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, var7, GL11.GL_RGBA, var9, var10, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)this.imageData);
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glTexImage2D(3553 /* GL_TEXTURE_2D */, i1, 6408 /* GL_RGBA */, i2, k2, 0, 6408 /* GL_RGBA */,
|
||||
5121 /* GL_UNSIGNED_BYTE */, imageDataB2);
|
||||
ByteBuffer tmp = imageDataB1;
|
||||
imageDataB1 = imageDataB2;
|
||||
imageDataB2 = tmp;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void func_28150_a(int[] var1, int var2, int var3, int var4) {
|
||||
|
@ -281,69 +243,98 @@ public class RenderEngine {
|
|||
var5[var6 * 4 + 3] = (byte)var7;
|
||||
}
|
||||
|
||||
this.imageData.clear();
|
||||
this.imageData.put(var5);
|
||||
this.imageData.position(0).limit(var5.length);
|
||||
GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, var2, var3, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)this.imageData);
|
||||
this.imageDataB1.clear();
|
||||
this.imageDataB1.put(var5);
|
||||
this.imageDataB1.position(0).limit(var5.length);
|
||||
GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, var2, var3, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)this.imageDataB1);
|
||||
}
|
||||
|
||||
public int[] func_28149_a(String var1) {
|
||||
TexturePackBase var2 = this.texturePack.selectedTexturePack;
|
||||
int[] var3 = (int[])this.field_28151_c.get(var1);
|
||||
if(var3 != null) {
|
||||
return var3;
|
||||
} else {
|
||||
try {
|
||||
Object var6 = null;
|
||||
if(var1.startsWith("%clamp%")) {
|
||||
this.clampTexture = true;
|
||||
var3 = this.func_28148_b(this.readTextureImage(var2.getResourceAsStream(var1.substring(7))));
|
||||
this.clampTexture = false;
|
||||
} else if(var1.startsWith("%blur%")) {
|
||||
this.blurTexture = true;
|
||||
var3 = this.func_28148_b(this.readTextureImage(var2.getResourceAsStream(var1.substring(6))));
|
||||
this.blurTexture = false;
|
||||
} else {
|
||||
InputStream var7 = var2.getResourceAsStream(var1);
|
||||
if(var7 == null) {
|
||||
var3 = this.func_28148_b(this.missingTextureImage);
|
||||
} else {
|
||||
var3 = this.func_28148_b(this.readTextureImage(var7));
|
||||
}
|
||||
}
|
||||
|
||||
this.field_28151_c.put(var1, var3);
|
||||
return var3;
|
||||
} catch (IOException var5) {
|
||||
var5.printStackTrace();
|
||||
int[] var4 = this.func_28148_b(this.missingTextureImage);
|
||||
this.field_28151_c.put(var1, var4);
|
||||
return var4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int[] func_28148_b(BufferedImage var1) {
|
||||
int var2 = var1.getWidth();
|
||||
int var3 = var1.getHeight();
|
||||
int[] var4 = new int[var2 * var3];
|
||||
var1.getRGB(0, 0, var2, var3, var4, 0, var2);
|
||||
return var4;
|
||||
}
|
||||
|
||||
public void deleteTexture(int var1) {
|
||||
this.textureNameToImageMap.remove(Integer.valueOf(var1));
|
||||
this.singleIntBuffer.clear();
|
||||
this.singleIntBuffer.put(var1);
|
||||
this.singleIntBuffer.flip();
|
||||
GL11.glDeleteTextures(var1);
|
||||
}
|
||||
|
||||
public int getTextureForDownloadableImage(String s, String s1) {
|
||||
if(Minecraft.getMinecraft().theWorld.multiplayerWorld) {
|
||||
return getTexture("/mob/char.png");
|
||||
} else {
|
||||
return Profile.defaultOptionsTextures[Profile.presetSkinId].getTexturePointer();
|
||||
}
|
||||
}
|
||||
|
||||
public void registerTextureFX(TextureFX var1) {
|
||||
this.textureList.add(var1);
|
||||
var1.onTick();
|
||||
}
|
||||
|
||||
// public void updateDynamicTextures() {
|
||||
// for (int i = 0; i < textureList.size(); i++) {
|
||||
// TextureFX texturefx = (TextureFX) textureList.get(i);
|
||||
// texturefx.anaglyphEnabled = this.options.anaglyph;
|
||||
// texturefx.onTick();
|
||||
// texturefx.bindImage(this);
|
||||
// int tileSize = 16 * 16 * 4;
|
||||
// imageData.clear();
|
||||
// imageData.put(texturefx.imageData);
|
||||
// imageData.position(0).limit(tileSize);
|
||||
// GL11.glTexSubImage2D(3553, 0, (texturefx.iconIndex % 16) * 16, (texturefx.iconIndex / 16) * 16, 16, 16, 6408, 5121, imageData);
|
||||
// }
|
||||
// }
|
||||
|
||||
public void updateDynamicTextures() {
|
||||
|
||||
for (int i = 0; i < textureList.size(); i++) {
|
||||
TextureFX texturefx = (TextureFX) textureList.get(i);
|
||||
texturefx.anaglyphEnabled = this.options.anaglyph;
|
||||
texturefx.anaglyphEnabled = options.anaglyph;
|
||||
texturefx.onTick();
|
||||
texturefx.bindImage(this);
|
||||
int tileSize = 16 * 16 * 4;
|
||||
imageData.clear();
|
||||
imageData.put(texturefx.imageData);
|
||||
imageData.position(0).limit(tileSize);
|
||||
GL11.glTexSubImage2D(3553, 0, (texturefx.iconIndex % this.textureWidth) * 16, (texturefx.iconIndex / this.textureWidth) * 16, 16, 16, 6408, 5121, imageData);
|
||||
imageDataB1.clear();
|
||||
imageDataB1.put(texturefx.imageData);
|
||||
imageDataB1.position(0).limit(tileSize);
|
||||
GL11.glTexSubImage2D(3553 /* GL_TEXTURE_2D */, 0, (texturefx.iconIndex % this.textureWidth) * 16, (texturefx.iconIndex / this.textureWidth) * 16, 16, 16,
|
||||
6408 /* GL_RGBA */, 5121 /* GL_UNSIGNED_BYTE */, imageDataB1);
|
||||
}
|
||||
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, getTexture("/terrain.png"));
|
||||
TextureFX.terrainTexture.bindTexture();
|
||||
for(int i = 0, l = textureSpriteList.size(); i < l; ++i) {
|
||||
SpriteSheetTexture sp = textureSpriteList.get(i);
|
||||
sp.update();
|
||||
int w = 16;
|
||||
int tileSize = (w * sp.iconTileSize) * (w * sp.iconTileSize) * 4;
|
||||
//for(int j = 0; j < 5; ++j) {
|
||||
imageDataB1.clear();
|
||||
imageDataB1.put(sp.grabFrame(0));
|
||||
imageDataB1.position(0).limit(tileSize);
|
||||
GL11.glTexSubImage2D(3553, 0, (sp.iconIndex % this.textureWidth) * w, (sp.iconIndex / this.textureWidth) * w, w * sp.iconTileSize, w * sp.iconTileSize,
|
||||
6408, 5121, imageDataB1);
|
||||
for(int j = 0; j < 5; ++j) {
|
||||
GL11.glTexSubImage2D(3553 /* GL_TEXTURE_2D */, j, (sp.iconIndex % this.textureWidth) * w, (sp.iconIndex / this.textureWidth) * w, w * sp.iconTileSize, w * sp.iconTileSize,
|
||||
6408 /* GL_RGBA */, 5121 /* GL_UNSIGNED_BYTE */, sp.grabFrame(j));
|
||||
w /= 2;
|
||||
//}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void registerSpriteSheet(String name, int iconIndex, int iconTileSize) {
|
||||
|
@ -356,28 +347,6 @@ public class RenderEngine {
|
|||
return (var3 + var4 >> 1 << 24) + ((var1 & 16711422) + (var2 & 16711422) >> 1);
|
||||
}
|
||||
|
||||
private int weightedAverageColor(int var1, int var2) {
|
||||
int var3 = (var1 & -16777216) >> 24 & 255;
|
||||
int var4 = (var2 & -16777216) >> 24 & 255;
|
||||
short var5 = 255;
|
||||
if(var3 + var4 == 0) {
|
||||
var3 = 1;
|
||||
var4 = 1;
|
||||
var5 = 0;
|
||||
}
|
||||
|
||||
int var6 = (var1 >> 16 & 255) * var3;
|
||||
int var7 = (var1 >> 8 & 255) * var3;
|
||||
int var8 = (var1 & 255) * var3;
|
||||
int var9 = (var2 >> 16 & 255) * var4;
|
||||
int var10 = (var2 >> 8 & 255) * var4;
|
||||
int var11 = (var2 & 255) * var4;
|
||||
int var12 = (var6 + var9) / (var3 + var4);
|
||||
int var13 = (var7 + var10) / (var3 + var4);
|
||||
int var14 = (var8 + var11) / (var3 + var4);
|
||||
return var5 << 24 | var12 << 16 | var13 << 8 | var14;
|
||||
}
|
||||
|
||||
public void refreshTextures() {
|
||||
TexturePackBase var1 = this.texturePack.selectedTexturePack;
|
||||
Iterator var2 = this.textureNameToImageMap.keySet().iterator();
|
||||
|
@ -431,7 +400,8 @@ public class RenderEngine {
|
|||
var4 = this.readTextureImage(var1.getResourceAsStream(var9));
|
||||
}
|
||||
|
||||
this.func_28147_a(var4, (int[])this.field_28151_c.get(var9));
|
||||
int j = ((Integer) textureMap.get(var9)).intValue();
|
||||
setupTexture(var4, j);
|
||||
this.blurTexture = false;
|
||||
this.clampTexture = false;
|
||||
} catch (IOException var6) {
|
||||
|
@ -459,14 +429,12 @@ public class RenderEngine {
|
|||
return GL11.EaglerAdapterImpl2.loadPNG(((ByteArrayInputStream)var1).readAllBytes());
|
||||
}
|
||||
|
||||
public void bindTexture(int var1) {
|
||||
if(var1 >= 0) {
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, var1);
|
||||
public void bindTexture(int i) {
|
||||
if (i < 0) {
|
||||
return;
|
||||
} else {
|
||||
GL11.glBindTexture(3553, i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public int getTextureForDownloadableImage(String skinUrl, String entityTexture) {
|
||||
int i = this.getTexture(entityTexture);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,4 +8,9 @@ public class RenderEntity extends Render {
|
|||
renderOffsetAABB(var1.boundingBox, var2 - var1.lastTickPosX, var4 - var1.lastTickPosY, var6 - var1.lastTickPosZ);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class RenderFallingSand extends Render {
|
||||
private RenderBlocks field_197_d = new RenderBlocks();
|
||||
|
||||
private static final TextureLocation terrainTexture = new TextureLocation("/terrain.png");
|
||||
|
||||
public RenderFallingSand() {
|
||||
this.shadowSize = 0.5F;
|
||||
}
|
||||
|
@ -12,7 +15,7 @@ public class RenderFallingSand extends Render {
|
|||
public void doRenderFallingSand(EntityFallingSand var1, double var2, double var4, double var6, float var8, float var9) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)var2, (float)var4, (float)var6);
|
||||
this.loadTexture("/terrain.png");
|
||||
terrainTexture.bindTexture();
|
||||
Block var10 = Block.blocksList[var1.blockID];
|
||||
World var11 = var1.getWorld();
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
@ -24,4 +27,9 @@ public class RenderFallingSand extends Render {
|
|||
public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
|
||||
this.doRenderFallingSand((EntityFallingSand)var1, var2, var4, var6, var8, var9);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,8 +2,12 @@ package net.minecraft.src;
|
|||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.opengl.GL12;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class RenderFireball extends Render {
|
||||
|
||||
private static final TextureLocation itemsTexture = new TextureLocation("/gui/items.png");
|
||||
|
||||
public void func_4012_a(EntityFireball var1, double var2, double var4, double var6, float var8, float var9) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)var2, (float)var4, (float)var6);
|
||||
|
@ -11,7 +15,7 @@ public class RenderFireball extends Render {
|
|||
float var10 = 2.0F;
|
||||
GL11.glScalef(var10 / 1.0F, var10 / 1.0F, var10 / 1.0F);
|
||||
int var11 = Item.snowball.getIconFromDamage(0);
|
||||
this.loadTexture("/gui/items.png");
|
||||
itemsTexture.bindTexture();
|
||||
Tessellator var12 = Tessellator.instance;
|
||||
float var13 = (float)(var11 % 16 * 16 + 0) / 256.0F;
|
||||
float var14 = (float)(var11 % 16 * 16 + 16) / 256.0F;
|
||||
|
@ -36,4 +40,9 @@ public class RenderFireball extends Render {
|
|||
public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
|
||||
this.func_4012_a((EntityFireball)var1, var2, var4, var6, var8, var9);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,8 +2,12 @@ package net.minecraft.src;
|
|||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.opengl.GL12;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class RenderFish extends Render {
|
||||
|
||||
private static final TextureLocation particlesTexture = new TextureLocation("/particles.png");
|
||||
|
||||
public void func_4011_a(EntityFish var1, double var2, double var4, double var6, float var8, float var9) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)var2, (float)var4, (float)var6);
|
||||
|
@ -11,7 +15,7 @@ public class RenderFish extends Render {
|
|||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
byte var10 = 1;
|
||||
byte var11 = 2;
|
||||
this.loadTexture("/particles.png");
|
||||
particlesTexture.bindTexture();
|
||||
Tessellator var12 = Tessellator.instance;
|
||||
float var13 = (float)(var10 * 8 + 0) / 128.0F;
|
||||
float var14 = (float)(var10 * 8 + 8) / 128.0F;
|
||||
|
@ -81,4 +85,9 @@ public class RenderFish extends Render {
|
|||
public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
|
||||
this.func_4011_a((EntityFish)var1, var2, var4, var6, var8, var9);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,24 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class RenderGhast extends RenderLiving {
|
||||
|
||||
private static final TextureLocation ghastTexture = new TextureLocation("/mob/ghast.png");
|
||||
private static final TextureLocation ghastFireTexture = new TextureLocation("/mob/ghast_fire.png");
|
||||
|
||||
public RenderGhast() {
|
||||
super(new ModelGhast(), 0.5F);
|
||||
}
|
||||
|
||||
protected void func_4014_a(EntityGhast var1, float var2) {
|
||||
float var4 = ((float)var1.prevAttackCounter + (float)(var1.attackCounter - var1.prevAttackCounter) * var2) / 20.0F;
|
||||
if(var4 <= 10) {
|
||||
ghastTexture.bindTexture();
|
||||
}else {
|
||||
ghastFireTexture.bindTexture();
|
||||
}
|
||||
if(var4 < 0.0F) {
|
||||
var4 = 0.0F;
|
||||
}
|
||||
|
@ -23,4 +33,9 @@ public class RenderGhast extends RenderLiving {
|
|||
protected void preRenderCallback(EntityLiving var1, float var2) {
|
||||
this.func_4014_a((EntityGhast)var1, var2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,4 +17,9 @@ public class RenderGiantZombie extends RenderLiving {
|
|||
protected void preRenderCallback(EntityLiving var1, float var2) {
|
||||
this.preRenderScale((EntityGiantZombie)var1, var2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public class RenderGlobal implements IWorldAccess {
|
||||
|
@ -54,6 +55,11 @@ public class RenderGlobal implements IWorldAccess {
|
|||
public float damagePartialTime;
|
||||
int frustrumCheckOffset = 0;
|
||||
|
||||
private static final TextureLocation terrainSun = new TextureLocation("/terrain/sun.png");
|
||||
private static final TextureLocation terrainMoon = new TextureLocation("/terrain/moon.png");
|
||||
private static final TextureLocation cloudsTexture = new TextureLocation("/environment/clouds.png");
|
||||
private static final TextureLocation terrainTexture = new TextureLocation("/terrain.png");
|
||||
|
||||
public RenderGlobal(Minecraft var1, RenderEngine var2) {
|
||||
this.mc = var1;
|
||||
this.renderEngine = var2;
|
||||
|
@ -559,7 +565,7 @@ public class RenderGlobal implements IWorldAccess {
|
|||
GL11.glRotatef(0.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(this.worldObj.getCelestialAngle(var1) * 360.0F, 1.0F, 0.0F, 0.0F);
|
||||
var11 = 30.0F;
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.renderEngine.getTexture("/terrain/sun.png"));
|
||||
terrainSun.bindTexture();
|
||||
var17.startDrawingQuads();
|
||||
var17.addVertexWithUV((double)(-var11), 100.0D, (double)(-var11), 0.0D, 0.0D);
|
||||
var17.addVertexWithUV((double)var11, 100.0D, (double)(-var11), 1.0D, 0.0D);
|
||||
|
@ -567,7 +573,7 @@ public class RenderGlobal implements IWorldAccess {
|
|||
var17.addVertexWithUV((double)(-var11), 100.0D, (double)var11, 0.0D, 1.0D);
|
||||
var17.draw();
|
||||
var11 = 20.0F;
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.renderEngine.getTexture("/terrain/moon.png"));
|
||||
terrainMoon.bindTexture();
|
||||
var17.startDrawingQuads();
|
||||
var17.addVertexWithUV((double)(-var11), -100.0D, (double)var11, 1.0D, 1.0D);
|
||||
var17.addVertexWithUV((double)var11, -100.0D, (double)var11, 0.0D, 1.0D);
|
||||
|
@ -609,7 +615,7 @@ public class RenderGlobal implements IWorldAccess {
|
|||
byte var3 = 32;
|
||||
int var4 = 256 / var3;
|
||||
Tessellator var5 = Tessellator.instance;
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.renderEngine.getTexture("/environment/clouds.png"));
|
||||
cloudsTexture.bindTexture();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
Vec3D var6 = this.worldObj.func_628_d(var1);
|
||||
|
@ -673,7 +679,7 @@ public class RenderGlobal implements IWorldAccess {
|
|||
int var12 = MathHelper.floor_double(var8 / 2048.0D);
|
||||
var6 -= (double)(var11 * 2048);
|
||||
var8 -= (double)(var12 * 2048);
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.renderEngine.getTexture("/environment/clouds.png"));
|
||||
cloudsTexture.bindTexture();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
Vec3D var13 = this.worldObj.func_628_d(var1);
|
||||
|
@ -865,8 +871,7 @@ public class RenderGlobal implements IWorldAccess {
|
|||
if(var3 == 0) {
|
||||
if(this.damagePartialTime > 0.0F) {
|
||||
GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_SRC_COLOR);
|
||||
int var7 = this.renderEngine.getTexture("/terrain.png");
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, var7);
|
||||
terrainTexture.bindTexture();
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.5F);
|
||||
GL11.glPushMatrix();
|
||||
var8 = this.worldObj.getBlockId(var2.blockX, var2.blockY, var2.blockZ);
|
||||
|
@ -899,8 +904,7 @@ public class RenderGlobal implements IWorldAccess {
|
|||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
float var16 = MathHelper.sin((float)System.currentTimeMillis() / 100.0F) * 0.2F + 0.8F;
|
||||
GL11.glColor4f(var16, var16, var16, MathHelper.sin((float)System.currentTimeMillis() / 200.0F) * 0.2F + 0.5F);
|
||||
var8 = this.renderEngine.getTexture("/terrain.png");
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, var8);
|
||||
terrainTexture.bindTexture();
|
||||
int var17 = var2.blockX;
|
||||
int var18 = var2.blockY;
|
||||
int var11 = var2.blockZ;
|
||||
|
|
|
@ -2,12 +2,16 @@ package net.minecraft.src;
|
|||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.opengl.GL12;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class RenderItem extends Render {
|
||||
private RenderBlocks renderBlocks = new RenderBlocks();
|
||||
private Random random = new Random();
|
||||
public boolean field_27004_a = true;
|
||||
|
||||
private static final TextureLocation terrainTexture = new TextureLocation("/terrain.png");
|
||||
private static final TextureLocation itemsTexture = new TextureLocation("/gui/items.png");
|
||||
|
||||
public RenderItem() {
|
||||
this.shadowSize = 0.15F;
|
||||
this.field_194_c = 12.0F / 16.0F;
|
||||
|
@ -39,7 +43,7 @@ public class RenderItem extends Render {
|
|||
float var18;
|
||||
if(var10.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var10.itemID].getRenderType())) {
|
||||
GL11.glRotatef(var12, 0.0F, 1.0F, 0.0F);
|
||||
this.loadTexture("/terrain.png");
|
||||
terrainTexture.bindTexture();
|
||||
float var28 = 0.25F;
|
||||
if(!Block.blocksList[var10.itemID].renderAsNormalBlock() && var10.itemID != Block.stairSingle.blockID && Block.blocksList[var10.itemID].getRenderType() != 16) {
|
||||
var28 = 0.5F;
|
||||
|
@ -63,9 +67,9 @@ public class RenderItem extends Render {
|
|||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
int var14 = var10.getIconIndex();
|
||||
if(var10.itemID < 256) {
|
||||
this.loadTexture("/terrain.png");
|
||||
terrainTexture.bindTexture();
|
||||
} else {
|
||||
this.loadTexture("/gui/items.png");
|
||||
itemsTexture.bindTexture();
|
||||
}
|
||||
|
||||
Tessellator var15 = Tessellator.instance;
|
||||
|
@ -117,7 +121,7 @@ public class RenderItem extends Render {
|
|||
public void drawItemIntoGui(FontRenderer var1, RenderEngine var2, int var3, int var4, int var5, int var6, int var7) {
|
||||
float var11;
|
||||
if(var3 < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var3].getRenderType())) {
|
||||
var2.bindTexture(var2.getTexture("/terrain.png"));
|
||||
terrainTexture.bindTexture();
|
||||
Block var14 = Block.blocksList[var3];
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)(var6 - 2), (float)(var7 + 3), -3.0F);
|
||||
|
@ -142,9 +146,9 @@ public class RenderItem extends Render {
|
|||
} else if(var5 >= 0) {
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
if(var3 < 256) {
|
||||
var2.bindTexture(var2.getTexture("/terrain.png"));
|
||||
terrainTexture.bindTexture();
|
||||
} else {
|
||||
var2.bindTexture(var2.getTexture("/gui/items.png"));
|
||||
itemsTexture.bindTexture();
|
||||
}
|
||||
|
||||
int var8 = Item.itemsList[var3].getColorFromDamage(var4);
|
||||
|
@ -226,4 +230,9 @@ public class RenderItem extends Render {
|
|||
public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
|
||||
this.doRenderItem((EntityItem)var1, var2, var4, var6, var8, var9);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,4 +101,9 @@ public class RenderLightningBolt extends Render {
|
|||
public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
|
||||
this.func_27002_a((EntityLightningBolt)var1, var2, var4, var6, var8, var9);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import net.PeytonPlayz585.opengl.GL11;
|
|||
import net.PeytonPlayz585.opengl.GL12;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public class RenderLiving extends Render {
|
||||
public abstract class RenderLiving extends Render {
|
||||
protected ModelBase mainModel;
|
||||
protected ModelBase renderPassModel;
|
||||
|
||||
|
|
|
@ -32,15 +32,15 @@ public class RenderManager {
|
|||
this.entityRenderMap.put(EntityWolf.class, new RenderWolf(new ModelWolf(), 0.5F));
|
||||
this.entityRenderMap.put(EntityChicken.class, new RenderChicken(new ModelChicken(), 0.3F));
|
||||
this.entityRenderMap.put(EntityCreeper.class, new RenderCreeper());
|
||||
this.entityRenderMap.put(EntitySkeleton.class, new RenderBiped(new ModelSkeleton(), 0.5F));
|
||||
this.entityRenderMap.put(EntityZombie.class, new RenderBiped(new ModelZombie(), 0.5F));
|
||||
this.entityRenderMap.put(EntitySkeleton.class, new RenderBiped(new ModelSkeleton(), 0.5F, "/mob/skeleton.png"));
|
||||
this.entityRenderMap.put(EntityZombie.class, new RenderBiped(new ModelZombie(), 0.5F, "/mob/zombie.png"));
|
||||
this.entityRenderMap.put(EntitySlime.class, new RenderSlime(new ModelSlime(16), new ModelSlime(0), 0.25F));
|
||||
this.entityRenderMap.put(EntityPlayer.class, new RenderPlayer());
|
||||
this.entityRenderMap.put(EntityGiantZombie.class, new RenderGiantZombie(new ModelZombie(), 0.5F, 6.0F));
|
||||
this.entityRenderMap.put(EntityGhast.class, new RenderGhast());
|
||||
this.entityRenderMap.put(EntitySquid.class, new RenderSquid(new ModelSquid(), 0.7F));
|
||||
this.entityRenderMap.put(EntityLiving.class, new RenderLiving(new ModelBiped(), 0.5F));
|
||||
this.entityRenderMap.put(Entity.class, new RenderEntity());
|
||||
//this.entityRenderMap.put(EntityLiving.class, new RenderLiving(new ModelBiped(), 0.5F));
|
||||
//this.entityRenderMap.put(Entity.class, new RenderEntity());
|
||||
this.entityRenderMap.put(EntityPainting.class, new RenderPainting());
|
||||
this.entityRenderMap.put(EntityArrow.class, new RenderArrow());
|
||||
this.entityRenderMap.put(EntitySnowball.class, new RenderSnowball(Item.snowball.getIconFromDamage(0)));
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class RenderMinecart extends Render {
|
||||
protected ModelBase modelMinecart;
|
||||
|
||||
private static final TextureLocation terrainTexture = new TextureLocation("/terrain.png");
|
||||
private static final TextureLocation minecartTexture = new TextureLocation("/item/cart.png");
|
||||
|
||||
public RenderMinecart() {
|
||||
this.shadowSize = 0.5F;
|
||||
this.modelMinecart = new ModelMinecart();
|
||||
|
@ -54,7 +58,7 @@ public class RenderMinecart extends Render {
|
|||
}
|
||||
|
||||
if(var1.minecartType != 0) {
|
||||
this.loadTexture("/terrain.png");
|
||||
terrainTexture.bindTexture();
|
||||
float var25 = 12.0F / 16.0F;
|
||||
GL11.glScalef(var25, var25, var25);
|
||||
GL11.glTranslatef(0.0F, 5.0F / 16.0F, 0.0F);
|
||||
|
@ -70,7 +74,7 @@ public class RenderMinecart extends Render {
|
|||
GL11.glScalef(1.0F / var25, 1.0F / var25, 1.0F / var25);
|
||||
}
|
||||
|
||||
this.loadTexture("/item/cart.png");
|
||||
minecartTexture.bindTexture();
|
||||
GL11.glScalef(-1.0F, -1.0F, 1.0F);
|
||||
this.modelMinecart.render(0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 1.0F / 16.0F);
|
||||
GL11.glPopMatrix();
|
||||
|
@ -79,4 +83,9 @@ public class RenderMinecart extends Render {
|
|||
public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
|
||||
this.func_152_a((EntityMinecart)var1, var2, var4, var6, var8, var9);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,17 +2,20 @@ package net.minecraft.src;
|
|||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.opengl.GL12;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class RenderPainting extends Render {
|
||||
private Random rand = new Random();
|
||||
|
||||
private static final TextureLocation paintingTexture = new TextureLocation("/art/kz.png");
|
||||
|
||||
public void func_158_a(EntityPainting var1, double var2, double var4, double var6, float var8, float var9) {
|
||||
this.rand.setSeed(187L);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)var2, (float)var4, (float)var6);
|
||||
GL11.glRotatef(var8, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
this.loadTexture("/art/kz.png");
|
||||
paintingTexture.bindTexture();
|
||||
EnumArt var10 = var1.art;
|
||||
float var11 = 1.0F / 16.0F;
|
||||
GL11.glScalef(var11, var11, var11);
|
||||
|
@ -115,4 +118,9 @@ public class RenderPainting extends Render {
|
|||
public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
|
||||
this.func_158_a((EntityPainting)var1, var2, var4, var6, var8, var9);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,17 +1,29 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class RenderPig extends RenderLiving {
|
||||
|
||||
private static final TextureLocation saddleTexture = new TextureLocation("/mob/saddle.png");
|
||||
private static final TextureLocation pigTexture = new TextureLocation("/mob/pig.png");
|
||||
|
||||
public RenderPig(ModelBase var1, ModelBase var2, float var3) {
|
||||
super(var1, var3);
|
||||
this.setRenderPassModel(var2);
|
||||
}
|
||||
|
||||
protected boolean renderSaddledPig(EntityPig var1, int var2, float var3) {
|
||||
this.loadTexture("/mob/saddle.png");
|
||||
saddleTexture.bindTexture();
|
||||
return var2 == 0 && var1.getSaddled();
|
||||
}
|
||||
|
||||
protected boolean shouldRenderPass(EntityLiving var1, int var2, float var3) {
|
||||
return this.renderSaddledPig((EntityPig)var1, var2, var3);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
pigTexture.bindTexture();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.profile.Profile;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public class RenderPlayer extends RenderLiving {
|
||||
|
@ -8,6 +10,14 @@ public class RenderPlayer extends RenderLiving {
|
|||
private ModelBiped modelArmorChestplate = new ModelBiped(1.0F);
|
||||
private ModelBiped modelArmor = new ModelBiped(0.5F);
|
||||
private static final String[] armorFilenamePrefix = new String[]{"cloth", "chain", "iron", "diamond", "gold"};
|
||||
private static final TextureLocation[][] armorTextures = new TextureLocation[armorFilenamePrefix.length][2];
|
||||
|
||||
static {
|
||||
for(int i = 0; i < armorFilenamePrefix.length; ++i) {
|
||||
armorTextures[i][0] = new TextureLocation("/armor/" + armorFilenamePrefix[i] + "_1.png");
|
||||
armorTextures[i][1] = new TextureLocation("/armor/" + armorFilenamePrefix[i] + "_2.png");
|
||||
}
|
||||
}
|
||||
|
||||
public RenderPlayer() {
|
||||
super(new ModelBiped(0.0F), 0.5F);
|
||||
|
@ -19,7 +29,7 @@ public class RenderPlayer extends RenderLiving {
|
|||
Item var5 = var4.getItem();
|
||||
if(var5 instanceof ItemArmor) {
|
||||
ItemArmor var6 = (ItemArmor)var5;
|
||||
this.loadTexture("/armor/" + armorFilenamePrefix[var6.renderIndex] + "_" + (var2 == 2 ? 2 : 1) + ".png");
|
||||
armorTextures[var6.renderIndex][var2 != 2 ? 0 : 1].bindTexture();
|
||||
ModelBiped var7 = var2 == 2 ? this.modelArmor : this.modelArmorChestplate;
|
||||
var7.bipedHead.showModel = var2 == 0;
|
||||
var7.bipedHeadwear.showModel = var2 == 0;
|
||||
|
@ -278,4 +288,16 @@ public class RenderPlayer extends RenderLiving {
|
|||
public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
|
||||
this.renderPlayer((EntityPlayer)var1, var2, var4, var6, var8, var9);
|
||||
}
|
||||
|
||||
private static final TextureLocation defaultPlayerSkin = new TextureLocation("/mob/char.png");
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
if(Minecraft.getMinecraft().theWorld.multiplayerWorld) {
|
||||
defaultPlayerSkin.bindTexture();
|
||||
} else {
|
||||
Profile.defaultOptionsTextures[Profile.presetSkinId].bindTexture();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class RenderSheep extends RenderLiving {
|
||||
|
||||
private static final TextureLocation sheepTexture = new TextureLocation("/mob/sheep.png");
|
||||
private static final TextureLocation sheepFurTexture = new TextureLocation("/mob/sheep_fur.png");
|
||||
|
||||
public RenderSheep(ModelBase var1, ModelBase var2, float var3) {
|
||||
super(var1, var3);
|
||||
this.setRenderPassModel(var2);
|
||||
|
@ -10,7 +15,7 @@ public class RenderSheep extends RenderLiving {
|
|||
|
||||
protected boolean setWoolColorAndRender(EntitySheep var1, int var2, float var3) {
|
||||
if(var2 == 0 && !var1.getSheared()) {
|
||||
this.loadTexture("/mob/sheep_fur.png");
|
||||
sheepFurTexture.bindTexture();
|
||||
float var4 = var1.getEntityBrightness(var3);
|
||||
int var5 = var1.getFleeceColor();
|
||||
GL11.glColor3f(var4 * EntitySheep.fleeceColorTable[var5][0], var4 * EntitySheep.fleeceColorTable[var5][1], var4 * EntitySheep.fleeceColorTable[var5][2]);
|
||||
|
@ -23,4 +28,10 @@ public class RenderSheep extends RenderLiving {
|
|||
protected boolean shouldRenderPass(EntityLiving var1, int var2, float var3) {
|
||||
return this.setWoolColorAndRender((EntitySheep)var1, var2, var3);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
sheepTexture.bindTexture();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class RenderSlime extends RenderLiving {
|
||||
private ModelBase scaleAmount;
|
||||
|
||||
private static final TextureLocation slimeTexture = new TextureLocation("/mob/slime.png");
|
||||
|
||||
public RenderSlime(ModelBase var1, ModelBase var2, float var3) {
|
||||
super(var1, var3);
|
||||
this.scaleAmount = var2;
|
||||
|
@ -42,4 +45,10 @@ public class RenderSlime extends RenderLiving {
|
|||
protected boolean shouldRenderPass(EntityLiving var1, int var2, float var3) {
|
||||
return this.renderSlimePassModel((EntitySlime)var1, var2, var3);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
slimeTexture.bindTexture();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,8 +2,11 @@ package net.minecraft.src;
|
|||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.opengl.GL12;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class RenderSnowball extends Render {
|
||||
|
||||
private static final TextureLocation itemTexture = new TextureLocation("/gui/items.png");
|
||||
private int itemIconIndex;
|
||||
|
||||
public RenderSnowball(int var1) {
|
||||
|
@ -15,7 +18,7 @@ public class RenderSnowball extends Render {
|
|||
GL11.glTranslatef((float)var2, (float)var4, (float)var6);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
this.loadTexture("/gui/items.png");
|
||||
itemTexture.bindTexture();
|
||||
Tessellator var10 = Tessellator.instance;
|
||||
float var11 = (float)(this.itemIconIndex % 16 * 16 + 0) / 256.0F;
|
||||
float var12 = (float)(this.itemIconIndex % 16 * 16 + 16) / 256.0F;
|
||||
|
@ -36,4 +39,9 @@ public class RenderSnowball extends Render {
|
|||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class RenderSpider extends RenderLiving {
|
||||
|
||||
private static final TextureLocation spiderTexture = new TextureLocation("/mob/spider.png");
|
||||
private static final TextureLocation spiderEyesTexture = new TextureLocation("/mob/spider_eyes.png");
|
||||
|
||||
public RenderSpider() {
|
||||
super(new ModelSpider(), 1.0F);
|
||||
this.setRenderPassModel(new ModelSpider());
|
||||
|
@ -18,7 +23,7 @@ public class RenderSpider extends RenderLiving {
|
|||
} else if(var2 != 0) {
|
||||
return false;
|
||||
} else {
|
||||
this.loadTexture("/mob/spider_eyes.png");
|
||||
spiderEyesTexture.bindTexture();
|
||||
float var4 = (1.0F - var1.getEntityBrightness(1.0F)) * 0.5F;
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
|
@ -35,4 +40,10 @@ public class RenderSpider extends RenderLiving {
|
|||
protected boolean shouldRenderPass(EntityLiving var1, int var2, float var3) {
|
||||
return this.setSpiderEyeBrightness((EntitySpider)var1, var2, var3);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
spiderTexture.bindTexture();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class RenderSquid extends RenderLiving {
|
||||
|
||||
private static final TextureLocation squidTexture = new TextureLocation("/mob/squid.png");
|
||||
|
||||
public RenderSquid(ModelBase var1, float var2) {
|
||||
super(var1, var2);
|
||||
}
|
||||
|
@ -48,4 +52,10 @@ public class RenderSquid extends RenderLiving {
|
|||
public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
|
||||
this.func_21008_a((EntitySquid)var1, var2, var4, var6, var8, var9);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
squidTexture.bindTexture();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class RenderTNTPrimed extends Render {
|
||||
|
||||
private static final TextureLocation terrainTexture = new TextureLocation("/terrain.png");
|
||||
|
||||
private RenderBlocks blockRenderer = new RenderBlocks();
|
||||
|
||||
public RenderTNTPrimed() {
|
||||
|
@ -30,7 +34,7 @@ public class RenderTNTPrimed extends Render {
|
|||
}
|
||||
|
||||
var10 = (1.0F - ((float)var1.fuse - var9 + 1.0F) / 100.0F) * 0.8F;
|
||||
this.loadTexture("/terrain.png");
|
||||
terrainTexture.bindTexture();
|
||||
this.blockRenderer.renderBlockOnInventory(Block.tnt, 0, var1.getEntityBrightness(var9));
|
||||
if(var1.fuse / 5 % 2 == 0) {
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
|
@ -51,4 +55,9 @@ public class RenderTNTPrimed extends Render {
|
|||
public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
|
||||
this.func_153_a((EntityTNTPrimed)var1, var2, var4, var6, var8, var9);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class RenderWolf extends RenderLiving {
|
||||
|
||||
private static final TextureLocation wolfTexture = new TextureLocation("/mob/wolf.png");
|
||||
|
||||
public RenderWolf(ModelBase var1, float var2) {
|
||||
super(var1, var2);
|
||||
}
|
||||
|
@ -31,4 +36,10 @@ public class RenderWolf extends RenderLiving {
|
|||
public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
|
||||
this.renderWolf((EntityWolf)var1, var2, var4, var6, var8, var9);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean loadDownloadableImageTexture(String s, String s1) {
|
||||
wolfTexture.bindTexture();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,133 +64,6 @@ public class TerrainTextureManager {
|
|||
|
||||
}
|
||||
|
||||
public void func_799_a(IsoImageBuffer var1) {
|
||||
World var2 = var1.worldObj;
|
||||
if(var2 == null) {
|
||||
var1.field_1351_f = true;
|
||||
var1.field_1352_e = true;
|
||||
} else {
|
||||
int var3 = var1.field_1354_c * 16;
|
||||
int var4 = var1.field_1353_d * 16;
|
||||
int var5 = var3 + 16;
|
||||
int var6 = var4 + 16;
|
||||
Chunk var7 = var2.getChunkFromChunkCoords(var1.field_1354_c, var1.field_1353_d);
|
||||
if(var7.func_21167_h()) {
|
||||
var1.field_1351_f = true;
|
||||
var1.field_1352_e = true;
|
||||
} else {
|
||||
var1.field_1351_f = false;
|
||||
Arrays.fill(this.field_1186_c, 0);
|
||||
Arrays.fill(this.field_1185_d, 0);
|
||||
Arrays.fill(this.field_1183_f, 160);
|
||||
|
||||
for(int var8 = var6 - 1; var8 >= var4; --var8) {
|
||||
for(int var9 = var5 - 1; var9 >= var3; --var9) {
|
||||
int var10 = var9 - var3;
|
||||
int var11 = var8 - var4;
|
||||
int var12 = var10 + var11;
|
||||
boolean var13 = true;
|
||||
|
||||
for(int var14 = 0; var14 < 128; ++var14) {
|
||||
int var15 = var11 - var10 - var14 + 160 - 16;
|
||||
if(var15 < this.field_1183_f[var12] || var15 < this.field_1183_f[var12 + 1]) {
|
||||
Block var16 = Block.blocksList[var2.getBlockId(var9, var14, var8)];
|
||||
if(var16 == null) {
|
||||
var13 = false;
|
||||
} else if(var16.blockMaterial == Material.water) {
|
||||
int var24 = var2.getBlockId(var9, var14 + 1, var8);
|
||||
if(var24 == 0 || Block.blocksList[var24].blockMaterial != Material.water) {
|
||||
float var25 = (float)var14 / 127.0F * 0.6F + 0.4F;
|
||||
float var26 = var2.getLightBrightness(var9, var14 + 1, var8) * var25;
|
||||
if(var15 >= 0 && var15 < 160) {
|
||||
int var27 = var12 + var15 * 32;
|
||||
if(var12 >= 0 && var12 <= 32 && this.field_1185_d[var27] <= var14) {
|
||||
this.field_1185_d[var27] = var14;
|
||||
this.field_1184_e[var27] = (int)(var26 * 127.0F);
|
||||
}
|
||||
|
||||
if(var12 >= -1 && var12 <= 31 && this.field_1185_d[var27 + 1] <= var14) {
|
||||
this.field_1185_d[var27 + 1] = var14;
|
||||
this.field_1184_e[var27 + 1] = (int)(var26 * 127.0F);
|
||||
}
|
||||
|
||||
var13 = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(var13) {
|
||||
if(var15 < this.field_1183_f[var12]) {
|
||||
this.field_1183_f[var12] = var15;
|
||||
}
|
||||
|
||||
if(var15 < this.field_1183_f[var12 + 1]) {
|
||||
this.field_1183_f[var12 + 1] = var15;
|
||||
}
|
||||
}
|
||||
|
||||
float var17 = (float)var14 / 127.0F * 0.6F + 0.4F;
|
||||
int var18;
|
||||
int var19;
|
||||
float var20;
|
||||
float var22;
|
||||
if(var15 >= 0 && var15 < 160) {
|
||||
var18 = var12 + var15 * 32;
|
||||
var19 = this.field_1182_g[var16.blockID * 3 + 0];
|
||||
var20 = (var2.getLightBrightness(var9, var14 + 1, var8) * 0.8F + 0.2F) * var17;
|
||||
if(var12 >= 0 && this.field_1186_c[var18] <= var14) {
|
||||
this.field_1186_c[var18] = var14;
|
||||
this.field_1180_b[var18] = -16777216 | (int)(this.field_1181_a[var19 * 3 + 0] * var20) << 16 | (int)(this.field_1181_a[var19 * 3 + 1] * var20) << 8 | (int)(this.field_1181_a[var19 * 3 + 2] * var20);
|
||||
}
|
||||
|
||||
if(var12 < 31) {
|
||||
var22 = var20 * 0.9F;
|
||||
if(this.field_1186_c[var18 + 1] <= var14) {
|
||||
this.field_1186_c[var18 + 1] = var14;
|
||||
this.field_1180_b[var18 + 1] = -16777216 | (int)(this.field_1181_a[var19 * 3 + 0] * var22) << 16 | (int)(this.field_1181_a[var19 * 3 + 1] * var22) << 8 | (int)(this.field_1181_a[var19 * 3 + 2] * var22);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(var15 >= -1 && var15 < 159) {
|
||||
var18 = var12 + (var15 + 1) * 32;
|
||||
var19 = this.field_1182_g[var16.blockID * 3 + 1];
|
||||
var20 = var2.getLightBrightness(var9 - 1, var14, var8) * 0.8F + 0.2F;
|
||||
int var21 = this.field_1182_g[var16.blockID * 3 + 2];
|
||||
var22 = var2.getLightBrightness(var9, var14, var8 + 1) * 0.8F + 0.2F;
|
||||
float var23;
|
||||
if(var12 >= 0) {
|
||||
var23 = var20 * var17 * 0.6F;
|
||||
if(this.field_1186_c[var18] <= var14 - 1) {
|
||||
this.field_1186_c[var18] = var14 - 1;
|
||||
this.field_1180_b[var18] = -16777216 | (int)(this.field_1181_a[var19 * 3 + 0] * var23) << 16 | (int)(this.field_1181_a[var19 * 3 + 1] * var23) << 8 | (int)(this.field_1181_a[var19 * 3 + 2] * var23);
|
||||
}
|
||||
}
|
||||
|
||||
if(var12 < 31) {
|
||||
var23 = var22 * 0.9F * var17 * 0.4F;
|
||||
if(this.field_1186_c[var18 + 1] <= var14 - 1) {
|
||||
this.field_1186_c[var18 + 1] = var14 - 1;
|
||||
this.field_1180_b[var18 + 1] = -16777216 | (int)(this.field_1181_a[var21 * 3 + 0] * var23) << 16 | (int)(this.field_1181_a[var21 * 3 + 1] * var23) << 8 | (int)(this.field_1181_a[var21 * 3 + 2] * var23);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.func_800_a();
|
||||
if(var1.field_1348_a == null) {
|
||||
var1.field_1348_a = new BufferedImage(32, 160, 2);
|
||||
}
|
||||
|
||||
var1.field_1348_a.setRGB(0, 0, 32, 160, this.field_1180_b, 0, 32);
|
||||
var1.field_1352_e = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void func_800_a() {
|
||||
for(int var1 = 0; var1 < 32; ++var1) {
|
||||
for(int var2 = 0; var2 < 160; ++var2) {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class TextureFX {
|
||||
public byte[] imageData = new byte[1024];
|
||||
|
@ -10,6 +11,9 @@ public class TextureFX {
|
|||
public int tileSize = 1;
|
||||
public int tileImage = 0;
|
||||
|
||||
public static final TextureLocation terrainTexture = new TextureLocation("/terrain.png");
|
||||
public static final TextureLocation itemsTexture = new TextureLocation("/gui/items.png");
|
||||
|
||||
public TextureFX(int var1) {
|
||||
this.iconIndex = var1;
|
||||
}
|
||||
|
@ -19,9 +23,9 @@ public class TextureFX {
|
|||
|
||||
public void bindImage(RenderEngine var1) {
|
||||
if(this.tileImage == 0) {
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, var1.getTexture("/terrain.png"));
|
||||
terrainTexture.bindTexture();
|
||||
} else if(this.tileImage == 1) {
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, var1.getTexture("/gui/items.png"));
|
||||
itemsTexture.bindTexture();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import net.PeytonPlayz585.awt.image.BufferedImage;
|
|||
import net.PeytonPlayz585.awt.image.ImageIO;
|
||||
import net.PeytonPlayz585.fileutils.FileEntry;
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
import net.PeytonPlayz585.util.zip.ZipFile;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
|
@ -19,6 +20,8 @@ public class TexturePackCustom extends TexturePackBase {
|
|||
private BufferedImage texturePackThumbnail;
|
||||
private FileEntry texturePackFile;
|
||||
|
||||
private static final TextureLocation unknownPack = new TextureLocation("/gui/unknown_pack.png");
|
||||
|
||||
public TexturePackCustom(FileEntry var1) {
|
||||
this.texturePackFileName = var1.getName();
|
||||
this.texturePackFile = var1;
|
||||
|
@ -90,7 +93,7 @@ public class TexturePackCustom extends TexturePackBase {
|
|||
if(this.texturePackThumbnail != null) {
|
||||
var1.renderEngine.bindTexture(this.texturePackName);
|
||||
} else {
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, var1.renderEngine.getTexture("/gui/unknown_pack.png"));
|
||||
unknownPack.bindTexture();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,12 +5,15 @@ import java.io.IOException;
|
|||
import net.PeytonPlayz585.awt.image.BufferedImage;
|
||||
import net.PeytonPlayz585.awt.image.ImageIO;
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public class TexturePackDefault extends TexturePackBase {
|
||||
private int texturePackName = -1;
|
||||
private BufferedImage texturePackThumbnail;
|
||||
|
||||
private static final TextureLocation unknownPack = new TextureLocation("/gui/unknown_pack.png");
|
||||
|
||||
public TexturePackDefault() {
|
||||
this.texturePackFileName = "Default";
|
||||
this.firstDescriptionLine = "The default look of Minecraft";
|
||||
|
@ -38,7 +41,7 @@ public class TexturePackDefault extends TexturePackBase {
|
|||
if(this.texturePackThumbnail != null) {
|
||||
var1.renderEngine.bindTexture(this.texturePackName);
|
||||
} else {
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, var1.renderEngine.getTexture("/gui/unknown_pack.png"));
|
||||
unknownPack.bindTexture();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.PeytonPlayz585.opengl.GL11;
|
||||
import net.PeytonPlayz585.textures.TextureLocation;
|
||||
|
||||
public class TileEntitySignRenderer extends TileEntitySpecialRenderer {
|
||||
private SignModel signModel = new SignModel();
|
||||
|
||||
private static final TextureLocation signTexture = new TextureLocation("/item/sign.png");
|
||||
|
||||
public void renderTileEntitySignAt(TileEntitySign var1, double var2, double var4, double var6, float var8) {
|
||||
Block var9 = var1.getBlockType();
|
||||
GL11.glPushMatrix();
|
||||
|
@ -36,7 +39,7 @@ public class TileEntitySignRenderer extends TileEntitySpecialRenderer {
|
|||
this.signModel.signStick.showModel = false;
|
||||
}
|
||||
|
||||
this.bindTextureByName("/item/sign.png");
|
||||
signTexture.bindTexture();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(var10, -var10, -var10);
|
||||
this.signModel.func_887_a();
|
||||
|
|
|
@ -5,6 +5,7 @@ public abstract class TileEntitySpecialRenderer {
|
|||
|
||||
public abstract void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8);
|
||||
|
||||
@Deprecated
|
||||
protected void bindTextureByName(String var1) {
|
||||
RenderEngine var2 = this.tileEntityRenderer.renderEngine;
|
||||
var2.bindTexture(var2.getTexture(var1));
|
||||
|
|