75 errors

This commit is contained in:
catfoolyou
2025-01-31 10:11:34 -05:00
parent 00c82f9530
commit b458ce2332
81 changed files with 750 additions and 375 deletions

View File

@@ -5,6 +5,7 @@ import java.util.List;
import java.util.Random;
import net.lax1dude.eaglercraft.TextureLocation;
import net.lax1dude.eaglercraft.adapter.Tessellator;
import org.lwjgl.opengl.GL11;
public class EffectRenderer

View File

@@ -1,5 +1,7 @@
package net.minecraft.src;
import net.lax1dude.eaglercraft.adapter.Tessellator;
public class EntityFX extends Entity
{
protected int particleTextureIndexX;

View File

@@ -4,6 +4,7 @@ import java.nio.FloatBuffer;
import java.util.List;
import java.util.Random;
import net.lax1dude.eaglercraft.EaglerAdapter;
import net.lax1dude.eaglercraft.EaglerImage;
import net.lax1dude.eaglercraft.TextureLocation;
import net.lax1dude.eaglercraft.adapter.Tessellator;
@@ -77,13 +78,12 @@ public class EntityRenderer
/**
* The texture id of the blocklight/skylight texture used for lighting effects
*/
private final DynamicTexture lightmapTexture;
private int lightmapTexture;
/**
* Colors computed in updateLightmap() and loaded into the lightmap emptyTexture
*/
private final int[] lightmapColors;
private final TextureLocation locationLightMap;
/** FOV modifier hand */
private float fovModifierHand;
@@ -162,9 +162,8 @@ public class EntityRenderer
{
this.mc = par1Minecraft;
this.itemRenderer = new ItemRenderer(par1Minecraft);
this.lightmapTexture = new DynamicTexture(16, 16);
this.locationLightMap = par1Minecraft.renderEngine.allocateAndSetupTexture(new EaglerImage(16, 16, true));
this.lightmapColors = this.lightmapTexture.getTextureData();
this.lightmapTexture = par1Minecraft.renderEngine.allocateAndSetupTexture(new EaglerImage(16, 16, true));
this.lightmapColors = new int[256];
}
/**
@@ -712,21 +711,20 @@ public class EntityRenderer
public void enableLightmap(double par1)
{
OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glLoadIdentity();
float var3 = 0.00390625F;
GL11.glScalef(var3, var3, var3);
GL11.glTranslatef(8.0F, 8.0F, 8.0F);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
this.locationLightMap.bindTexture();
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);
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);
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);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glEnable(GL11.GL_TEXTURE_2D);
//EaglerAdapter.glMatrixMode(EaglerAdapter.GL_TEXTURE);
//EaglerAdapter.glLoadIdentity();
//float var3 = 0.00390625F;
//EaglerAdapter.glScalef(var3, var3, var3);
//EaglerAdapter.glTranslatef(8.0F, 8.0F, 8.0F);
//EaglerAdapter.glMatrixMode(EaglerAdapter.GL_MODELVIEW);
EaglerAdapter.glBindTexture(EaglerAdapter.GL_TEXTURE_2D, this.lightmapTexture);
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MIN_FILTER, EaglerAdapter.GL_LINEAR);
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MAG_FILTER, EaglerAdapter.GL_LINEAR);
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_WRAP_S, EaglerAdapter.GL_CLAMP);
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_WRAP_T, EaglerAdapter.GL_CLAMP);
EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
EaglerAdapter.glEnable(EaglerAdapter.GL_TEXTURE_2D);
this.mc.renderEngine.resetBoundTexture();
OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
}
@@ -876,8 +874,7 @@ public class EntityRenderer
this.lightmapColors[var3] = var20 << 24 | var21 << 16 | var22 << 8 | var23;
}
this.lightmapTexture.updateDynamicTexture();
this.lightmapUpdateNeeded = false;
this.mc.renderEngine.createTextureFromBytes(this.lightmapColors, 16, 16, this.lightmapTexture);
}
}

View File

@@ -1,201 +0,0 @@
package net.minecraft.src;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import org.lwjgl.Sys;
public class GuiScreenTemporaryResourcePackSelect extends GuiScreen
{
protected GuiScreen field_110347_a;
private int refreshTimer = -1;
private GuiScreenTemporaryResourcePackSelectSelectionList field_110346_c;
private GameSettings field_96146_n;
public GuiScreenTemporaryResourcePackSelect(GuiScreen par1GuiScreen, GameSettings par2GameSettings)
{
this.field_110347_a = par1GuiScreen;
this.field_96146_n = par2GameSettings;
}
/**
* Adds the buttons (and other controls) to the screen in question.
*/
public void initGui()
{
this.buttonList.add(new GuiSmallButton(5, this.width / 2 - 154, this.height - 48, I18n.getString("resourcePack.openFolder")));
this.buttonList.add(new GuiSmallButton(6, this.width / 2 + 4, this.height - 48, I18n.getString("gui.done")));
this.field_110346_c = new GuiScreenTemporaryResourcePackSelectSelectionList(this, this.mc.getResourcePackRepository());
this.field_110346_c.registerScrollButtons(7, 8);
}
/**
* Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
*/
protected void actionPerformed(GuiButton par1GuiButton)
{
if (par1GuiButton.enabled)
{
if (par1GuiButton.id == 5)
{
File var2 = GuiScreenTemporaryResourcePackSelectSelectionList.func_110510_a(this.field_110346_c).getDirResourcepacks();
String var3 = var2.getAbsolutePath();
if (Util.getOSType() == EnumOS.MACOS)
{
try
{
this.mc.getLogAgent().logInfo(var3);
Runtime.getRuntime().exec(new String[] {"/usr/bin/open", var3});
return;
}
catch (IOException var9)
{
var9.printStackTrace();
}
}
else if (Util.getOSType() == EnumOS.WINDOWS)
{
String var4 = String.format("cmd.exe /C start \"Open file\" \"%s\"", new Object[] {var3});
try
{
Runtime.getRuntime().exec(var4);
return;
}
catch (IOException var8)
{
var8.printStackTrace();
}
}
boolean var10 = false;
try
{
Class var5 = Class.forName("java.awt.Desktop");
Object var6 = var5.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]);
var5.getMethod("browse", new Class[] {URI.class}).invoke(var6, new Object[] {var2.toURI()});
}
catch (Throwable var7)
{
var7.printStackTrace();
var10 = true;
}
if (var10)
{
this.mc.getLogAgent().logInfo("Opening via system class!");
Sys.openURL("file://" + var3);
}
}
else if (par1GuiButton.id == 6)
{
this.mc.displayGuiScreen(this.field_110347_a);
}
else
{
this.field_110346_c.actionPerformed(par1GuiButton);
}
}
}
/**
* Called when the mouse is clicked.
*/
protected void mouseClicked(int par1, int par2, int par3)
{
super.mouseClicked(par1, par2, par3);
}
/**
* Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is
* mouseMove, which==0 or which==1 is mouseUp
*/
protected void mouseMovedOrUp(int par1, int par2, int par3)
{
super.mouseMovedOrUp(par1, par2, par3);
}
/**
* Draws the screen and all the components in it.
*/
public void drawScreen(int par1, int par2, float par3)
{
this.field_110346_c.drawScreen(par1, par2, par3);
if (this.refreshTimer <= 0)
{
GuiScreenTemporaryResourcePackSelectSelectionList.func_110510_a(this.field_110346_c).updateRepositoryEntriesAll();
this.refreshTimer = 20;
}
this.drawCenteredString(this.fontRenderer, I18n.getString("resourcePack.title"), this.width / 2, 16, 16777215);
this.drawCenteredString(this.fontRenderer, I18n.getString("resourcePack.folderInfo"), this.width / 2 - 77, this.height - 26, 8421504);
super.drawScreen(par1, par2, par3);
}
/**
* Called from the main game loop to update the screen.
*/
public void updateScreen()
{
super.updateScreen();
--this.refreshTimer;
}
static Minecraft func_110344_a(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect)
{
return par0GuiScreenTemporaryResourcePackSelect.mc;
}
static Minecraft func_110341_b(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect)
{
return par0GuiScreenTemporaryResourcePackSelect.mc;
}
static Minecraft func_110339_c(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect)
{
return par0GuiScreenTemporaryResourcePackSelect.mc;
}
static Minecraft func_110345_d(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect)
{
return par0GuiScreenTemporaryResourcePackSelect.mc;
}
static Minecraft func_110334_e(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect)
{
return par0GuiScreenTemporaryResourcePackSelect.mc;
}
static Minecraft func_110340_f(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect)
{
return par0GuiScreenTemporaryResourcePackSelect.mc;
}
static FontRenderer func_130017_g(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect)
{
return par0GuiScreenTemporaryResourcePackSelect.fontRenderer;
}
static FontRenderer func_130016_h(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect)
{
return par0GuiScreenTemporaryResourcePackSelect.fontRenderer;
}
static FontRenderer func_110337_i(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect)
{
return par0GuiScreenTemporaryResourcePackSelect.fontRenderer;
}
static FontRenderer func_110335_j(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect)
{
return par0GuiScreenTemporaryResourcePackSelect.fontRenderer;
}
static FontRenderer func_110338_k(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect)
{
return par0GuiScreenTemporaryResourcePackSelect.fontRenderer;
}
}

