mirror of
https://git.zelz.net/catfoolyou/Project164.git
synced 2025-12-14 08:47:40 +00:00
No end in sight
This commit is contained in:
@@ -240,16 +240,13 @@ public class TextureTerrainMap implements IconRegister {
|
||||
|
||||
@Override
|
||||
public int getIconWidth() {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'getIconWidth'");
|
||||
return originX_center;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconHeight() {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'getIconHeight'");
|
||||
return originY_center;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private final String basePath;
|
||||
@@ -463,6 +460,7 @@ public class TextureTerrainMap implements IconRegister {
|
||||
}
|
||||
|
||||
public void refreshTextures() {
|
||||
System.out.println("refreshing textures");
|
||||
for(TerrainIconV2 t : iconList) {
|
||||
t.free();
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
public abstract class AbstractTexture implements TextureObject
|
||||
{
|
||||
protected int glTextureId = -1;
|
||||
|
||||
public int getGlTextureId()
|
||||
{
|
||||
if (this.glTextureId == -1)
|
||||
{
|
||||
this.glTextureId = TextureUtil.glGenTextures();
|
||||
}
|
||||
|
||||
return this.glTextureId;
|
||||
}
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglerImage;
|
||||
import net.lax1dude.eaglercraft.EaglerInputStream;
|
||||
import net.lax1dude.eaglercraft.TextureLocation;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.*;
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
public class DefaultResourcePack implements ResourcePack
|
||||
{
|
||||
public static final Set defaultResourceDomains = new HashSet<>(Arrays.asList("minecraft"));
|
||||
private final Map mapResourceFiles = new HashMap<>();
|
||||
private final File fileAssets;
|
||||
|
||||
public DefaultResourcePack(File par1File)
|
||||
{
|
||||
this.fileAssets = par1File;
|
||||
this.readAssetsDir(this.fileAssets);
|
||||
}
|
||||
|
||||
public InputStream getInputStream(TextureLocation par1TextureLocation) throws IOException
|
||||
{
|
||||
InputStream var2 = this.getResourceStream(par1TextureLocation);
|
||||
|
||||
if (var2 != null)
|
||||
{
|
||||
return var2;
|
||||
}
|
||||
else
|
||||
{
|
||||
File var3 = (File)this.mapResourceFiles.get(par1TextureLocation.toString());
|
||||
|
||||
if (var3 != null)
|
||||
{
|
||||
return new FileInputStream(var3);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new FileNotFoundException("Something is fuck: " + par1TextureLocation.toString() + "I have no idea what the hell this is"); // FIX THIS SHIT
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private InputStream getResourceStream(TextureLocation par1TextureLocation)
|
||||
{
|
||||
return DefaultResourcePack.class.getResourceAsStream("/assets/minecraft/" + par1TextureLocation);
|
||||
}
|
||||
|
||||
public void addResourceFile(String par1Str, File par2File)
|
||||
{
|
||||
this.mapResourceFiles.put((new TextureLocation(par1Str)).toString(), par2File);
|
||||
}
|
||||
|
||||
public boolean resourceExists(TextureLocation par1TextureLocation)
|
||||
{
|
||||
return this.getResourceStream(par1TextureLocation) != null || this.mapResourceFiles.containsKey(par1TextureLocation.toString());
|
||||
}
|
||||
|
||||
public Set getResourceDomains()
|
||||
{
|
||||
return defaultResourceDomains;
|
||||
}
|
||||
|
||||
public void readAssetsDir(File par1File)
|
||||
{
|
||||
if (par1File.isDirectory())
|
||||
{
|
||||
File[] var2 = par1File.listFiles();
|
||||
int var3 = var2.length;
|
||||
|
||||
for (int var4 = 0; var4 < var3; ++var4)
|
||||
{
|
||||
File var5 = var2[var4];
|
||||
this.readAssetsDir(var5);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//this.addResourceFile(AbstractResourcePack.getRelativeName(this.fileAssets, par1File), par1File);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public EaglerImage getPackImage() throws IOException
|
||||
{
|
||||
//return ImageIO.read(DefaultResourcePack.class.getResourceAsStream("/" + (new TextureLocation("pack.png"))));
|
||||
return null; // FIX THIS SHIT
|
||||
}
|
||||
|
||||
public String getPackName()
|
||||
{
|
||||
return "Default";
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
|
||||
public class DynamicTexture extends AbstractTexture
|
||||
{
|
||||
private final int[] dynamicTextureData;
|
||||
|
||||
/** width of this icon in pixels */
|
||||
private final int width;
|
||||
|
||||
/** height of this icon in pixels */
|
||||
private final int height;
|
||||
|
||||
public DynamicTexture(BufferedImage par1BufferedImage)
|
||||
{
|
||||
this(par1BufferedImage.getWidth(), par1BufferedImage.getHeight());
|
||||
par1BufferedImage.getRGB(0, 0, par1BufferedImage.getWidth(), par1BufferedImage.getHeight(), this.dynamicTextureData, 0, par1BufferedImage.getWidth());
|
||||
this.updateDynamicTexture();
|
||||
}
|
||||
|
||||
public DynamicTexture(int par1, int par2)
|
||||
{
|
||||
this.width = par1;
|
||||
this.height = par2;
|
||||
this.dynamicTextureData = new int[par1 * par2];
|
||||
TextureUtil.allocateTexture(this.getGlTextureId(), par1, par2);
|
||||
}
|
||||
|
||||
public void loadTexture(ResourceManager par1ResourceManager) throws IOException {}
|
||||
|
||||
public void updateDynamicTexture()
|
||||
{
|
||||
TextureUtil.uploadTexture(this.getGlTextureId(), this.dynamicTextureData, this.width, this.height);
|
||||
}
|
||||
|
||||
public int[] getTextureData()
|
||||
{
|
||||
return this.dynamicTextureData;
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import net.lax1dude.eaglercraft.TextureLocation;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class FoliageColorReloadListener implements ResourceManagerReloadListener
|
||||
{
|
||||
private static final TextureLocation field_130079_a = new TextureLocation("textures/colormap/foliage.png");
|
||||
|
||||
public void onResourceManagerReload(ResourceManager par1ResourceManager)
|
||||
{
|
||||
try
|
||||
{
|
||||
ColorizerFoliage.setFoliageBiomeColorizer(TextureUtil.readImageData(par1ResourceManager, field_130079_a));
|
||||
}
|
||||
catch (IOException var3)
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,7 @@ public class GameSettings {
|
||||
public boolean snooperEnabled = false;
|
||||
public boolean fullScreen = false;
|
||||
public boolean enableVsync = true;
|
||||
public boolean hideVsyncWarning = false;
|
||||
public boolean hideVsyncWarning = true;
|
||||
public boolean hideServerAddress = false;
|
||||
|
||||
/**
|
||||
@@ -296,11 +296,6 @@ public class GameSettings {
|
||||
this.enableFog = !this.enableFog;
|
||||
}
|
||||
|
||||
if (par1EnumOptions == EnumOptions.ANAGLYPH) {
|
||||
this.anaglyph = !this.anaglyph;
|
||||
this.mc.renderEngine.refreshTextures();
|
||||
}
|
||||
|
||||
if (par1EnumOptions == EnumOptions.FRAMERATE_LIMIT) {
|
||||
this.limitFramerate = (this.limitFramerate + par2 + 3) % 3;
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import net.lax1dude.eaglercraft.TextureLocation;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class GrassColorReloadListener implements ResourceManagerReloadListener
|
||||
{
|
||||
private static final TextureLocation field_130078_a = new TextureLocation("textures/colormap/grass.png");
|
||||
|
||||
public void onResourceManagerReload(ResourceManager par1ResourceManager)
|
||||
{
|
||||
try
|
||||
{
|
||||
ColorizerGrass.setGrassBiomeColorizer(TextureUtil.readImageData(par1ResourceManager, field_130078_a));
|
||||
}
|
||||
catch (IOException var3)
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,7 @@ public class GuiIngame extends Gui
|
||||
|
||||
if (var10 > 0.0F)
|
||||
{
|
||||
this.func_130015_b(var10, var6, var7);
|
||||
this.renderPortalOverlay(var10, var6, var7);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,9 +107,7 @@ public class GuiIngame extends Gui
|
||||
EaglerAdapter.glBlendFunc(EaglerAdapter.GL_ONE_MINUS_DST_COLOR, EaglerAdapter.GL_ONE_MINUS_SRC_COLOR);
|
||||
this.drawTexturedModalRect(var6 / 2 - 7, var7 / 2 - 7, 0, 0, 16, 16);
|
||||
EaglerAdapter.glDisable(EaglerAdapter.GL_BLEND);
|
||||
this.mc.mcProfiler.startSection("bossHealth");
|
||||
this.renderBossHealth();
|
||||
this.mc.mcProfiler.endSection();
|
||||
|
||||
if (this.mc.playerController.shouldDrawHUD())
|
||||
{
|
||||
@@ -117,9 +115,8 @@ public class GuiIngame extends Gui
|
||||
}
|
||||
|
||||
EaglerAdapter.glDisable(EaglerAdapter.GL_BLEND);
|
||||
this.mc.mcProfiler.startSection("actionBar");
|
||||
EaglerAdapter.glEnable(EaglerAdapter.GL_RESCALE_NORMAL);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
RenderHelper.enableGUIStandardItemLighting2();
|
||||
|
||||
for (var11 = 0; var11 < 9; ++var11)
|
||||
{
|
||||
@@ -895,7 +892,7 @@ public class GuiIngame extends Gui
|
||||
EaglerAdapter.glBlendFunc(EaglerAdapter.GL_SRC_ALPHA, EaglerAdapter.GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
|
||||
private void func_130015_b(float par1, int par2, int par3)
|
||||
private void renderPortalOverlay(float par1, int par2, int par3)
|
||||
{
|
||||
if (par1 < 1.0F)
|
||||
{
|
||||
|
||||
@@ -93,7 +93,7 @@ public class GuiInventory extends InventoryEffectRenderer
|
||||
float var9 = par5EntityLivingBase.prevRotationYawHead;
|
||||
float var10 = par5EntityLivingBase.rotationYawHead;
|
||||
EaglerAdapter.glRotatef(135.0F, 0.0F, 1.0F, 0.0F);
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
RenderHelper.enableStandardItemLighting2();
|
||||
EaglerAdapter.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
|
||||
EaglerAdapter.glRotatef(-((float)Math.atan((double)(par4 / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F);
|
||||
par5EntityLivingBase.renderYawOffset = (float)Math.atan((double)(par3 / 40.0F)) * 20.0F;
|
||||
|
||||
@@ -4,11 +4,10 @@ import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
import net.lax1dude.eaglercraft.TextureLocation;
|
||||
import net.lax1dude.eaglercraft.*;
|
||||
|
||||
import net.lax1dude.eaglercraft.adapter.Tessellator;
|
||||
import net.lax1dude.eaglercraft.EaglerAdapter;
|
||||
|
||||
public class GuiWinGame extends GuiScreen
|
||||
{
|
||||
@@ -68,28 +67,23 @@ public class GuiWinGame extends GuiScreen
|
||||
/**
|
||||
* Adds the buttons (and other controls) to the screen in question.
|
||||
*/
|
||||
public void initGui()
|
||||
{
|
||||
if (this.lines == null)
|
||||
{
|
||||
public void initGui() {
|
||||
if (this.lines == null) {
|
||||
this.lines = new ArrayList();
|
||||
|
||||
try
|
||||
{
|
||||
try {
|
||||
String var1 = "";
|
||||
String var2 = "" + EnumChatFormatting.WHITE + EnumChatFormatting.OBFUSCATED + EnumChatFormatting.GREEN + EnumChatFormatting.AQUA;
|
||||
short var3 = 274;
|
||||
BufferedReader var4 = new BufferedReader(new InputStreamReader(this.mc.getResourceManager().getResource(new TextureLocation("texts/end.txt")).getInputStream()));
|
||||
EaglercraftRandom var5 = new EaglercraftRandom(8124371L);
|
||||
int var6;
|
||||
|
||||
while ((var1 = var4.readLine()) != null)
|
||||
{
|
||||
String[] strs = EaglerMisc.bytesToLines(mc.texturePackList.getSelectedTexturePack().getResourceAsBytes("/title/win.txt"));
|
||||
for(String str : strs) {
|
||||
String var7;
|
||||
String var8;
|
||||
|
||||
for (var1 = var1.replaceAll("PLAYERNAME", this.mc.getSession().getUsername()); var1.contains(var2); var1 = var7 + EnumChatFormatting.WHITE + EnumChatFormatting.OBFUSCATED + "XXXXXXXX".substring(0, var5.nextInt(4) + 3) + var8)
|
||||
{
|
||||
for (var1 = var1.replaceAll("PLAYERNAME", EaglerProfile.username); var1.contains(var2); var1 = var7 + EnumChatFormatting.WHITE + EnumChatFormatting.OBFUSCATED + "XXXXXXXX".substring(0, var5.nextInt(4) + 3) + var8) {
|
||||
var6 = var1.indexOf(var2);
|
||||
var7 = var1.substring(0, var6);
|
||||
var8 = var1.substring(var6 + var2.length());
|
||||
@@ -99,30 +93,27 @@ public class GuiWinGame extends GuiScreen
|
||||
this.lines.add("");
|
||||
}
|
||||
|
||||
for (var6 = 0; var6 < 8; ++var6)
|
||||
{
|
||||
for (var6 = 0; var6 < 8; ++var6) {
|
||||
this.lines.add("");
|
||||
}
|
||||
|
||||
var4 = new BufferedReader(new InputStreamReader(this.mc.getResourceManager().getResource(new TextureLocation("texts/credits.txt")).getInputStream()));
|
||||
|
||||
while ((var1 = var4.readLine()) != null)
|
||||
{
|
||||
var1 = var1.replaceAll("PLAYERNAME", this.mc.getSession().getUsername());
|
||||
strs = EaglerMisc.bytesToLines(mc.texturePackList.getSelectedTexturePack().getResourceAsBytes("/title/credits.txt"));
|
||||
for(String str : strs) {
|
||||
var1 = var1.replaceAll("PLAYERNAME", EaglerProfile.username);
|
||||
var1 = var1.replaceAll("\t", " ");
|
||||
this.lines.addAll(this.mc.fontRenderer.listFormattedStringToWidth(var1, var3));
|
||||
this.lines.add("");
|
||||
}
|
||||
|
||||
this.field_73989_c = this.lines.size() * 12;
|
||||
}
|
||||
catch (Exception var9)
|
||||
{
|
||||
} catch (Exception var9) {
|
||||
var9.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static final TextureLocation bk = new TextureLocation("%blur%/gui/background.png");
|
||||
|
||||
private void func_73986_b(int par1, int par2, float par3)
|
||||
{
|
||||
Tessellator var4 = Tessellator.instance;
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import net.lax1dude.eaglercraft.TextureLocation;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.ImageObserver;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
public class LayeredTexture extends AbstractTexture
|
||||
{
|
||||
public final List layeredTextureNames;
|
||||
|
||||
public LayeredTexture(String ... par1ArrayOfStr)
|
||||
{
|
||||
this.layeredTextureNames = new ArrayList<>(List.of(par1ArrayOfStr));
|
||||
}
|
||||
|
||||
public void loadTexture(ResourceManager par1ResourceManager) throws IOException
|
||||
{
|
||||
BufferedImage var2 = null;
|
||||
|
||||
try
|
||||
{
|
||||
Iterator var3 = this.layeredTextureNames.iterator();
|
||||
|
||||
while (var3.hasNext())
|
||||
{
|
||||
String var4 = (String)var3.next();
|
||||
|
||||
if (var4 != null)
|
||||
{
|
||||
InputStream var5 = par1ResourceManager.getResource(new TextureLocation(var4)).getInputStream();
|
||||
BufferedImage var6 = ImageIO.read(var5);
|
||||
|
||||
if (var2 == null)
|
||||
{
|
||||
var2 = new BufferedImage(var6.getWidth(), var6.getHeight(), 2);
|
||||
}
|
||||
|
||||
var2.getGraphics().drawImage(var6, 0, 0, (ImageObserver)null);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IOException var7)
|
||||
{
|
||||
var7.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
TextureUtil.uploadTextureImage(this.getGlTextureId(), var2);
|
||||
}
|
||||
}
|
||||
@@ -133,9 +133,7 @@ public class Minecraft
|
||||
/** The profiler instance */
|
||||
public final Profiler mcProfiler = new Profiler();
|
||||
private long field_83002_am = -1L;
|
||||
private ReloadableResourceManager mcResourceManager;
|
||||
private List defaultResourcePacks = new ArrayList<>();
|
||||
private DefaultResourcePack mcDefaultResourcePack;
|
||||
|
||||
/**
|
||||
* Set to true to keep the game loop running. Set to false by shutdown() to allow the game loop to exit cleanly.
|
||||
@@ -464,11 +462,6 @@ public class Minecraft
|
||||
EaglerAdapter.optimize();
|
||||
}
|
||||
|
||||
private void addDefaultResourcePack()
|
||||
{
|
||||
this.defaultResourcePacks.add(this.mcDefaultResourcePack);
|
||||
}
|
||||
|
||||
private ByteBuffer readImage(File par1File) throws IOException
|
||||
{
|
||||
BufferedImage var2 = ImageIO.read(par1File);
|
||||
@@ -2010,11 +2003,6 @@ public class Minecraft
|
||||
return this.renderEngine;
|
||||
}
|
||||
|
||||
public ResourceManager getResourceManager()
|
||||
{
|
||||
return this.mcResourceManager;
|
||||
}
|
||||
|
||||
static String getLaunchedVersion(Minecraft par0Minecraft)
|
||||
{
|
||||
return "1.6.4";
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ReloadableResourceManager extends ResourceManager
|
||||
{
|
||||
void reloadResources(List var1);
|
||||
|
||||
void registerReloadListener(ResourceManagerReloadListener var1);
|
||||
}
|
||||
@@ -56,7 +56,7 @@ public class RenderHelper {
|
||||
EaglerAdapter.glPushMatrix();
|
||||
EaglerAdapter.glRotatef(-30.0F, 0.0F, 1.0F, 0.0F);
|
||||
EaglerAdapter.glRotatef(165.0F, 1.0F, 0.0F, 0.0F);
|
||||
//EaglerAdapter.glScalef(1.0F, -1.0F, 1.0F);
|
||||
EaglerAdapter.glScalef(1.0F, -1.0F, 1.0F);
|
||||
enableStandardItemLighting();
|
||||
EaglerAdapter.glPopMatrix();
|
||||
}
|
||||
|
||||
@@ -1,186 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
|
||||
public abstract class Request
|
||||
{
|
||||
protected HttpURLConnection field_96367_a;
|
||||
private boolean field_96366_c;
|
||||
protected String field_96365_b;
|
||||
|
||||
public Request(String par1Str, int par2, int par3)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void func_100006_a(String par1Str, String par2Str)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public int func_96362_a()
|
||||
{
|
||||
try
|
||||
{
|
||||
this.func_96354_d();
|
||||
return this.field_96367_a.getResponseCode();
|
||||
}
|
||||
catch (Exception var2)
|
||||
{
|
||||
throw new ExceptionMcoHttp("Failed URL: " + this.field_96365_b, var2);
|
||||
}
|
||||
}
|
||||
|
||||
public int func_111221_b()
|
||||
{
|
||||
String var1 = this.field_96367_a.getHeaderField("Retry-After");
|
||||
|
||||
try
|
||||
{
|
||||
return Integer.valueOf(var1).intValue();
|
||||
}
|
||||
catch (Exception var3)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
|
||||
public String func_96364_c()
|
||||
{
|
||||
try
|
||||
{
|
||||
this.func_96354_d();
|
||||
String var1 = this.func_96362_a() >= 400 ? this.func_96352_a(this.field_96367_a.getErrorStream()) : this.func_96352_a(this.field_96367_a.getInputStream());
|
||||
this.func_96360_f();
|
||||
return var1;
|
||||
}
|
||||
catch (IOException var2)
|
||||
{
|
||||
throw new ExceptionMcoHttp("Failed URL: " + this.field_96365_b, var2);
|
||||
}
|
||||
}
|
||||
|
||||
private String func_96352_a(InputStream par1InputStream) throws IOException
|
||||
{
|
||||
if (par1InputStream == null)
|
||||
{
|
||||
throw new IOException("No response (null)");
|
||||
}
|
||||
else
|
||||
{
|
||||
StringBuilder var2 = new StringBuilder();
|
||||
|
||||
for (int var3 = par1InputStream.read(); var3 != -1; var3 = par1InputStream.read())
|
||||
{
|
||||
var2.append((char)var3);
|
||||
}
|
||||
|
||||
return var2.toString();
|
||||
}
|
||||
}
|
||||
|
||||
private void func_96360_f()
|
||||
{
|
||||
byte[] var1 = new byte[1024];
|
||||
InputStream var3;
|
||||
|
||||
try
|
||||
{
|
||||
boolean var2 = false;
|
||||
var3 = this.field_96367_a.getInputStream();
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (var3.read(var1) <= 0)
|
||||
{
|
||||
var3.close();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception var6)
|
||||
{
|
||||
try
|
||||
{
|
||||
var3 = this.field_96367_a.getErrorStream();
|
||||
boolean var4 = false;
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (var3.read(var1) <= 0)
|
||||
{
|
||||
var3.close();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IOException var5)
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected Request func_96354_d()
|
||||
{
|
||||
if (!this.field_96366_c)
|
||||
{
|
||||
Request var1 = this.func_96359_e();
|
||||
this.field_96366_c = true;
|
||||
return var1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract Request func_96359_e();
|
||||
|
||||
public static Request func_96358_a(String par0Str)
|
||||
{
|
||||
return new RequestGet(par0Str, 5000, 10000);
|
||||
}
|
||||
|
||||
public static Request func_96361_b(String par0Str, String par1Str)
|
||||
{
|
||||
return new RequestPost(par0Str, par1Str.getBytes(), 5000, 10000);
|
||||
}
|
||||
|
||||
public static Request func_104064_a(String par0Str, String par1Str, int par2, int par3)
|
||||
{
|
||||
return new RequestPost(par0Str, par1Str.getBytes(), par2, par3);
|
||||
}
|
||||
|
||||
public static Request func_96355_b(String par0Str)
|
||||
{
|
||||
return new RequestDelete(par0Str, 5000, 10000);
|
||||
}
|
||||
|
||||
public static Request func_96363_c(String par0Str, String par1Str)
|
||||
{
|
||||
return new RequestPut(par0Str, par1Str.getBytes(), 5000, 10000);
|
||||
}
|
||||
|
||||
public static Request func_96353_a(String par0Str, String par1Str, int par2, int par3)
|
||||
{
|
||||
return new RequestPut(par0Str, par1Str.getBytes(), par2, par3);
|
||||
}
|
||||
|
||||
public int func_130110_g()
|
||||
{
|
||||
String var1 = this.field_96367_a.getHeaderField("Error-Code");
|
||||
|
||||
try
|
||||
{
|
||||
return Integer.valueOf(var1).intValue();
|
||||
}
|
||||
catch (Exception var3)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
public class RequestDelete extends Request
|
||||
{
|
||||
public RequestDelete(String par1Str, int par2, int par3)
|
||||
{
|
||||
super(par1Str, par2, par3);
|
||||
}
|
||||
|
||||
public RequestDelete func_96370_f()
|
||||
{
|
||||
try
|
||||
{
|
||||
this.field_96367_a.setDoOutput(true);
|
||||
this.field_96367_a.setRequestMethod("DELETE");
|
||||
this.field_96367_a.connect();
|
||||
return this;
|
||||
}
|
||||
catch (Exception var2)
|
||||
{
|
||||
throw new ExceptionMcoHttp("Failed URL: " + this.field_96365_b, var2);
|
||||
}
|
||||
}
|
||||
|
||||
public Request func_96359_e()
|
||||
{
|
||||
return this.func_96370_f();
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
public class RequestGet extends Request
|
||||
{
|
||||
public RequestGet(String par1Str, int par2, int par3)
|
||||
{
|
||||
super(par1Str, par2, par3);
|
||||
}
|
||||
|
||||
public RequestGet func_96371_f()
|
||||
{
|
||||
try
|
||||
{
|
||||
this.field_96367_a.setDoInput(true);
|
||||
this.field_96367_a.setDoOutput(true);
|
||||
this.field_96367_a.setUseCaches(false);
|
||||
this.field_96367_a.setRequestMethod("GET");
|
||||
return this;
|
||||
}
|
||||
catch (Exception var2)
|
||||
{
|
||||
throw new ExceptionMcoHttp("Failed URL: " + this.field_96365_b, var2);
|
||||
}
|
||||
}
|
||||
|
||||
public Request func_96359_e()
|
||||
{
|
||||
return this.func_96371_f();
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.io.OutputStream;
|
||||
|
||||
public class RequestPost extends Request
|
||||
{
|
||||
private byte[] field_96373_c;
|
||||
|
||||
public RequestPost(String par1Str, byte[] par2ArrayOfByte, int par3, int par4)
|
||||
{
|
||||
super(par1Str, par3, par4);
|
||||
this.field_96373_c = par2ArrayOfByte;
|
||||
}
|
||||
|
||||
public RequestPost func_96372_f()
|
||||
{
|
||||
try
|
||||
{
|
||||
this.field_96367_a.setDoInput(true);
|
||||
this.field_96367_a.setDoOutput(true);
|
||||
this.field_96367_a.setUseCaches(false);
|
||||
this.field_96367_a.setRequestMethod("POST");
|
||||
OutputStream var1 = this.field_96367_a.getOutputStream();
|
||||
var1.write(this.field_96373_c);
|
||||
var1.flush();
|
||||
return this;
|
||||
}
|
||||
catch (Exception var2)
|
||||
{
|
||||
throw new ExceptionMcoHttp("Failed URL: " + this.field_96365_b, var2);
|
||||
}
|
||||
}
|
||||
|
||||
public Request func_96359_e()
|
||||
{
|
||||
return this.func_96372_f();
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.io.OutputStream;
|
||||
|
||||
public class RequestPut extends Request
|
||||
{
|
||||
private byte[] field_96369_c;
|
||||
|
||||
public RequestPut(String par1Str, byte[] par2ArrayOfByte, int par3, int par4)
|
||||
{
|
||||
super(par1Str, par3, par4);
|
||||
this.field_96369_c = par2ArrayOfByte;
|
||||
}
|
||||
|
||||
public RequestPut func_96368_f()
|
||||
{
|
||||
try
|
||||
{
|
||||
this.field_96367_a.setDoOutput(true);
|
||||
this.field_96367_a.setDoInput(true);
|
||||
this.field_96367_a.setRequestMethod("PUT");
|
||||
OutputStream var1 = this.field_96367_a.getOutputStream();
|
||||
var1.write(this.field_96369_c);
|
||||
var1.flush();
|
||||
return this;
|
||||
}
|
||||
catch (Exception var2)
|
||||
{
|
||||
throw new ExceptionMcoHttp("Failed URL: " + this.field_96365_b, var2);
|
||||
}
|
||||
}
|
||||
|
||||
public Request func_96359_e()
|
||||
{
|
||||
return this.func_96368_f();
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
public interface Resource
|
||||
{
|
||||
InputStream getInputStream();
|
||||
|
||||
boolean hasMetadata();
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import net.lax1dude.eaglercraft.TextureLocation;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public interface ResourceManager
|
||||
{
|
||||
Set getResourceDomains();
|
||||
|
||||
Resource getResource(TextureLocation var1) throws IOException;
|
||||
|
||||
List getAllResources(TextureLocation var1) throws IOException;
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
public interface ResourceManagerReloadListener
|
||||
{
|
||||
void onResourceManagerReload(ResourceManager var1);
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglerImage;
|
||||
import net.lax1dude.eaglercraft.TextureLocation;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Set;
|
||||
|
||||
public interface ResourcePack
|
||||
{
|
||||
InputStream getInputStream(TextureLocation var1) throws IOException;
|
||||
|
||||
boolean resourceExists(TextureLocation var1);
|
||||
|
||||
Set getResourceDomains();
|
||||
|
||||
EaglerImage getPackImage() throws IOException;
|
||||
|
||||
String getPackName();
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import net.lax1dude.eaglercraft.TextureLocation;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
public class SimpleTexture extends AbstractTexture
|
||||
{
|
||||
private final TextureLocation textureLocation;
|
||||
|
||||
public SimpleTexture(TextureLocation par1TextureLocation)
|
||||
{
|
||||
this.textureLocation = par1TextureLocation;
|
||||
}
|
||||
|
||||
public void loadTexture(ResourceManager par1ResourceManager) throws IOException
|
||||
{
|
||||
InputStream var2 = null;
|
||||
|
||||
try
|
||||
{
|
||||
Resource var3 = par1ResourceManager.getResource(this.textureLocation);
|
||||
var2 = var3.getInputStream();
|
||||
BufferedImage var4 = ImageIO.read(var2);
|
||||
boolean var5 = false;
|
||||
boolean var6 = false;
|
||||
|
||||
if (var3.hasMetadata())
|
||||
{
|
||||
try
|
||||
{
|
||||
TextureMetadataSection var7 = null;
|
||||
|
||||
if (var7 != null)
|
||||
{
|
||||
var5 = var7.getTextureBlur();
|
||||
var6 = var7.getTextureClamp();
|
||||
}
|
||||
}
|
||||
catch (RuntimeException var11)
|
||||
{
|
||||
System.out.printf("Failed reading metadata of: " + this.textureLocation, var11);
|
||||
}
|
||||
}
|
||||
|
||||
TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), var4, var5, var6);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (var2 != null)
|
||||
{
|
||||
var2.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@ import java.util.Map;
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglerAdapter;
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
import net.minecraft.src.Minecraft;
|
||||
|
||||
public class SoundManager {
|
||||
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import net.lax1dude.eaglercraft.TextureLocation;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
public class SoundPool
|
||||
{
|
||||
/** The RNG used by SoundPool. */
|
||||
private final EaglercraftRandom rand = new EaglercraftRandom();
|
||||
|
||||
/**
|
||||
* Maps a name (can be sound/newsound/streaming/music/newmusic) to a list of SoundPoolEntry's.
|
||||
*/
|
||||
private final Map nameToSoundPoolEntriesMapping = new HashMap<>();
|
||||
private final ResourceManager soundResourceManager;
|
||||
private final String soundType;
|
||||
private final boolean isGetRandomSound;
|
||||
|
||||
public SoundPool(ResourceManager par1ResourceManager, String par2Str, boolean par3)
|
||||
{
|
||||
this.soundResourceManager = par1ResourceManager;
|
||||
this.soundType = par2Str;
|
||||
this.isGetRandomSound = par3;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a sound to this sound pool.
|
||||
*/
|
||||
public void addSound(String par1Str)
|
||||
{
|
||||
try
|
||||
{
|
||||
String var2 = par1Str;
|
||||
par1Str = par1Str.substring(0, par1Str.indexOf("."));
|
||||
|
||||
if (this.isGetRandomSound)
|
||||
{
|
||||
while (Character.isDigit(par1Str.charAt(par1Str.length() - 1)))
|
||||
{
|
||||
par1Str = par1Str.substring(0, par1Str.length() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
par1Str = par1Str.replaceAll("/", ".");
|
||||
Object var3 = (List)this.nameToSoundPoolEntriesMapping.get(par1Str);
|
||||
|
||||
if (var3 == null)
|
||||
{
|
||||
var3 = new ArrayList<>();
|
||||
this.nameToSoundPoolEntriesMapping.put(par1Str, var3);
|
||||
}
|
||||
|
||||
((List)var3).add(new SoundPoolEntry(var2, this.func_110654_c(var2)));
|
||||
}
|
||||
catch (MalformedURLException var4)
|
||||
{
|
||||
var4.printStackTrace();
|
||||
throw new RuntimeException(var4);
|
||||
}
|
||||
}
|
||||
|
||||
private URL func_110654_c(String par1Str) throws MalformedURLException
|
||||
{
|
||||
TextureLocation var2 = new TextureLocation(par1Str);
|
||||
String var3 = String.format("%s:%s:%s/%s", new Object[] {"mcsounddomain", var2, this.soundType, var2});
|
||||
SoundPoolProtocolHandler var4 = new SoundPoolProtocolHandler(this);
|
||||
return new URL((URL)null, var3, var4);
|
||||
}
|
||||
|
||||
/**
|
||||
* gets a random sound from the specified (by name, can be sound/newsound/streaming/music/newmusic) sound pool.
|
||||
*/
|
||||
public SoundPoolEntry getRandomSoundFromSoundPool(String par1Str)
|
||||
{
|
||||
List var2 = (List)this.nameToSoundPoolEntriesMapping.get(par1Str);
|
||||
return var2 == null ? null : (SoundPoolEntry)var2.get(this.rand.nextInt(var2.size()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a random SoundPoolEntry.
|
||||
*/
|
||||
public SoundPoolEntry getRandomSound()
|
||||
{
|
||||
if (this.nameToSoundPoolEntriesMapping.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
ArrayList var1 = new ArrayList<>(this.nameToSoundPoolEntriesMapping.keySet());
|
||||
return this.getRandomSoundFromSoundPool((String)var1.get(this.rand.nextInt(var1.size())));
|
||||
}
|
||||
}
|
||||
|
||||
static ResourceManager func_110655_a(SoundPool par0SoundPool)
|
||||
{
|
||||
return par0SoundPool.soundResourceManager;
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
public class SoundPoolEntry
|
||||
{
|
||||
private final String soundName;
|
||||
private final URL soundUrl;
|
||||
|
||||
public SoundPoolEntry(String par1Str, URL par2URL)
|
||||
{
|
||||
this.soundName = par1Str;
|
||||
this.soundUrl = par2URL;
|
||||
}
|
||||
|
||||
public String getSoundName()
|
||||
{
|
||||
return this.soundName;
|
||||
}
|
||||
|
||||
public URL getSoundUrl()
|
||||
{
|
||||
return this.soundUrl;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.net.URLStreamHandler;
|
||||
|
||||
class SoundPoolProtocolHandler extends URLStreamHandler
|
||||
{
|
||||
final SoundPool theSoundPool;
|
||||
|
||||
SoundPoolProtocolHandler(SoundPool par1SoundPool)
|
||||
{
|
||||
this.theSoundPool = par1SoundPool;
|
||||
}
|
||||
|
||||
protected URLConnection openConnection(URL par1URL)
|
||||
{
|
||||
return new SoundPoolURLConnection(this.theSoundPool, par1URL, (SoundPoolProtocolHandler)null);
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import net.lax1dude.eaglercraft.TextureLocation;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
|
||||
class SoundPoolURLConnection extends URLConnection
|
||||
{
|
||||
private final TextureLocation field_110659_b;
|
||||
|
||||
final SoundPool theSoundPool;
|
||||
|
||||
private SoundPoolURLConnection(SoundPool par1SoundPool, URL par2URL)
|
||||
{
|
||||
super(par2URL);
|
||||
this.theSoundPool = par1SoundPool;
|
||||
this.field_110659_b = new TextureLocation(par2URL.getPath());
|
||||
}
|
||||
|
||||
public void connect() {}
|
||||
|
||||
public InputStream getInputStream()
|
||||
{
|
||||
try
|
||||
{
|
||||
return SoundPool.func_110655_a(this.theSoundPool).getResource(this.field_110659_b).getInputStream();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
SoundPoolURLConnection(SoundPool par1SoundPool, URL par2URL, SoundPoolProtocolHandler par3SoundPoolProtocolHandler)
|
||||
{
|
||||
this(par1SoundPool, par2URL);
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
class TextureManagerINNER1 implements Callable
|
||||
{
|
||||
final TextureObject theTextureObject;
|
||||
|
||||
final TextureManager theTextureManager;
|
||||
|
||||
TextureManagerINNER1(TextureManager par1TextureManager, TextureObject par2TextureObject)
|
||||
{
|
||||
this.theTextureManager = par1TextureManager;
|
||||
this.theTextureObject = par2TextureObject;
|
||||
}
|
||||
|
||||
public String func_135060_a()
|
||||
{
|
||||
return this.theTextureObject.getClass().getName();
|
||||
}
|
||||
|
||||
public Object call()
|
||||
{
|
||||
return this.func_135060_a();
|
||||
}
|
||||
}
|
||||
@@ -12,8 +12,8 @@ import net.lax1dude.eaglercraft.EaglerImage;
|
||||
import net.lax1dude.eaglercraft.TextureLocation;
|
||||
|
||||
public class TextureMap implements IconRegister {
|
||||
public static final TextureLocation locationBlocksTexture = new TextureLocation("textures/atlas/blocks.png");
|
||||
public static final TextureLocation locationItemsTexture = new TextureLocation("textures/atlas/items.png");
|
||||
public static final TextureLocation locationBlocksTexture = new TextureLocation("/terrain.png");
|
||||
public static final TextureLocation locationItemsTexture = new TextureLocation("/gui/items.png");
|
||||
|
||||
/** 0 = terrain.png, 1 = items.png */
|
||||
private final int textureType;
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public interface TextureObject
|
||||
{
|
||||
void loadTexture(ResourceManager var1) throws IOException;
|
||||
|
||||
int getGlTextureId();
|
||||
}
|
||||
@@ -43,7 +43,7 @@ public class TexturePackList
|
||||
private Map texturePackCache = new HashMap();
|
||||
|
||||
/** The TexturePack that will be used. */
|
||||
private ITexturePack selectedTexturePack;
|
||||
private ITexturePack selectedTexturePack = defaultTexturePack;
|
||||
|
||||
/** True if a texture pack is downloading in the background. */
|
||||
private boolean isDownloading;
|
||||
|
||||
@@ -4,7 +4,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglerMisc;
|
||||
import net.minecraft.src.Minecraft;
|
||||
|
||||
public class TextureStitched implements Icon {
|
||||
private final String textureName;
|
||||
|
||||
@@ -1,186 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.nio.IntBuffer;
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import net.lax1dude.eaglercraft.TextureLocation;
|
||||
import net.lax1dude.eaglercraft.EaglerAdapter;
|
||||
|
||||
public class TextureUtil
|
||||
{
|
||||
private static final IntBuffer dataBuffer = GLAllocation.createDirectIntBuffer(4194304);
|
||||
public static final DynamicTexture missingTexture = new DynamicTexture(16, 16);
|
||||
public static final int[] missingTextureData = missingTexture.getTextureData();
|
||||
|
||||
public static int glGenTextures()
|
||||
{
|
||||
return EaglerAdapter.glGenTextures();
|
||||
}
|
||||
|
||||
public static int uploadTextureImage(int par0, BufferedImage par1BufferedImage)
|
||||
{
|
||||
return uploadTextureImageAllocate(par0, par1BufferedImage, false, false);
|
||||
}
|
||||
|
||||
public static void uploadTexture(int par0, int[] par1ArrayOfInteger, int par2, int par3)
|
||||
{
|
||||
bindTexture(par0);
|
||||
uploadTextureSub(par1ArrayOfInteger, par2, par3, 0, 0, false, false);
|
||||
}
|
||||
|
||||
public static void uploadTextureSub(int[] par0ArrayOfInteger, int par1, int par2, int par3, int par4, boolean par5, boolean par6)
|
||||
{
|
||||
int var7 = 4194304 / par1;
|
||||
setTextureBlurred(par5);
|
||||
setTextureClamped(par6);
|
||||
int var10;
|
||||
|
||||
for (int var8 = 0; var8 < par1 * par2; var8 += par1 * var10)
|
||||
{
|
||||
int var9 = var8 / par1;
|
||||
var10 = Math.min(var7, par2 - var9);
|
||||
int var11 = par1 * var10;
|
||||
copyToBufferPos(par0ArrayOfInteger, var8, var11);
|
||||
EaglerAdapter.glTexSubImage2D(EaglerAdapter.GL_TEXTURE_2D, 0, par3, par4 + var9, par1, var10, EaglerAdapter.GL_BGRA, EaglerAdapter.GL_UNSIGNED_INT_8_8_8_8_REV, dataBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
public static int uploadTextureImageAllocate(int par0, BufferedImage par1BufferedImage, boolean par2, boolean par3)
|
||||
{
|
||||
allocateTexture(par0, par1BufferedImage.getWidth(), par1BufferedImage.getHeight());
|
||||
return uploadTextureImageSub(par0, par1BufferedImage, 0, 0, par2, par3);
|
||||
}
|
||||
|
||||
public static void allocateTexture(int par0, int par1, int par2)
|
||||
{
|
||||
bindTexture(par0);
|
||||
EaglerAdapter.glTexImage2D(EaglerAdapter.GL_TEXTURE_2D, 0, EaglerAdapter.GL_RGBA, par1, par2, 0, EaglerAdapter.GL_BGRA, EaglerAdapter.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)null);
|
||||
}
|
||||
|
||||
public static int uploadTextureImageSub(int par0, BufferedImage par1BufferedImage, int par2, int par3, boolean par4, boolean par5)
|
||||
{
|
||||
bindTexture(par0);
|
||||
uploadTextureImageSubImpl(par1BufferedImage, par2, par3, par4, par5);
|
||||
return par0;
|
||||
}
|
||||
|
||||
private static void uploadTextureImageSubImpl(BufferedImage par0BufferedImage, int par1, int par2, boolean par3, boolean par4)
|
||||
{
|
||||
int var5 = par0BufferedImage.getWidth();
|
||||
int var6 = par0BufferedImage.getHeight();
|
||||
int var7 = 4194304 / var5;
|
||||
int[] var8 = new int[var7 * var5];
|
||||
setTextureBlurred(par3);
|
||||
setTextureClamped(par4);
|
||||
|
||||
for (int var9 = 0; var9 < var5 * var6; var9 += var5 * var7)
|
||||
{
|
||||
int var10 = var9 / var5;
|
||||
int var11 = Math.min(var7, var6 - var10);
|
||||
int var12 = var5 * var11;
|
||||
par0BufferedImage.getRGB(0, var10, var5, var11, var8, 0, var5);
|
||||
copyToBuffer(var8, var12);
|
||||
EaglerAdapter.glTexSubImage2D(EaglerAdapter.GL_TEXTURE_2D, 0, par1, par2 + var10, var5, var11, EaglerAdapter.GL_BGRA, EaglerAdapter.GL_UNSIGNED_INT_8_8_8_8_REV, dataBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
private static void setTextureClamped(boolean par0)
|
||||
{
|
||||
if (par0)
|
||||
{
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_WRAP_S, EaglerAdapter.GL_REPEAT);
|
||||
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_WRAP_T, EaglerAdapter.GL_REPEAT);
|
||||
}
|
||||
}
|
||||
|
||||
private static void setTextureBlurred(boolean par0)
|
||||
{
|
||||
if (par0)
|
||||
{
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MIN_FILTER, EaglerAdapter.GL_NEAREST);
|
||||
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MAG_FILTER, EaglerAdapter.GL_NEAREST);
|
||||
}
|
||||
}
|
||||
|
||||
private static void copyToBuffer(int[] par0ArrayOfInteger, int par1)
|
||||
{
|
||||
copyToBufferPos(par0ArrayOfInteger, 0, par1);
|
||||
}
|
||||
|
||||
private static void copyToBufferPos(int[] par0ArrayOfInteger, int par1, int par2)
|
||||
{
|
||||
int[] var3 = par0ArrayOfInteger;
|
||||
|
||||
if (Minecraft.getMinecraft().gameSettings.anaglyph)
|
||||
{
|
||||
var3 = updateAnaglyph(par0ArrayOfInteger);
|
||||
}
|
||||
|
||||
dataBuffer.clear();
|
||||
dataBuffer.put(var3, par1, par2);
|
||||
dataBuffer.position(0).limit(par2);
|
||||
}
|
||||
|
||||
static void bindTexture(int par0)
|
||||
{
|
||||
EaglerAdapter.glBindTexture(EaglerAdapter.GL_TEXTURE_2D, par0);
|
||||
}
|
||||
|
||||
public static int[] readImageData(ResourceManager par0ResourceManager, TextureLocation par1TextureLocation) throws IOException
|
||||
{
|
||||
BufferedImage var2 = ImageIO.read(par0ResourceManager.getResource(par1TextureLocation).getInputStream());
|
||||
int var3 = var2.getWidth();
|
||||
int var4 = var2.getHeight();
|
||||
int[] var5 = new int[var3 * var4];
|
||||
var2.getRGB(0, 0, var3, var4, var5, 0, var3);
|
||||
return var5;
|
||||
}
|
||||
|
||||
public static int[] updateAnaglyph(int[] par0ArrayOfInteger)
|
||||
{
|
||||
int[] var1 = new int[par0ArrayOfInteger.length];
|
||||
|
||||
for (int var2 = 0; var2 < par0ArrayOfInteger.length; ++var2)
|
||||
{
|
||||
int var3 = par0ArrayOfInteger[var2] >> 24 & 255;
|
||||
int var4 = par0ArrayOfInteger[var2] >> 16 & 255;
|
||||
int var5 = par0ArrayOfInteger[var2] >> 8 & 255;
|
||||
int var6 = par0ArrayOfInteger[var2] & 255;
|
||||
int var7 = (var4 * 30 + var5 * 59 + var6 * 11) / 100;
|
||||
int var8 = (var4 * 30 + var5 * 70) / 100;
|
||||
int var9 = (var4 * 30 + var6 * 70) / 100;
|
||||
var1[var2] = var3 << 24 | var7 << 16 | var8 << 8 | var9;
|
||||
}
|
||||
|
||||
return var1;
|
||||
}
|
||||
|
||||
static
|
||||
{
|
||||
int var0 = -16777216;
|
||||
int var1 = -524040;
|
||||
int[] var2 = new int[] { -524040, -524040, -524040, -524040, -524040, -524040, -524040, -524040};
|
||||
int[] var3 = new int[] { -16777216, -16777216, -16777216, -16777216, -16777216, -16777216, -16777216, -16777216};
|
||||
int var4 = var2.length;
|
||||
|
||||
for (int var5 = 0; var5 < 16; ++var5)
|
||||
{
|
||||
System.arraycopy(var5 < var4 ? var2 : var3, 0, missingTextureData, 16 * var5, var4);
|
||||
System.arraycopy(var5 < var4 ? var3 : var2, 0, missingTextureData, 16 * var5 + var4, var4);
|
||||
}
|
||||
|
||||
missingTexture.updateDynamicTexture();
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
public interface TickableTextureObject extends TextureObject, Tickable
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user