mirror of
https://github.com/catfoolyou/Beta-1.4_01.git
synced 2025-05-31 19:00:57 -05:00
89 errors
This commit is contained in:
parent
b66190630a
commit
f0c9d758c6
BIN
.gradle/8.0/executionHistory/executionHistory.bin
Normal file
BIN
.gradle/8.0/executionHistory/executionHistory.bin
Normal file
Binary file not shown.
Binary file not shown.
BIN
.gradle/8.0/fileHashes/fileHashes.bin
Normal file
BIN
.gradle/8.0/fileHashes/fileHashes.bin
Normal file
Binary file not shown.
Binary file not shown.
BIN
.gradle/8.0/fileHashes/resourceHashesCache.bin
Normal file
BIN
.gradle/8.0/fileHashes/resourceHashesCache.bin
Normal file
Binary file not shown.
Binary file not shown.
BIN
.gradle/buildOutputCleanup/outputFiles.bin
Normal file
BIN
.gradle/buildOutputCleanup/outputFiles.bin
Normal file
Binary file not shown.
BIN
.gradle/file-system.probe
Normal file
BIN
.gradle/file-system.probe
Normal file
Binary file not shown.
@ -1,7 +1,6 @@
|
||||
package net.minecraft.client;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import net.lax1dude.eaglercraft.EagRuntime;
|
||||
import net.lax1dude.eaglercraft.internal.EnumPlatformType;
|
||||
@ -22,7 +21,6 @@ import net.minecraft.src.EnumOptions;
|
||||
import net.minecraft.src.FontRenderer;
|
||||
import net.minecraft.src.GLAllocation;
|
||||
import net.minecraft.src.GameSettings;
|
||||
import net.minecraft.src.GameWindowListener;
|
||||
import net.minecraft.src.GuiAchievement;
|
||||
import net.minecraft.src.GuiChat;
|
||||
import net.minecraft.src.GuiConflictWarning;
|
||||
@ -57,7 +55,6 @@ import net.minecraft.src.RenderGlobal;
|
||||
import net.minecraft.src.RenderManager;
|
||||
import net.minecraft.src.SaveConverterMcRegion;
|
||||
import net.minecraft.src.ScaledResolution;
|
||||
import net.minecraft.src.ScreenShotHelper;
|
||||
import net.minecraft.src.Session;
|
||||
import net.minecraft.src.SoundManager;
|
||||
import net.minecraft.src.StatList;
|
||||
@ -81,16 +78,14 @@ import net.minecraft.src.WorldProvider;
|
||||
import net.minecraft.src.WorldProviderHell;
|
||||
import net.minecraft.src.WorldRenderer;
|
||||
import net.minecraft.src.XBlah;
|
||||
import org.lwjgl.BufferUtils;
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.Display;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
import org.lwjgl.util.glu.GLU;
|
||||
|
||||
public abstract class Minecraft {
|
||||
public class Minecraft {
|
||||
private static Minecraft theMinecraft;
|
||||
public PlayerController playerController;
|
||||
private boolean fullscreen = false;
|
||||
@ -775,7 +770,7 @@ public abstract class Minecraft {
|
||||
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.renderEngine.getTexture("/terrain.png"));
|
||||
if(!this.isWorldLoaded) {
|
||||
this.renderEngine.func_1067_a();
|
||||
this.renderEngine.updateTerrainTextures();
|
||||
}
|
||||
|
||||
if(this.currentScreen == null && this.thePlayer != null) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.nio.FloatBuffer;
|
||||
import net.lax1dude.eaglercraft.internal.buffer.FloatBuffer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ClippingHelperImplementation extends ClippingHelper {
|
||||
|
@ -1,7 +1,6 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
import net.lax1dude.eaglercraft.EagRuntime;
|
||||
import net.lax1dude.eaglercraft.internal.buffer.ByteBuffer;
|
||||
import net.lax1dude.eaglercraft.internal.buffer.IntBuffer;
|
||||
import net.lax1dude.eaglercraft.internal.buffer.FloatBuffer;
|
||||
@ -31,9 +30,9 @@ public class GLAllocation {
|
||||
}
|
||||
|
||||
public static synchronized void deleteTexturesAndDisplayLists() {
|
||||
for(int var0 = 0; var0 < displayLists.size(); var0 += 2) {
|
||||
GL11.glDeleteLists(((Integer)displayLists.get(var0)).intValue(), ((Integer)displayLists.get(var0 + 1)).intValue());
|
||||
}
|
||||
// for(int var0 = 0; var0 < displayLists.size(); var0 += 2) {
|
||||
// GL11.glDeleteLists(((Integer)displayLists.get(var0)).intValue(), ((Integer)displayLists.get(var0 + 1)).intValue());
|
||||
// }
|
||||
|
||||
IntBuffer var2 = createDirectIntBuffer(textureNames.size());
|
||||
var2.flip();
|
||||
@ -50,8 +49,7 @@ public class GLAllocation {
|
||||
}
|
||||
|
||||
public static synchronized ByteBuffer createDirectByteBuffer(int var0) {
|
||||
ByteBuffer var1 = ByteBuffer.allocateDirect(var0).order(ByteOrder.nativeOrder());
|
||||
return var1;
|
||||
return EagRuntime.allocateByteBuffer(var0);
|
||||
}
|
||||
|
||||
public static IntBuffer createDirectIntBuffer(int var0) {
|
||||
|
@ -2,7 +2,6 @@ package net.minecraft.src;
|
||||
|
||||
import java.io.File;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import org.lwjgl.Sys;
|
||||
|
||||
public class GuiTexturePacks extends GuiScreen {
|
||||
protected GuiScreen guiScreen;
|
||||
@ -27,7 +26,7 @@ public class GuiTexturePacks extends GuiScreen {
|
||||
protected void actionPerformed(GuiButton var1) {
|
||||
if(var1.enabled) {
|
||||
if(var1.id == 5) {
|
||||
Sys.openURL("file://" + this.fileLocation);
|
||||
//Sys.openURL("file://" + this.fileLocation);
|
||||
} else if(var1.id == 6) {
|
||||
this.mc.renderEngine.refreshTextures();
|
||||
this.mc.displayGuiScreen(this.guiScreen);
|
||||
|
@ -2,13 +2,12 @@ package net.minecraft.src;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import java.util.*;
|
||||
|
||||
import net.lax1dude.eaglercraft.EagRuntime;
|
||||
import net.lax1dude.eaglercraft.opengl.ImageData;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.lax1dude.eaglercraft.internal.buffer.ByteBuffer;
|
||||
import net.lax1dude.eaglercraft.internal.buffer.IntBuffer;
|
||||
|
||||
@ -23,22 +22,15 @@ public class RenderEngine {
|
||||
private GameSettings options;
|
||||
private boolean clampTexture = false;
|
||||
private boolean blurTexture = false;
|
||||
private TexturePackList field_6527_k;
|
||||
private BufferedImage field_25189_l = new BufferedImage(64, 64, 2);
|
||||
private TexturePackList texturePackList;
|
||||
|
||||
public RenderEngine(TexturePackList var1, GameSettings var2) {
|
||||
this.field_6527_k = var1;
|
||||
this.texturePackList = var1;
|
||||
this.options = var2;
|
||||
Graphics var3 = this.field_25189_l.getGraphics();
|
||||
var3.setColor(Color.WHITE);
|
||||
var3.fillRect(0, 0, 64, 64);
|
||||
var3.setColor(Color.BLACK);
|
||||
var3.drawString("missingtex", 1, 10);
|
||||
var3.dispose();
|
||||
}
|
||||
|
||||
public int getTexture(String var1) {
|
||||
TexturePackBase var2 = this.field_6527_k.selectedTexturePack;
|
||||
TexturePackBase var2 = this.texturePackList.selectedTexturePack;
|
||||
Integer var3 = (Integer)this.textureMap.get(var1);
|
||||
if(var3 != null) {
|
||||
return var3.intValue();
|
||||
@ -48,22 +40,17 @@ public class RenderEngine {
|
||||
GLAllocation.generateTextureNames(this.singleIntBuffer);
|
||||
int var6 = this.singleIntBuffer.get(0);
|
||||
if(var1.startsWith("##")) {
|
||||
this.setupTexture(this.unwrapImageByColumns(this.readTextureImage(var2.func_6481_a(var1.substring(2)))), var6);
|
||||
this.setupTexture(this.unwrapImageByColumns(this.readTextureImage(var2.getReqResStream(var1.substring(2)))), var6);
|
||||
} else if(var1.startsWith("%clamp%")) {
|
||||
this.clampTexture = true;
|
||||
this.setupTexture(this.readTextureImage(var2.func_6481_a(var1.substring(7))), var6);
|
||||
this.setupTexture(this.readTextureImage(var2.getReqResStream(var1.substring(7))), var6);
|
||||
this.clampTexture = false;
|
||||
} else if(var1.startsWith("%blur%")) {
|
||||
this.blurTexture = true;
|
||||
this.setupTexture(this.readTextureImage(var2.func_6481_a(var1.substring(6))), var6);
|
||||
this.setupTexture(this.readTextureImage(var2.getReqResStream(var1.substring(6))), var6);
|
||||
this.blurTexture = false;
|
||||
} else {
|
||||
InputStream var4 = var2.func_6481_a(var1);
|
||||
if(var4 == null) {
|
||||
this.setupTexture(this.field_25189_l, var6);
|
||||
} else {
|
||||
this.setupTexture(this.readTextureImage(var4), var6);
|
||||
}
|
||||
this.setupTexture(this.readTextureImage(EagRuntime.getRequiredResourceStream(var1)), var6);
|
||||
}
|
||||
|
||||
this.textureMap.put(var1, Integer.valueOf(var6));
|
||||
@ -74,20 +61,18 @@ public class RenderEngine {
|
||||
}
|
||||
}
|
||||
|
||||
private BufferedImage unwrapImageByColumns(BufferedImage var1) {
|
||||
private ImageData unwrapImageByColumns(ImageData var1) {
|
||||
int var2 = var1.getWidth() / 16;
|
||||
BufferedImage var3 = new BufferedImage(16, var1.getHeight() * var2, 2);
|
||||
Graphics var4 = var3.getGraphics();
|
||||
ImageData var3 = new ImageData(16, var1.getHeight() * var2, var1.alpha);
|
||||
|
||||
for(int var5 = 0; var5 < var2; ++var5) {
|
||||
var4.drawImage(var1, -var5 * 16, var5 * var1.getHeight(), (ImageObserver)null);
|
||||
var3.drawLayer(var1, 0, var5 * var1.getHeight(), 16, (var5 + 1) * var1.getHeight(), var5 * 16, 0, (var5 + 1) * 16, var1.getHeight());
|
||||
}
|
||||
|
||||
var4.dispose();
|
||||
return var3;
|
||||
}
|
||||
|
||||
public int allocateAndSetupTexture(BufferedImage var1) {
|
||||
public int allocateAndSetupTexture(ImageData var1) {
|
||||
this.singleIntBuffer.clear();
|
||||
GLAllocation.generateTextureNames(this.singleIntBuffer);
|
||||
int var2 = this.singleIntBuffer.get(0);
|
||||
@ -96,7 +81,7 @@ public class RenderEngine {
|
||||
return var2;
|
||||
}
|
||||
|
||||
public void setupTexture(BufferedImage var1, int var2) {
|
||||
public void setupTexture(ImageData var1, int var2) {
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, var2);
|
||||
if(useMipmaps) {
|
||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR_MIPMAP_LINEAR);
|
||||
@ -189,44 +174,7 @@ public class RenderEngine {
|
||||
}
|
||||
|
||||
public int getTextureForDownloadableImage(String var1, String var2) {
|
||||
ThreadDownloadImageData var3 = (ThreadDownloadImageData)this.urlToImageDataMap.get(var1);
|
||||
if(var3 != null && var3.image != null && !var3.textureSetupComplete) {
|
||||
if(var3.textureName < 0) {
|
||||
var3.textureName = this.allocateAndSetupTexture(var3.image);
|
||||
} else {
|
||||
this.setupTexture(var3.image, var3.textureName);
|
||||
}
|
||||
|
||||
var3.textureSetupComplete = true;
|
||||
}
|
||||
|
||||
return var3 != null && var3.textureName >= 0 ? var3.textureName : (var2 == null ? -1 : this.getTexture(var2));
|
||||
}
|
||||
|
||||
public ThreadDownloadImageData obtainImageData(String var1, ImageBuffer var2) {
|
||||
ThreadDownloadImageData var3 = (ThreadDownloadImageData)this.urlToImageDataMap.get(var1);
|
||||
if(var3 == null) {
|
||||
this.urlToImageDataMap.put(var1, new ThreadDownloadImageData(var1, var2));
|
||||
} else {
|
||||
++var3.referenceCount;
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
|
||||
public void releaseImageData(String var1) {
|
||||
ThreadDownloadImageData var2 = (ThreadDownloadImageData)this.urlToImageDataMap.get(var1);
|
||||
if(var2 != null) {
|
||||
--var2.referenceCount;
|
||||
if(var2.referenceCount == 0) {
|
||||
if(var2.textureName >= 0) {
|
||||
this.deleteTexture(var2.textureName);
|
||||
}
|
||||
|
||||
this.urlToImageDataMap.remove(var1);
|
||||
}
|
||||
}
|
||||
|
||||
return this.getTexture(var2);
|
||||
}
|
||||
|
||||
public void registerTextureFX(TextureFX var1) {
|
||||
@ -234,7 +182,7 @@ public class RenderEngine {
|
||||
var1.onTick();
|
||||
}
|
||||
|
||||
public void func_1067_a() {
|
||||
public void updateTerrainTextures() {
|
||||
int var1;
|
||||
TextureFX var2;
|
||||
int var3;
|
||||
@ -343,21 +291,16 @@ public class RenderEngine {
|
||||
}
|
||||
|
||||
public void refreshTextures() {
|
||||
TexturePackBase var1 = this.field_6527_k.selectedTexturePack;
|
||||
TexturePackBase var1 = this.texturePackList.selectedTexturePack;
|
||||
Iterator var2 = this.textureNameToImageMap.keySet().iterator();
|
||||
|
||||
BufferedImage var4;
|
||||
ImageData var4;
|
||||
while(var2.hasNext()) {
|
||||
int var3 = ((Integer)var2.next()).intValue();
|
||||
var4 = (BufferedImage)this.textureNameToImageMap.get(Integer.valueOf(var3));
|
||||
var4 = (ImageData)this.textureNameToImageMap.get(Integer.valueOf(var3));
|
||||
this.setupTexture(var4, var3);
|
||||
}
|
||||
|
||||
ThreadDownloadImageData var7;
|
||||
for(var2 = this.urlToImageDataMap.values().iterator(); var2.hasNext(); var7.textureSetupComplete = false) {
|
||||
var7 = (ThreadDownloadImageData)var2.next();
|
||||
}
|
||||
|
||||
var2 = this.textureMap.keySet().iterator();
|
||||
|
||||
while(var2.hasNext()) {
|
||||
@ -365,15 +308,15 @@ public class RenderEngine {
|
||||
|
||||
try {
|
||||
if(var8.startsWith("##")) {
|
||||
var4 = this.unwrapImageByColumns(this.readTextureImage(var1.func_6481_a(var8.substring(2))));
|
||||
var4 = this.unwrapImageByColumns(this.readTextureImage(var1.getReqResStream(var8.substring(2))));
|
||||
} else if(var8.startsWith("%clamp%")) {
|
||||
this.clampTexture = true;
|
||||
var4 = this.readTextureImage(var1.func_6481_a(var8.substring(7)));
|
||||
var4 = this.readTextureImage(var1.getReqResStream(var8.substring(7)));
|
||||
} else if(var8.startsWith("%blur%")) {
|
||||
this.blurTexture = true;
|
||||
var4 = this.readTextureImage(var1.func_6481_a(var8.substring(6)));
|
||||
var4 = this.readTextureImage(var1.getReqResStream(var8.substring(6)));
|
||||
} else {
|
||||
var4 = this.readTextureImage(var1.func_6481_a(var8));
|
||||
var4 = this.readTextureImage(var1.getReqResStream(var8));
|
||||
}
|
||||
|
||||
int var5 = ((Integer)this.textureMap.get(var8)).intValue();
|
||||
@ -387,8 +330,8 @@ public class RenderEngine {
|
||||
|
||||
}
|
||||
|
||||
private BufferedImage readTextureImage(InputStream var1) throws IOException {
|
||||
BufferedImage var2 = ImageIO.read(var1);
|
||||
private ImageData readTextureImage(InputStream var1) throws IOException {
|
||||
ImageData var2 = ImageData.loadImageFile(var1).swapRB();
|
||||
var1.close();
|
||||
return var2;
|
||||
}
|
||||
|
@ -1,15 +1,13 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.nio.IntBuffer;
|
||||
import net.lax1dude.eaglercraft.internal.buffer.IntBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import org.lwjgl.opengl.ARBOcclusionQuery;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL15;
|
||||
|
||||
public class RenderGlobal implements IWorldAccess {
|
||||
public List tileEntities = new ArrayList();
|
||||
@ -71,7 +69,7 @@ public class RenderGlobal implements IWorldAccess {
|
||||
this.field_1437_v.clear();
|
||||
this.field_1437_v.position(0);
|
||||
this.field_1437_v.limit(var3 * var3 * var3);
|
||||
ARBOcclusionQuery.glGenQueriesARB(this.field_1437_v);
|
||||
//ARBOcclusionQuery.glGenQueriesARB(this.field_1437_v);
|
||||
}
|
||||
|
||||
this.starGLCallList = GLAllocation.generateDisplayLists(3);
|
||||
@ -457,9 +455,9 @@ public class RenderGlobal implements IWorldAccess {
|
||||
var22 += var32;
|
||||
}
|
||||
|
||||
ARBOcclusionQuery.glBeginQueryARB(GL15.GL_SAMPLES_PASSED, this.sortedWorldRenderers[var23].field_1732_z);
|
||||
//ARBOcclusionQuery.glBeginQueryARB(GL15.GL_SAMPLES_PASSED, this.sortedWorldRenderers[var23].field_1732_z);
|
||||
this.sortedWorldRenderers[var23].callOcclusionQueryList();
|
||||
ARBOcclusionQuery.glEndQueryARB(GL15.GL_SAMPLES_PASSED);
|
||||
//ARBOcclusionQuery.glEndQueryARB(GL15.GL_SAMPLES_PASSED);
|
||||
this.sortedWorldRenderers[var23].isWaitingOnOcclusionQuery = true;
|
||||
}
|
||||
}
|
||||
@ -485,11 +483,11 @@ public class RenderGlobal implements IWorldAccess {
|
||||
for(int var3 = var1; var3 < var2; ++var3) {
|
||||
if(this.sortedWorldRenderers[var3].isWaitingOnOcclusionQuery) {
|
||||
this.field_1456_c.clear();
|
||||
ARBOcclusionQuery.glGetQueryObjectuARB(this.sortedWorldRenderers[var3].field_1732_z, GL15.GL_QUERY_RESULT_AVAILABLE, this.field_1456_c);
|
||||
//ARBOcclusionQuery.glGetQueryObjectuARB(this.sortedWorldRenderers[var3].field_1732_z, GL15.GL_QUERY_RESULT_AVAILABLE, this.field_1456_c);
|
||||
if(this.field_1456_c.get(0) != 0) {
|
||||
this.sortedWorldRenderers[var3].isWaitingOnOcclusionQuery = false;
|
||||
this.field_1456_c.clear();
|
||||
ARBOcclusionQuery.glGetQueryObjectuARB(this.sortedWorldRenderers[var3].field_1732_z, GL15.GL_QUERY_RESULT, this.field_1456_c);
|
||||
//ARBOcclusionQuery.glGetQueryObjectuARB(this.sortedWorldRenderers[var3].field_1732_z, GL15.GL_QUERY_RESULT, this.field_1456_c);
|
||||
this.sortedWorldRenderers[var3].isVisible = this.field_1456_c.get(0) != 0;
|
||||
}
|
||||
}
|
||||
@ -1237,25 +1235,10 @@ public class RenderGlobal implements IWorldAccess {
|
||||
}
|
||||
|
||||
public void obtainEntitySkin(Entity var1) {
|
||||
var1.updateCloak();
|
||||
if(var1.skinUrl != null) {
|
||||
this.renderEngine.obtainImageData(var1.skinUrl, new ImageBufferDownload());
|
||||
}
|
||||
|
||||
if(var1.cloakUrl != null) {
|
||||
this.renderEngine.obtainImageData(var1.cloakUrl, new ImageBufferDownload());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void releaseEntitySkin(Entity var1) {
|
||||
if(var1.skinUrl != null) {
|
||||
this.renderEngine.releaseImageData(var1.skinUrl);
|
||||
}
|
||||
|
||||
if(var1.cloakUrl != null) {
|
||||
this.renderEngine.releaseImageData(var1.cloakUrl);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,14 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.nio.FloatBuffer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.lax1dude.eaglercraft.opengl.GlStateManager;
|
||||
import net.peyton.eagler.v1_12.vec.Vec3D_112;
|
||||
|
||||
public class RenderHelper {
|
||||
private static FloatBuffer field_1695_a = GLAllocation.createDirectFloatBuffer(16);
|
||||
|
||||
private static final Vec3D_112 LIGHT0_POS = (new Vec3D_112(0.20000000298023224D, 1.0D, -0.699999988079071D)).normalize();
|
||||
private static final Vec3D_112 LIGHT1_POS = (new Vec3D_112(-0.20000000298023224D, 1.0D, 0.699999988079071D)).normalize();
|
||||
|
||||
public static void disableStandardItemLighting() {
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
@ -15,35 +19,9 @@ public class RenderHelper {
|
||||
|
||||
public static void enableStandardItemLighting() {
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_LIGHT0);
|
||||
GL11.glEnable(GL11.GL_LIGHT1);
|
||||
GlStateManager.enableMCLight(0, 0.6f, LIGHT0_POS.xCoord, LIGHT0_POS.yCoord, LIGHT0_POS.zCoord, 0.0D);
|
||||
GlStateManager.enableMCLight(1, 0.6f, LIGHT1_POS.xCoord, LIGHT1_POS.yCoord, LIGHT1_POS.zCoord, 0.0D);
|
||||
GlStateManager.setMCLightAmbient(0.4f, 0.4f, 0.4f);
|
||||
GL11.glEnable(GL11.GL_COLOR_MATERIAL);
|
||||
GL11.glColorMaterial(GL11.GL_FRONT_AND_BACK, GL11.GL_AMBIENT_AND_DIFFUSE);
|
||||
float var0 = 0.4F;
|
||||
float var1 = 0.6F;
|
||||
float var2 = 0.0F;
|
||||
Vec3D var3 = Vec3D.createVector((double)0.2F, 1.0D, (double)-0.7F).normalize();
|
||||
GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, func_1157_a(var3.xCoord, var3.yCoord, var3.zCoord, 0.0D));
|
||||
GL11.glLight(GL11.GL_LIGHT0, GL11.GL_DIFFUSE, func_1156_a(var1, var1, var1, 1.0F));
|
||||
GL11.glLight(GL11.GL_LIGHT0, GL11.GL_AMBIENT, func_1156_a(0.0F, 0.0F, 0.0F, 1.0F));
|
||||
GL11.glLight(GL11.GL_LIGHT0, GL11.GL_SPECULAR, func_1156_a(var2, var2, var2, 1.0F));
|
||||
var3 = Vec3D.createVector((double)-0.2F, 1.0D, (double)0.7F).normalize();
|
||||
GL11.glLight(GL11.GL_LIGHT1, GL11.GL_POSITION, func_1157_a(var3.xCoord, var3.yCoord, var3.zCoord, 0.0D));
|
||||
GL11.glLight(GL11.GL_LIGHT1, GL11.GL_DIFFUSE, func_1156_a(var1, var1, var1, 1.0F));
|
||||
GL11.glLight(GL11.GL_LIGHT1, GL11.GL_AMBIENT, func_1156_a(0.0F, 0.0F, 0.0F, 1.0F));
|
||||
GL11.glLight(GL11.GL_LIGHT1, GL11.GL_SPECULAR, func_1156_a(var2, var2, var2, 1.0F));
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glLightModel(GL11.GL_LIGHT_MODEL_AMBIENT, func_1156_a(var0, var0, var0, 1.0F));
|
||||
}
|
||||
|
||||
private static FloatBuffer func_1157_a(double var0, double var2, double var4, double var6) {
|
||||
return func_1156_a((float)var0, (float)var2, (float)var4, (float)var6);
|
||||
}
|
||||
|
||||
private static FloatBuffer func_1156_a(float var0, float var1, float var2, float var3) {
|
||||
field_1695_a.clear();
|
||||
field_1695_a.put(var0).put(var1).put(var2).put(var3);
|
||||
field_1695_a.flip();
|
||||
return field_1695_a;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,131 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import javax.imageio.ImageIO;
|
||||
import org.lwjgl.BufferUtils;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ScreenShotHelper {
|
||||
private static DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss");
|
||||
private static ByteBuffer buffer;
|
||||
private static byte[] pixelData;
|
||||
private static int[] imageData;
|
||||
private int field_21197_e;
|
||||
private DataOutputStream field_21196_f;
|
||||
private byte[] field_21195_g;
|
||||
private int field_21194_h;
|
||||
private int field_21193_i;
|
||||
private File field_21192_j;
|
||||
|
||||
public static String saveScreenshot(File var0, int var1, int var2) {
|
||||
try {
|
||||
File var3 = new File(var0, "screenshots");
|
||||
var3.mkdir();
|
||||
if(buffer == null || buffer.capacity() < var1 * var2) {
|
||||
buffer = BufferUtils.createByteBuffer(var1 * var2 * 3);
|
||||
}
|
||||
|
||||
if(imageData == null || imageData.length < var1 * var2 * 3) {
|
||||
pixelData = new byte[var1 * var2 * 3];
|
||||
imageData = new int[var1 * var2];
|
||||
}
|
||||
|
||||
GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, 1);
|
||||
GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
|
||||
buffer.clear();
|
||||
GL11.glReadPixels(0, 0, var1, var2, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)buffer);
|
||||
buffer.clear();
|
||||
String var4 = "" + dateFormat.format(new Date());
|
||||
int var6 = 1;
|
||||
|
||||
while(true) {
|
||||
File var5 = new File(var3, var4 + (var6 == 1 ? "" : "_" + var6) + ".png");
|
||||
if(!var5.exists()) {
|
||||
buffer.get(pixelData);
|
||||
|
||||
for(int var7 = 0; var7 < var1; ++var7) {
|
||||
for(int var8 = 0; var8 < var2; ++var8) {
|
||||
int var9 = var7 + (var2 - var8 - 1) * var1;
|
||||
int var10 = pixelData[var9 * 3 + 0] & 255;
|
||||
int var11 = pixelData[var9 * 3 + 1] & 255;
|
||||
int var12 = pixelData[var9 * 3 + 2] & 255;
|
||||
int var13 = -16777216 | var10 << 16 | var11 << 8 | var12;
|
||||
imageData[var7 + var8 * var1] = var13;
|
||||
}
|
||||
}
|
||||
|
||||
BufferedImage var15 = new BufferedImage(var1, var2, 1);
|
||||
var15.setRGB(0, 0, var1, var2, imageData, 0, var1);
|
||||
ImageIO.write(var15, "png", var5);
|
||||
return "Saved screenshot as " + var5.getName();
|
||||
}
|
||||
|
||||
++var6;
|
||||
}
|
||||
} catch (Exception var14) {
|
||||
var14.printStackTrace();
|
||||
return "Failed to save: " + var14;
|
||||
}
|
||||
}
|
||||
|
||||
public ScreenShotHelper(File var1, int var2, int var3, int var4) throws IOException {
|
||||
this.field_21194_h = var2;
|
||||
this.field_21193_i = var3;
|
||||
this.field_21197_e = var4;
|
||||
File var5 = new File(var1, "screenshots");
|
||||
var5.mkdir();
|
||||
String var6 = "huge_" + dateFormat.format(new Date());
|
||||
|
||||
for(int var7 = 1; (this.field_21192_j = new File(var5, var6 + (var7 == 1 ? "" : "_" + var7) + ".tga")).exists(); ++var7) {
|
||||
}
|
||||
|
||||
byte[] var8 = new byte[18];
|
||||
var8[2] = 2;
|
||||
var8[12] = (byte)(var2 % 256);
|
||||
var8[13] = (byte)(var2 / 256);
|
||||
var8[14] = (byte)(var3 % 256);
|
||||
var8[15] = (byte)(var3 / 256);
|
||||
var8[16] = 24;
|
||||
this.field_21195_g = new byte[var2 * var4 * 3];
|
||||
this.field_21196_f = new DataOutputStream(new FileOutputStream(this.field_21192_j));
|
||||
this.field_21196_f.write(var8);
|
||||
}
|
||||
|
||||
public void func_21189_a(ByteBuffer var1, int var2, int var3, int var4, int var5) throws IOException {
|
||||
int var6 = var4;
|
||||
int var7 = var5;
|
||||
if(var4 > this.field_21194_h - var2) {
|
||||
var6 = this.field_21194_h - var2;
|
||||
}
|
||||
|
||||
if(var5 > this.field_21193_i - var3) {
|
||||
var7 = this.field_21193_i - var3;
|
||||
}
|
||||
|
||||
this.field_21197_e = var7;
|
||||
|
||||
for(int var8 = 0; var8 < var7; ++var8) {
|
||||
var1.position((var5 - var7) * var4 * 3 + var8 * var4 * 3);
|
||||
int var9 = (var2 + var8 * this.field_21194_h) * 3;
|
||||
var1.get(this.field_21195_g, var9, var6 * 3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void func_21191_a() throws IOException {
|
||||
this.field_21196_f.write(this.field_21195_g, 0, this.field_21194_h * 3 * this.field_21197_e);
|
||||
}
|
||||
|
||||
public String func_21190_b() throws IOException {
|
||||
this.field_21196_f.close();
|
||||
return "Saved screenshot as " + this.field_21192_j.getName();
|
||||
}
|
||||
}
|
@ -1,214 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
public class TerrainTextureManager {
|
||||
private float[] field_1181_a = new float[768];
|
||||
private int[] field_1180_b = new int[5120];
|
||||
private int[] field_1186_c = new int[5120];
|
||||
private int[] field_1185_d = new int[5120];
|
||||
private int[] field_1184_e = new int[5120];
|
||||
private int[] field_1183_f = new int[34];
|
||||
private int[] field_1182_g = new int[768];
|
||||
|
||||
public TerrainTextureManager() {
|
||||
try {
|
||||
BufferedImage var1 = ImageIO.read(TerrainTextureManager.class.getResource("/terrain.png"));
|
||||
int[] var2 = new int[65536];
|
||||
var1.getRGB(0, 0, 256, 256, var2, 0, 256);
|
||||
|
||||
for(int var3 = 0; var3 < 256; ++var3) {
|
||||
int var4 = 0;
|
||||
int var5 = 0;
|
||||
int var6 = 0;
|
||||
int var7 = var3 % 16 * 16;
|
||||
int var8 = var3 / 16 * 16;
|
||||
int var9 = 0;
|
||||
|
||||
for(int var10 = 0; var10 < 16; ++var10) {
|
||||
for(int var11 = 0; var11 < 16; ++var11) {
|
||||
int var12 = var2[var11 + var7 + (var10 + var8) * 256];
|
||||
int var13 = var12 >> 24 & 255;
|
||||
if(var13 > 128) {
|
||||
var4 += var12 >> 16 & 255;
|
||||
var5 += var12 >> 8 & 255;
|
||||
var6 += var12 & 255;
|
||||
++var9;
|
||||
}
|
||||
}
|
||||
|
||||
if(var9 == 0) {
|
||||
++var9;
|
||||
}
|
||||
|
||||
this.field_1181_a[var3 * 3 + 0] = (float)(var4 / var9);
|
||||
this.field_1181_a[var3 * 3 + 1] = (float)(var5 / var9);
|
||||
this.field_1181_a[var3 * 3 + 2] = (float)(var6 / var9);
|
||||
}
|
||||
}
|
||||
} catch (IOException var14) {
|
||||
var14.printStackTrace();
|
||||
}
|
||||
|
||||
for(int var15 = 0; var15 < 256; ++var15) {
|
||||
if(Block.blocksList[var15] != null) {
|
||||
this.field_1182_g[var15 * 3 + 0] = Block.blocksList[var15].getBlockTextureFromSide(1);
|
||||
this.field_1182_g[var15 * 3 + 1] = Block.blocksList[var15].getBlockTextureFromSide(2);
|
||||
this.field_1182_g[var15 * 3 + 2] = Block.blocksList[var15].getBlockTextureFromSide(3);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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) {
|
||||
int var3 = var1 + var2 * 32;
|
||||
if(this.field_1186_c[var3] == 0) {
|
||||
this.field_1180_b[var3] = 0;
|
||||
}
|
||||
|
||||
if(this.field_1185_d[var3] > this.field_1186_c[var3]) {
|
||||
int var4 = this.field_1180_b[var3] >> 24 & 255;
|
||||
this.field_1180_b[var3] = ((this.field_1180_b[var3] & 16711422) >> 1) + this.field_1184_e[var3];
|
||||
if(var4 < 128) {
|
||||
this.field_1180_b[var3] = Integer.MIN_VALUE + this.field_1184_e[var3] * 2;
|
||||
} else {
|
||||
this.field_1180_b[var3] |= -16777216;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -2,6 +2,8 @@ package net.minecraft.src;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import net.lax1dude.eaglercraft.EagRuntime;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public abstract class TexturePackBase {
|
||||
@ -25,7 +27,7 @@ public abstract class TexturePackBase {
|
||||
public void bindThumbnailTexture(Minecraft var1) {
|
||||
}
|
||||
|
||||
public InputStream func_6481_a(String var1) {
|
||||
return TexturePackBase.class.getResourceAsStream(var1);
|
||||
public InputStream getReqResStream(String var1) {
|
||||
return EagRuntime.getRequiredResourceStream(var1);
|
||||
}
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ public class TexturePackCustom extends TexturePackBase {
|
||||
this.texturePackZipFile = null;
|
||||
}
|
||||
|
||||
public InputStream func_6481_a(String var1) {
|
||||
public InputStream getReqResStream(String var1) {
|
||||
try {
|
||||
ZipEntry var2 = this.texturePackZipFile.getEntry(var1.substring(1));
|
||||
if(var2 != null) {
|
||||
|
@ -1,26 +1,21 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import net.lax1dude.eaglercraft.opengl.ImageData;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class TexturePackDefault extends TexturePackBase {
|
||||
private int texturePackName = -1;
|
||||
private BufferedImage texturePackThumbnail;
|
||||
private ImageData texturePackThumbnail;
|
||||
|
||||
public TexturePackDefault() {
|
||||
this.texturePackFileName = "Default";
|
||||
this.firstDescriptionLine = "The default look of Minecraft";
|
||||
|
||||
try {
|
||||
this.texturePackThumbnail = ImageIO.read(TexturePackDefault.class.getResource("/pack.png"));
|
||||
} catch (IOException var2) {
|
||||
var2.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
this.texturePackThumbnail = ImageData.loadImageFile("/pack.png");
|
||||
}
|
||||
|
||||
public void func_6484_b(Minecraft var1) {
|
||||
if(this.texturePackThumbnail != null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user