View File

@@ -1,148 +0,0 @@
package net.minecraft.src;
import java.io.IOException;
import java.util.List;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.opengl.GL11;
import net.lax1dude.eaglercraft.adapter.Tessellator;
class GuiScreenTemporaryResourcePackSelectSelectionList extends GuiSlot
{
private final ResourcePackRepository field_110511_b;
private TextureLocation field_110513_h;
final GuiScreenTemporaryResourcePackSelect field_110512_a;
public GuiScreenTemporaryResourcePackSelectSelectionList(GuiScreenTemporaryResourcePackSelect par1GuiScreenTemporaryResourcePackSelect, ResourcePackRepository par2ResourcePackRepository)
{
super(GuiScreenTemporaryResourcePackSelect.func_110344_a(par1GuiScreenTemporaryResourcePackSelect), par1GuiScreenTemporaryResourcePackSelect.width, par1GuiScreenTemporaryResourcePackSelect.height, 32, par1GuiScreenTemporaryResourcePackSelect.height - 55 + 4, 36);
this.field_110512_a = par1GuiScreenTemporaryResourcePackSelect;
this.field_110511_b = par2ResourcePackRepository;
par2ResourcePackRepository.updateRepositoryEntriesAll();
}
/**
* Gets the size of the current slot list.
*/
protected int getSize()
{
return 1 + this.field_110511_b.getRepositoryEntriesAll().size();
}
/**
* the element in the slot that was clicked, boolean for wether it was double clicked or not
*/
protected void elementClicked(int par1, boolean par2)
{
List var3 = this.field_110511_b.getRepositoryEntriesAll();
try
{
if (par1 == 0)
{
throw new RuntimeException("This is so horrible ;D");
}
this.field_110511_b.setRepositoryEntries(new ResourcePackRepositoryEntry[] {(ResourcePackRepositoryEntry)var3.get(par1 - 1)});
GuiScreenTemporaryResourcePackSelect.func_110341_b(this.field_110512_a).refreshResources();
}
catch (Exception var5)
{
this.field_110511_b.setRepositoryEntries(new ResourcePackRepositoryEntry[0]);
GuiScreenTemporaryResourcePackSelect.func_110339_c(this.field_110512_a).refreshResources();
}
GuiScreenTemporaryResourcePackSelect.func_110345_d(this.field_110512_a).gameSettings.skin = this.field_110511_b.getResourcePackName();
GuiScreenTemporaryResourcePackSelect.func_110334_e(this.field_110512_a).gameSettings.saveOptions();
}
/**
* returns true if the element passed in is currently selected
*/
protected boolean isSelected(int par1)
{
List var2 = this.field_110511_b.getRepositoryEntries();
return par1 == 0 ? var2.isEmpty() : var2.contains(this.field_110511_b.getRepositoryEntriesAll().get(par1 - 1));
}
/**
* return the height of the content being scrolled
*/
protected int getContentHeight()
{
return this.getSize() * 36;
}
protected void drawBackground()
{
this.field_110512_a.drawDefaultBackground();
}
protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator)
{
RenderEngine var6 = GuiScreenTemporaryResourcePackSelect.func_110340_f(this.field_110512_a).getTextureManager();
if (par1 == 0)
{
try
{
ResourcePack var12 = this.field_110511_b.rprDefaultResourcePack;
PackMetadataSection var13 = (PackMetadataSection)var12.getPackMetadata(this.field_110511_b.rprMetadataSerializer, "pack");
if (this.field_110513_h == null)
{
this.field_110513_h = var6.getDynamicTextureLocation("texturepackicon", new DynamicTexture(var12.getPackImage()));
}
this.field_110513_h.bindTexture();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
par5Tessellator.startDrawingQuads();
par5Tessellator.setColorOpaque_I(16777215);
par5Tessellator.addVertexWithUV((double)par2, (double)(par3 + par4), 0.0D, 0.0D, 1.0D);
par5Tessellator.addVertexWithUV((double)(par2 + 32), (double)(par3 + par4), 0.0D, 1.0D, 1.0D);
par5Tessellator.addVertexWithUV((double)(par2 + 32), (double)par3, 0.0D, 1.0D, 0.0D);
par5Tessellator.addVertexWithUV((double)par2, (double)par3, 0.0D, 0.0D, 0.0D);
par5Tessellator.draw();
this.field_110512_a.drawString(GuiScreenTemporaryResourcePackSelect.func_130017_g(this.field_110512_a), "Default", par2 + 32 + 2, par3 + 1, 16777215);
this.field_110512_a.drawString(GuiScreenTemporaryResourcePackSelect.func_130016_h(this.field_110512_a), var13.getPackDescription(), par2 + 32 + 2, par3 + 12 + 10, 8421504);
}
catch (IOException var11)
{
;
}
}
else
{
ResourcePackRepositoryEntry var7 = (ResourcePackRepositoryEntry)this.field_110511_b.getRepositoryEntriesAll().get(par1 - 1);
var7.bindTexturePackIcon(var6);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
par5Tessellator.startDrawingQuads();
par5Tessellator.setColorOpaque_I(16777215);
par5Tessellator.addVertexWithUV((double)par2, (double)(par3 + par4), 0.0D, 0.0D, 1.0D);
par5Tessellator.addVertexWithUV((double)(par2 + 32), (double)(par3 + par4), 0.0D, 1.0D, 1.0D);
par5Tessellator.addVertexWithUV((double)(par2 + 32), (double)par3, 0.0D, 1.0D, 0.0D);
par5Tessellator.addVertexWithUV((double)par2, (double)par3, 0.0D, 0.0D, 0.0D);
par5Tessellator.draw();
String var8 = var7.getResourcePackName();
if (var8.length() > 32)
{
var8 = var8.substring(0, 32).trim() + "...";
}
this.field_110512_a.drawString(GuiScreenTemporaryResourcePackSelect.func_110337_i(this.field_110512_a), var8, par2 + 32 + 2, par3 + 1, 16777215);
List var9 = GuiScreenTemporaryResourcePackSelect.func_110335_j(this.field_110512_a).listFormattedStringToWidth(var7.getTexturePackDescription(), 183);
for (int var10 = 0; var10 < 2 && var10 < var9.size(); ++var10)
{
this.field_110512_a.drawString(GuiScreenTemporaryResourcePackSelect.func_110338_k(this.field_110512_a), (String)var9.get(var10), par2 + 32 + 2, par3 + 12 + 10 * var10, 8421504);
}
}
}
static ResourcePackRepository func_110510_a(GuiScreenTemporaryResourcePackSelectSelectionList par0GuiScreenTemporaryResourcePackSelectSelectionList)
{
return par0GuiScreenTemporaryResourcePackSelectSelectionList.field_110511_b;
}
}

View File

@@ -219,7 +219,7 @@ public class Item
private String potionEffect;
/** The unlocalized name of this item. */
private String unlocalizedName;
public String unlocalizedName;
/** Icon index in the icons table. */
protected Icon itemIcon;

View File

@@ -1,5 +1,6 @@
package net.minecraft.src;
import net.lax1dude.eaglercraft.adapter.Tessellator;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.GL11;
@@ -117,7 +118,7 @@ public class LoadingScreenRenderer implements IProgressUpdate
GL11.glTranslatef(0.0F, 0.0F, -200.0F);
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
Tessellator var7 = Tessellator.instance;
this.mc.getTextureManager().bindTexture(Gui.optionsBackground);
Gui.optionsBackground.bindTexture();
float var8 = 32.0F;
var7.startDrawingQuads();
var7.setColorOpaque_I(4210752);

View File

@@ -185,9 +185,9 @@ public class RenderItem extends Render
}
}
protected TextureLocation func_110796_a(EntityItem par1EntityItem)
protected TextureLocation func_110796_a(EntityItem par1EntityItem) // FIX THIS (maybe)
{
return (par1EntityItem.getEntityItem().getItemSpriteNumber());
return new TextureLocation("textures/items/" + par1EntityItem.getEntityItem().getItem().unlocalizedName + ".png");
}
/**