commit 638f62372e6884b44e35da7cf75c123de41468c0 Author: Arves100 Date: Mon Jul 11 15:36:50 2022 +0200 initial commit diff --git a/client2server_1.6.4_full.patch b/client2server_1.6.4_full.patch new file mode 100644 index 0000000..aff2ff0 --- /dev/null +++ b/client2server_1.6.4_full.patch @@ -0,0 +1,109855 @@ +*** AABBLocalPool.java Sat Feb 5 04:13:11 2022 +--- AABBLocalPool.java Sat Feb 5 04:12:32 2022 +*** AABBPool.java Sat Feb 5 04:13:11 2022 +--- AABBPool.java Sat Feb 5 04:12:32 2022 +*************** +*** 83,92 **** +--- 83,101 ---- + } + + this.nextPoolIndex = 0; + } + ++ /** ++ * Clears the AABBPool ++ */ ++ public void clearPool() ++ { ++ this.nextPoolIndex = 0; ++ this.listAABB.clear(); ++ } ++ + public int getlistAABBsize() + { + return this.listAABB.size(); + } + +*** /dev/null Thu Jan 1 01:00:00 1970 +--- AbstractClientPlayer.java Sat Feb 5 04:12:32 2022 +*************** +*** 0 **** +--- 1,98 ---- ++ package net.minecraft.src; ++ ++ public abstract class AbstractClientPlayer extends EntityPlayer ++ { ++ public static final ResourceLocation locationStevePng = new ResourceLocation("textures/entity/steve.png"); ++ private ThreadDownloadImageData downloadImageSkin; ++ private ThreadDownloadImageData downloadImageCape; ++ private ResourceLocation locationSkin; ++ private ResourceLocation locationCape; ++ ++ public AbstractClientPlayer(World par1World, String par2Str) ++ { ++ super(par1World, par2Str); ++ this.setupCustomSkin(); ++ } ++ ++ protected void setupCustomSkin() ++ { ++ System.out.println("Setting up custom skins"); ++ ++ if (this.username != null && !this.username.isEmpty()) ++ { ++ this.locationSkin = getLocationSkin(this.username); ++ this.locationCape = getLocationCape(this.username); ++ this.downloadImageSkin = getDownloadImageSkin(this.locationSkin, this.username); ++ this.downloadImageCape = getDownloadImageCape(this.locationCape, this.username); ++ } ++ } ++ ++ public ThreadDownloadImageData getTextureSkin() ++ { ++ return this.downloadImageSkin; ++ } ++ ++ public ThreadDownloadImageData getTextureCape() ++ { ++ return this.downloadImageCape; ++ } ++ ++ public ResourceLocation getLocationSkin() ++ { ++ return this.locationSkin; ++ } ++ ++ public ResourceLocation getLocationCape() ++ { ++ return this.locationCape; ++ } ++ ++ public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation par0ResourceLocation, String par1Str) ++ { ++ return getDownloadImage(par0ResourceLocation, getSkinUrl(par1Str), locationStevePng, new ImageBufferDownload()); ++ } ++ ++ public static ThreadDownloadImageData getDownloadImageCape(ResourceLocation par0ResourceLocation, String par1Str) ++ { ++ return getDownloadImage(par0ResourceLocation, getCapeUrl(par1Str), (ResourceLocation)null, (IImageBuffer)null); ++ } ++ ++ private static ThreadDownloadImageData getDownloadImage(ResourceLocation par0ResourceLocation, String par1Str, ResourceLocation par2ResourceLocation, IImageBuffer par3IImageBuffer) ++ { ++ TextureManager var4 = Minecraft.getMinecraft().getTextureManager(); ++ Object var5 = var4.getTexture(par0ResourceLocation); ++ ++ if (var5 == null) ++ { ++ var5 = new ThreadDownloadImageData(par1Str, par2ResourceLocation, par3IImageBuffer); ++ var4.loadTexture(par0ResourceLocation, (TextureObject)var5); ++ } ++ ++ return (ThreadDownloadImageData)var5; ++ } ++ ++ public static String getSkinUrl(String par0Str) ++ { ++ return String.format("http://skins.minecraft.net/MinecraftSkins/%s.png", new Object[] {StringUtils.stripControlCodes(par0Str)}); ++ } ++ ++ public static String getCapeUrl(String par0Str) ++ { ++ return String.format("http://skins.minecraft.net/MinecraftCloaks/%s.png", new Object[] {StringUtils.stripControlCodes(par0Str)}); ++ } ++ ++ public static ResourceLocation getLocationSkin(String par0Str) ++ { ++ return new ResourceLocation("skins/" + StringUtils.stripControlCodes(par0Str)); ++ } ++ ++ public static ResourceLocation getLocationCape(String par0Str) ++ { ++ return new ResourceLocation("cloaks/" + StringUtils.stripControlCodes(par0Str)); ++ } ++ ++ public static ResourceLocation getLocationSkull(String par0Str) ++ { ++ return new ResourceLocation("skull/" + StringUtils.stripControlCodes(par0Str)); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- AbstractResourcePack.java Sat Feb 5 04:12:32 2022 +*************** +*** 0 **** +--- 1,85 ---- ++ package net.minecraft.src; ++ ++ import com.google.gson.JsonObject; ++ import com.google.gson.JsonParser; ++ import java.awt.image.BufferedImage; ++ import java.io.BufferedReader; ++ import java.io.File; ++ import java.io.IOException; ++ import java.io.InputStream; ++ import java.io.InputStreamReader; ++ import javax.imageio.ImageIO; ++ import org.apache.commons.io.IOUtils; ++ ++ public abstract class AbstractResourcePack implements ResourcePack ++ { ++ protected static final ILogAgent resourceLog = Minecraft.getMinecraft().getLogAgent(); ++ protected final File resourcePackFile; ++ ++ public AbstractResourcePack(File par1File) ++ { ++ this.resourcePackFile = par1File; ++ } ++ ++ private static String locationToName(ResourceLocation par0ResourceLocation) ++ { ++ return String.format("%s/%s/%s", new Object[] {"assets", par0ResourceLocation.getResourceDomain(), par0ResourceLocation.getResourcePath()}); ++ } ++ ++ protected static String getRelativeName(File par0File, File par1File) ++ { ++ return par0File.toURI().relativize(par1File.toURI()).getPath(); ++ } ++ ++ public InputStream getInputStream(ResourceLocation par1ResourceLocation) throws IOException ++ { ++ return this.getInputStreamByName(locationToName(par1ResourceLocation)); ++ } ++ ++ public boolean resourceExists(ResourceLocation par1ResourceLocation) ++ { ++ return this.hasResourceName(locationToName(par1ResourceLocation)); ++ } ++ ++ protected abstract InputStream getInputStreamByName(String var1) throws IOException; ++ ++ protected abstract boolean hasResourceName(String var1); ++ ++ protected void logNameNotLowercase(String par1Str) ++ { ++ resourceLog.logWarningFormatted("ResourcePack: ignored non-lowercase namespace: %s in %s", new Object[] {par1Str, this.resourcePackFile}); ++ } ++ ++ public MetadataSection getPackMetadata(MetadataSerializer par1MetadataSerializer, String par2Str) throws IOException ++ { ++ return readMetadata(par1MetadataSerializer, this.getInputStreamByName("pack.mcmeta"), par2Str); ++ } ++ ++ static MetadataSection readMetadata(MetadataSerializer par0MetadataSerializer, InputStream par1InputStream, String par2Str) ++ { ++ JsonObject var3 = null; ++ BufferedReader var4 = null; ++ ++ try ++ { ++ var4 = new BufferedReader(new InputStreamReader(par1InputStream)); ++ var3 = (new JsonParser()).parse(var4).getAsJsonObject(); ++ } ++ finally ++ { ++ IOUtils.closeQuietly(var4); ++ } ++ ++ return par0MetadataSerializer.parseMetadataSection(par2Str, var3); ++ } ++ ++ public BufferedImage getPackImage() throws IOException ++ { ++ return ImageIO.read(this.getInputStreamByName("pack.png")); ++ } ++ ++ public String getPackName() ++ { ++ return this.resourcePackFile.getName(); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- AbstractTexture.java Sat Feb 5 04:12:32 2022 +*************** +*** 0 **** +--- 1,16 ---- ++ 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; ++ } ++ } +*** Achievement.java Sat Feb 5 04:13:11 2022 +--- Achievement.java Sat Feb 5 04:12:32 2022 +*************** +*** 21,30 **** +--- 21,36 ---- + * Holds the description of the achievement, ready to be formatted and/or displayed. + */ + private final String achievementDescription; + + /** ++ * Holds a string formatter for the achievement, some of then needs extra dynamic info - like the key used to open ++ * the inventory. ++ */ ++ private IStatStringFormat statStringFormatter; ++ ++ /** + * Holds the ItemStack that will be used to draw the achievement into the GUI. + */ + public final ItemStack theItemStack; + + /** +*************** +*** 100,109 **** +--- 106,149 ---- + public Achievement registerAchievement() + { + super.registerStat(); + AchievementList.achievementList.add(this); + return this; ++ } ++ ++ /** ++ * Returns whether or not the StatBase-derived class is a statistic (running counter) or an achievement (one-shot). ++ */ ++ public boolean isAchievement() ++ { ++ return true; ++ } ++ ++ /** ++ * Returns the fully description of the achievement - ready to be displayed on screen. ++ */ ++ public String getDescription() ++ { ++ return this.statStringFormatter != null ? this.statStringFormatter.formatString(StatCollector.translateToLocal(this.achievementDescription)) : StatCollector.translateToLocal(this.achievementDescription); ++ } ++ ++ /** ++ * Defines a string formatter for the achievement. ++ */ ++ public Achievement setStatStringFormatter(IStatStringFormat par1IStatStringFormat) ++ { ++ this.statStringFormatter = par1IStatStringFormat; ++ return this; ++ } ++ ++ /** ++ * Special achievements have a 'spiked' (on normal texture pack) frame, special achievements are the hardest ones to ++ * achieve. ++ */ ++ public boolean getSpecial() ++ { ++ return this.isSpecial; + } + + /** + * Register the stat into StatList. + */ +*** AchievementList.java Sat Feb 5 04:13:11 2022 +--- AchievementList.java Sat Feb 5 04:12:32 2022 +*************** +*** 15,25 **** + public static int maxDisplayColumn; + + /** Is the biggest row used to display a achievement on the GUI. */ + public static int maxDisplayRow; + +! /** The list holding all achievements */ + public static List achievementList = new ArrayList(); + + /** Is the 'open inventory' achievement. */ + public static Achievement openInventory = (new Achievement(0, "openInventory", 0, 0, Item.book, (Achievement)null)).setIndependent().registerAchievement(); + +--- 15,25 ---- + public static int maxDisplayColumn; + + /** Is the biggest row used to display a achievement on the GUI. */ + public static int maxDisplayRow; + +! /** Holds a list of all registered achievements. */ + public static List achievementList = new ArrayList(); + + /** Is the 'open inventory' achievement. */ + public static Achievement openInventory = (new Achievement(0, "openInventory", 0, 0, Item.book, (Achievement)null)).setIndependent().registerAchievement(); + +*** AchievementMap.java Sat Feb 5 04:13:11 2022 +--- AchievementMap.java Sat Feb 5 04:12:32 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ActiveRenderInfo.java Sat Feb 5 04:12:32 2022 +*************** +*** 0 **** +--- 1,111 ---- ++ package net.minecraft.src; ++ ++ import java.nio.FloatBuffer; ++ import java.nio.IntBuffer; ++ import org.lwjgl.opengl.GL11; ++ import org.lwjgl.util.glu.GLU; ++ ++ public class ActiveRenderInfo ++ { ++ /** The calculated view object X coordinate */ ++ public static float objectX; ++ ++ /** The calculated view object Y coordinate */ ++ public static float objectY; ++ ++ /** The calculated view object Z coordinate */ ++ public static float objectZ; ++ ++ /** The current GL viewport */ ++ private static IntBuffer viewport = GLAllocation.createDirectIntBuffer(16); ++ ++ /** The current GL modelview matrix */ ++ private static FloatBuffer modelview = GLAllocation.createDirectFloatBuffer(16); ++ ++ /** The current GL projection matrix */ ++ private static FloatBuffer projection = GLAllocation.createDirectFloatBuffer(16); ++ ++ /** The computed view object coordinates */ ++ private static FloatBuffer objectCoords = GLAllocation.createDirectFloatBuffer(3); ++ ++ /** The X component of the entity's yaw rotation */ ++ public static float rotationX; ++ ++ /** The combined X and Z components of the entity's pitch rotation */ ++ public static float rotationXZ; ++ ++ /** The Z component of the entity's yaw rotation */ ++ public static float rotationZ; ++ ++ /** ++ * The Y component (scaled along the Z axis) of the entity's pitch rotation ++ */ ++ public static float rotationYZ; ++ ++ /** ++ * The Y component (scaled along the X axis) of the entity's pitch rotation ++ */ ++ public static float rotationXY; ++ ++ /** ++ * Updates the current render info and camera location based on entity look angles and 1st/3rd person view mode ++ */ ++ public static void updateRenderInfo(EntityPlayer par0EntityPlayer, boolean par1) ++ { ++ GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, modelview); ++ GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, projection); ++ GL11.glGetInteger(GL11.GL_VIEWPORT, viewport); ++ float var2 = (float)((viewport.get(0) + viewport.get(2)) / 2); ++ float var3 = (float)((viewport.get(1) + viewport.get(3)) / 2); ++ GLU.gluUnProject(var2, var3, 0.0F, modelview, projection, viewport, objectCoords); ++ objectX = objectCoords.get(0); ++ objectY = objectCoords.get(1); ++ objectZ = objectCoords.get(2); ++ int var4 = par1 ? 1 : 0; ++ float var5 = par0EntityPlayer.rotationPitch; ++ float var6 = par0EntityPlayer.rotationYaw; ++ rotationX = MathHelper.cos(var6 * (float)Math.PI / 180.0F) * (float)(1 - var4 * 2); ++ rotationZ = MathHelper.sin(var6 * (float)Math.PI / 180.0F) * (float)(1 - var4 * 2); ++ rotationYZ = -rotationZ * MathHelper.sin(var5 * (float)Math.PI / 180.0F) * (float)(1 - var4 * 2); ++ rotationXY = rotationX * MathHelper.sin(var5 * (float)Math.PI / 180.0F) * (float)(1 - var4 * 2); ++ rotationXZ = MathHelper.cos(var5 * (float)Math.PI / 180.0F); ++ } ++ ++ /** ++ * Returns a vector representing the projection along the given entity's view for the given distance ++ */ ++ public static Vec3 projectViewFromEntity(EntityLivingBase par0EntityLivingBase, double par1) ++ { ++ double var3 = par0EntityLivingBase.prevPosX + (par0EntityLivingBase.posX - par0EntityLivingBase.prevPosX) * par1; ++ double var5 = par0EntityLivingBase.prevPosY + (par0EntityLivingBase.posY - par0EntityLivingBase.prevPosY) * par1 + (double)par0EntityLivingBase.getEyeHeight(); ++ double var7 = par0EntityLivingBase.prevPosZ + (par0EntityLivingBase.posZ - par0EntityLivingBase.prevPosZ) * par1; ++ double var9 = var3 + (double)(objectX * 1.0F); ++ double var11 = var5 + (double)(objectY * 1.0F); ++ double var13 = var7 + (double)(objectZ * 1.0F); ++ return par0EntityLivingBase.worldObj.getWorldVec3Pool().getVecFromPool(var9, var11, var13); ++ } ++ ++ /** ++ * Returns the block ID at the current camera location (either air or fluid), taking into account the height of ++ * fluid blocks ++ */ ++ public static int getBlockIdAtEntityViewpoint(World par0World, EntityLivingBase par1EntityLivingBase, float par2) ++ { ++ Vec3 var3 = projectViewFromEntity(par1EntityLivingBase, (double)par2); ++ ChunkPosition var4 = new ChunkPosition(var3); ++ int var5 = par0World.getBlockId(var4.x, var4.y, var4.z); ++ ++ if (var5 != 0 && Block.blocksList[var5].blockMaterial.isLiquid()) ++ { ++ float var6 = BlockFluid.getFluidHeightPercent(par0World.getBlockMetadata(var4.x, var4.y, var4.z)) - 0.11111111F; ++ float var7 = (float)(var4.y + 1) - var6; ++ ++ if (var3.yCoord >= (double)var7) ++ { ++ var5 = par0World.getBlockId(var4.x, var4.y + 1, var4.z); ++ } ++ } ++ ++ return var5; ++ } ++ } +*** AnimalChest.java Sat Feb 5 04:13:11 2022 +--- AnimalChest.java Sat Feb 5 04:12:32 2022 +*************** +*** 4,9 **** +--- 4,14 ---- + { + public AnimalChest(String par1Str, int par2) + { + super(par1Str, false, par2); + } ++ ++ public AnimalChest(String par1Str, boolean par2, int par3) ++ { ++ super(par1Str, par2, par3); ++ } + } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- AnimationFrame.java Sat Feb 5 04:12:32 2022 +*************** +*** 0 **** +--- 1,33 ---- ++ package net.minecraft.src; ++ ++ public class AnimationFrame ++ { ++ private final int frameIndex; ++ private final int frameTime; ++ ++ public AnimationFrame(int par1) ++ { ++ this(par1, -1); ++ } ++ ++ public AnimationFrame(int par1, int par2) ++ { ++ this.frameIndex = par1; ++ this.frameTime = par2; ++ } ++ ++ public boolean hasNoTime() ++ { ++ return this.frameTime == -1; ++ } ++ ++ public int getFrameTime() ++ { ++ return this.frameTime; ++ } ++ ++ public int getFrameIndex() ++ { ++ return this.frameIndex; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- AnimationMetadataSection.java Sat Feb 5 04:12:32 2022 +*************** +*** 0 **** +--- 1,78 ---- ++ package net.minecraft.src; ++ ++ import com.google.common.collect.Sets; ++ import java.util.HashSet; ++ import java.util.Iterator; ++ import java.util.List; ++ import java.util.Set; ++ ++ public class AnimationMetadataSection implements MetadataSection ++ { ++ private final List animationFrames; ++ private final int frameWidth; ++ private final int frameHeight; ++ private final int frameTime; ++ ++ public AnimationMetadataSection(List par1List, int par2, int par3, int par4) ++ { ++ this.animationFrames = par1List; ++ this.frameWidth = par2; ++ this.frameHeight = par3; ++ this.frameTime = par4; ++ } ++ ++ public int getFrameHeight() ++ { ++ return this.frameHeight; ++ } ++ ++ public int getFrameWidth() ++ { ++ return this.frameWidth; ++ } ++ ++ public int getFrameCount() ++ { ++ return this.animationFrames.size(); ++ } ++ ++ public int getFrameTime() ++ { ++ return this.frameTime; ++ } ++ ++ private AnimationFrame getAnimationFrame(int par1) ++ { ++ return (AnimationFrame)this.animationFrames.get(par1); ++ } ++ ++ public int getFrameTimeSingle(int par1) ++ { ++ AnimationFrame var2 = this.getAnimationFrame(par1); ++ return var2.hasNoTime() ? this.frameTime : var2.getFrameTime(); ++ } ++ ++ public boolean frameHasTime(int par1) ++ { ++ return !((AnimationFrame)this.animationFrames.get(par1)).hasNoTime(); ++ } ++ ++ public int getFrameIndex(int par1) ++ { ++ return ((AnimationFrame)this.animationFrames.get(par1)).getFrameIndex(); ++ } ++ ++ public Set getFrameIndexSet() ++ { ++ HashSet var1 = Sets.newHashSet(); ++ Iterator var2 = this.animationFrames.iterator(); ++ ++ while (var2.hasNext()) ++ { ++ AnimationFrame var3 = (AnimationFrame)var2.next(); ++ var1.add(Integer.valueOf(var3.getFrameIndex())); ++ } ++ ++ return var1; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- AnimationMetadataSectionSerializer.java Sat Feb 5 04:12:32 2022 +*************** +*** 0 **** +--- 1,135 ---- ++ package net.minecraft.src; ++ ++ import com.google.common.collect.Lists; ++ import com.google.gson.JsonArray; ++ import com.google.gson.JsonDeserializationContext; ++ import com.google.gson.JsonElement; ++ import com.google.gson.JsonObject; ++ import com.google.gson.JsonParseException; ++ import com.google.gson.JsonPrimitive; ++ import com.google.gson.JsonSerializationContext; ++ import com.google.gson.JsonSerializer; ++ import java.lang.reflect.Type; ++ import java.util.ArrayList; ++ ++ public class AnimationMetadataSectionSerializer extends BaseMetadataSectionSerializer implements JsonSerializer ++ { ++ public AnimationMetadataSection func_110493_a(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) ++ { ++ ArrayList var4 = Lists.newArrayList(); ++ JsonObject var5 = (JsonObject)par1JsonElement; ++ int var6 = this.func_110485_a(var5.get("frametime"), "frametime", Integer.valueOf(1), 1, Integer.MAX_VALUE); ++ int var8; ++ ++ if (var5.has("frames")) ++ { ++ try ++ { ++ JsonArray var7 = var5.getAsJsonArray("frames"); ++ ++ for (var8 = 0; var8 < var7.size(); ++var8) ++ { ++ JsonElement var9 = var7.get(var8); ++ AnimationFrame var10 = this.parseAnimationFrame(var8, var9); ++ ++ if (var10 != null) ++ { ++ var4.add(var10); ++ } ++ } ++ } ++ catch (ClassCastException var11) ++ { ++ throw new JsonParseException("Invalid animation->frames: expected array, was " + var5.get("frames"), var11); ++ } ++ } ++ ++ int var12 = this.func_110485_a(var5.get("width"), "width", Integer.valueOf(-1), 1, Integer.MAX_VALUE); ++ var8 = this.func_110485_a(var5.get("height"), "height", Integer.valueOf(-1), 1, Integer.MAX_VALUE); ++ return new AnimationMetadataSection(var4, var12, var8, var6); ++ } ++ ++ private AnimationFrame parseAnimationFrame(int par1, JsonElement par2JsonElement) ++ { ++ if (par2JsonElement.isJsonPrimitive()) ++ { ++ try ++ { ++ return new AnimationFrame(par2JsonElement.getAsInt()); ++ } ++ catch (NumberFormatException var6) ++ { ++ throw new JsonParseException("Invalid animation->frames->" + par1 + ": expected number, was " + par2JsonElement, var6); ++ } ++ } ++ else if (par2JsonElement.isJsonObject()) ++ { ++ JsonObject var3 = par2JsonElement.getAsJsonObject(); ++ int var4 = this.func_110485_a(var3.get("time"), "frames->" + par1 + "->time", Integer.valueOf(-1), 1, Integer.MAX_VALUE); ++ int var5 = this.func_110485_a(var3.get("index"), "frames->" + par1 + "->index", (Integer)null, 0, Integer.MAX_VALUE); ++ return new AnimationFrame(var5, var4); ++ } ++ else ++ { ++ return null; ++ } ++ } ++ ++ public JsonElement func_110491_a(AnimationMetadataSection par1AnimationMetadataSection, Type par2Type, JsonSerializationContext par3JsonSerializationContext) ++ { ++ JsonObject var4 = new JsonObject(); ++ var4.addProperty("frametime", Integer.valueOf(par1AnimationMetadataSection.getFrameTime())); ++ ++ if (par1AnimationMetadataSection.getFrameWidth() != -1) ++ { ++ var4.addProperty("width", Integer.valueOf(par1AnimationMetadataSection.getFrameWidth())); ++ } ++ ++ if (par1AnimationMetadataSection.getFrameHeight() != -1) ++ { ++ var4.addProperty("height", Integer.valueOf(par1AnimationMetadataSection.getFrameHeight())); ++ } ++ ++ if (par1AnimationMetadataSection.getFrameCount() > 0) ++ { ++ JsonArray var5 = new JsonArray(); ++ ++ for (int var6 = 0; var6 < par1AnimationMetadataSection.getFrameCount(); ++var6) ++ { ++ if (par1AnimationMetadataSection.frameHasTime(var6)) ++ { ++ JsonObject var7 = new JsonObject(); ++ var7.addProperty("index", Integer.valueOf(par1AnimationMetadataSection.getFrameIndex(var6))); ++ var7.addProperty("time", Integer.valueOf(par1AnimationMetadataSection.getFrameTimeSingle(var6))); ++ var5.add(var7); ++ } ++ else ++ { ++ var5.add(new JsonPrimitive(Integer.valueOf(par1AnimationMetadataSection.getFrameIndex(var6)))); ++ } ++ } ++ ++ var4.add("frames", var5); ++ } ++ ++ return var4; ++ } ++ ++ /** ++ * The name of this section type as it appears in JSON. ++ */ ++ public String getSectionName() ++ { ++ return "animation"; ++ } ++ ++ public Object deserialize(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) ++ { ++ return this.func_110493_a(par1JsonElement, par2Type, par3JsonDeserializationContext); ++ } ++ ++ public JsonElement serialize(Object par1Obj, Type par2Type, JsonSerializationContext par3JsonSerializationContext) ++ { ++ return this.func_110491_a((AnimationMetadataSection)par1Obj, par2Type, par3JsonSerializationContext); ++ } ++ } +*** AnvilChunkLoader.java Sat Feb 5 04:13:11 2022 +--- AnvilChunkLoader.java Sat Feb 5 04:12:32 2022 +*** AnvilChunkLoaderPending.java Sat Feb 5 04:13:11 2022 +--- AnvilChunkLoaderPending.java Sat Feb 5 04:12:32 2022 +*** AnvilConverterData.java Sat Feb 5 04:13:11 2022 +--- AnvilConverterData.java Sat Feb 5 04:12:32 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- AnvilConverterException.java Sat Feb 5 04:12:32 2022 +*************** +*** 0 **** +--- 1,9 ---- ++ package net.minecraft.src; ++ ++ public class AnvilConverterException extends Exception ++ { ++ public AnvilConverterException(String par1Str) ++ { ++ super(par1Str); ++ } ++ } +*** AnvilSaveConverter.java Sat Feb 5 04:13:11 2022 +--- AnvilSaveConverter.java Sat Feb 5 04:12:32 2022 +*************** +*** 6,24 **** +--- 6,67 ---- + import java.io.IOException; + import java.util.ArrayList; + import java.util.Collection; + import java.util.Collections; + import java.util.Iterator; ++ import java.util.List; + import net.minecraft.server.MinecraftServer; + + public class AnvilSaveConverter extends SaveFormatOld + { + public AnvilSaveConverter(File par1File) + { + super(par1File); + } + ++ public List getSaveList() throws AnvilConverterException ++ { ++ if (this.savesDirectory != null && this.savesDirectory.exists() && this.savesDirectory.isDirectory()) ++ { ++ ArrayList var1 = new ArrayList(); ++ File[] var2 = this.savesDirectory.listFiles(); ++ File[] var3 = var2; ++ int var4 = var2.length; ++ ++ for (int var5 = 0; var5 < var4; ++var5) ++ { ++ File var6 = var3[var5]; ++ ++ if (var6.isDirectory()) ++ { ++ String var7 = var6.getName(); ++ WorldInfo var8 = this.getWorldInfo(var7); ++ ++ if (var8 != null && (var8.getSaveVersion() == 19132 || var8.getSaveVersion() == 19133)) ++ { ++ boolean var9 = var8.getSaveVersion() != this.getSaveVersion(); ++ String var10 = var8.getWorldName(); ++ ++ if (var10 == null || MathHelper.stringNullOrLengthZero(var10)) ++ { ++ var10 = var7; ++ } ++ ++ long var11 = 0L; ++ var1.add(new SaveFormatComparator(var7, var10, var8.getLastTimePlayed(), var11, var8.getGameType(), var9, var8.isHardcoreModeEnabled(), var8.areCommandsAllowed())); ++ } ++ } ++ } ++ ++ return var1; ++ } ++ else ++ { ++ throw new AnvilConverterException("Unable to read or access folder where game worlds are saved!"); ++ } ++ } ++ + protected int getSaveVersion() + { + return 19133; + } + +*************** +*** 34,53 **** + { + return new AnvilSaveHandler(this.savesDirectory, par1Str, par2); + } + + /** +! * gets if the map is old chunk saving (true) or McRegion (false) + */ + public boolean isOldMapFormat(String par1Str) + { + WorldInfo var2 = this.getWorldInfo(par1Str); + return var2 != null && var2.getSaveVersion() != this.getSaveVersion(); + } + + /** +! * converts the map to mcRegion + */ + public boolean convertMapFormat(String par1Str, IProgressUpdate par2IProgressUpdate) + { + par2IProgressUpdate.setLoadingProgress(0); + ArrayList var3 = new ArrayList(); +--- 77,96 ---- + { + return new AnvilSaveHandler(this.savesDirectory, par1Str, par2); + } + + /** +! * Checks if the save directory uses the old map format + */ + public boolean isOldMapFormat(String par1Str) + { + WorldInfo var2 = this.getWorldInfo(par1Str); + return var2 != null && var2.getSaveVersion() != this.getSaveVersion(); + } + + /** +! * Converts the specified map to the new map format. Args: worldName, loadingScreen + */ + public boolean convertMapFormat(String par1Str, IProgressUpdate par2IProgressUpdate) + { + par2IProgressUpdate.setLoadingProgress(0); + ArrayList var3 = new ArrayList(); +*** AnvilSaveConverterFileFilter.java Sat Feb 5 04:13:11 2022 +--- AnvilSaveConverterFileFilter.java Sat Feb 5 04:12:32 2022 +*** AnvilSaveHandler.java Sat Feb 5 04:13:11 2022 +--- AnvilSaveHandler.java Sat Feb 5 04:12:32 2022 +*************** +*** 8,18 **** + { + super(par1File, par2Str, par3); + } + + /** +! * initializes and returns the chunk loader for the specified world provider + */ + public IChunkLoader getChunkLoader(WorldProvider par1WorldProvider) + { + File var2 = this.getWorldDirectory(); + File var3; +--- 8,18 ---- + { + super(par1File, par2Str, par3); + } + + /** +! * Returns the chunk loader with the provided world provider + */ + public IChunkLoader getChunkLoader(WorldProvider par1WorldProvider) + { + File var2 = this.getWorldDirectory(); + File var3; +*** Attribute.java Sat Feb 5 04:13:11 2022 +--- Attribute.java Sat Feb 5 04:12:32 2022 +*** AttributeInstance.java Sat Feb 5 04:13:11 2022 +--- AttributeInstance.java Sat Feb 5 04:12:32 2022 +*************** +*** 20,26 **** +--- 20,28 ---- + + void applyModifier(AttributeModifier var1); + + void removeModifier(AttributeModifier var1); + ++ void func_142049_d(); ++ + double getAttributeValue(); + } +*** AttributeModifier.java Sat Feb 5 04:13:11 2022 +--- AttributeModifier.java Sat Feb 5 04:12:32 2022 +*** AxisAlignedBB.java Sat Feb 5 04:13:11 2022 +--- AxisAlignedBB.java Sat Feb 5 04:12:32 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- Backup.java Sat Feb 5 04:12:32 2022 +*************** +*** 0 **** +--- 1,29 ---- ++ package net.minecraft.src; ++ ++ import argo.jdom.JsonNode; ++ import java.util.Date; ++ ++ public class Backup extends ValueObject ++ { ++ public String field_110727_a; ++ public Date field_110725_b; ++ public long field_110726_c; ++ ++ public static Backup func_110724_a(JsonNode par0JsonNode) ++ { ++ Backup var1 = new Backup(); ++ ++ try ++ { ++ var1.field_110727_a = par0JsonNode.getStringValue(new Object[] {"backupId"}); ++ var1.field_110725_b = new Date(Long.parseLong(par0JsonNode.getNumberValue(new Object[] {"lastModifiedDate"}))); ++ var1.field_110726_c = Long.parseLong(par0JsonNode.getNumberValue(new Object[] {"size"})); ++ } ++ catch (IllegalArgumentException var3) ++ { ++ ; ++ } ++ ++ return var1; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- BackupList.java Sat Feb 5 04:12:32 2022 +*************** +*** 0 **** +--- 1,46 ---- ++ package net.minecraft.src; ++ ++ import argo.jdom.JdomParser; ++ import argo.jdom.JsonNode; ++ import argo.jdom.JsonRootNode; ++ import argo.saj.InvalidSyntaxException; ++ import java.util.ArrayList; ++ import java.util.Iterator; ++ import java.util.List; ++ ++ public class BackupList ++ { ++ public List field_111223_a; ++ ++ public static BackupList func_111222_a(String par0Str) ++ { ++ BackupList var1 = new BackupList(); ++ var1.field_111223_a = new ArrayList(); ++ ++ try ++ { ++ JsonRootNode var2 = (new JdomParser()).parse(par0Str); ++ ++ if (var2.isArrayNode(new Object[] {"backups"})) ++ { ++ Iterator var3 = var2.getArrayNode(new Object[] {"backups"}).iterator(); ++ ++ while (var3.hasNext()) ++ { ++ JsonNode var4 = (JsonNode)var3.next(); ++ var1.field_111223_a.add(Backup.func_110724_a(var4)); ++ } ++ } ++ } ++ catch (InvalidSyntaxException var5) ++ { ++ ; ++ } ++ catch (IllegalArgumentException var6) ++ { ++ ; ++ } ++ ++ return var1; ++ } ++ } +*** BanEntry.java Sat Feb 5 04:13:11 2022 +--- BanEntry.java Sat Feb 5 04:12:32 2022 +*** BanList.java Sat Feb 5 04:13:11 2022 +--- BanList.java Sat Feb 5 04:12:32 2022 +*** BaseAttribute.java Sat Feb 5 04:13:11 2022 +--- BaseAttribute.java Sat Feb 5 04:12:32 2022 +*** BaseAttributeMap.java Sat Feb 5 04:13:11 2022 +--- BaseAttributeMap.java Sat Feb 5 04:12:32 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- BaseMetadataSectionSerializer.java Sat Feb 5 04:12:32 2022 +*************** +*** 0 **** +--- 1,161 ---- ++ package net.minecraft.src; ++ ++ import com.google.gson.JsonElement; ++ import com.google.gson.JsonParseException; ++ ++ public abstract class BaseMetadataSectionSerializer implements MetadataSectionSerializer ++ { ++ protected float func_110487_a(JsonElement par1JsonElement, String par2Str, Float par3, float par4, float par5) ++ { ++ par2Str = this.getSectionName() + "->" + par2Str; ++ ++ if (par1JsonElement == null) ++ { ++ if (par3 == null) ++ { ++ throw new JsonParseException("Missing " + par2Str + ": expected float"); ++ } ++ else ++ { ++ return par3.floatValue(); ++ } ++ } ++ else if (!par1JsonElement.isJsonPrimitive()) ++ { ++ throw new JsonParseException("Invalid " + par2Str + ": expected float, was " + par1JsonElement); ++ } ++ else ++ { ++ try ++ { ++ float var6 = par1JsonElement.getAsFloat(); ++ ++ if (var6 < par4) ++ { ++ throw new JsonParseException("Invalid " + par2Str + ": expected float >= " + par4 + ", was " + var6); ++ } ++ else if (var6 > par5) ++ { ++ throw new JsonParseException("Invalid " + par2Str + ": expected float <= " + par5 + ", was " + var6); ++ } ++ else ++ { ++ return var6; ++ } ++ } ++ catch (NumberFormatException var7) ++ { ++ throw new JsonParseException("Invalid " + par2Str + ": expected float, was " + par1JsonElement, var7); ++ } ++ } ++ } ++ ++ protected int func_110485_a(JsonElement par1JsonElement, String par2Str, Integer par3, int par4, int par5) ++ { ++ par2Str = this.getSectionName() + "->" + par2Str; ++ ++ if (par1JsonElement == null) ++ { ++ if (par3 == null) ++ { ++ throw new JsonParseException("Missing " + par2Str + ": expected int"); ++ } ++ else ++ { ++ return par3.intValue(); ++ } ++ } ++ else if (!par1JsonElement.isJsonPrimitive()) ++ { ++ throw new JsonParseException("Invalid " + par2Str + ": expected int, was " + par1JsonElement); ++ } ++ else ++ { ++ try ++ { ++ int var6 = par1JsonElement.getAsInt(); ++ ++ if (var6 < par4) ++ { ++ throw new JsonParseException("Invalid " + par2Str + ": expected int >= " + par4 + ", was " + var6); ++ } ++ else if (var6 > par5) ++ { ++ throw new JsonParseException("Invalid " + par2Str + ": expected int <= " + par5 + ", was " + var6); ++ } ++ else ++ { ++ return var6; ++ } ++ } ++ catch (NumberFormatException var7) ++ { ++ throw new JsonParseException("Invalid " + par2Str + ": expected int, was " + par1JsonElement, var7); ++ } ++ } ++ } ++ ++ protected String func_110486_a(JsonElement par1JsonElement, String par2Str, String par3Str, int par4, int par5) ++ { ++ par2Str = this.getSectionName() + "->" + par2Str; ++ ++ if (par1JsonElement == null) ++ { ++ if (par3Str == null) ++ { ++ throw new JsonParseException("Missing " + par2Str + ": expected string"); ++ } ++ else ++ { ++ return par3Str; ++ } ++ } ++ else if (!par1JsonElement.isJsonPrimitive()) ++ { ++ throw new JsonParseException("Invalid " + par2Str + ": expected string, was " + par1JsonElement); ++ } ++ else ++ { ++ String var6 = par1JsonElement.getAsString(); ++ ++ if (var6.length() < par4) ++ { ++ throw new JsonParseException("Invalid " + par2Str + ": expected string length >= " + par4 + ", was " + var6); ++ } ++ else if (var6.length() > par5) ++ { ++ throw new JsonParseException("Invalid " + par2Str + ": expected string length <= " + par5 + ", was " + var6); ++ } ++ else ++ { ++ return var6; ++ } ++ } ++ } ++ ++ protected boolean func_110484_a(JsonElement par1JsonElement, String par2Str, Boolean par3) ++ { ++ par2Str = this.getSectionName() + "->" + par2Str; ++ ++ if (par1JsonElement == null) ++ { ++ if (par3 == null) ++ { ++ throw new JsonParseException("Missing " + par2Str + ": expected boolean"); ++ } ++ else ++ { ++ return par3.booleanValue(); ++ } ++ } ++ else if (!par1JsonElement.isJsonPrimitive()) ++ { ++ throw new JsonParseException("Invalid " + par2Str + ": expected boolean, was " + par1JsonElement); ++ } ++ else ++ { ++ boolean var4 = par1JsonElement.getAsBoolean(); ++ return var4; ++ } ++ } ++ } +*** BehaviorDefaultDispenseItem.java Sat Feb 5 04:13:11 2022 +--- BehaviorDefaultDispenseItem.java Sat Feb 5 04:12:32 2022 +*** BehaviorDispenseArmor.java Sat Feb 5 04:13:11 2022 +--- BehaviorDispenseArmor.java Sat Feb 5 04:12:32 2022 +*** BehaviorDispenseItemProvider.java Sat Feb 5 04:13:11 2022 +--- BehaviorDispenseItemProvider.java Sat Feb 5 04:12:32 2022 +*** BehaviorDispenseMinecart.java Sat Feb 5 04:13:11 2022 +--- BehaviorDispenseMinecart.java Sat Feb 5 04:12:32 2022 +*** BehaviorProjectileDispense.java Sat Feb 5 04:13:11 2022 +--- BehaviorProjectileDispense.java Sat Feb 5 04:12:32 2022 +*** BiomeCache.java Sat Feb 5 04:13:11 2022 +--- BiomeCache.java Sat Feb 5 04:12:32 2022 +*************** +*** 40,50 **** + var5 = new BiomeCacheBlock(this, par1, par2); + this.cacheMap.add(var3, var5); + this.cache.add(var5); + } + +! var5.lastAccessTime = MinecraftServer.getCurrentTimeMillis(); + return var5; + } + + /** + * Returns the BiomeGenBase related to the x, z position from the cache. +--- 40,50 ---- + var5 = new BiomeCacheBlock(this, par1, par2); + this.cacheMap.add(var3, var5); + this.cache.add(var5); + } + +! var5.lastAccessTime = MinecraftServer.getSystemTimeMillis(); + return var5; + } + + /** + * Returns the BiomeGenBase related to the x, z position from the cache. +*************** +*** 57,67 **** + /** + * Removes BiomeCacheBlocks from this cache that haven't been accessed in at least 30 seconds. + */ + public void cleanupCache() + { +! long var1 = MinecraftServer.getCurrentTimeMillis(); + long var3 = var1 - this.lastCleanupTime; + + if (var3 > 7500L || var3 < 0L) + { + this.lastCleanupTime = var1; +--- 57,67 ---- + /** + * Removes BiomeCacheBlocks from this cache that haven't been accessed in at least 30 seconds. + */ + public void cleanupCache() + { +! long var1 = MinecraftServer.getSystemTimeMillis(); + long var3 = var1 - this.lastCleanupTime; + + if (var3 > 7500L || var3 < 0L) + { + this.lastCleanupTime = var1; +*** BiomeCacheBlock.java Sat Feb 5 04:13:11 2022 +--- BiomeCacheBlock.java Sat Feb 5 04:12:32 2022 +*** BiomeDecorator.java Sat Feb 5 04:13:11 2022 +--- BiomeDecorator.java Sat Feb 5 04:12:32 2022 +*** BiomeEndDecorator.java Sat Feb 5 04:13:11 2022 +--- BiomeEndDecorator.java Sat Feb 5 04:12:32 2022 +*** BiomeGenBase.java Sat Feb 5 04:13:11 2022 +--- BiomeGenBase.java Sat Feb 5 04:12:32 2022 +*************** +*** 1,7 **** +--- 1,8 ---- + package net.minecraft.src; + ++ import java.awt.Color; + import java.util.ArrayList; + import java.util.List; + import java.util.Random; + + public abstract class BiomeGenBase +*************** +*** 234,243 **** +--- 235,264 ---- + this.color = par1; + return this; + } + + /** ++ * takes temperature, returns color ++ */ ++ public int getSkyColorByTemp(float par1) ++ { ++ par1 /= 3.0F; ++ ++ if (par1 < -1.0F) ++ { ++ par1 = -1.0F; ++ } ++ ++ if (par1 > 1.0F) ++ { ++ par1 = 1.0F; ++ } ++ ++ return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB(); ++ } ++ ++ /** + * Returns the correspondent list of the EnumCreatureType informed. + */ + public List getSpawnableList(EnumCreatureType par1EnumCreatureType) + { + return par1EnumCreatureType == EnumCreatureType.monster ? this.spawnableMonsterList : (par1EnumCreatureType == EnumCreatureType.creature ? this.spawnableCreatureList : (par1EnumCreatureType == EnumCreatureType.waterCreature ? this.spawnableWaterCreatureList : (par1EnumCreatureType == EnumCreatureType.ambient ? this.spawnableCaveCreatureList : null))); +*************** +*** 290,306 **** +--- 311,355 ---- + { + return (int)(this.temperature * 65536.0F); + } + + /** ++ * Gets a floating point representation of this biome's rainfall ++ */ ++ public final float getFloatRainfall() ++ { ++ return this.rainfall; ++ } ++ ++ /** + * Gets a floating point representation of this biome's temperature + */ + public final float getFloatTemperature() + { + return this.temperature; + } + + public void decorate(World par1World, Random par2Random, int par3, int par4) + { + this.theBiomeDecorator.decorate(par1World, par2Random, par3, par4); ++ } ++ ++ /** ++ * Provides the basic grass color based on the biome temperature and rainfall ++ */ ++ public int getBiomeGrassColor() ++ { ++ double var1 = (double)MathHelper.clamp_float(this.getFloatTemperature(), 0.0F, 1.0F); ++ double var3 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F); ++ return ColorizerGrass.getGrassColor(var1, var3); ++ } ++ ++ /** ++ * Provides the basic foliage color based on the biome temperature and rainfall ++ */ ++ public int getBiomeFoliageColor() ++ { ++ double var1 = (double)MathHelper.clamp_float(this.getFloatTemperature(), 0.0F, 1.0F); ++ double var3 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F); ++ return ColorizerFoliage.getFoliageColor(var1, var3); + } + } +*** BiomeGenBeach.java Sat Feb 5 04:13:11 2022 +--- BiomeGenBeach.java Sat Feb 5 04:12:32 2022 +*** BiomeGenDesert.java Sat Feb 5 04:13:11 2022 +--- BiomeGenDesert.java Sat Feb 5 04:12:32 2022 +*** BiomeGenEnd.java Sat Feb 5 04:13:11 2022 +--- BiomeGenEnd.java Sat Feb 5 04:12:32 2022 +*************** +*** 12,17 **** +--- 12,25 ---- + this.spawnableMonsterList.add(new SpawnListEntry(EntityEnderman.class, 10, 4, 4)); + this.topBlock = (byte)Block.dirt.blockID; + this.fillerBlock = (byte)Block.dirt.blockID; + this.theBiomeDecorator = new BiomeEndDecorator(this); + } ++ ++ /** ++ * takes temperature, returns color ++ */ ++ public int getSkyColorByTemp(float par1) ++ { ++ return 0; ++ } + } +*** BiomeGenForest.java Sat Feb 5 04:13:11 2022 +--- BiomeGenForest.java Sat Feb 5 04:12:32 2022 +*** BiomeGenHell.java Sat Feb 5 04:13:11 2022 +--- BiomeGenHell.java Sat Feb 5 04:12:32 2022 +*** BiomeGenHills.java Sat Feb 5 04:13:11 2022 +--- BiomeGenHills.java Sat Feb 5 04:12:32 2022 +*** BiomeGenJungle.java Sat Feb 5 04:13:11 2022 +--- BiomeGenJungle.java Sat Feb 5 04:12:32 2022 +*** BiomeGenMushroomIsland.java Sat Feb 5 04:13:11 2022 +--- BiomeGenMushroomIsland.java Sat Feb 5 04:12:32 2022 +*** BiomeGenOcean.java Sat Feb 5 04:13:11 2022 +--- BiomeGenOcean.java Sat Feb 5 04:12:32 2022 +*** BiomeGenPlains.java Sat Feb 5 04:13:11 2022 +--- BiomeGenPlains.java Sat Feb 5 04:12:32 2022 +*** BiomeGenRiver.java Sat Feb 5 04:13:11 2022 +--- BiomeGenRiver.java Sat Feb 5 04:12:32 2022 +*** BiomeGenSnow.java Sat Feb 5 04:13:11 2022 +--- BiomeGenSnow.java Sat Feb 5 04:12:32 2022 +*** BiomeGenSwamp.java Sat Feb 5 04:13:11 2022 +--- BiomeGenSwamp.java Sat Feb 5 04:12:32 2022 +*************** +*** 23,28 **** +--- 23,48 ---- + */ + public WorldGenerator getRandomWorldGenForTrees(Random par1Random) + { + return this.worldGeneratorSwamp; + } ++ ++ /** ++ * Provides the basic grass color based on the biome temperature and rainfall ++ */ ++ public int getBiomeGrassColor() ++ { ++ double var1 = (double)this.getFloatTemperature(); ++ double var3 = (double)this.getFloatRainfall(); ++ return ((ColorizerGrass.getGrassColor(var1, var3) & 16711422) + 5115470) / 2; ++ } ++ ++ /** ++ * Provides the basic foliage color based on the biome temperature and rainfall ++ */ ++ public int getBiomeFoliageColor() ++ { ++ double var1 = (double)this.getFloatTemperature(); ++ double var3 = (double)this.getFloatRainfall(); ++ return ((ColorizerFoliage.getFoliageColor(var1, var3) & 16711422) + 5115470) / 2; ++ } + } +*** BiomeGenTaiga.java Sat Feb 5 04:13:11 2022 +--- BiomeGenTaiga.java Sat Feb 5 04:12:32 2022 +*** Block.java Sat Feb 5 04:13:11 2022 +--- Block.java Sat Feb 5 04:12:32 2022 +*************** +*** 174,183 **** +--- 174,185 ---- + public static final Block enchantmentTable = (new BlockEnchantmentTable(116)).setHardness(5.0F).setResistance(2000.0F).setUnlocalizedName("enchantmentTable").setTextureName("enchanting_table"); + public static final Block brewingStand = (new BlockBrewingStand(117)).setHardness(0.5F).setLightValue(0.125F).setUnlocalizedName("brewingStand").setTextureName("brewing_stand"); + public static final BlockCauldron cauldron = (BlockCauldron)(new BlockCauldron(118)).setHardness(2.0F).setUnlocalizedName("cauldron").setTextureName("cauldron"); + public static final Block endPortal = (new BlockEndPortal(119, Material.portal)).setHardness(-1.0F).setResistance(6000000.0F); + public static final Block endPortalFrame = (new BlockEndPortalFrame(120)).setStepSound(soundGlassFootstep).setLightValue(0.125F).setHardness(-1.0F).setUnlocalizedName("endPortalFrame").setResistance(6000000.0F).setCreativeTab(CreativeTabs.tabDecorations).setTextureName("endframe"); ++ ++ /** The rock found in The End. */ + public static final Block whiteStone = (new Block(121, Material.rock)).setHardness(3.0F).setResistance(15.0F).setStepSound(soundStoneFootstep).setUnlocalizedName("whiteStone").setCreativeTab(CreativeTabs.tabBlock).setTextureName("end_stone"); + public static final Block dragonEgg = (new BlockDragonEgg(122)).setHardness(3.0F).setResistance(15.0F).setStepSound(soundStoneFootstep).setLightValue(0.125F).setUnlocalizedName("dragonEgg").setTextureName("dragon_egg"); + public static final Block redstoneLampIdle = (new BlockRedstoneLight(123, false)).setHardness(0.3F).setStepSound(soundGlassFootstep).setUnlocalizedName("redstoneLight").setCreativeTab(CreativeTabs.tabRedstone).setTextureName("redstone_lamp_off"); + public static final Block redstoneLampActive = (new BlockRedstoneLight(124, true)).setHardness(0.3F).setStepSound(soundGlassFootstep).setUnlocalizedName("redstoneLight").setTextureName("redstone_lamp_on"); + public static final BlockHalfSlab woodDoubleSlab = (BlockHalfSlab)(new BlockWoodSlab(125, true)).setHardness(2.0F).setResistance(5.0F).setStepSound(soundWoodFootstep).setUnlocalizedName("woodSlab"); +*************** +*** 278,287 **** +--- 280,290 ---- + */ + public float slipperiness; + + /** The unlocalized name of this block. */ + private String unlocalizedName; ++ protected Icon blockIcon; + + protected Block(int par1, Material par2Material) + { + this.stepSound = soundPowderFootstep; + this.blockParticleGravity = 1.0F; +*************** +*** 440,458 **** +--- 443,518 ---- + this.maxY = (double)par5; + this.maxZ = (double)par6; + } + + /** ++ * How bright to render this block based on the light its receiving. Args: iBlockAccess, x, y, z ++ */ ++ public float getBlockBrightness(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) ++ { ++ return par1IBlockAccess.getBrightness(par2, par3, par4, lightValue[par1IBlockAccess.getBlockId(par2, par3, par4)]); ++ } ++ ++ /** ++ * Goes straight to getLightBrightnessForSkyBlocks for Blocks, does some fancy computing for Fluids ++ */ ++ public int getMixedBrightnessForBlock(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) ++ { ++ return par1IBlockAccess.getLightBrightnessForSkyBlocks(par2, par3, par4, lightValue[par1IBlockAccess.getBlockId(par2, par3, par4)]); ++ } ++ ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) ++ { ++ return par5 == 0 && this.minY > 0.0D ? true : (par5 == 1 && this.maxY < 1.0D ? true : (par5 == 2 && this.minZ > 0.0D ? true : (par5 == 3 && this.maxZ < 1.0D ? true : (par5 == 4 && this.minX > 0.0D ? true : (par5 == 5 && this.maxX < 1.0D ? true : !par1IBlockAccess.isBlockOpaqueCube(par2, par3, par4)))))); ++ } ++ ++ /** + * Returns Returns true if the given side of this block type should be rendered (if it's solid or not), if the + * adjacent block is at the given coordinates. Args: blockAccess, x, y, z, side + */ + public boolean isBlockSolid(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) + { + return par1IBlockAccess.getBlockMaterial(par2, par3, par4).isSolid(); + } + + /** ++ * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side ++ */ ++ public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) ++ { ++ return this.getIcon(par5, par1IBlockAccess.getBlockMetadata(par2, par3, par4)); ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return this.blockIcon; ++ } ++ ++ /** ++ * Returns the block texture based on the side being looked at. Args: side ++ */ ++ public final Icon getBlockTextureFromSide(int par1) ++ { ++ return this.getIcon(par1, 0); ++ } ++ ++ /** ++ * Returns the bounding box of the wired rectangular prism to render. ++ */ ++ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) ++ { ++ return AxisAlignedBB.getAABBPool().getAABB((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)par3 + this.maxY, (double)par4 + this.maxZ); ++ } ++ ++ /** + * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the + * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity + */ + public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) + { +*************** +*** 481,491 **** + { + return true; + } + + /** +! * Returns whether this block is collideable based on the arguments passed in Args: blockMetaData, unknownFlag + */ + public boolean canCollideCheck(int par1, boolean par2) + { + return this.isCollidable(); + } +--- 541,552 ---- + { + return true; + } + + /** +! * Returns whether this block is collideable based on the arguments passed in \n@param par1 block metaData \n@param +! * par2 whether the player right-clicked while holding a boat + */ + public boolean canCollideCheck(int par1, boolean par2) + { + return this.isCollidable(); + } +*************** +*** 502,511 **** +--- 563,577 ---- + * Ticks the block if it's been scheduled + */ + public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {} + + /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {} ++ ++ /** + * Called right before the block is destroyed by a player. Args: world, x, y, z, metaData + */ + public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {} + + /** +*************** +*** 788,797 **** +--- 854,871 ---- + /** + * Called upon the block being destroyed by an explosion + */ + public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4, Explosion par5Explosion) {} + ++ /** ++ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha ++ */ ++ public int getRenderBlockPass() ++ { ++ return 0; ++ } ++ + public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5, ItemStack par6ItemStack) + { + return this.canPlaceBlockOnSide(par1World, par2, par3, par4, par5); + } + +*************** +*** 849,859 **** + public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {} + + /** + * returns the block bounderies minX value + */ +! public final double getMinX() + { + return this.minX; + } + + /** +--- 923,933 ---- + public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {} + + /** + * returns the block bounderies minX value + */ +! public final double getBlockBoundsMinX() + { + return this.minX; + } + + /** +*************** +*** 894,903 **** +--- 968,999 ---- + public final double getBlockBoundsMaxZ() + { + return this.maxZ; + } + ++ public int getBlockColor() ++ { ++ return 16777215; ++ } ++ ++ /** ++ * Returns the color this block should be rendered. Used by leaves. ++ */ ++ public int getRenderColor(int par1) ++ { ++ return 16777215; ++ } ++ ++ /** ++ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called ++ * when first determining what to render. ++ */ ++ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) ++ { ++ return 16777215; ++ } ++ + /** + * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube + * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, + * Y, Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. + */ +*************** +*** 1064,1086 **** +--- 1160,1214 ---- + { + return this.blockMaterial.getMaterialMobility(); + } + + /** ++ * Returns the default ambient occlusion value based on block opacity ++ */ ++ public float getAmbientOcclusionLightValue(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) ++ { ++ return par1IBlockAccess.isBlockNormalCube(par2, par3, par4) ? 0.2F : 1.0F; ++ } ++ ++ /** + * Block's chance to react to an entity falling on it. + */ + public void onFallenUpon(World par1World, int par2, int par3, int par4, Entity par5Entity, float par6) {} + + /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return this.blockID; ++ } ++ ++ /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World par1World, int par2, int par3, int par4) + { + return this.damageDropped(par1World.getBlockMetadata(par2, par3, par4)); + } + + /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) ++ { ++ par3List.add(new ItemStack(par1, 1, 0)); ++ } ++ ++ /** ++ * Returns the CreativeTab to display the given block on. ++ */ ++ public CreativeTabs getCreativeTabToDisplayOn() ++ { ++ return this.displayOnCreativeTab; ++ } ++ ++ /** + * Sets the CreativeTab to display this block on. + */ + public Block setCreativeTab(CreativeTabs par1CreativeTabs) + { + this.displayOnCreativeTab = par1CreativeTabs; +*************** +*** 1101,1110 **** +--- 1229,1246 ---- + /** + * currently only used by BlockCauldron to incrament meta-data during rain + */ + public void fillWithRain(World par1World, int par2, int par3, int par4) {} + ++ /** ++ * Returns true only if block is flowerPot ++ */ ++ public boolean isFlowerPot() ++ { ++ return false; ++ } ++ + public boolean func_82506_l() + { + return true; + } + +*************** +*** 1153,1162 **** +--- 1289,1320 ---- + + protected Block setTextureName(String par1Str) + { + this.textureName = par1Str; + return this; ++ } ++ ++ protected String getTextureName() ++ { ++ return this.textureName == null ? "MISSING_ICON_TILE_" + this.blockID + "_" + this.unlocalizedName : this.textureName; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName()); ++ } ++ ++ /** ++ * Gets the icon name of the ItemBlock corresponding to this block. Used by hoppers. ++ */ ++ public String getItemIconName() ++ { ++ return null; + } + + static + { + Item.itemsList[cloth.blockID] = (new ItemCloth(cloth.blockID - 256)).setUnlocalizedName("cloth"); +*** BlockAnvil.java Sat Feb 5 04:13:11 2022 +--- BlockAnvil.java Sat Feb 5 04:12:32 2022 +*************** +*** 1,12 **** +--- 1,16 ---- + package net.minecraft.src; + ++ import java.util.List; ++ + public class BlockAnvil extends BlockSand + { + /** List of types/statues the Anvil can be in. */ + public static final String[] statuses = new String[] {"intact", "slightlyDamaged", "veryDamaged"}; + private static final String[] anvilIconNames = new String[] {"anvil_top_damaged_0", "anvil_top_damaged_1", "anvil_top_damaged_2"}; ++ public int field_82521_b; ++ private Icon[] iconArray; + + protected BlockAnvil(int par1) + { + super(par1, Material.anvil); + this.setLightOpacity(0); +*************** +*** 29,38 **** +--- 33,73 ---- + { + return false; + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ if (this.field_82521_b == 3 && par1 == 1) ++ { ++ int var3 = (par2 >> 2) % this.iconArray.length; ++ return this.iconArray[var3]; ++ } ++ else ++ { ++ return this.blockIcon; ++ } ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon("anvil_base"); ++ this.iconArray = new Icon[anvilIconNames.length]; ++ ++ for (int var2 = 0; var2 < this.iconArray.length; ++var2) ++ { ++ this.iconArray[var2] = par1IconRegister.registerIcon(anvilIconNames[var2]); ++ } ++ } ++ ++ /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) + { + int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; +*************** +*** 40,65 **** + ++var7; + var7 %= 4; + + if (var7 == 0) + { +! par1World.setBlockMetadata(par2, par3, par4, 2 | var8 << 2, 2); + } + + if (var7 == 1) + { +! par1World.setBlockMetadata(par2, par3, par4, 3 | var8 << 2, 2); + } + + if (var7 == 2) + { +! par1World.setBlockMetadata(par2, par3, par4, 0 | var8 << 2, 2); + } + + if (var7 == 3) + { +! par1World.setBlockMetadata(par2, par3, par4, 1 | var8 << 2, 2); + } + } + + /** + * Called upon block activation (right click on the block.) +--- 75,100 ---- + ++var7; + var7 %= 4; + + if (var7 == 0) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 2 | var8 << 2, 2); + } + + if (var7 == 1) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 3 | var8 << 2, 2); + } + + if (var7 == 2) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 0 | var8 << 2, 2); + } + + if (var7 == 3) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 1 | var8 << 2, 2); + } + } + + /** + * Called upon block activation (right click on the block.) +*************** +*** 109,118 **** +--- 144,163 ---- + this.setBlockBounds(0.0F, 0.0F, 0.125F, 1.0F, 1.0F, 0.875F); + } + } + + /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) ++ { ++ par3List.add(new ItemStack(par1, 1, 0)); ++ par3List.add(new ItemStack(par1, 1, 1)); ++ par3List.add(new ItemStack(par1, 1, 2)); ++ } ++ ++ /** + * Called when the falling block entity for this block is created + */ + protected void onStartFalling(EntityFallingSand par1EntityFallingSand) + { + par1EntityFallingSand.setIsAnvil(true); +*************** +*** 122,128 **** +--- 167,182 ---- + * Called when the falling block entity for this block hits the ground and turns back into a block + */ + public void onFinishFalling(World par1World, int par2, int par3, int par4, int par5) + { + par1World.playAuxSFX(1022, par2, par3, par4, 0); ++ } ++ ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) ++ { ++ return true; + } + } +*** BlockBasePressurePlate.java Sat Feb 5 04:13:11 2022 +--- BlockBasePressurePlate.java Sat Feb 5 04:12:32 2022 +*************** +*** 146,156 **** + boolean var7 = par5 > 0; + boolean var8 = var6 > 0; + + if (par5 != var6) + { +! par1World.setBlockMetadata(par2, par3, par4, this.getMetaFromWeight(var6), 2); + this.func_94354_b_(par1World, par2, par3, par4); + par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); + } + + if (!var8 && var7) +--- 146,156 ---- + boolean var7 = par5 > 0; + boolean var8 = var6 > 0; + + if (par5 != var6) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, this.getMetaFromWeight(var6), 2); + this.func_94354_b_(par1World, par2, par3, par4); + par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); + } + + if (!var8 && var7) +*************** +*** 255,260 **** +--- 255,269 ---- + + /** + * Argument is weight (0-15). Return the metadata to be set because of it. + */ + protected abstract int getMetaFromWeight(int var1); ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon(this.pressurePlateIconName); ++ } + } +*** BlockBaseRailLogic.java Sat Feb 5 04:13:11 2022 +--- BlockBaseRailLogic.java Sat Feb 5 04:12:32 2022 +*************** +*** 9,27 **** + private int railX; + private int railY; + private int railZ; + private final boolean isStraightRail; + +! /** The positions of connected rails */ +! private List connectedTracks; + + final BlockRailBase theRail; + + public BlockBaseRailLogic(BlockRailBase par1BlockRailBase, World par2World, int par3, int par4, int par5) + { + this.theRail = par1BlockRailBase; +! this.connectedTracks = new ArrayList(); + this.logicWorld = par2World; + this.railX = par3; + this.railY = par4; + this.railZ = par5; + int var6 = par2World.getBlockId(par3, par4, par5); +--- 9,27 ---- + private int railX; + private int railY; + private int railZ; + private final boolean isStraightRail; + +! /** The chunk position the rail is at. */ +! private List railChunkPosition; + + final BlockRailBase theRail; + + public BlockBaseRailLogic(BlockRailBase par1BlockRailBase, World par2World, int par3, int par4, int par5) + { + this.theRail = par1BlockRailBase; +! this.railChunkPosition = new ArrayList(); + this.logicWorld = par2World; + this.railX = par3; + this.railY = par4; + this.railZ = par5; + int var6 = par2World.getBlockId(par3, par4, par5); +*************** +*** 40,116 **** + this.setBasicRail(var7); + } + + private void setBasicRail(int par1) + { +! this.connectedTracks.clear(); + + if (par1 == 0) + { +! this.connectedTracks.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1)); +! this.connectedTracks.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1)); + } + else if (par1 == 1) + { +! this.connectedTracks.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ)); +! this.connectedTracks.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ)); + } + else if (par1 == 2) + { +! this.connectedTracks.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ)); +! this.connectedTracks.add(new ChunkPosition(this.railX + 1, this.railY + 1, this.railZ)); + } + else if (par1 == 3) + { +! this.connectedTracks.add(new ChunkPosition(this.railX - 1, this.railY + 1, this.railZ)); +! this.connectedTracks.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ)); + } + else if (par1 == 4) + { +! this.connectedTracks.add(new ChunkPosition(this.railX, this.railY + 1, this.railZ - 1)); +! this.connectedTracks.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1)); + } + else if (par1 == 5) + { +! this.connectedTracks.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1)); +! this.connectedTracks.add(new ChunkPosition(this.railX, this.railY + 1, this.railZ + 1)); + } + else if (par1 == 6) + { +! this.connectedTracks.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ)); +! this.connectedTracks.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1)); + } + else if (par1 == 7) + { +! this.connectedTracks.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ)); +! this.connectedTracks.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1)); + } + else if (par1 == 8) + { +! this.connectedTracks.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ)); +! this.connectedTracks.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1)); + } + else if (par1 == 9) + { +! this.connectedTracks.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ)); +! this.connectedTracks.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1)); + } + } + + private void refreshConnectedTracks() + { +! for (int var1 = 0; var1 < this.connectedTracks.size(); ++var1) + { +! BlockBaseRailLogic var2 = this.getRailLogic((ChunkPosition)this.connectedTracks.get(var1)); + + if (var2 != null && var2.isRailChunkPositionCorrect(this)) + { +! this.connectedTracks.set(var1, new ChunkPosition(var2.railX, var2.railY, var2.railZ)); + } + else + { +! this.connectedTracks.remove(var1--); + } + } + } + + private boolean isMinecartTrack(int par1, int par2, int par3) +--- 40,116 ---- + this.setBasicRail(var7); + } + + private void setBasicRail(int par1) + { +! this.railChunkPosition.clear(); + + if (par1 == 0) + { +! this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1)); +! this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1)); + } + else if (par1 == 1) + { +! this.railChunkPosition.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ)); +! this.railChunkPosition.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ)); + } + else if (par1 == 2) + { +! this.railChunkPosition.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ)); +! this.railChunkPosition.add(new ChunkPosition(this.railX + 1, this.railY + 1, this.railZ)); + } + else if (par1 == 3) + { +! this.railChunkPosition.add(new ChunkPosition(this.railX - 1, this.railY + 1, this.railZ)); +! this.railChunkPosition.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ)); + } + else if (par1 == 4) + { +! this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY + 1, this.railZ - 1)); +! this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1)); + } + else if (par1 == 5) + { +! this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1)); +! this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY + 1, this.railZ + 1)); + } + else if (par1 == 6) + { +! this.railChunkPosition.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ)); +! this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1)); + } + else if (par1 == 7) + { +! this.railChunkPosition.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ)); +! this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1)); + } + else if (par1 == 8) + { +! this.railChunkPosition.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ)); +! this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1)); + } + else if (par1 == 9) + { +! this.railChunkPosition.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ)); +! this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1)); + } + } + + private void refreshConnectedTracks() + { +! for (int var1 = 0; var1 < this.railChunkPosition.size(); ++var1) + { +! BlockBaseRailLogic var2 = this.getRailLogic((ChunkPosition)this.railChunkPosition.get(var1)); + + if (var2 != null && var2.isRailChunkPositionCorrect(this)) + { +! this.railChunkPosition.set(var1, new ChunkPosition(var2.railX, var2.railY, var2.railZ)); + } + else + { +! this.railChunkPosition.remove(var1--); + } + } + } + + private boolean isMinecartTrack(int par1, int par2, int par3) +*************** +*** 126,138 **** + /** + * Checks if the rail is at the chunk position it is expected to be. + */ + private boolean isRailChunkPositionCorrect(BlockBaseRailLogic par1BlockBaseRailLogic) + { +! for (int var2 = 0; var2 < this.connectedTracks.size(); ++var2) + { +! ChunkPosition var3 = (ChunkPosition)this.connectedTracks.get(var2); + + if (var3.x == par1BlockBaseRailLogic.railX && var3.z == par1BlockBaseRailLogic.railZ) + { + return true; + } +--- 126,138 ---- + /** + * Checks if the rail is at the chunk position it is expected to be. + */ + private boolean isRailChunkPositionCorrect(BlockBaseRailLogic par1BlockBaseRailLogic) + { +! for (int var2 = 0; var2 < this.railChunkPosition.size(); ++var2) + { +! ChunkPosition var3 = (ChunkPosition)this.railChunkPosition.get(var2); + + if (var3.x == par1BlockBaseRailLogic.railX && var3.z == par1BlockBaseRailLogic.railZ) + { + return true; + } +*************** +*** 141,153 **** + return false; + } + + private boolean isPartOfTrack(int par1, int par2, int par3) + { +! for (int var4 = 0; var4 < this.connectedTracks.size(); ++var4) + { +! ChunkPosition var5 = (ChunkPosition)this.connectedTracks.get(var4); + + if (var5.x == par1 && var5.z == par3) + { + return true; + } +--- 141,153 ---- + return false; + } + + private boolean isPartOfTrack(int par1, int par2, int par3) + { +! for (int var4 = 0; var4 < this.railChunkPosition.size(); ++var4) + { +! ChunkPosition var5 = (ChunkPosition)this.railChunkPosition.get(var4); + + if (var5.x == par1 && var5.z == par3) + { + return true; + } +*************** +*** 183,198 **** + return var1; + } + + private boolean canConnectTo(BlockBaseRailLogic par1BlockBaseRailLogic) + { +! return this.isRailChunkPositionCorrect(par1BlockBaseRailLogic) ? true : (this.connectedTracks.size() == 2 ? false : (this.connectedTracks.isEmpty() ? true : true)); + } + + private void connectToNeighbor(BlockBaseRailLogic par1BlockBaseRailLogic) + { +! this.connectedTracks.add(new ChunkPosition(par1BlockBaseRailLogic.railX, par1BlockBaseRailLogic.railY, par1BlockBaseRailLogic.railZ)); + boolean var2 = this.isPartOfTrack(this.railX, this.railY, this.railZ - 1); + boolean var3 = this.isPartOfTrack(this.railX, this.railY, this.railZ + 1); + boolean var4 = this.isPartOfTrack(this.railX - 1, this.railY, this.railZ); + boolean var5 = this.isPartOfTrack(this.railX + 1, this.railY, this.railZ); + byte var6 = -1; +--- 183,198 ---- + return var1; + } + + private boolean canConnectTo(BlockBaseRailLogic par1BlockBaseRailLogic) + { +! return this.isRailChunkPositionCorrect(par1BlockBaseRailLogic) ? true : (this.railChunkPosition.size() == 2 ? false : (this.railChunkPosition.isEmpty() ? true : true)); + } + + private void connectToNeighbor(BlockBaseRailLogic par1BlockBaseRailLogic) + { +! this.railChunkPosition.add(new ChunkPosition(par1BlockBaseRailLogic.railX, par1BlockBaseRailLogic.railY, par1BlockBaseRailLogic.railZ)); + boolean var2 = this.isPartOfTrack(this.railX, this.railY, this.railZ - 1); + boolean var3 = this.isPartOfTrack(this.railX, this.railY, this.railZ + 1); + boolean var4 = this.isPartOfTrack(this.railX - 1, this.railY, this.railZ); + boolean var5 = this.isPartOfTrack(this.railX + 1, this.railY, this.railZ); + byte var6 = -1; +*************** +*** 266,276 **** + if (this.isStraightRail) + { + var7 = this.logicWorld.getBlockMetadata(this.railX, this.railY, this.railZ) & 8 | var6; + } + +! this.logicWorld.setBlockMetadata(this.railX, this.railY, this.railZ, var7, 3); + } + + private boolean canConnectFrom(int par1, int par2, int par3) + { + BlockBaseRailLogic var4 = this.getRailLogic(new ChunkPosition(par1, par2, par3)); +--- 266,276 ---- + if (this.isStraightRail) + { + var7 = this.logicWorld.getBlockMetadata(this.railX, this.railY, this.railZ) & 8 | var6; + } + +! this.logicWorld.setBlockMetadataWithNotify(this.railX, this.railY, this.railZ, var7, 3); + } + + private boolean canConnectFrom(int par1, int par2, int par3) + { + BlockBaseRailLogic var4 = this.getRailLogic(new ChunkPosition(par1, par2, par3)); +*************** +*** 427,441 **** + var8 = this.logicWorld.getBlockMetadata(this.railX, this.railY, this.railZ) & 8 | var7; + } + + if (par2 || this.logicWorld.getBlockMetadata(this.railX, this.railY, this.railZ) != var8) + { +! this.logicWorld.setBlockMetadata(this.railX, this.railY, this.railZ, var8, 3); + +! for (int var9 = 0; var9 < this.connectedTracks.size(); ++var9) + { +! BlockBaseRailLogic var10 = this.getRailLogic((ChunkPosition)this.connectedTracks.get(var9)); + + if (var10 != null) + { + var10.refreshConnectedTracks(); + +--- 427,441 ---- + var8 = this.logicWorld.getBlockMetadata(this.railX, this.railY, this.railZ) & 8 | var7; + } + + if (par2 || this.logicWorld.getBlockMetadata(this.railX, this.railY, this.railZ) != var8) + { +! this.logicWorld.setBlockMetadataWithNotify(this.railX, this.railY, this.railZ, var8, 3); + +! for (int var9 = 0; var9 < this.railChunkPosition.size(); ++var9) + { +! BlockBaseRailLogic var10 = this.getRailLogic((ChunkPosition)this.railChunkPosition.get(var9)); + + if (var10 != null) + { + var10.refreshConnectedTracks(); + +*** BlockBeacon.java Sat Feb 5 04:13:11 2022 +--- BlockBeacon.java Sat Feb 5 04:12:32 2022 +*************** +*** 63,72 **** +--- 63,81 ---- + { + return 34; + } + + /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ super.registerIcons(par1IconRegister); ++ } ++ ++ /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) + { + super.onBlockPlacedBy(par1World, par2, par3, par4, par5EntityLivingBase, par6ItemStack); +*** BlockBed.java Sat Feb 5 04:13:11 2022 +--- BlockBed.java Sat Feb 5 04:12:32 2022 +*************** +*** 5,14 **** +--- 5,17 ---- + + public class BlockBed extends BlockDirectional + { + /** Maps the foot-of-bed block to the head-of-bed block. */ + public static final int[][] footBlockToHeadBlockMap = new int[][] {{0, 1}, { -1, 0}, {0, -1}, {1, 0}}; ++ private Icon[] field_94472_b; ++ private Icon[] bedSideIcons; ++ private Icon[] bedTopIcons; + + public BlockBed(int par1) + { + super(par1, Material.cloth); + this.setBounds(); +*************** +*** 116,125 **** +--- 119,157 ---- + } + } + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ if (par1 == 0) ++ { ++ return Block.planks.getBlockTextureFromSide(par1); ++ } ++ else ++ { ++ int var3 = getDirection(par2); ++ int var4 = Direction.bedDirection[var3][par1]; ++ int var5 = isBlockHeadOfBed(par2) ? 1 : 0; ++ return (var5 != 1 || var4 != 2) && (var5 != 0 || var4 != 3) ? (var4 != 5 && var4 != 4 ? this.bedTopIcons[var5] : this.bedSideIcons[var5]) : this.field_94472_b[var5]; ++ } ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.bedTopIcons = new Icon[] {par1IconRegister.registerIcon(this.getTextureName() + "_feet_top"), par1IconRegister.registerIcon(this.getTextureName() + "_head_top")}; ++ this.field_94472_b = new Icon[] {par1IconRegister.registerIcon(this.getTextureName() + "_feet_end"), par1IconRegister.registerIcon(this.getTextureName() + "_head_end")}; ++ this.bedSideIcons = new Icon[] {par1IconRegister.registerIcon(this.getTextureName() + "_feet_side"), par1IconRegister.registerIcon(this.getTextureName() + "_head_side")}; ++ } ++ ++ /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 14; +*************** +*** 223,233 **** + else + { + var5 &= -5; + } + +! par0World.setBlockMetadata(par1, par2, par3, var5, 4); + } + + /** + * Gets the nearest empty chunk coordinates for the player to wake up from a bed into. + */ +--- 255,265 ---- + else + { + var5 &= -5; + } + +! par0World.setBlockMetadataWithNotify(par1, par2, par3, var5, 4); + } + + /** + * Gets the nearest empty chunk coordinates for the player to wake up from a bed into. + */ +*************** +*** 279,288 **** +--- 311,328 ---- + * and stop pistons + */ + public int getMobilityFlag() + { + return 1; ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return Item.bed.itemID; + } + + /** + * Called when the block is attempted to be harvested + */ +*** BlockBookshelf.java Sat Feb 5 04:13:11 2022 +--- BlockBookshelf.java Sat Feb 5 04:12:32 2022 +*************** +*** 9,18 **** +--- 9,26 ---- + super(par1, Material.wood); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return par1 != 1 && par1 != 0 ? super.getIcon(par1, par2) : Block.planks.getBlockTextureFromSide(par1); ++ } ++ ++ /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random par1Random) + { + return 3; +*** BlockBreakable.java Sat Feb 5 04:13:11 2022 +--- BlockBreakable.java Sat Feb 5 04:12:32 2022 +*************** +*** 18,23 **** +--- 18,42 ---- + */ + public boolean isOpaqueCube() + { + return false; + } ++ ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) ++ { ++ int var6 = par1IBlockAccess.getBlockId(par2, par3, par4); ++ return !this.localFlag && var6 == this.blockID ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon(this.breakableBlockIcon); ++ } + } +*** BlockBrewingStand.java Sat Feb 5 04:13:11 2022 +--- BlockBrewingStand.java Sat Feb 5 04:12:32 2022 +*************** +*** 4,13 **** +--- 4,14 ---- + import java.util.Random; + + public class BlockBrewingStand extends BlockContainer + { + private Random rand = new Random(); ++ private Icon theIcon; + + public BlockBrewingStand(int par1) + { + super(par1, Material.iron); + } +*************** +*** 97,106 **** +--- 98,118 ---- + ((TileEntityBrewingStand)par1World.getBlockTileEntity(par2, par3, par4)).func_94131_a(par6ItemStack.getDisplayName()); + } + } + + /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) ++ { ++ double var6 = (double)((float)par2 + 0.4F + par5Random.nextFloat() * 0.2F); ++ double var8 = (double)((float)par3 + 0.7F + par5Random.nextFloat() * 0.3F); ++ double var10 = (double)((float)par4 + 0.4F + par5Random.nextFloat() * 0.2F); ++ par1World.spawnParticle("smoke", var6, var8, var10, 0.0D, 0.0D, 0.0D); ++ } ++ ++ /** + * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a + * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old + * metadata + */ + public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) +*************** +*** 152,161 **** +--- 164,181 ---- + { + return Item.brewingStand.itemID; + } + + /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return Item.brewingStand.itemID; ++ } ++ ++ /** + * If this returns true, then comparators facing away from this block will use the value from + * getComparatorInputOverride instead of the actual redstone signal strength. + */ + public boolean hasComparatorInputOverride() + { +*************** +*** 167,173 **** +--- 187,208 ---- + * strength when this block inputs to a comparator. + */ + public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) + { + return Container.calcRedstoneFromInventory((IInventory)par1World.getBlockTileEntity(par2, par3, par4)); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ super.registerIcons(par1IconRegister); ++ this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_base"); ++ } ++ ++ public Icon getBrewingStandIcon() ++ { ++ return this.theIcon; + } + } +*** BlockButton.java Sat Feb 5 04:13:11 2022 +--- BlockButton.java Sat Feb 5 04:12:32 2022 +*************** +*** 222,232 **** + { + return true; + } + else + { +! par1World.setBlockMetadata(par2, par3, par4, var11 + var12, 3); + par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); + par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, 0.6F); + this.func_82536_d(par1World, par2, par3, par4, var11); + par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); + return true; +--- 222,232 ---- + { + return true; + } + else + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var11 + var12, 3); + par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); + par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, 0.6F); + this.func_82536_d(par1World, par2, par3, par4, var11); + par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); + return true; +*************** +*** 301,311 **** + { + this.func_82535_o(par1World, par2, par3, par4); + } + else + { +! par1World.setBlockMetadata(par2, par3, par4, var6 & 7, 3); + int var7 = var6 & 7; + this.func_82536_d(par1World, par2, par3, par4, var7); + par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, 0.5F); + par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); + } +--- 301,311 ---- + { + this.func_82535_o(par1World, par2, par3, par4); + } + else + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & 7, 3); + int var7 = var6 & 7; + this.func_82536_d(par1World, par2, par3, par4, var7); + par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, 0.5F); + par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); + } +*************** +*** 350,368 **** + List var9 = par1World.getEntitiesWithinAABB(EntityArrow.class, AxisAlignedBB.getAABBPool().getAABB((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)par3 + this.maxY, (double)par4 + this.maxZ)); + boolean var8 = !var9.isEmpty(); + + if (var8 && !var7) + { +! par1World.setBlockMetadata(par2, par3, par4, var6 | 8, 3); + this.func_82536_d(par1World, par2, par3, par4, var6); + par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); + par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, 0.6F); + } + + if (!var8 && var7) + { +! par1World.setBlockMetadata(par2, par3, par4, var6, 3); + this.func_82536_d(par1World, par2, par3, par4, var6); + par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); + par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, 0.5F); + } + +--- 350,368 ---- + List var9 = par1World.getEntitiesWithinAABB(EntityArrow.class, AxisAlignedBB.getAABBPool().getAABB((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)par3 + this.maxY, (double)par4 + this.maxZ)); + boolean var8 = !var9.isEmpty(); + + if (var8 && !var7) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 | 8, 3); + this.func_82536_d(par1World, par2, par3, par4, var6); + par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); + par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, 0.6F); + } + + if (!var8 && var7) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); + this.func_82536_d(par1World, par2, par3, par4, var6); + par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); + par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, 0.5F); + } + +*************** +*** 395,400 **** +--- 395,406 ---- + else + { + par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); + } + } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) {} + } +*** BlockButtonStone.java Sat Feb 5 04:13:11 2022 +--- BlockButtonStone.java Sat Feb 5 04:12:32 2022 +*************** +*** 4,9 **** +--- 4,17 ---- + { + protected BlockButtonStone(int par1) + { + super(par1, false); + } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return Block.stone.getBlockTextureFromSide(1); ++ } + } +*** BlockButtonWood.java Sat Feb 5 04:13:11 2022 +--- BlockButtonWood.java Sat Feb 5 04:12:32 2022 +*************** +*** 4,9 **** +--- 4,17 ---- + { + protected BlockButtonWood(int par1) + { + super(par1, true); + } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return Block.planks.getBlockTextureFromSide(1); ++ } + } +*** BlockCactus.java Sat Feb 5 04:13:11 2022 +--- BlockCactus.java Sat Feb 5 04:12:32 2022 +*************** +*** 2,11 **** +--- 2,14 ---- + + import java.util.Random; + + public class BlockCactus extends Block + { ++ private Icon cactusTopIcon; ++ private Icon cactusBottomIcon; ++ + protected BlockCactus(int par1) + { + super(par1, Material.cactus); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); +*************** +*** 30,45 **** + int var7 = par1World.getBlockMetadata(par2, par3, par4); + + if (var7 == 15) + { + par1World.setBlock(par2, par3 + 1, par4, this.blockID); +! par1World.setBlockMetadata(par2, par3, par4, 0, 4); + this.onNeighborBlockChange(par1World, par2, par3 + 1, par4, this.blockID); + } + else + { +! par1World.setBlockMetadata(par2, par3, par4, var7 + 1, 4); + } + } + } + } + +--- 33,48 ---- + int var7 = par1World.getBlockMetadata(par2, par3, par4); + + if (var7 == 15) + { + par1World.setBlock(par2, par3 + 1, par4, this.blockID); +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 0, 4); + this.onNeighborBlockChange(par1World, par2, par3 + 1, par4, this.blockID); + } + else + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 + 1, 4); + } + } + } + } + +*************** +*** 52,61 **** +--- 55,81 ---- + float var5 = 0.0625F; + return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + var5), (double)par3, (double)((float)par4 + var5), (double)((float)(par2 + 1) - var5), (double)((float)(par3 + 1) - var5), (double)((float)(par4 + 1) - var5)); + } + + /** ++ * Returns the bounding box of the wired rectangular prism to render. ++ */ ++ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) ++ { ++ float var5 = 0.0625F; ++ return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + var5), (double)par3, (double)((float)par4 + var5), (double)((float)(par2 + 1) - var5), (double)(par3 + 1), (double)((float)(par4 + 1) - var5)); ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return par1 == 1 ? this.cactusTopIcon : (par1 == 0 ? this.cactusBottomIcon : this.blockIcon); ++ } ++ ++ /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; +*************** +*** 130,136 **** +--- 150,167 ---- + * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity + */ + public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) + { + par5Entity.attackEntityFrom(DamageSource.cactus, 1.0F); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); ++ this.cactusTopIcon = par1IconRegister.registerIcon(this.getTextureName() + "_top"); ++ this.cactusBottomIcon = par1IconRegister.registerIcon(this.getTextureName() + "_bottom"); + } + } +*** BlockCake.java Sat Feb 5 04:13:11 2022 +--- BlockCake.java Sat Feb 5 04:12:32 2022 +*************** +*** 2,11 **** +--- 2,15 ---- + + import java.util.Random; + + public class BlockCake extends Block + { ++ private Icon cakeTopIcon; ++ private Icon cakeBottomIcon; ++ private Icon field_94382_c; ++ + protected BlockCake(int par1) + { + super(par1, Material.cake); + this.setTickRandomly(true); + } +*************** +*** 44,53 **** +--- 48,89 ---- + float var8 = 0.5F; + return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + var7), (double)par3, (double)((float)par4 + var6), (double)((float)(par2 + 1) - var6), (double)((float)par3 + var8 - var6), (double)((float)(par4 + 1) - var6)); + } + + /** ++ * Returns the bounding box of the wired rectangular prism to render. ++ */ ++ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) ++ { ++ int var5 = par1World.getBlockMetadata(par2, par3, par4); ++ float var6 = 0.0625F; ++ float var7 = (float)(1 + var5 * 2) / 16.0F; ++ float var8 = 0.5F; ++ return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + var7), (double)par3, (double)((float)par4 + var6), (double)((float)(par2 + 1) - var6), (double)((float)par3 + var8), (double)((float)(par4 + 1) - var6)); ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return par1 == 1 ? this.cakeTopIcon : (par1 == 0 ? this.cakeBottomIcon : (par2 > 0 && par1 == 4 ? this.field_94382_c : this.blockIcon)); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); ++ this.field_94382_c = par1IconRegister.registerIcon(this.getTextureName() + "_inner"); ++ this.cakeTopIcon = par1IconRegister.registerIcon(this.getTextureName() + "_top"); ++ this.cakeBottomIcon = par1IconRegister.registerIcon(this.getTextureName() + "_bottom"); ++ } ++ ++ /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; +*************** +*** 93,103 **** + { + par1World.setBlockToAir(par2, par3, par4); + } + else + { +! par1World.setBlockMetadata(par2, par3, par4, var6, 2); + } + } + } + + /** +--- 129,139 ---- + { + par1World.setBlockToAir(par2, par3, par4); + } + else + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 2); + } + } + } + + /** +*************** +*** 140,146 **** +--- 176,190 ---- + * Returns the ID of the items to drop on destruction. + */ + public int idDropped(int par1, Random par2Random, int par3) + { + return 0; ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return Item.cake.itemID; + } + } +*** BlockCarpet.java Sat Feb 5 04:13:11 2022 +--- BlockCarpet.java Sat Feb 5 04:12:32 2022 +*************** +*** 1,7 **** +--- 1,9 ---- + package net.minecraft.src; + ++ import java.util.List; ++ + public class BlockCarpet extends Block + { + protected BlockCarpet(int par1) + { + super(par1, Material.materialCarpet); +*************** +*** 10,19 **** +--- 12,29 ---- + this.setCreativeTab(CreativeTabs.tabDecorations); + this.func_111047_d(0); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return Block.cloth.getIcon(par1, par2); ++ } ++ ++ /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) + { +*************** +*** 100,111 **** +--- 110,147 ---- + { + return !par1World.isAirBlock(par2, par3 - 1, par4); + } + + /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) ++ { ++ return par5 == 1 ? true : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); ++ } ++ ++ /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int par1) + { + return par1; + } ++ ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) ++ { ++ for (int var4 = 0; var4 < 16; ++var4) ++ { ++ par3List.add(new ItemStack(par1, 1, var4)); ++ } ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) {} + } +*** BlockCarrot.java Sat Feb 5 04:13:11 2022 +--- BlockCarrot.java Sat Feb 5 04:12:32 2022 +*************** +*** 1,15 **** +--- 1,37 ---- + package net.minecraft.src; + + public class BlockCarrot extends BlockCrops + { ++ private Icon[] iconArray; ++ + public BlockCarrot(int par1) + { + super(par1); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ if (par2 < 7) ++ { ++ if (par2 == 6) ++ { ++ par2 = 5; ++ } ++ ++ return this.iconArray[par2 >> 1]; ++ } ++ else ++ { ++ return this.iconArray[3]; ++ } ++ } ++ ++ /** + * Generate a seed ItemStack for this crop. + */ + protected int getSeedItem() + { + return Item.carrot.itemID; +*************** +*** 19,25 **** +--- 41,61 ---- + * Generate a crop produce ItemStack for this crop. + */ + protected int getCropItem() + { + return Item.carrot.itemID; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.iconArray = new Icon[4]; ++ ++ for (int var2 = 0; var2 < this.iconArray.length; ++var2) ++ { ++ this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_stage_" + var2); ++ } + } + } +*** BlockCauldron.java Sat Feb 5 04:13:11 2022 +--- BlockCauldron.java Sat Feb 5 04:12:32 2022 +*************** +*** 3,18 **** +--- 3,47 ---- + import java.util.List; + import java.util.Random; + + public class BlockCauldron extends Block + { ++ private Icon field_94378_a; ++ private Icon cauldronTopIcon; ++ private Icon cauldronBottomIcon; ++ + public BlockCauldron(int par1) + { + super(par1, Material.iron); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return par1 == 1 ? this.cauldronTopIcon : (par1 == 0 ? this.cauldronBottomIcon : this.blockIcon); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.field_94378_a = par1IconRegister.registerIcon(this.getTextureName() + "_" + "inner"); ++ this.cauldronTopIcon = par1IconRegister.registerIcon(this.getTextureName() + "_top"); ++ this.cauldronBottomIcon = par1IconRegister.registerIcon(this.getTextureName() + "_" + "bottom"); ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); ++ } ++ ++ public static Icon getCauldronIcon(String par0Str) ++ { ++ return par0Str.equals("inner") ? Block.cauldron.field_94378_a : (par0Str.equals("bottom") ? Block.cauldron.cauldronBottomIcon : null); ++ } ++ ++ /** + * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the + * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity + */ + public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) + { +*************** +*** 92,102 **** + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, new ItemStack(Item.bucketEmpty)); + } + +! par1World.setBlockMetadata(par2, par3, par4, 3, 2); + par1World.func_96440_m(par2, par3, par4, this.blockID); + } + + return true; + } +--- 121,131 ---- + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, new ItemStack(Item.bucketEmpty)); + } + +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); + par1World.func_96440_m(par2, par3, par4, this.blockID); + } + + return true; + } +*************** +*** 122,140 **** + if (var10.stackSize <= 0) + { + par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, (ItemStack)null); + } + +! par1World.setBlockMetadata(par2, par3, par4, var12 - 1, 2); + par1World.func_96440_m(par2, par3, par4, this.blockID); + } + } + else if (var12 > 0 && var10.getItem() instanceof ItemArmor && ((ItemArmor)var10.getItem()).getArmorMaterial() == EnumArmorMaterial.CLOTH) + { + ItemArmor var14 = (ItemArmor)var10.getItem(); + var14.removeColor(var10); +! par1World.setBlockMetadata(par2, par3, par4, var12 - 1, 2); + par1World.func_96440_m(par2, par3, par4, this.blockID); + return true; + } + + return true; +--- 151,169 ---- + if (var10.stackSize <= 0) + { + par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, (ItemStack)null); + } + +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var12 - 1, 2); + par1World.func_96440_m(par2, par3, par4, this.blockID); + } + } + else if (var12 > 0 && var10.getItem() instanceof ItemArmor && ((ItemArmor)var10.getItem()).getArmorMaterial() == EnumArmorMaterial.CLOTH) + { + ItemArmor var14 = (ItemArmor)var10.getItem(); + var14.removeColor(var10); +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var12 - 1, 2); + par1World.func_96440_m(par2, par3, par4, this.blockID); + return true; + } + + return true; +*************** +*** 152,170 **** + { + int var5 = par1World.getBlockMetadata(par2, par3, par4); + + if (var5 < 3) + { +! par1World.setBlockMetadata(par2, par3, par4, var5 + 1, 2); + } + } + } + + /** + * Returns the ID of the items to drop on destruction. + */ + public int idDropped(int par1, Random par2Random, int par3) + { + return Item.cauldron.itemID; + } + + /** +--- 181,207 ---- + { + int var5 = par1World.getBlockMetadata(par2, par3, par4); + + if (var5 < 3) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var5 + 1, 2); + } + } + } + + /** + * Returns the ID of the items to drop on destruction. + */ + public int idDropped(int par1, Random par2Random, int par3) ++ { ++ return Item.cauldron.itemID; ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) + { + return Item.cauldron.itemID; + } + + /** +*** BlockChest.java Sat Feb 5 04:13:11 2022 +--- BlockChest.java Sat Feb 5 04:12:32 2022 +*************** +*** 135,174 **** + var11 = 4; + } + + if (var7 != this.blockID && var8 != this.blockID && var9 != this.blockID && var10 != this.blockID) + { +! par1World.setBlockMetadata(par2, par3, par4, var11, 3); + } + else + { + if ((var7 == this.blockID || var8 == this.blockID) && (var11 == 4 || var11 == 5)) + { + if (var7 == this.blockID) + { +! par1World.setBlockMetadata(par2, par3, par4 - 1, var11, 3); + } + else + { +! par1World.setBlockMetadata(par2, par3, par4 + 1, var11, 3); + } + +! par1World.setBlockMetadata(par2, par3, par4, var11, 3); + } + + if ((var9 == this.blockID || var10 == this.blockID) && (var11 == 2 || var11 == 3)) + { + if (var9 == this.blockID) + { +! par1World.setBlockMetadata(par2 - 1, par3, par4, var11, 3); + } + else + { +! par1World.setBlockMetadata(par2 + 1, par3, par4, var11, 3); + } + +! par1World.setBlockMetadata(par2, par3, par4, var11, 3); + } + } + + if (par6ItemStack.hasDisplayName()) + { +--- 135,174 ---- + var11 = 4; + } + + if (var7 != this.blockID && var8 != this.blockID && var9 != this.blockID && var10 != this.blockID) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var11, 3); + } + else + { + if ((var7 == this.blockID || var8 == this.blockID) && (var11 == 4 || var11 == 5)) + { + if (var7 == this.blockID) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4 - 1, var11, 3); + } + else + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4 + 1, var11, 3); + } + +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var11, 3); + } + + if ((var9 == this.blockID || var10 == this.blockID) && (var11 == 2 || var11 == 3)) + { + if (var9 == this.blockID) + { +! par1World.setBlockMetadataWithNotify(par2 - 1, par3, par4, var11, 3); + } + else + { +! par1World.setBlockMetadataWithNotify(par2 + 1, par3, par4, var11, 3); + } + +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var11, 3); + } + } + + if (par6ItemStack.hasDisplayName()) + { +*************** +*** 282,292 **** + { + var13 = 4; + } + } + +! par1World.setBlockMetadata(par2, par3, par4, var13, 3); + } + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z +--- 282,292 ---- + { + var13 = 4; + } + } + +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var13, 3); + } + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z +*************** +*** 558,564 **** +--- 558,573 ---- + * strength when this block inputs to a comparator. + */ + public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) + { + return Container.calcRedstoneFromInventory(this.getInventory(par1World, par2, par3, par4)); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon("planks_oak"); + } + } +*** BlockClay.java Sat Feb 5 04:13:11 2022 +--- BlockClay.java Sat Feb 5 04:12:32 2022 +*** BlockCocoa.java Sat Feb 5 04:13:11 2022 +--- BlockCocoa.java Sat Feb 5 04:12:32 2022 +*************** +*** 2,18 **** +--- 2,38 ---- + + import java.util.Random; + + public class BlockCocoa extends BlockDirectional + { ++ private Icon[] iconArray; ++ + public BlockCocoa(int par1) + { + super(par1, Material.plants); + this.setTickRandomly(true); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return this.iconArray[2]; ++ } ++ ++ public Icon getCocoaIcon(int par1) ++ { ++ if (par1 < 0 || par1 >= this.iconArray.length) ++ { ++ par1 = this.iconArray.length - 1; ++ } ++ ++ return this.iconArray[par1]; ++ } ++ ++ /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) + { + if (!this.canBlockStay(par1World, par2, par3, par4)) +*************** +*** 26,36 **** + int var7 = func_72219_c(var6); + + if (var7 < 2) + { + ++var7; +! par1World.setBlockMetadata(par2, par3, par4, var7 << 2 | getDirection(var6), 2); + } + } + } + + /** +--- 46,56 ---- + int var7 = func_72219_c(var6); + + if (var7 < 2) + { + ++var7; +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 << 2 | getDirection(var6), 2); + } + } + } + + /** +*************** +*** 79,88 **** +--- 99,117 ---- + this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); + return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); + } + + /** ++ * Returns the bounding box of the wired rectangular prism to render. ++ */ ++ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) ++ { ++ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); ++ return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); ++ } ++ ++ /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) + { + int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); +*************** +*** 115,125 **** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) + { + int var7 = ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 0) % 4; +! par1World.setBlockMetadata(par2, par3, par4, var7, 2); + } + + /** + * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata + */ +--- 144,154 ---- + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) + { + int var7 = ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 0) % 4; +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); + } + + /** + * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata + */ +*************** +*** 169,180 **** +--- 198,231 ---- + this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.dyePowder, 1, 3)); + } + } + + /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return Item.dyePowder.itemID; ++ } ++ ++ /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World par1World, int par2, int par3, int par4) + { + return 3; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.iconArray = new Icon[3]; ++ ++ for (int var2 = 0; var2 < this.iconArray.length; ++var2) ++ { ++ this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_stage_" + var2); ++ } + } + } +*** BlockColored.java Sat Feb 5 04:13:11 2022 +--- BlockColored.java Sat Feb 5 04:12:32 2022 +*************** +*** 1,16 **** +--- 1,28 ---- + package net.minecraft.src; + ++ import java.util.List; ++ + public class BlockColored extends Block + { ++ private Icon[] iconArray; ++ + public BlockColored(int par1, Material par2Material) + { + super(par1, par2Material); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return this.iconArray[par2 % this.iconArray.length]; ++ } ++ ++ /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int par1) + { + return par1; +*************** +*** 28,34 **** +--- 40,71 ---- + * Takes a block damage value and returns the dye damage value to match + */ + public static int getDyeFromBlock(int par0) + { + return ~par0 & 15; ++ } ++ ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) ++ { ++ for (int var4 = 0; var4 < 16; ++var4) ++ { ++ par3List.add(new ItemStack(par1, 1, var4)); ++ } ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.iconArray = new Icon[16]; ++ ++ for (int var2 = 0; var2 < this.iconArray.length; ++var2) ++ { ++ this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + ItemDye.dyeItemNames[getDyeFromBlock(var2)]); ++ } + } + } +*** BlockCommandBlock.java Sat Feb 5 04:13:11 2022 +--- BlockCommandBlock.java Sat Feb 5 04:12:32 2022 +*************** +*** 29,44 **** + int var7 = par1World.getBlockMetadata(par2, par3, par4); + boolean var8 = (var7 & 1) != 0; + + if (var6 && !var8) + { +! par1World.setBlockMetadata(par2, par3, par4, var7 | 1, 4); + par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); + } + else if (!var6 && var8) + { +! par1World.setBlockMetadata(par2, par3, par4, var7 & -2, 4); + } + } + } + + /** +--- 29,44 ---- + int var7 = par1World.getBlockMetadata(par2, par3, par4); + boolean var8 = (var7 & 1) != 0; + + if (var6 && !var8) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 | 1, 4); + par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); + } + else if (!var6 && var8) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 & -2, 4); + } + } + } + + /** +*************** +*** 49,59 **** + TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4); + + if (var6 != null && var6 instanceof TileEntityCommandBlock) + { + TileEntityCommandBlock var7 = (TileEntityCommandBlock)var6; +! var7.setSignalStrength(var7.executeCommandOnPowered(par1World)); + par1World.func_96440_m(par2, par3, par4, this.blockID); + } + } + + /** +--- 49,59 ---- + TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4); + + if (var6 != null && var6 instanceof TileEntityCommandBlock) + { + TileEntityCommandBlock var7 = (TileEntityCommandBlock)var6; +! var7.func_96102_a(var7.executeCommandOnPowered(par1World)); + par1World.func_96440_m(par2, par3, par4, this.blockID); + } + } + + /** +*************** +*** 93,103 **** + * strength when this block inputs to a comparator. + */ + public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) + { + TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4); +! return var6 != null && var6 instanceof TileEntityCommandBlock ? ((TileEntityCommandBlock)var6).getSignalStrength() : 0; + } + + /** + * Called when the block is placed in the world. + */ +--- 93,103 ---- + * strength when this block inputs to a comparator. + */ + public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) + { + TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4); +! return var6 != null && var6 instanceof TileEntityCommandBlock ? ((TileEntityCommandBlock)var6).func_96103_d() : 0; + } + + /** + * Called when the block is placed in the world. + */ +*** BlockComparator.java Sat Feb 5 04:13:11 2022 +--- BlockComparator.java Sat Feb 5 04:12:32 2022 +*************** +*** 16,25 **** +--- 16,33 ---- + public int idDropped(int par1, Random par2Random, int par3) + { + return Item.comparator.itemID; + } + ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return Item.comparator.itemID; ++ } ++ + protected int func_94481_j_(int par1) + { + return 2; + } + +*************** +*** 39,48 **** +--- 47,65 ---- + public int getRenderType() + { + return 37; + } + ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ boolean var3 = this.isRepeaterPowered || (par2 & 8) != 0; ++ return par1 == 0 ? (var3 ? Block.torchRedstoneActive.getBlockTextureFromSide(par1) : Block.torchRedstoneIdle.getBlockTextureFromSide(par1)) : (par1 == 1 ? (var3 ? Block.redstoneComparatorActive.blockIcon : this.blockIcon) : Block.stoneDoubleSlab.getBlockTextureFromSide(1)); ++ } ++ + protected boolean func_96470_c(int par1) + { + return this.isRepeaterPowered || (par1 & 8) != 0; + } + +*************** +*** 130,140 **** + boolean var11 = this.isRepeaterPowered | (var10 & 8) != 0; + boolean var12 = !this.func_94490_c(var10); + int var13 = var12 ? 4 : 0; + var13 |= var11 ? 8 : 0; + par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, var12 ? 0.55F : 0.5F); +! par1World.setBlockMetadata(par2, par3, par4, var13 | var10 & 3, 2); + this.func_96476_c(par1World, par2, par3, par4, par1World.rand); + return true; + } + + protected void func_94479_f(World par1World, int par2, int par3, int par4, int par5) +--- 147,157 ---- + boolean var11 = this.isRepeaterPowered | (var10 & 8) != 0; + boolean var12 = !this.func_94490_c(var10); + int var13 = var12 ? 4 : 0; + var13 |= var11 ? 8 : 0; + par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, var12 ? 0.55F : 0.5F); +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var13 | var10 & 3, 2); + this.func_96476_c(par1World, par2, par3, par4, par1World.rand); + return true; + } + + protected void func_94479_f(World par1World, int par2, int par3, int par4, int par5) +*************** +*** 171,185 **** + boolean var9 = this.isGettingInput(par1World, par2, par3, par4, var6); + boolean var10 = this.isRepeaterPowered || (var6 & 8) != 0; + + if (var10 && !var9) + { +! par1World.setBlockMetadata(par2, par3, par4, var6 & -9, 2); + } + else if (!var10 && var9) + { +! par1World.setBlockMetadata(par2, par3, par4, var6 | 8, 2); + } + + this.func_94483_i_(par1World, par2, par3, par4); + } + } +--- 188,202 ---- + boolean var9 = this.isGettingInput(par1World, par2, par3, par4, var6); + boolean var10 = this.isRepeaterPowered || (var6 & 8) != 0; + + if (var10 && !var9) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -9, 2); + } + else if (!var10 && var9) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 | 8, 2); + } + + this.func_94483_i_(par1World, par2, par3, par4); + } + } +*** BlockContainer.java Sat Feb 5 04:13:11 2022 +--- BlockContainer.java Sat Feb 5 04:12:32 2022 +*** BlockCrops.java Sat Feb 5 04:13:11 2022 +--- BlockCrops.java Sat Feb 5 04:12:32 2022 +*************** +*** 2,11 **** +--- 2,13 ---- + + import java.util.Random; + + public class BlockCrops extends BlockFlower + { ++ private Icon[] iconArray; ++ + protected BlockCrops(int par1) + { + super(par1); + this.setTickRandomly(true); + float var2 = 0.5F; +*************** +*** 41,51 **** + float var7 = this.getGrowthRate(par1World, par2, par3, par4); + + if (par5Random.nextInt((int)(25.0F / var7) + 1) == 0) + { + ++var6; +! par1World.setBlockMetadata(par2, par3, par4, var6, 2); + } + } + } + } + +--- 43,53 ---- + float var7 = this.getGrowthRate(par1World, par2, par3, par4); + + if (par5Random.nextInt((int)(25.0F / var7) + 1) == 0) + { + ++var6; +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 2); + } + } + } + } + +*************** +*** 59,69 **** + if (var5 > 7) + { + var5 = 7; + } + +! par1World.setBlockMetadata(par2, par3, par4, var5, 2); + } + + /** + * Gets the growth rate for the crop. Setup to encourage rows by halving growth rate if there is diagonals, crops on + * different sides that aren't opposing, and by adding growth for every crop next to this one (and for crop below +--- 61,71 ---- + if (var5 > 7) + { + var5 = 7; + } + +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var5, 2); + } + + /** + * Gets the growth rate for the crop. Setup to encourage rows by halving growth rate if there is diagonals, crops on + * different sides that aren't opposing, and by adding growth for every crop next to this one (and for crop below +*************** +*** 117,126 **** +--- 119,141 ---- + + return var5; + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ if (par2 < 0 || par2 > 7) ++ { ++ par2 = 7; ++ } ++ ++ return this.iconArray[par2]; ++ } ++ ++ /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 6; +*************** +*** 178,184 **** +--- 193,221 ---- + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random par1Random) + { + return 1; ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return this.getSeedItem(); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.iconArray = new Icon[8]; ++ ++ for (int var2 = 0; var2 < this.iconArray.length; ++var2) ++ { ++ this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_stage_" + var2); ++ } + } + } +*** BlockDaylightDetector.java Sat Feb 5 04:13:11 2022 +--- BlockDaylightDetector.java Sat Feb 5 04:12:32 2022 +*************** +*** 76,86 **** + var6 = 15; + } + + if (var5 != var6) + { +! par1World.setBlockMetadata(par2, par3, par4, var6, 3); + } + } + } + + /** +--- 76,86 ---- + var6 = 15; + } + + if (var5 != var6) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); + } + } + } + + /** +*************** +*** 112,118 **** +--- 112,136 ---- + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World par1World) + { + return new TileEntityDaylightDetector(); ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return par1 == 1 ? this.iconArray[0] : this.iconArray[1]; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.iconArray[0] = par1IconRegister.registerIcon(this.getTextureName() + "_top"); ++ this.iconArray[1] = par1IconRegister.registerIcon(this.getTextureName() + "_side"); + } + } +*** BlockDeadBush.java Sat Feb 5 04:13:11 2022 +--- BlockDeadBush.java Sat Feb 5 04:12:32 2022 +*** BlockDetectorRail.java Sat Feb 5 04:13:11 2022 +--- BlockDetectorRail.java Sat Feb 5 04:12:32 2022 +*************** +*** 3,12 **** +--- 3,14 ---- + import java.util.List; + import java.util.Random; + + public class BlockDetectorRail extends BlockRailBase + { ++ private Icon[] iconArray; ++ + public BlockDetectorRail(int par1) + { + super(par1, true); + this.setTickRandomly(true); + } +*************** +*** 93,111 **** + var7 = true; + } + + if (var7 && !var6) + { +! par1World.setBlockMetadata(par2, par3, par4, par5 | 8, 3); + par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); + par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); + par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); + } + + if (!var7 && var6) + { +! par1World.setBlockMetadata(par2, par3, par4, par5 & 7, 3); + par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); + par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); + par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); + } + +--- 95,113 ---- + var7 = true; + } + + if (var7 && !var6) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, par5 | 8, 3); + par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); + par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); + par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); + } + + if (!var7 && var6) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, par5 & 7, 3); + par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); + par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); + par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); + } + +*************** +*** 151,157 **** +--- 153,178 ---- + return Container.calcRedstoneFromInventory((IInventory)var7.get(0)); + } + } + + return 0; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.iconArray = new Icon[2]; ++ this.iconArray[0] = par1IconRegister.registerIcon(this.getTextureName()); ++ this.iconArray[1] = par1IconRegister.registerIcon(this.getTextureName() + "_powered"); ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return (par2 & 8) != 0 ? this.iconArray[1] : this.iconArray[0]; + } + } +*** BlockDirectional.java Sat Feb 5 04:13:11 2022 +--- BlockDirectional.java Sat Feb 5 04:12:32 2022 +*** BlockDirt.java Sat Feb 5 04:13:11 2022 +--- BlockDirt.java Sat Feb 5 04:12:32 2022 +*** BlockDispenser.java Sat Feb 5 04:13:11 2022 +--- BlockDispenser.java Sat Feb 5 04:12:32 2022 +*************** +*** 5,14 **** +--- 5,17 ---- + public class BlockDispenser extends BlockContainer + { + /** Registry for all dispense behaviors. */ + public static final IRegistry dispenseBehaviorRegistry = new RegistryDefaulted(new BehaviorDefaultDispenseItem()); + protected Random random = new Random(); ++ protected Icon furnaceTopIcon; ++ protected Icon furnaceFrontIcon; ++ protected Icon field_96473_e; + + protected BlockDispenser(int par1) + { + super(par1, Material.rock); + this.setCreativeTab(CreativeTabs.tabRedstone); +*************** +*** 63,77 **** + if (Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) + { + var9 = 4; + } + +! par1World.setBlockMetadata(par2, par3, par4, var9, 2); + } + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) + { + if (par1World.isRemote) +--- 66,101 ---- + if (Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) + { + var9 = 4; + } + +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var9, 2); + } + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ int var3 = par2 & 7; ++ return par1 == var3 ? (var3 != 1 && var3 != 0 ? this.furnaceFrontIcon : this.field_96473_e) : (var3 != 1 && var3 != 0 ? (par1 != 1 && par1 != 0 ? this.blockIcon : this.furnaceTopIcon) : this.furnaceTopIcon); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon("furnace_side"); ++ this.furnaceTopIcon = par1IconRegister.registerIcon("furnace_top"); ++ this.furnaceFrontIcon = par1IconRegister.registerIcon(this.getTextureName() + "_front_horizontal"); ++ this.field_96473_e = par1IconRegister.registerIcon(this.getTextureName() + "_front_vertical"); ++ } ++ ++ /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) + { + if (par1World.isRemote) +*************** +*** 137,151 **** + boolean var8 = (var7 & 8) != 0; + + if (var6 && !var8) + { + par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); +! par1World.setBlockMetadata(par2, par3, par4, var7 | 8, 4); + } + else if (!var6 && var8) + { +! par1World.setBlockMetadata(par2, par3, par4, var7 & -9, 4); + } + } + + /** + * Ticks the block if it's been scheduled +--- 161,175 ---- + boolean var8 = (var7 & 8) != 0; + + if (var6 && !var8) + { + par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 | 8, 4); + } + else if (!var6 && var8) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 & -9, 4); + } + } + + /** + * Ticks the block if it's been scheduled +*************** +*** 170,180 **** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) + { + int var7 = BlockPistonBase.determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase); +! par1World.setBlockMetadata(par2, par3, par4, var7, 2); + + if (par6ItemStack.hasDisplayName()) + { + ((TileEntityDispenser)par1World.getBlockTileEntity(par2, par3, par4)).setCustomName(par6ItemStack.getDisplayName()); + } +--- 194,204 ---- + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) + { + int var7 = BlockPistonBase.determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase); +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); + + if (par6ItemStack.hasDisplayName()) + { + ((TileEntityDispenser)par1World.getBlockTileEntity(par2, par3, par4)).setCustomName(par6ItemStack.getDisplayName()); + } +*** BlockDoor.java Sat Feb 5 04:13:11 2022 +--- BlockDoor.java Sat Feb 5 04:12:32 2022 +*************** +*** 2,20 **** +--- 2,110 ---- + + import java.util.Random; + + public class BlockDoor extends Block + { ++ private Icon[] field_111044_a; ++ private Icon[] field_111043_b; ++ + protected BlockDoor(int par1, Material par2Material) + { + super(par1, par2Material); + float var3 = 0.5F; + float var4 = 1.0F; + this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var4, 0.5F + var3); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return this.field_111043_b[0]; ++ } ++ ++ /** ++ * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side ++ */ ++ public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) ++ { ++ if (par5 != 1 && par5 != 0) ++ { ++ int var6 = this.getFullMetadata(par1IBlockAccess, par2, par3, par4); ++ int var7 = var6 & 3; ++ boolean var8 = (var6 & 4) != 0; ++ boolean var9 = false; ++ boolean var10 = (var6 & 8) != 0; ++ ++ if (var8) ++ { ++ if (var7 == 0 && par5 == 2) ++ { ++ var9 = !var9; ++ } ++ else if (var7 == 1 && par5 == 5) ++ { ++ var9 = !var9; ++ } ++ else if (var7 == 2 && par5 == 3) ++ { ++ var9 = !var9; ++ } ++ else if (var7 == 3 && par5 == 4) ++ { ++ var9 = !var9; ++ } ++ } ++ else ++ { ++ if (var7 == 0 && par5 == 5) ++ { ++ var9 = !var9; ++ } ++ else if (var7 == 1 && par5 == 3) ++ { ++ var9 = !var9; ++ } ++ else if (var7 == 2 && par5 == 4) ++ { ++ var9 = !var9; ++ } ++ else if (var7 == 3 && par5 == 2) ++ { ++ var9 = !var9; ++ } ++ ++ if ((var6 & 16) != 0) ++ { ++ var9 = !var9; ++ } ++ } ++ ++ return var10 ? this.field_111044_a[var9 ? 1 : 0] : this.field_111043_b[var9 ? 1 : 0]; ++ } ++ else ++ { ++ return this.field_111043_b[0]; ++ } ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.field_111044_a = new Icon[2]; ++ this.field_111043_b = new Icon[2]; ++ this.field_111044_a[0] = par1IconRegister.registerIcon(this.getTextureName() + "_upper"); ++ this.field_111043_b[0] = par1IconRegister.registerIcon(this.getTextureName() + "_lower"); ++ this.field_111044_a[1] = new IconFlipped(this.field_111044_a[0], true, false); ++ this.field_111043_b[1] = new IconFlipped(this.field_111043_b[0], true, false); ++ } ++ ++ /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { +*************** +*** 42,51 **** +--- 132,150 ---- + { + return 7; + } + + /** ++ * Returns the bounding box of the wired rectangular prism to render. ++ */ ++ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) ++ { ++ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); ++ return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); ++ } ++ ++ /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) + { +*************** +*** 176,191 **** + int var11 = var10 & 7; + var11 ^= 4; + + if ((var10 & 8) == 0) + { +! par1World.setBlockMetadata(par2, par3, par4, var11, 2); + par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); + } + else + { +! par1World.setBlockMetadata(par2, par3 - 1, par4, var11, 2); + par1World.markBlockRangeForRenderUpdate(par2, par3 - 1, par4, par2, par3, par4); + } + + par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0); + return true; +--- 275,290 ---- + int var11 = var10 & 7; + var11 ^= 4; + + if ((var10 & 8) == 0) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var11, 2); + par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); + } + else + { +! par1World.setBlockMetadataWithNotify(par2, par3 - 1, par4, var11, 2); + par1World.markBlockRangeForRenderUpdate(par2, par3 - 1, par4, par2, par3, par4); + } + + par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0); + return true; +*************** +*** 205,220 **** + int var8 = var6 & 7; + var8 ^= 4; + + if ((var6 & 8) == 0) + { +! par1World.setBlockMetadata(par2, par3, par4, var8, 2); + par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); + } + else + { +! par1World.setBlockMetadata(par2, par3 - 1, par4, var8, 2); + par1World.markBlockRangeForRenderUpdate(par2, par3 - 1, par4, par2, par3, par4); + } + + par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0); + } +--- 304,319 ---- + int var8 = var6 & 7; + var8 ^= 4; + + if ((var6 & 8) == 0) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var8, 2); + par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); + } + else + { +! par1World.setBlockMetadataWithNotify(par2, par3 - 1, par4, var8, 2); + par1World.markBlockRangeForRenderUpdate(par2, par3 - 1, par4, par2, par3, par4); + } + + par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0); + } +*************** +*** 336,345 **** +--- 435,452 ---- + var8 = par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4); + } + + boolean var9 = (var8 & 1) != 0; + return var7 & 7 | (var6 ? 8 : 0) | (var9 ? 16 : 0); ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return this.blockMaterial == Material.iron ? Item.doorIron.itemID : Item.doorWood.itemID; + } + + /** + * Called when the block is attempted to be harvested + */ +*** BlockDragonEgg.java Sat Feb 5 04:13:11 2022 +--- BlockDragonEgg.java Sat Feb 5 04:12:32 2022 +*************** +*** 150,161 **** +--- 150,178 ---- + { + return false; + } + + /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) ++ { ++ return true; ++ } ++ ++ /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 27; ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return 0; + } + } +*** BlockDropper.java Sat Feb 5 04:13:12 2022 +--- BlockDropper.java Sat Feb 5 04:12:32 2022 +*************** +*** 8,17 **** +--- 8,29 ---- + { + super(par1); + } + + /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon("furnace_side"); ++ this.furnaceTopIcon = par1IconRegister.registerIcon("furnace_top"); ++ this.furnaceFrontIcon = par1IconRegister.registerIcon(this.getTextureName() + "_front_horizontal"); ++ this.field_96473_e = par1IconRegister.registerIcon(this.getTextureName() + "_front_vertical"); ++ } ++ ++ /** + * Returns the behavior for the given ItemStack. + */ + protected IBehaviorDispenseItem getBehaviorForItemStack(ItemStack par1ItemStack) + { + return this.dropperDefaultBehaviour; +*** BlockEnchantmentTable.java Sat Feb 5 04:13:12 2022 +--- BlockEnchantmentTable.java Sat Feb 5 04:12:32 2022 +*************** +*** 1,9 **** +--- 1,14 ---- + package net.minecraft.src; + ++ import java.util.Random; ++ + public class BlockEnchantmentTable extends BlockContainer + { ++ private Icon field_94461_a; ++ private Icon field_94460_b; ++ + protected BlockEnchantmentTable(int par1) + { + super(par1, Material.rock); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F); + this.setLightOpacity(0); +*************** +*** 17,35 **** +--- 22,83 ---- + { + return false; + } + + /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) ++ { ++ super.randomDisplayTick(par1World, par2, par3, par4, par5Random); ++ ++ for (int var6 = par2 - 2; var6 <= par2 + 2; ++var6) ++ { ++ for (int var7 = par4 - 2; var7 <= par4 + 2; ++var7) ++ { ++ if (var6 > par2 - 2 && var6 < par2 + 2 && var7 == par4 - 1) ++ { ++ var7 = par4 + 2; ++ } ++ ++ if (par5Random.nextInt(16) == 0) ++ { ++ for (int var8 = par3; var8 <= par3 + 1; ++var8) ++ { ++ if (par1World.getBlockId(var6, var8, var7) == Block.bookShelf.blockID) ++ { ++ if (!par1World.isAirBlock((var6 - par2) / 2 + par2, var8, (var7 - par4) / 2 + par4)) ++ { ++ break; ++ } ++ ++ par1World.spawnParticle("enchantmenttable", (double)par2 + 0.5D, (double)par3 + 2.0D, (double)par4 + 0.5D, (double)((float)(var6 - par2) + par5Random.nextFloat()) - 0.5D, (double)((float)(var8 - par3) - par5Random.nextFloat() - 1.0F), (double)((float)(var7 - par4) + par5Random.nextFloat()) - 0.5D); ++ } ++ } ++ } ++ } ++ } ++ } ++ ++ /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return par1 == 0 ? this.field_94460_b : (par1 == 1 ? this.field_94461_a : this.blockIcon); ++ } ++ ++ /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World par1World) + { + return new TileEntityEnchantmentTable(); +*************** +*** 61,67 **** +--- 109,126 ---- + + if (par6ItemStack.hasDisplayName()) + { + ((TileEntityEnchantmentTable)par1World.getBlockTileEntity(par2, par3, par4)).func_94134_a(par6ItemStack.getDisplayName()); + } ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_" + "side"); ++ this.field_94461_a = par1IconRegister.registerIcon(this.getTextureName() + "_" + "top"); ++ this.field_94460_b = par1IconRegister.registerIcon(this.getTextureName() + "_" + "bottom"); + } + } +*** BlockEnderChest.java Sat Feb 5 04:13:12 2022 +--- BlockEnderChest.java Sat Feb 5 04:12:32 2022 +*************** +*** 86,96 **** + if (var8 == 3) + { + var7 = 4; + } + +! par1World.setBlockMetadata(par2, par3, par4, var7, 2); + } + + /** + * Called upon block activation (right click on the block.) + */ +--- 86,96 ---- + if (var8 == 3) + { + var7 = 4; + } + +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); + } + + /** + * Called upon block activation (right click on the block.) + */ +*************** +*** 126,132 **** +--- 126,167 ---- + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World par1World) + { + return new TileEntityEnderChest(); ++ } ++ ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) ++ { ++ for (int var6 = 0; var6 < 3; ++var6) ++ { ++ double var10000 = (double)((float)par2 + par5Random.nextFloat()); ++ double var9 = (double)((float)par3 + par5Random.nextFloat()); ++ var10000 = (double)((float)par4 + par5Random.nextFloat()); ++ double var13 = 0.0D; ++ double var15 = 0.0D; ++ double var17 = 0.0D; ++ int var19 = par5Random.nextInt(2) * 2 - 1; ++ int var20 = par5Random.nextInt(2) * 2 - 1; ++ var13 = ((double)par5Random.nextFloat() - 0.5D) * 0.125D; ++ var15 = ((double)par5Random.nextFloat() - 0.5D) * 0.125D; ++ var17 = ((double)par5Random.nextFloat() - 0.5D) * 0.125D; ++ double var11 = (double)par4 + 0.5D + 0.25D * (double)var20; ++ var17 = (double)(par5Random.nextFloat() * 1.0F * (float)var20); ++ double var7 = (double)par2 + 0.5D + 0.25D * (double)var19; ++ var13 = (double)(par5Random.nextFloat() * 1.0F * (float)var19); ++ par1World.spawnParticle("portal", var7, var9, var11, var13, var15, var17); ++ } ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon("obsidian"); + } + } +*** BlockEndPortal.java Sat Feb 5 04:13:12 2022 +--- BlockEndPortal.java Sat Feb 5 04:12:32 2022 +*************** +*** 32,41 **** +--- 32,50 ---- + float var5 = 0.0625F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, var5, 1.0F); + } + + /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) ++ { ++ return par5 != 0 ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); ++ } ++ ++ /** + * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the + * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity + */ + public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) {} + +*************** +*** 74,83 **** +--- 83,106 ---- + par5Entity.travelToDimension(1); + } + } + + /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) ++ { ++ double var6 = (double)((float)par2 + par5Random.nextFloat()); ++ double var8 = (double)((float)par3 + 0.8F); ++ double var10 = (double)((float)par4 + par5Random.nextFloat()); ++ double var12 = 0.0D; ++ double var14 = 0.0D; ++ double var16 = 0.0D; ++ par1World.spawnParticle("smoke", var6, var8, var10, var12, var14, var16); ++ } ++ ++ /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return -1; +*************** +*** 93,99 **** +--- 116,139 ---- + if (par1World.provider.dimensionId != 0) + { + par1World.setBlockToAir(par2, par3, par4); + } + } ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return 0; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon("portal"); + } + } +*** BlockEndPortalFrame.java Sat Feb 5 04:13:12 2022 +--- BlockEndPortalFrame.java Sat Feb 5 04:12:32 2022 +*************** +*** 3,18 **** +--- 3,45 ---- + import java.util.List; + import java.util.Random; + + public class BlockEndPortalFrame extends Block + { ++ private Icon field_94400_a; ++ private Icon field_94399_b; ++ + public BlockEndPortalFrame(int par1) + { + super(par1, Material.rock); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return par1 == 1 ? this.field_94400_a : (par1 == 0 ? Block.whiteStone.getBlockTextureFromSide(par1) : this.blockIcon); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); ++ this.field_94400_a = par1IconRegister.registerIcon(this.getTextureName() + "_top"); ++ this.field_94399_b = par1IconRegister.registerIcon(this.getTextureName() + "_eye"); ++ } ++ ++ public Icon func_94398_p() ++ { ++ return this.field_94399_b; ++ } ++ ++ /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { +*************** +*** 74,84 **** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) + { + int var7 = ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4; +! par1World.setBlockMetadata(par2, par3, par4, var7, 2); + } + + /** + * If this returns true, then comparators facing away from this block will use the value from + * getComparatorInputOverride instead of the actual redstone signal strength. +--- 101,111 ---- + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) + { + int var7 = ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4; +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); + } + + /** + * If this returns true, then comparators facing away from this block will use the value from + * getComparatorInputOverride instead of the actual redstone signal strength. +*** BlockEventData.java Sat Feb 5 04:13:12 2022 +--- BlockEventData.java Sat Feb 5 04:12:32 2022 +*** BlockFarmland.java Sat Feb 5 04:13:12 2022 +--- BlockFarmland.java Sat Feb 5 04:12:32 2022 +*************** +*** 2,11 **** +--- 2,14 ---- + + import java.util.Random; + + public class BlockFarmland extends Block + { ++ private Icon field_94441_a; ++ private Icon field_94440_b; ++ + protected BlockFarmland(int par1) + { + super(par1, Material.ground); + this.setTickRandomly(true); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.9375F, 1.0F); +*************** +*** 37,66 **** + { + return false; + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) + { + if (!this.isWaterNearby(par1World, par2, par3, par4) && !par1World.canLightningStrikeAt(par2, par3 + 1, par4)) + { + int var6 = par1World.getBlockMetadata(par2, par3, par4); + + if (var6 > 0) + { +! par1World.setBlockMetadata(par2, par3, par4, var6 - 1, 2); + } + else if (!this.isCropsNearby(par1World, par2, par3, par4)) + { + par1World.setBlock(par2, par3, par4, Block.dirt.blockID); + } + } + else + { +! par1World.setBlockMetadata(par2, par3, par4, 7, 2); + } + } + + /** + * Block's chance to react to an entity falling on it. +--- 40,77 ---- + { + return false; + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return par1 == 1 ? (par2 > 0 ? this.field_94441_a : this.field_94440_b) : Block.dirt.getBlockTextureFromSide(par1); ++ } ++ ++ /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) + { + if (!this.isWaterNearby(par1World, par2, par3, par4) && !par1World.canLightningStrikeAt(par2, par3 + 1, par4)) + { + int var6 = par1World.getBlockMetadata(par2, par3, par4); + + if (var6 > 0) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 - 1, 2); + } + else if (!this.isCropsNearby(par1World, par2, par3, par4)) + { + par1World.setBlock(par2, par3, par4, Block.dirt.blockID); + } + } + else + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 7, 2); + } + } + + /** + * Block's chance to react to an entity falling on it. +*************** +*** 142,148 **** +--- 153,177 ---- + * Returns the ID of the items to drop on destruction. + */ + public int idDropped(int par1, Random par2Random, int par3) + { + return Block.dirt.idDropped(0, par2Random, par3); ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return Block.dirt.blockID; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.field_94441_a = par1IconRegister.registerIcon(this.getTextureName() + "_wet"); ++ this.field_94440_b = par1IconRegister.registerIcon(this.getTextureName() + "_dry"); + } + } +*** BlockFence.java Sat Feb 5 04:13:12 2022 +--- BlockFence.java Sat Feb 5 04:12:32 2022 +*************** +*** 165,174 **** +--- 165,192 ---- + { + return par0 == Block.fence.blockID || par0 == Block.netherFence.blockID; + } + + /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) ++ { ++ return true; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon(this.field_94464_a); ++ } ++ ++ /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) + { + return par1World.isRemote ? true : ItemLeash.func_135066_a(par5EntityPlayer, par1World, par2, par3, par4); +*** BlockFenceGate.java Sat Feb 5 04:13:12 2022 +--- BlockFenceGate.java Sat Feb 5 04:12:32 2022 +*************** +*** 7,16 **** +--- 7,24 ---- + super(par1, Material.wood); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return Block.planks.getBlockTextureFromSide(par1); ++ } ++ ++ /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) + { + return !par1World.getBlockMaterial(par2, par3 - 1, par4).isSolid() ? false : super.canPlaceBlockAt(par1World, par2, par3, par4); +*************** +*** 77,87 **** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) + { + int var7 = (MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) % 4; +! par1World.setBlockMetadata(par2, par3, par4, var7, 2); + } + + /** + * Called upon block activation (right click on the block.) + */ +--- 85,95 ---- + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) + { + int var7 = (MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) % 4; +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); + } + + /** + * Called upon block activation (right click on the block.) + */ +*************** +*** 89,99 **** + { + int var10 = par1World.getBlockMetadata(par2, par3, par4); + + if (isFenceGateOpen(var10)) + { +! par1World.setBlockMetadata(par2, par3, par4, var10 & -5, 2); + } + else + { + int var11 = (MathHelper.floor_double((double)(par5EntityPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) % 4; + int var12 = getDirection(var10); +--- 97,107 ---- + { + int var10 = par1World.getBlockMetadata(par2, par3, par4); + + if (isFenceGateOpen(var10)) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var10 & -5, 2); + } + else + { + int var11 = (MathHelper.floor_double((double)(par5EntityPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) % 4; + int var12 = getDirection(var10); +*************** +*** 101,111 **** + if (var12 == (var11 + 2) % 4) + { + var10 = var11; + } + +! par1World.setBlockMetadata(par2, par3, par4, var10 | 4, 2); + } + + par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0); + return true; + } +--- 109,119 ---- + if (var12 == (var11 + 2) % 4) + { + var10 = var11; + } + +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var10 | 4, 2); + } + + par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0); + return true; + } +*************** +*** 123,138 **** + + if (var7 || par5 > 0 && Block.blocksList[par5].canProvidePower()) + { + if (var7 && !isFenceGateOpen(var6)) + { +! par1World.setBlockMetadata(par2, par3, par4, var6 | 4, 2); + par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0); + } + else if (!var7 && isFenceGateOpen(var6)) + { +! par1World.setBlockMetadata(par2, par3, par4, var6 & -5, 2); + par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0); + } + } + } + } +--- 131,146 ---- + + if (var7 || par5 > 0 && Block.blocksList[par5].canProvidePower()) + { + if (var7 && !isFenceGateOpen(var6)) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 | 4, 2); + par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0); + } + else if (!var7 && isFenceGateOpen(var6)) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -5, 2); + par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0); + } + } + } + } +*************** +*** 142,147 **** +--- 150,170 ---- + */ + public static boolean isFenceGateOpen(int par0) + { + return (par0 & 4) != 0; + } ++ ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) ++ { ++ return true; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) {} + } +*** BlockFire.java Sat Feb 5 04:13:12 2022 +--- BlockFire.java Sat Feb 5 04:12:32 2022 +*************** +*** 10,19 **** +--- 10,20 ---- + /** + * This is an array indexed by block ID the larger the number in the array the more likely a block type will catch + * fires + */ + private int[] abilityToCatchFire = new int[256]; ++ private Icon[] iconArray; + + protected BlockFire(int par1) + { + super(par1, Material.fire); + this.setTickRandomly(true); +*************** +*** 132,142 **** + { + int var7 = par1World.getBlockMetadata(par2, par3, par4); + + if (var7 < 15) + { +! par1World.setBlockMetadata(par2, par3, par4, var7 + par5Random.nextInt(3) / 2, 4); + } + + par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World) + par5Random.nextInt(10)); + + if (!var6 && !this.canNeighborBurn(par1World, par2, par3, par4)) +--- 133,143 ---- + { + int var7 = par1World.getBlockMetadata(par2, par3, par4); + + if (var7 < 15) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 + par5Random.nextInt(3) / 2, 4); + } + + par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World) + par5Random.nextInt(10)); + + if (!var6 && !this.canNeighborBurn(par1World, par2, par3, par4)) +*************** +*** 342,348 **** +--- 343,455 ---- + else + { + par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World) + par1World.rand.nextInt(10)); + } + } ++ } ++ ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) ++ { ++ if (par5Random.nextInt(24) == 0) ++ { ++ par1World.playSound((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), "fire.fire", 1.0F + par5Random.nextFloat(), par5Random.nextFloat() * 0.7F + 0.3F, false); ++ } ++ ++ int var6; ++ float var7; ++ float var8; ++ float var9; ++ ++ if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(par1World, par2, par3 - 1, par4)) ++ { ++ if (Block.fire.canBlockCatchFire(par1World, par2 - 1, par3, par4)) ++ { ++ for (var6 = 0; var6 < 2; ++var6) ++ { ++ var7 = (float)par2 + par5Random.nextFloat() * 0.1F; ++ var8 = (float)par3 + par5Random.nextFloat(); ++ var9 = (float)par4 + par5Random.nextFloat(); ++ par1World.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); ++ } ++ } ++ ++ if (Block.fire.canBlockCatchFire(par1World, par2 + 1, par3, par4)) ++ { ++ for (var6 = 0; var6 < 2; ++var6) ++ { ++ var7 = (float)(par2 + 1) - par5Random.nextFloat() * 0.1F; ++ var8 = (float)par3 + par5Random.nextFloat(); ++ var9 = (float)par4 + par5Random.nextFloat(); ++ par1World.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); ++ } ++ } ++ ++ if (Block.fire.canBlockCatchFire(par1World, par2, par3, par4 - 1)) ++ { ++ for (var6 = 0; var6 < 2; ++var6) ++ { ++ var7 = (float)par2 + par5Random.nextFloat(); ++ var8 = (float)par3 + par5Random.nextFloat(); ++ var9 = (float)par4 + par5Random.nextFloat() * 0.1F; ++ par1World.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); ++ } ++ } ++ ++ if (Block.fire.canBlockCatchFire(par1World, par2, par3, par4 + 1)) ++ { ++ for (var6 = 0; var6 < 2; ++var6) ++ { ++ var7 = (float)par2 + par5Random.nextFloat(); ++ var8 = (float)par3 + par5Random.nextFloat(); ++ var9 = (float)(par4 + 1) - par5Random.nextFloat() * 0.1F; ++ par1World.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); ++ } ++ } ++ ++ if (Block.fire.canBlockCatchFire(par1World, par2, par3 + 1, par4)) ++ { ++ for (var6 = 0; var6 < 2; ++var6) ++ { ++ var7 = (float)par2 + par5Random.nextFloat(); ++ var8 = (float)(par3 + 1) - par5Random.nextFloat() * 0.1F; ++ var9 = (float)par4 + par5Random.nextFloat(); ++ par1World.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); ++ } ++ } ++ } ++ else ++ { ++ for (var6 = 0; var6 < 3; ++var6) ++ { ++ var7 = (float)par2 + par5Random.nextFloat(); ++ var8 = (float)par3 + par5Random.nextFloat() * 0.5F + 0.5F; ++ var9 = (float)par4 + par5Random.nextFloat(); ++ par1World.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); ++ } ++ } ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.iconArray = new Icon[] {par1IconRegister.registerIcon(this.getTextureName() + "_layer_0"), par1IconRegister.registerIcon(this.getTextureName() + "_layer_1")}; ++ } ++ ++ public Icon getFireIcon(int par1) ++ { ++ return this.iconArray[par1]; ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return this.iconArray[0]; + } + } +*** BlockFlower.java Sat Feb 5 04:13:12 2022 +--- BlockFlower.java Sat Feb 5 04:12:32 2022 +*** BlockFlowerPot.java Sat Feb 5 04:13:12 2022 +--- BlockFlowerPot.java Sat Feb 5 04:12:32 2022 +*************** +*** 64,74 **** + { + int var11 = getMetaForPlant(var10); + + if (var11 > 0) + { +! par1World.setBlockMetadata(par2, par3, par4, var11, 2); + + if (!par5EntityPlayer.capabilities.isCreativeMode && --var10.stackSize <= 0) + { + par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, (ItemStack)null); + } +--- 64,74 ---- + { + int var11 = getMetaForPlant(var10); + + if (var11 > 0) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var11, 2); + + if (!par5EntityPlayer.capabilities.isCreativeMode && --var10.stackSize <= 0) + { + par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, (ItemStack)null); + } +*************** +*** 81,96 **** +--- 81,113 ---- + } + } + } + + /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ ItemStack var5 = getPlantForMeta(par1World.getBlockMetadata(par2, par3, par4)); ++ return var5 == null ? Item.flowerPot.itemID : var5.itemID; ++ } ++ ++ /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World par1World, int par2, int par3, int par4) + { + ItemStack var5 = getPlantForMeta(par1World.getBlockMetadata(par2, par3, par4)); + return var5 == null ? Item.flowerPot.itemID : var5.getItemDamage(); ++ } ++ ++ /** ++ * Returns true only if block is flowerPot ++ */ ++ public boolean isFlowerPot() ++ { ++ return true; + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ +*** BlockFlowing.java Sat Feb 5 04:13:12 2022 +--- BlockFlowing.java Sat Feb 5 04:12:32 2022 +*************** +*** 119,129 **** + { + par1World.setBlockToAir(par2, par3, par4); + } + else + { +! par1World.setBlockMetadata(par2, par3, par4, var11, 2); + par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, var9); + par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); + } + } + } +--- 119,129 ---- + { + par1World.setBlockToAir(par2, par3, par4); + } + else + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var11, 2); + par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, var9); + par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); + } + } + } +*** BlockFluid.java Sat Feb 5 04:13:12 2022 +--- BlockFluid.java Sat Feb 5 04:12:32 2022 +*************** +*** 2,11 **** +--- 2,13 ---- + + import java.util.Random; + + public abstract class BlockFluid extends Block + { ++ private Icon[] theIcon; ++ + protected BlockFluid(int par1, Material par2Material) + { + super(par1, par2Material); + float var3 = 0.0F; + float var4 = 0.0F; +*************** +*** 16,25 **** +--- 18,63 ---- + public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) + { + return this.blockMaterial != Material.lava; + } + ++ public int getBlockColor() ++ { ++ return 16777215; ++ } ++ ++ /** ++ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called ++ * when first determining what to render. ++ */ ++ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) ++ { ++ if (this.blockMaterial != Material.water) ++ { ++ return 16777215; ++ } ++ else ++ { ++ int var5 = 0; ++ int var6 = 0; ++ int var7 = 0; ++ ++ for (int var8 = -1; var8 <= 1; ++var8) ++ { ++ for (int var9 = -1; var9 <= 1; ++var9) ++ { ++ int var10 = par1IBlockAccess.getBiomeGenForCoords(par2 + var9, par4 + var8).waterColorMultiplier; ++ var5 += (var10 & 16711680) >> 16; ++ var6 += (var10 & 65280) >> 8; ++ var7 += var10 & 255; ++ } ++ } ++ ++ return (var5 / 9 & 255) << 16 | (var6 / 9 & 255) << 8 | var7 / 9 & 255; ++ } ++ } ++ + /** + * Returns the percentage of the fluid block that is air, based on the given flow decay of the fluid. + */ + public static float getFluidHeightPercent(int par0) + { +*************** +*** 30,39 **** +--- 68,85 ---- + + return (float)(par0 + 1) / 9.0F; + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return par1 != 0 && par1 != 1 ? this.theIcon[1] : this.theIcon[0]; ++ } ++ ++ /** + * Returns the amount of fluid decay at the coordinates, or -1 if the block at the coordinates is not the same + * material as the fluid. + */ + protected int getFlowDecay(World par1World, int par2, int par3, int par4) + { +*************** +*** 79,89 **** + { + return false; + } + + /** +! * Returns whether this block is collideable based on the arguments passed in Args: blockMetaData, unknownFlag + */ + public boolean canCollideCheck(int par1, boolean par2) + { + return par2 && par1 == 0; + } +--- 125,136 ---- + { + return false; + } + + /** +! * Returns whether this block is collideable based on the arguments passed in \n@param par1 block metaData \n@param +! * par2 whether the player right-clicked while holding a boat + */ + public boolean canCollideCheck(int par1, boolean par2) + { + return par2 && par1 == 0; + } +*************** +*** 97,106 **** +--- 144,163 ---- + Material var6 = par1IBlockAccess.getBlockMaterial(par2, par3, par4); + return var6 == this.blockMaterial ? false : (par5 == 1 ? true : (var6 == Material.ice ? false : super.isBlockSolid(par1IBlockAccess, par2, par3, par4, par5))); + } + + /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) ++ { ++ Material var6 = par1IBlockAccess.getBlockMaterial(par2, par3, par4); ++ return var6 == this.blockMaterial ? false : (par5 == 1 ? true : (var6 == Material.ice ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5))); ++ } ++ ++ /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) + { +*************** +*** 259,268 **** +--- 316,525 ---- + { + return this.blockMaterial == Material.water ? 5 : (this.blockMaterial == Material.lava ? (par1World.provider.hasNoSky ? 10 : 30) : 0); + } + + /** ++ * Goes straight to getLightBrightnessForSkyBlocks for Blocks, does some fancy computing for Fluids ++ */ ++ public int getMixedBrightnessForBlock(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) ++ { ++ int var5 = par1IBlockAccess.getLightBrightnessForSkyBlocks(par2, par3, par4, 0); ++ int var6 = par1IBlockAccess.getLightBrightnessForSkyBlocks(par2, par3 + 1, par4, 0); ++ int var7 = var5 & 255; ++ int var8 = var6 & 255; ++ int var9 = var5 >> 16 & 255; ++ int var10 = var6 >> 16 & 255; ++ return (var7 > var8 ? var7 : var8) | (var9 > var10 ? var9 : var10) << 16; ++ } ++ ++ /** ++ * How bright to render this block based on the light its receiving. Args: iBlockAccess, x, y, z ++ */ ++ public float getBlockBrightness(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) ++ { ++ float var5 = par1IBlockAccess.getLightBrightness(par2, par3, par4); ++ float var6 = par1IBlockAccess.getLightBrightness(par2, par3 + 1, par4); ++ return var5 > var6 ? var5 : var6; ++ } ++ ++ /** ++ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha ++ */ ++ public int getRenderBlockPass() ++ { ++ return this.blockMaterial == Material.water ? 1 : 0; ++ } ++ ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) ++ { ++ int var6; ++ ++ if (this.blockMaterial == Material.water) ++ { ++ if (par5Random.nextInt(10) == 0) ++ { ++ var6 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if (var6 <= 0 || var6 >= 8) ++ { ++ par1World.spawnParticle("suspended", (double)((float)par2 + par5Random.nextFloat()), (double)((float)par3 + par5Random.nextFloat()), (double)((float)par4 + par5Random.nextFloat()), 0.0D, 0.0D, 0.0D); ++ } ++ } ++ ++ for (var6 = 0; var6 < 0; ++var6) ++ { ++ int var7 = par5Random.nextInt(4); ++ int var8 = par2; ++ int var9 = par4; ++ ++ if (var7 == 0) ++ { ++ var8 = par2 - 1; ++ } ++ ++ if (var7 == 1) ++ { ++ ++var8; ++ } ++ ++ if (var7 == 2) ++ { ++ var9 = par4 - 1; ++ } ++ ++ if (var7 == 3) ++ { ++ ++var9; ++ } ++ ++ if (par1World.getBlockMaterial(var8, par3, var9) == Material.air && (par1World.getBlockMaterial(var8, par3 - 1, var9).blocksMovement() || par1World.getBlockMaterial(var8, par3 - 1, var9).isLiquid())) ++ { ++ float var10 = 0.0625F; ++ double var11 = (double)((float)par2 + par5Random.nextFloat()); ++ double var13 = (double)((float)par3 + par5Random.nextFloat()); ++ double var15 = (double)((float)par4 + par5Random.nextFloat()); ++ ++ if (var7 == 0) ++ { ++ var11 = (double)((float)par2 - var10); ++ } ++ ++ if (var7 == 1) ++ { ++ var11 = (double)((float)(par2 + 1) + var10); ++ } ++ ++ if (var7 == 2) ++ { ++ var15 = (double)((float)par4 - var10); ++ } ++ ++ if (var7 == 3) ++ { ++ var15 = (double)((float)(par4 + 1) + var10); ++ } ++ ++ double var17 = 0.0D; ++ double var19 = 0.0D; ++ ++ if (var7 == 0) ++ { ++ var17 = (double)(-var10); ++ } ++ ++ if (var7 == 1) ++ { ++ var17 = (double)var10; ++ } ++ ++ if (var7 == 2) ++ { ++ var19 = (double)(-var10); ++ } ++ ++ if (var7 == 3) ++ { ++ var19 = (double)var10; ++ } ++ ++ par1World.spawnParticle("splash", var11, var13, var15, var17, 0.0D, var19); ++ } ++ } ++ } ++ ++ if (this.blockMaterial == Material.water && par5Random.nextInt(64) == 0) ++ { ++ var6 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if (var6 > 0 && var6 < 8) ++ { ++ par1World.playSound((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), "liquid.water", par5Random.nextFloat() * 0.25F + 0.75F, par5Random.nextFloat() * 1.0F + 0.5F, false); ++ } ++ } ++ ++ double var21; ++ double var22; ++ double var23; ++ ++ if (this.blockMaterial == Material.lava && par1World.getBlockMaterial(par2, par3 + 1, par4) == Material.air && !par1World.isBlockOpaqueCube(par2, par3 + 1, par4)) ++ { ++ if (par5Random.nextInt(100) == 0) ++ { ++ var21 = (double)((float)par2 + par5Random.nextFloat()); ++ var22 = (double)par3 + this.maxY; ++ var23 = (double)((float)par4 + par5Random.nextFloat()); ++ par1World.spawnParticle("lava", var21, var22, var23, 0.0D, 0.0D, 0.0D); ++ par1World.playSound(var21, var22, var23, "liquid.lavapop", 0.2F + par5Random.nextFloat() * 0.2F, 0.9F + par5Random.nextFloat() * 0.15F, false); ++ } ++ ++ if (par5Random.nextInt(200) == 0) ++ { ++ par1World.playSound((double)par2, (double)par3, (double)par4, "liquid.lava", 0.2F + par5Random.nextFloat() * 0.2F, 0.9F + par5Random.nextFloat() * 0.15F, false); ++ } ++ } ++ ++ if (par5Random.nextInt(10) == 0 && par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !par1World.getBlockMaterial(par2, par3 - 2, par4).blocksMovement()) ++ { ++ var21 = (double)((float)par2 + par5Random.nextFloat()); ++ var22 = (double)par3 - 1.05D; ++ var23 = (double)((float)par4 + par5Random.nextFloat()); ++ ++ if (this.blockMaterial == Material.water) ++ { ++ par1World.spawnParticle("dripWater", var21, var22, var23, 0.0D, 0.0D, 0.0D); ++ } ++ else ++ { ++ par1World.spawnParticle("dripLava", var21, var22, var23, 0.0D, 0.0D, 0.0D); ++ } ++ } ++ } ++ ++ /** ++ * the sin and cos of this number determine the surface gradient of the flowing block. ++ */ ++ public static double getFlowDirection(IBlockAccess par0IBlockAccess, int par1, int par2, int par3, Material par4Material) ++ { ++ Vec3 var5 = null; ++ ++ if (par4Material == Material.water) ++ { ++ var5 = Block.waterMoving.getFlowVector(par0IBlockAccess, par1, par2, par3); ++ } ++ ++ if (par4Material == Material.lava) ++ { ++ var5 = Block.lavaMoving.getFlowVector(par0IBlockAccess, par1, par2, par3); ++ } ++ ++ return var5.xCoord == 0.0D && var5.zCoord == 0.0D ? -1000.0D : Math.atan2(var5.zCoord, var5.xCoord) - (Math.PI / 2D); ++ } ++ ++ /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World par1World, int par2, int par3, int par4) + { + this.checkForHarden(par1World, par2, par3, par4); +*************** +*** 341,347 **** +--- 598,625 ---- + + for (int var5 = 0; var5 < 8; ++var5) + { + par1World.spawnParticle("largesmoke", (double)par2 + Math.random(), (double)par3 + 1.2D, (double)par4 + Math.random(), 0.0D, 0.0D, 0.0D); + } ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ if (this.blockMaterial == Material.lava) ++ { ++ this.theIcon = new Icon[] {par1IconRegister.registerIcon("lava_still"), par1IconRegister.registerIcon("lava_flow")}; ++ } ++ else ++ { ++ this.theIcon = new Icon[] {par1IconRegister.registerIcon("water_still"), par1IconRegister.registerIcon("water_flow")}; ++ } ++ } ++ ++ public static Icon getFluidIcon(String par0Str) ++ { ++ return par0Str == "water_still" ? Block.waterMoving.theIcon[0] : (par0Str == "water_flow" ? Block.waterMoving.theIcon[1] : (par0Str == "lava_still" ? Block.lavaMoving.theIcon[0] : (par0Str == "lava_flow" ? Block.lavaMoving.theIcon[1] : null))); + } + } +*** BlockFurnace.java Sat Feb 5 04:13:12 2022 +--- BlockFurnace.java Sat Feb 5 04:12:32 2022 +*************** +*** 15,24 **** +--- 15,26 ---- + /** + * This flag is used to prevent the furnace inventory to be dropped upon block removal, is used internally when the + * furnace block changes from idle to active and vice-versa. + */ + private static boolean keepFurnaceInventory; ++ private Icon furnaceIconTop; ++ private Icon furnaceIconFront; + + protected BlockFurnace(int par1, boolean par2) + { + super(par1, Material.rock); + this.isActive = par2; +*************** +*** 72,82 **** + if (Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) + { + var9 = 4; + } + +! par1World.setBlockMetadata(par2, par3, par4, var9, 2); + } + } + + /** + * Called upon block activation (right click on the block.) +--- 74,140 ---- + if (Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) + { + var9 = 4; + } + +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var9, 2); +! } +! } +! +! /** +! * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata +! */ +! public Icon getIcon(int par1, int par2) +! { +! return par1 == 1 ? this.furnaceIconTop : (par1 == 0 ? this.furnaceIconTop : (par1 != par2 ? this.blockIcon : this.furnaceIconFront)); +! } +! +! /** +! * When this method is called, your block should register all the icons it needs with the given IconRegister. This +! * is the only chance you get to register icons. +! */ +! public void registerIcons(IconRegister par1IconRegister) +! { +! this.blockIcon = par1IconRegister.registerIcon("furnace_side"); +! this.furnaceIconFront = par1IconRegister.registerIcon(this.isActive ? "furnace_front_on" : "furnace_front_off"); +! this.furnaceIconTop = par1IconRegister.registerIcon("furnace_top"); +! } +! +! /** +! * A randomly called display update to be able to add particles or other items for display +! */ +! public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) +! { +! if (this.isActive) +! { +! int var6 = par1World.getBlockMetadata(par2, par3, par4); +! float var7 = (float)par2 + 0.5F; +! float var8 = (float)par3 + 0.0F + par5Random.nextFloat() * 6.0F / 16.0F; +! float var9 = (float)par4 + 0.5F; +! float var10 = 0.52F; +! float var11 = par5Random.nextFloat() * 0.6F - 0.3F; +! +! if (var6 == 4) +! { +! par1World.spawnParticle("smoke", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); +! par1World.spawnParticle("flame", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); +! } +! else if (var6 == 5) +! { +! par1World.spawnParticle("smoke", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); +! par1World.spawnParticle("flame", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); +! } +! else if (var6 == 2) +! { +! par1World.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D); +! par1World.spawnParticle("flame", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D); +! } +! else if (var6 == 3) +! { +! par1World.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D); +! par1World.spawnParticle("flame", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D); +! } + } + } + + /** + * Called upon block activation (right click on the block.) +*************** +*** 117,127 **** + { + par1World.setBlock(par2, par3, par4, Block.furnaceIdle.blockID); + } + + keepFurnaceInventory = false; +! par1World.setBlockMetadata(par2, par3, par4, var5, 2); + + if (var6 != null) + { + var6.validate(); + par1World.setBlockTileEntity(par2, par3, par4, var6); +--- 175,185 ---- + { + par1World.setBlock(par2, par3, par4, Block.furnaceIdle.blockID); + } + + keepFurnaceInventory = false; +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var5, 2); + + if (var6 != null) + { + var6.validate(); + par1World.setBlockTileEntity(par2, par3, par4, var6); +*************** +*** 143,168 **** + { + int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + + if (var7 == 0) + { +! par1World.setBlockMetadata(par2, par3, par4, 2, 2); + } + + if (var7 == 1) + { +! par1World.setBlockMetadata(par2, par3, par4, 5, 2); + } + + if (var7 == 2) + { +! par1World.setBlockMetadata(par2, par3, par4, 3, 2); + } + + if (var7 == 3) + { +! par1World.setBlockMetadata(par2, par3, par4, 4, 2); + } + + if (par6ItemStack.hasDisplayName()) + { + ((TileEntityFurnace)par1World.getBlockTileEntity(par2, par3, par4)).setGuiDisplayName(par6ItemStack.getDisplayName()); +--- 201,226 ---- + { + int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + + if (var7 == 0) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2); + } + + if (var7 == 1) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2); + } + + if (var7 == 2) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); + } + + if (var7 == 3) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2); + } + + if (par6ItemStack.hasDisplayName()) + { + ((TileEntityFurnace)par1World.getBlockTileEntity(par2, par3, par4)).setGuiDisplayName(par6ItemStack.getDisplayName()); +*************** +*** 239,245 **** +--- 297,311 ---- + * strength when this block inputs to a comparator. + */ + public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) + { + return Container.calcRedstoneFromInventory((IInventory)par1World.getBlockTileEntity(par2, par3, par4)); ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return Block.furnaceIdle.blockID; + } + } +*** BlockGlass.java Sat Feb 5 04:13:12 2022 +--- BlockGlass.java Sat Feb 5 04:12:32 2022 +*************** +*** 17,26 **** +--- 17,34 ---- + { + return 0; + } + + /** ++ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha ++ */ ++ public int getRenderBlockPass() ++ { ++ return 0; ++ } ++ ++ /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { +*** BlockGlowStone.java Sat Feb 5 04:13:12 2022 +--- BlockGlowStone.java Sat Feb 5 04:12:32 2022 +*** BlockGrass.java Sat Feb 5 04:13:12 2022 +--- BlockGrass.java Sat Feb 5 04:12:32 2022 +*************** +*** 2,19 **** +--- 2,102 ---- + + import java.util.Random; + + public class BlockGrass extends Block + { ++ private Icon iconGrassTop; ++ private Icon iconSnowSide; ++ private Icon iconGrassSideOverlay; ++ + protected BlockGrass(int par1) + { + super(par1, Material.grass); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return par1 == 1 ? this.iconGrassTop : (par1 == 0 ? Block.dirt.getBlockTextureFromSide(par1) : this.blockIcon); ++ } ++ ++ /** ++ * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side ++ */ ++ public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) ++ { ++ if (par5 == 1) ++ { ++ return this.iconGrassTop; ++ } ++ else if (par5 == 0) ++ { ++ return Block.dirt.getBlockTextureFromSide(par5); ++ } ++ else ++ { ++ Material var6 = par1IBlockAccess.getBlockMaterial(par2, par3 + 1, par4); ++ return var6 != Material.snow && var6 != Material.craftedSnow ? this.blockIcon : this.iconSnowSide; ++ } ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); ++ this.iconGrassTop = par1IconRegister.registerIcon(this.getTextureName() + "_top"); ++ this.iconSnowSide = par1IconRegister.registerIcon(this.getTextureName() + "_side_snowed"); ++ this.iconGrassSideOverlay = par1IconRegister.registerIcon(this.getTextureName() + "_side_overlay"); ++ } ++ ++ public int getBlockColor() ++ { ++ double var1 = 0.5D; ++ double var3 = 1.0D; ++ return ColorizerGrass.getGrassColor(var1, var3); ++ } ++ ++ /** ++ * Returns the color this block should be rendered. Used by leaves. ++ */ ++ public int getRenderColor(int par1) ++ { ++ return this.getBlockColor(); ++ } ++ ++ /** ++ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called ++ * when first determining what to render. ++ */ ++ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) ++ { ++ int var5 = 0; ++ int var6 = 0; ++ int var7 = 0; ++ ++ for (int var8 = -1; var8 <= 1; ++var8) ++ { ++ for (int var9 = -1; var9 <= 1; ++var9) ++ { ++ int var10 = par1IBlockAccess.getBiomeGenForCoords(par2 + var9, par4 + var8).getBiomeGrassColor(); ++ var5 += (var10 & 16711680) >> 16; ++ var6 += (var10 & 65280) >> 8; ++ var7 += var10 & 255; ++ } ++ } ++ ++ return (var5 / 9 & 255) << 16 | (var6 / 9 & 255) << 8 | var7 / 9 & 255; ++ } ++ ++ /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) + { + if (!par1World.isRemote) +*************** +*** 44,50 **** +--- 127,138 ---- + * Returns the ID of the items to drop on destruction. + */ + public int idDropped(int par1, Random par2Random, int par3) + { + return Block.dirt.idDropped(0, par2Random, par3); ++ } ++ ++ public static Icon getIconSideOverlay() ++ { ++ return Block.grass.iconGrassSideOverlay; + } + } +*** BlockGravel.java Sat Feb 5 04:13:12 2022 +--- BlockGravel.java Sat Feb 5 04:12:32 2022 +*** BlockHalfSlab.java Sat Feb 5 04:13:12 2022 +--- BlockHalfSlab.java Sat Feb 5 04:12:32 2022 +*************** +*** 113,129 **** +--- 113,169 ---- + { + return this.isDoubleSlab; + } + + /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) ++ { ++ if (this.isDoubleSlab) ++ { ++ return super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); ++ } ++ else if (par5 != 1 && par5 != 0 && !super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5)) ++ { ++ return false; ++ } ++ else ++ { ++ int var6 = par2 + Facing.offsetsXForSide[Facing.oppositeSide[par5]]; ++ int var7 = par3 + Facing.offsetsYForSide[Facing.oppositeSide[par5]]; ++ int var8 = par4 + Facing.offsetsZForSide[Facing.oppositeSide[par5]]; ++ boolean var9 = (par1IBlockAccess.getBlockMetadata(var6, var7, var8) & 8) != 0; ++ return var9 ? (par5 == 0 ? true : (par5 == 1 && super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5) ? true : !isBlockSingleSlab(par1IBlockAccess.getBlockId(par2, par3, par4)) || (par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 8) == 0)) : (par5 == 1 ? true : (par5 == 0 && super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5) ? true : !isBlockSingleSlab(par1IBlockAccess.getBlockId(par2, par3, par4)) || (par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 8) != 0)); ++ } ++ } ++ ++ /** ++ * Takes a block ID, returns true if it's the same as the ID for a stone or wooden single slab. ++ */ ++ private static boolean isBlockSingleSlab(int par0) ++ { ++ return par0 == Block.stoneSingleSlab.blockID || par0 == Block.woodSingleSlab.blockID; ++ } ++ ++ /** + * Returns the slab block name with step type. + */ + public abstract String getFullSlabName(int var1); + + /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World par1World, int par2, int par3, int par4) + { + return super.getDamageValue(par1World, par2, par3, par4) & 7; ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return isBlockSingleSlab(this.blockID) ? this.blockID : (this.blockID == Block.stoneDoubleSlab.blockID ? Block.stoneSingleSlab.blockID : (this.blockID == Block.woodDoubleSlab.blockID ? Block.woodSingleSlab.blockID : Block.stoneSingleSlab.blockID)); + } + } +*** BlockHay.java Sat Feb 5 04:13:12 2022 +--- BlockHay.java Sat Feb 5 04:12:32 2022 +*************** +*** 13,18 **** +--- 13,36 ---- + */ + public int getRenderType() + { + return 31; + } ++ ++ /** ++ * The icon for the side of the block. ++ */ ++ protected Icon getSideIcon(int par1) ++ { ++ return this.blockIcon; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.field_111051_a = par1IconRegister.registerIcon(this.getTextureName() + "_top"); ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); ++ } + } +*** BlockHopper.java Sat Feb 5 04:13:12 2022 +--- BlockHopper.java Sat Feb 5 04:12:32 2022 +*************** +*** 4,13 **** +--- 4,16 ---- + import java.util.Random; + + public class BlockHopper extends BlockContainer + { + private final Random field_94457_a = new Random(); ++ private Icon hopperIcon; ++ private Icon hopperTopIcon; ++ private Icon hopperInsideIcon; + + public BlockHopper(int par1) + { + super(par1, Material.iron); + this.setCreativeTab(CreativeTabs.tabRedstone); +*************** +*** 129,139 **** + boolean var7 = !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4); + boolean var8 = getIsBlockNotPoweredFromMetadata(var5); + + if (var7 != var8) + { +! par1World.setBlockMetadata(par2, par3, par4, var6 | (var7 ? 0 : 8), 4); + } + } + + /** + * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a +--- 132,142 ---- + boolean var7 = !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4); + boolean var8 = getIsBlockNotPoweredFromMetadata(var5); + + if (var7 != var8) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 | (var7 ? 0 : 8), 4); + } + } + + /** + * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a +*************** +*** 211,220 **** +--- 214,240 ---- + public boolean isOpaqueCube() + { + return false; + } + ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) ++ { ++ return true; ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return par1 == 1 ? this.hopperTopIcon : this.hopperIcon; ++ } ++ + public static int getDirectionFromMetadata(int par0) + { + return par0 & 7; + } + +*************** +*** 237,246 **** +--- 257,290 ---- + * strength when this block inputs to a comparator. + */ + public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) + { + return Container.calcRedstoneFromInventory(getHopperTile(par1World, par2, par3, par4)); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.hopperIcon = par1IconRegister.registerIcon("hopper_outside"); ++ this.hopperTopIcon = par1IconRegister.registerIcon("hopper_top"); ++ this.hopperInsideIcon = par1IconRegister.registerIcon("hopper_inside"); ++ } ++ ++ public static Icon getHopperIcon(String par0Str) ++ { ++ return par0Str.equals("hopper_outside") ? Block.hopperBlock.hopperIcon : (par0Str.equals("hopper_inside") ? Block.hopperBlock.hopperInsideIcon : null); ++ } ++ ++ /** ++ * Gets the icon name of the ItemBlock corresponding to this block. Used by hoppers. ++ */ ++ public String getItemIconName() ++ { ++ return "hopper"; + } + + public static TileEntityHopper getHopperTile(IBlockAccess par0IBlockAccess, int par1, int par2, int par3) + { + return (TileEntityHopper)par0IBlockAccess.getBlockTileEntity(par1, par2, par3); +*** BlockIce.java Sat Feb 5 04:13:12 2022 +--- BlockIce.java Sat Feb 5 04:12:32 2022 +*************** +*** 11,20 **** +--- 11,37 ---- + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** ++ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha ++ */ ++ public int getRenderBlockPass() ++ { ++ return 1; ++ } ++ ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) ++ { ++ return super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, 1 - par5); ++ } ++ ++ /** + * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the + * block and l is the block's subtype/damage. + */ + public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) + { +*** BlockJukeBox.java Sat Feb 5 04:13:12 2022 +--- BlockJukeBox.java Sat Feb 5 04:12:32 2022 +*************** +*** 1,16 **** +--- 1,26 ---- + package net.minecraft.src; + + public class BlockJukeBox extends BlockContainer + { ++ private Icon theIcon; ++ + protected BlockJukeBox(int par1) + { + super(par1, Material.wood); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return par1 == 1 ? this.theIcon : this.blockIcon; ++ } ++ ++ /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) + { + if (par1World.getBlockMetadata(par2, par3, par4) == 0) +*************** +*** 34,44 **** + TileEntityRecordPlayer var6 = (TileEntityRecordPlayer)par1World.getBlockTileEntity(par2, par3, par4); + + if (var6 != null) + { + var6.func_96098_a(par5ItemStack.copy()); +! par1World.setBlockMetadata(par2, par3, par4, 1, 2); + } + } + } + + /** +--- 44,54 ---- + TileEntityRecordPlayer var6 = (TileEntityRecordPlayer)par1World.getBlockTileEntity(par2, par3, par4); + + if (var6 != null) + { + var6.func_96098_a(par5ItemStack.copy()); +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 1, 2); + } + } + } + + /** +*************** +*** 57,67 **** + if (var6 != null) + { + par1World.playAuxSFX(1005, par2, par3, par4, 0); + par1World.playRecord((String)null, par2, par3, par4); + var5.func_96098_a((ItemStack)null); +! par1World.setBlockMetadata(par2, par3, par4, 0, 2); + float var7 = 0.7F; + double var8 = (double)(par1World.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D; + double var10 = (double)(par1World.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.2D + 0.6D; + double var12 = (double)(par1World.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D; + ItemStack var14 = var6.copy(); +--- 67,77 ---- + if (var6 != null) + { + par1World.playAuxSFX(1005, par2, par3, par4, 0); + par1World.playRecord((String)null, par2, par3, par4); + var5.func_96098_a((ItemStack)null); +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 0, 2); + float var7 = 0.7F; + double var8 = (double)(par1World.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D; + double var10 = (double)(par1World.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.2D + 0.6D; + double var12 = (double)(par1World.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D; + ItemStack var14 = var6.copy(); +*************** +*** 99,108 **** +--- 109,128 ---- + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World par1World) + { + return new TileEntityRecordPlayer(); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); ++ this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_top"); + } + + /** + * If this returns true, then comparators facing away from this block will use the value from + * getComparatorInputOverride instead of the actual redstone signal strength. +*** BlockLadder.java Sat Feb 5 04:13:12 2022 +--- BlockLadder.java Sat Feb 5 04:12:32 2022 +*************** +*** 19,28 **** +--- 19,37 ---- + this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); + return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); + } + + /** ++ * Returns the bounding box of the wired rectangular prism to render. ++ */ ++ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) ++ { ++ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); ++ return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); ++ } ++ ++ /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) + { + this.updateLadderBounds(par1IBlockAccess.getBlockMetadata(par2, par3, par4)); +*** BlockLeaves.java Sat Feb 5 04:13:12 2022 +--- BlockLeaves.java Sat Feb 5 04:12:32 2022 +*************** +*** 1,23 **** +--- 1,79 ---- + package net.minecraft.src; + ++ import java.util.List; + import java.util.Random; + + public class BlockLeaves extends BlockLeavesBase + { + public static final String[] LEAF_TYPES = new String[] {"oak", "spruce", "birch", "jungle"}; + public static final String[][] field_94396_b = new String[][] {{"leaves_oak", "leaves_spruce", "leaves_birch", "leaves_jungle"}, {"leaves_oak_opaque", "leaves_spruce_opaque", "leaves_birch_opaque", "leaves_jungle_opaque"}}; ++ ++ /** 1 for fast graphic. 0 for fancy graphics. used in iconArray. */ ++ private int iconType; + private Icon[][] iconArray = new Icon[2][]; + int[] adjacentTreeBlocks; + + protected BlockLeaves(int par1) + { + super(par1, Material.leaves, false); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + ++ public int getBlockColor() ++ { ++ double var1 = 0.5D; ++ double var3 = 1.0D; ++ return ColorizerFoliage.getFoliageColor(var1, var3); ++ } ++ ++ /** ++ * Returns the color this block should be rendered. Used by leaves. ++ */ ++ public int getRenderColor(int par1) ++ { ++ return (par1 & 3) == 1 ? ColorizerFoliage.getFoliageColorPine() : ((par1 & 3) == 2 ? ColorizerFoliage.getFoliageColorBirch() : ColorizerFoliage.getFoliageColorBasic()); ++ } ++ ++ /** ++ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called ++ * when first determining what to render. ++ */ ++ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) ++ { ++ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); ++ ++ if ((var5 & 3) == 1) ++ { ++ return ColorizerFoliage.getFoliageColorPine(); ++ } ++ else if ((var5 & 3) == 2) ++ { ++ return ColorizerFoliage.getFoliageColorBirch(); ++ } ++ else ++ { ++ int var6 = 0; ++ int var7 = 0; ++ int var8 = 0; ++ ++ for (int var9 = -1; var9 <= 1; ++var9) ++ { ++ for (int var10 = -1; var10 <= 1; ++var10) ++ { ++ int var11 = par1IBlockAccess.getBiomeGenForCoords(par2 + var10, par4 + var9).getBiomeFoliageColor(); ++ var6 += (var11 & 16711680) >> 16; ++ var7 += (var11 & 65280) >> 8; ++ var8 += var11 & 255; ++ } ++ } ++ ++ return (var6 / 9 & 255) << 16 | (var7 / 9 & 255) << 8 | var8 / 9 & 255; ++ } ++ } ++ + /** + * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a + * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old + * metadata + */ +*************** +*** 37,47 **** + int var12 = par1World.getBlockId(par2 + var9, par3 + var10, par4 + var11); + + if (var12 == Block.leaves.blockID) + { + int var13 = par1World.getBlockMetadata(par2 + var9, par3 + var10, par4 + var11); +! par1World.setBlockMetadata(par2 + var9, par3 + var10, par4 + var11, var13 | 8, 4); + } + } + } + } + } +--- 93,103 ---- + int var12 = par1World.getBlockId(par2 + var9, par3 + var10, par4 + var11); + + if (var12 == Block.leaves.blockID) + { + int var13 = par1World.getBlockMetadata(par2 + var9, par3 + var10, par4 + var11); +! par1World.setBlockMetadataWithNotify(par2 + var9, par3 + var10, par4 + var11, var13 | 8, 4); + } + } + } + } + } +*************** +*** 149,168 **** + + var12 = this.adjacentTreeBlocks[var11 * var10 + var11 * var9 + var11]; + + if (var12 >= 0) + { +! par1World.setBlockMetadata(par2, par3, par4, var6 & -9, 4); + } + else + { + this.removeLeaves(par1World, par2, par3, par4); + } + } + } + } + + private void removeLeaves(World par1World, int par2, int par3, int par4) + { + this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); + par1World.setBlockToAir(par2, par3, par4); + } +--- 205,238 ---- + + var12 = this.adjacentTreeBlocks[var11 * var10 + var11 * var9 + var11]; + + if (var12 >= 0) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -9, 4); + } + else + { + this.removeLeaves(par1World, par2, par3, par4); + } + } + } + } + ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) ++ { ++ if (par1World.canLightningStrikeAt(par2, par3 + 1, par4) && !par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && par5Random.nextInt(15) == 1) ++ { ++ double var6 = (double)((float)par2 + par5Random.nextFloat()); ++ double var8 = (double)par3 - 0.05D; ++ double var10 = (double)((float)par4 + par5Random.nextFloat()); ++ par1World.spawnParticle("dripWater", var6, var8, var10, 0.0D, 0.0D, 0.0D); ++ } ++ } ++ + private void removeLeaves(World par1World, int par2, int par3, int par4) + { + this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); + par1World.setBlockToAir(par2, par3, par4); + } +*************** +*** 265,277 **** +--- 335,392 ---- + { + return !this.graphicsLevel; + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return (par2 & 3) == 1 ? this.iconArray[this.iconType][1] : ((par2 & 3) == 3 ? this.iconArray[this.iconType][3] : ((par2 & 3) == 2 ? this.iconArray[this.iconType][2] : this.iconArray[this.iconType][0])); ++ } ++ ++ /** ++ * Pass true to draw this block using fancy graphics, or false for fast graphics. ++ */ ++ public void setGraphicsLevel(boolean par1) ++ { ++ this.graphicsLevel = par1; ++ this.iconType = par1 ? 0 : 1; ++ } ++ ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) ++ { ++ par3List.add(new ItemStack(par1, 1, 0)); ++ par3List.add(new ItemStack(par1, 1, 1)); ++ par3List.add(new ItemStack(par1, 1, 2)); ++ par3List.add(new ItemStack(par1, 1, 3)); ++ } ++ ++ /** + * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int par1) + { + return new ItemStack(this.blockID, 1, par1 & 3); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ for (int var2 = 0; var2 < field_94396_b.length; ++var2) ++ { ++ this.iconArray[var2] = new Icon[field_94396_b[var2].length]; ++ ++ for (int var3 = 0; var3 < field_94396_b[var2].length; ++var3) ++ { ++ this.iconArray[var2][var3] = par1IconRegister.registerIcon(field_94396_b[var2][var3]); ++ } ++ } + } + } +*** BlockLeavesBase.java Sat Feb 5 04:13:12 2022 +--- BlockLeavesBase.java Sat Feb 5 04:12:32 2022 +*************** +*** 20,25 **** +--- 20,35 ---- + */ + public boolean isOpaqueCube() + { + return false; + } ++ ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) ++ { ++ int var6 = par1IBlockAccess.getBlockId(par2, par3, par4); ++ return !this.graphicsLevel && var6 == this.blockID ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); ++ } + } +*** BlockLever.java Sat Feb 5 04:13:12 2022 +--- BlockLever.java Sat Feb 5 04:12:32 2022 +*************** +*** 111,136 **** + + if (var8 == invertMetadata(1)) + { + if ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 1) == 0) + { +! par1World.setBlockMetadata(par2, par3, par4, 5 | var9, 2); + } + else + { +! par1World.setBlockMetadata(par2, par3, par4, 6 | var9, 2); + } + } + else if (var8 == invertMetadata(0)) + { + if ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 1) == 0) + { +! par1World.setBlockMetadata(par2, par3, par4, 7 | var9, 2); + } + else + { +! par1World.setBlockMetadata(par2, par3, par4, 0 | var9, 2); + } + } + } + + /** +--- 111,136 ---- + + if (var8 == invertMetadata(1)) + { + if ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 1) == 0) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 5 | var9, 2); + } + else + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 6 | var9, 2); + } + } + else if (var8 == invertMetadata(0)) + { + if ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 1) == 0) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 7 | var9, 2); + } + else + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 0 | var9, 2); + } + } + } + + /** +*************** +*** 291,301 **** + else + { + int var10 = par1World.getBlockMetadata(par2, par3, par4); + int var11 = var10 & 7; + int var12 = 8 - (var10 & 8); +! par1World.setBlockMetadata(par2, par3, par4, var11 + var12, 3); + par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, var12 > 0 ? 0.6F : 0.5F); + par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); + + if (var11 == 1) + { +--- 291,301 ---- + else + { + int var10 = par1World.getBlockMetadata(par2, par3, par4); + int var11 = var10 & 7; + int var12 = 8 - (var10 & 8); +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var11 + var12, 3); + par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, var12 > 0 ? 0.6F : 0.5F); + par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); + + if (var11 == 1) + { +*** BlockLilyPad.java Sat Feb 5 04:13:12 2022 +--- BlockLilyPad.java Sat Feb 5 04:12:32 2022 +*************** +*** 40,49 **** +--- 40,71 ---- + public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) + { + return AxisAlignedBB.getAABBPool().getAABB((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)par3 + this.maxY, (double)par4 + this.maxZ); + } + ++ public int getBlockColor() ++ { ++ return 2129968; ++ } ++ ++ /** ++ * Returns the color this block should be rendered. Used by leaves. ++ */ ++ public int getRenderColor(int par1) ++ { ++ return 2129968; ++ } ++ ++ /** ++ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called ++ * when first determining what to render. ++ */ ++ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) ++ { ++ return 2129968; ++ } ++ + /** + * Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of + * blockID passed in. Args: blockID + */ + protected boolean canThisPlantGrowOnThisBlockID(int par1) +*** BlockLockedChest.java Sat Feb 5 04:13:12 2022 +--- BlockLockedChest.java Sat Feb 5 04:12:32 2022 +*************** +*** 22,27 **** +--- 22,33 ---- + */ + public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) + { + par1World.setBlockToAir(par2, par3, par4); + } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) {} + } +*** BlockLog.java Sat Feb 5 04:13:12 2022 +--- BlockLog.java Sat Feb 5 04:12:32 2022 +*************** +*** 1,13 **** +--- 1,16 ---- + package net.minecraft.src; + ++ import java.util.List; + import java.util.Random; + + public class BlockLog extends BlockRotatedPillar + { + /** The type of tree this log came from. */ + public static final String[] woodType = new String[] {"oak", "spruce", "birch", "jungle"}; ++ private Icon[] field_111052_c; ++ private Icon[] tree_top; + + protected BlockLog(int par1) + { + super(par1, Material.wood); + this.setCreativeTab(CreativeTabs.tabBlock); +*************** +*** 53,74 **** + { + int var13 = par1World.getBlockMetadata(par2 + var9, par3 + var10, par4 + var11); + + if ((var13 & 8) == 0) + { +! par1World.setBlockMetadata(par2 + var9, par3 + var10, par4 + var11, var13 | 8, 4); + } + } + } + } + } + } + } + + /** + * returns a number between 0 and 3 + */ + public static int limitToValidMetadata(int par0) + { + return par0 & 3; + } + } +--- 56,120 ---- + { + int var13 = par1World.getBlockMetadata(par2 + var9, par3 + var10, par4 + var11); + + if ((var13 & 8) == 0) + { +! par1World.setBlockMetadataWithNotify(par2 + var9, par3 + var10, par4 + var11, var13 | 8, 4); + } + } + } + } + } + } + } + + /** ++ * The icon for the side of the block. ++ */ ++ protected Icon getSideIcon(int par1) ++ { ++ return this.field_111052_c[par1]; ++ } ++ ++ /** ++ * The icon for the tops and bottoms of the block. ++ */ ++ protected Icon getEndIcon(int par1) ++ { ++ return this.tree_top[par1]; ++ } ++ ++ /** + * returns a number between 0 and 3 + */ + public static int limitToValidMetadata(int par0) + { + return par0 & 3; ++ } ++ ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) ++ { ++ par3List.add(new ItemStack(par1, 1, 0)); ++ par3List.add(new ItemStack(par1, 1, 1)); ++ par3List.add(new ItemStack(par1, 1, 2)); ++ par3List.add(new ItemStack(par1, 1, 3)); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.field_111052_c = new Icon[woodType.length]; ++ this.tree_top = new Icon[woodType.length]; ++ ++ for (int var2 = 0; var2 < this.field_111052_c.length; ++var2) ++ { ++ this.field_111052_c[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + woodType[var2]); ++ this.tree_top[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + woodType[var2] + "_top"); ++ } + } + } +*** BlockMelon.java Sat Feb 5 04:13:12 2022 +--- BlockMelon.java Sat Feb 5 04:12:32 2022 +*************** +*** 2,18 **** +--- 2,28 ---- + + import java.util.Random; + + public class BlockMelon extends Block + { ++ private Icon theIcon; ++ + protected BlockMelon(int par1) + { + super(par1, Material.pumpkin); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return par1 != 1 && par1 != 0 ? this.blockIcon : this.theIcon; ++ } ++ ++ /** + * Returns the ID of the items to drop on destruction. + */ + public int idDropped(int par1, Random par2Random, int par3) + { + return Item.melon.itemID; +*************** +*** 37,43 **** +--- 47,63 ---- + { + var3 = 9; + } + + return var3; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); ++ this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_top"); + } + } +*** BlockMobSpawner.java Sat Feb 5 04:13:12 2022 +--- BlockMobSpawner.java Sat Feb 5 04:12:32 2022 +*************** +*** 49,54 **** +--- 49,62 ---- + */ + public boolean isOpaqueCube() + { + return false; + } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return 0; ++ } + } +*** BlockMushroom.java Sat Feb 5 04:13:12 2022 +--- BlockMushroom.java Sat Feb 5 04:12:32 2022 +*** BlockMushroomCap.java Sat Feb 5 04:13:12 2022 +--- BlockMushroomCap.java Sat Feb 5 04:12:32 2022 +*************** +*** 6,23 **** +--- 6,34 ---- + { + private static final String[] field_94429_a = new String[] {"skin_brown", "skin_red"}; + + /** The mushroom type. 0 for brown, 1 for red. */ + private final int mushroomType; ++ private Icon[] iconArray; ++ private Icon field_94426_cO; ++ private Icon field_94427_cP; + + public BlockMushroomCap(int par1, Material par2Material, int par3) + { + super(par1, par2Material); + this.mushroomType = par3; + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return par2 == 10 && par1 > 1 ? this.field_94426_cO : (par2 >= 1 && par2 <= 9 && par1 == 1 ? this.iconArray[this.mushroomType] : (par2 >= 1 && par2 <= 3 && par1 == 2 ? this.iconArray[this.mushroomType] : (par2 >= 7 && par2 <= 9 && par1 == 3 ? this.iconArray[this.mushroomType] : ((par2 == 1 || par2 == 4 || par2 == 7) && par1 == 4 ? this.iconArray[this.mushroomType] : ((par2 == 3 || par2 == 6 || par2 == 9) && par1 == 5 ? this.iconArray[this.mushroomType] : (par2 == 14 ? this.iconArray[this.mushroomType] : (par2 == 15 ? this.field_94426_cO : this.field_94427_cP))))))); ++ } ++ ++ /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random par1Random) + { + int var2 = par1Random.nextInt(10) - 7; +*************** +*** 34,40 **** +--- 45,76 ---- + * Returns the ID of the items to drop on destruction. + */ + public int idDropped(int par1, Random par2Random, int par3) + { + return Block.mushroomBrown.blockID + this.mushroomType; ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return Block.mushroomBrown.blockID + this.mushroomType; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.iconArray = new Icon[field_94429_a.length]; ++ ++ for (int var2 = 0; var2 < this.iconArray.length; ++var2) ++ { ++ this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + field_94429_a[var2]); ++ } ++ ++ this.field_94427_cP = par1IconRegister.registerIcon(this.getTextureName() + "_" + "inside"); ++ this.field_94426_cO = par1IconRegister.registerIcon(this.getTextureName() + "_" + "skin_stem"); + } + } +*** BlockMycelium.java Sat Feb 5 04:13:12 2022 +--- BlockMycelium.java Sat Feb 5 04:12:32 2022 +*************** +*** 2,19 **** +--- 2,61 ---- + + import java.util.Random; + + public class BlockMycelium extends Block + { ++ private Icon field_94422_a; ++ private Icon field_94421_b; ++ + protected BlockMycelium(int par1) + { + super(par1, Material.grass); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return par1 == 1 ? this.field_94422_a : (par1 == 0 ? Block.dirt.getBlockTextureFromSide(par1) : this.blockIcon); ++ } ++ ++ /** ++ * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side ++ */ ++ public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) ++ { ++ if (par5 == 1) ++ { ++ return this.field_94422_a; ++ } ++ else if (par5 == 0) ++ { ++ return Block.dirt.getBlockTextureFromSide(par5); ++ } ++ else ++ { ++ Material var6 = par1IBlockAccess.getBlockMaterial(par2, par3 + 1, par4); ++ return var6 != Material.snow && var6 != Material.craftedSnow ? this.blockIcon : this.field_94421_b; ++ } ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); ++ this.field_94422_a = par1IconRegister.registerIcon(this.getTextureName() + "_top"); ++ this.field_94421_b = par1IconRegister.registerIcon("grass_side_snowed"); ++ } ++ ++ /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) + { + if (!par1World.isRemote) +*************** +*** 35,44 **** +--- 77,99 ---- + { + par1World.setBlock(var7, var8, var9, this.blockID); + } + } + } ++ } ++ } ++ ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) ++ { ++ super.randomDisplayTick(par1World, par2, par3, par4, par5Random); ++ ++ if (par5Random.nextInt(10) == 0) ++ { ++ par1World.spawnParticle("townaura", (double)((float)par2 + par5Random.nextFloat()), (double)((float)par3 + 1.1F), (double)((float)par4 + par5Random.nextFloat()), 0.0D, 0.0D, 0.0D); + } + } + + /** + * Returns the ID of the items to drop on destruction. +*** BlockNetherrack.java Sat Feb 5 04:13:12 2022 +--- BlockNetherrack.java Sat Feb 5 04:12:32 2022 +*** BlockNetherStalk.java Sat Feb 5 04:13:12 2022 +--- BlockNetherStalk.java Sat Feb 5 04:12:32 2022 +*************** +*** 2,11 **** +--- 2,13 ---- + + import java.util.Random; + + public class BlockNetherStalk extends BlockFlower + { ++ private Icon[] iconArray; ++ + protected BlockNetherStalk(int par1) + { + super(par1); + this.setTickRandomly(true); + float var2 = 0.5F; +*************** +*** 38,54 **** + int var6 = par1World.getBlockMetadata(par2, par3, par4); + + if (var6 < 3 && par5Random.nextInt(10) == 0) + { + ++var6; +! par1World.setBlockMetadata(par2, par3, par4, var6, 2); + } + + super.updateTick(par1World, par2, par3, par4, par5Random); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 6; +--- 40,64 ---- + int var6 = par1World.getBlockMetadata(par2, par3, par4); + + if (var6 < 3 && par5Random.nextInt(10) == 0) + { + ++var6; +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 2); + } + + super.updateTick(par1World, par2, par3, par4, par5Random); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return par2 >= 3 ? this.iconArray[2] : (par2 > 0 ? this.iconArray[1] : this.iconArray[0]); ++ } ++ ++ /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 6; +*************** +*** 92,98 **** +--- 102,130 ---- + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random par1Random) + { + return 0; ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return Item.netherStalkSeeds.itemID; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.iconArray = new Icon[3]; ++ ++ for (int var2 = 0; var2 < this.iconArray.length; ++var2) ++ { ++ this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_stage_" + var2); ++ } + } + } +*** BlockNote.java Sat Feb 5 04:13:12 2022 +--- BlockNote.java Sat Feb 5 04:12:32 2022 +*** BlockObsidian.java Sat Feb 5 04:13:12 2022 +--- BlockObsidian.java Sat Feb 5 04:12:32 2022 +*** BlockOre.java Sat Feb 5 04:13:12 2022 +--- BlockOre.java Sat Feb 5 04:12:32 2022 +*** BlockOreStorage.java Sat Feb 5 04:13:12 2022 +--- BlockOreStorage.java Sat Feb 5 04:12:32 2022 +*** BlockPane.java Sat Feb 5 04:13:12 2022 +--- BlockPane.java Sat Feb 5 04:12:32 2022 +*************** +*** 14,23 **** +--- 14,24 ---- + * If this field is true, the pane block drops itself when destroyed (like the iron fences), otherwise, it's just + * destroyed (like glass panes) + */ + private final boolean canDropItself; + private final String field_94402_c; ++ private Icon theIcon; + + protected BlockPane(int par1, String par2Str, String par3Str, Material par4Material, boolean par5) + { + super(par1, par4Material); + this.sideTextureIndex = par3Str; +*************** +*** 58,67 **** +--- 59,78 ---- + { + return 18; + } + + /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) ++ { ++ int var6 = par1IBlockAccess.getBlockId(par2, par3, par4); ++ return var6 == this.blockID ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); ++ } ++ ++ /** + * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the + * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity + */ + public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) + { +*************** +*** 167,176 **** +--- 178,195 ---- + + this.setBlockBounds(var5, 0.0F, var7, var6, 1.0F, var8); + } + + /** ++ * Returns the texture index of the thin side of the pane. ++ */ ++ public Icon getSideTextureIndex() ++ { ++ return this.theIcon; ++ } ++ ++ /** + * Gets passed in the blockID of the block adjacent and supposed to return true if its allowed to connect to the + * type of blockID passed in. Args: blockID + */ + public final boolean canThisPaneConnectToThisBlockID(int par1) + { +*************** +*** 190,196 **** +--- 209,225 ---- + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int par1) + { + return new ItemStack(this.blockID, 1, par1); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon(this.field_94402_c); ++ this.theIcon = par1IconRegister.registerIcon(this.sideTextureIndex); + } + } +*** BlockPistonBase.java Sat Feb 5 04:13:12 2022 +--- BlockPistonBase.java Sat Feb 5 04:12:32 2022 +*************** +*** 5,24 **** +--- 5,74 ---- + public class BlockPistonBase extends Block + { + /** This pistons is the sticky one? */ + private final boolean isSticky; + ++ /** Only visible when piston is extended */ ++ private Icon innerTopIcon; ++ ++ /** Bottom side texture */ ++ private Icon bottomIcon; ++ ++ /** Top icon of piston depends on (either sticky or normal) */ ++ private Icon topIcon; ++ + public BlockPistonBase(int par1, boolean par2) + { + super(par1, Material.piston); + this.isSticky = par2; + this.setStepSound(soundStoneFootstep); + this.setHardness(0.5F); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /** ++ * Return the either 106 or 107 as the texture index depending on the isSticky flag. This will actually never get ++ * called by TileEntityRendererPiston.renderPiston() because TileEntityPiston.shouldRenderHead() will always return ++ * false. ++ */ ++ public Icon getPistonExtensionTexture() ++ { ++ return this.topIcon; ++ } ++ ++ public void func_96479_b(float par1, float par2, float par3, float par4, float par5, float par6) ++ { ++ this.setBlockBounds(par1, par2, par3, par4, par5, par6); ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ int var3 = getOrientation(par2); ++ return var3 > 5 ? this.topIcon : (par1 == var3 ? (!isExtended(par2) && this.minX <= 0.0D && this.minY <= 0.0D && this.minZ <= 0.0D && this.maxX >= 1.0D && this.maxY >= 1.0D && this.maxZ >= 1.0D ? this.topIcon : this.innerTopIcon) : (par1 == Facing.oppositeSide[var3] ? this.bottomIcon : this.blockIcon)); ++ } ++ ++ public static Icon getPistonBaseIcon(String par0Str) ++ { ++ return par0Str == "piston_side" ? Block.pistonBase.blockIcon : (par0Str == "piston_top_normal" ? Block.pistonBase.topIcon : (par0Str == "piston_top_sticky" ? Block.pistonStickyBase.topIcon : (par0Str == "piston_inner" ? Block.pistonBase.innerTopIcon : null))); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon("piston_side"); ++ this.topIcon = par1IconRegister.registerIcon(this.isSticky ? "piston_top_sticky" : "piston_top_normal"); ++ this.innerTopIcon = par1IconRegister.registerIcon("piston_inner"); ++ this.bottomIcon = par1IconRegister.registerIcon("piston_bottom"); ++ } ++ ++ /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 16; +*************** +*** 45,55 **** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) + { + int var7 = determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase); +! par1World.setBlockMetadata(par2, par3, par4, var7, 2); + + if (!par1World.isRemote) + { + this.updatePistonState(par1World, par2, par3, par4); + } +--- 95,105 ---- + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) + { + int var7 = determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase); +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); + + if (!par1World.isRemote) + { + this.updatePistonState(par1World, par2, par3, par4); + } +*************** +*** 97,107 **** + par1World.addBlockEvent(par2, par3, par4, this.blockID, 0, var6); + } + } + else if (!var7 && isExtended(var5)) + { +! par1World.setBlockMetadata(par2, par3, par4, var6, 2); + par1World.addBlockEvent(par2, par3, par4, this.blockID, 1, var6); + } + } + } + +--- 147,157 ---- + par1World.addBlockEvent(par2, par3, par4, this.blockID, 0, var6); + } + } + else if (!var7 && isExtended(var5)) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 2); + par1World.addBlockEvent(par2, par3, par4, this.blockID, 1, var6); + } + } + } + +*************** +*** 123,133 **** + { + boolean var7 = this.isIndirectlyPowered(par1World, par2, par3, par4, par6); + + if (var7 && par5 == 1) + { +! par1World.setBlockMetadata(par2, par3, par4, par6 | 8, 2); + return false; + } + + if (!var7 && par5 == 0) + { +--- 173,183 ---- + { + boolean var7 = this.isIndirectlyPowered(par1World, par2, par3, par4, par6); + + if (var7 && par5 == 1) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, par6 | 8, 2); + return false; + } + + if (!var7 && par5 == 0) + { +*************** +*** 140,150 **** + if (!this.tryExtend(par1World, par2, par3, par4, par6)) + { + return false; + } + +! par1World.setBlockMetadata(par2, par3, par4, par6 | 8, 2); + par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "tile.piston.out", 0.5F, par1World.rand.nextFloat() * 0.25F + 0.6F); + } + else if (par5 == 1) + { + TileEntity var16 = par1World.getBlockTileEntity(par2 + Facing.offsetsXForSide[par6], par3 + Facing.offsetsYForSide[par6], par4 + Facing.offsetsZForSide[par6]); +--- 190,200 ---- + if (!this.tryExtend(par1World, par2, par3, par4, par6)) + { + return false; + } + +! par1World.setBlockMetadataWithNotify(par2, par3, par4, par6 | 8, 2); + par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "tile.piston.out", 0.5F, par1World.rand.nextFloat() * 0.25F + 0.6F); + } + else if (par5 == 1) + { + TileEntity var16 = par1World.getBlockTileEntity(par2 + Facing.offsetsXForSide[par6], par3 + Facing.offsetsYForSide[par6], par4 + Facing.offsetsZForSide[par6]); +*** BlockPistonExtension.java Sat Feb 5 04:13:12 2022 +--- BlockPistonExtension.java Sat Feb 5 04:12:32 2022 +*************** +*** 3,19 **** +--- 3,32 ---- + import java.util.List; + import java.util.Random; + + public class BlockPistonExtension extends Block + { ++ /** The texture for the 'head' of the piston. Sticky or normal. */ ++ private Icon headTexture; ++ + public BlockPistonExtension(int par1) + { + super(par1, Material.piston); + this.setStepSound(soundStoneFootstep); + this.setHardness(0.5F); + } + ++ public void setHeadTexture(Icon par1Icon) ++ { ++ this.headTexture = par1Icon; ++ } ++ ++ public void clearHeadTexture() ++ { ++ this.headTexture = null; ++ } ++ + /** + * Called when the block is attempted to be harvested + */ + public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) + { +*************** +*** 56,65 **** +--- 69,93 ---- + } + } + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ int var3 = getDirectionMeta(par2); ++ return par1 == var3 ? (this.headTexture != null ? this.headTexture : ((par2 & 8) != 0 ? BlockPistonBase.getPistonBaseIcon("piston_top_sticky") : BlockPistonBase.getPistonBaseIcon("piston_top_normal"))) : (var3 < 6 && par1 == Facing.oppositeSide[var3] ? BlockPistonBase.getPistonBaseIcon("piston_top_normal") : BlockPistonBase.getPistonBaseIcon("piston_side")); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) {} ++ ++ /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 17; +*************** +*** 221,227 **** +--- 249,264 ---- + } + + public static int getDirectionMeta(int par0) + { + return par0 & 7; ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ int var5 = par1World.getBlockMetadata(par2, par3, par4); ++ return (var5 & 8) != 0 ? Block.pistonStickyBase.blockID : Block.pistonBase.blockID; + } + } +*** BlockPistonMoving.java Sat Feb 5 04:13:12 2022 +--- BlockPistonMoving.java Sat Feb 5 04:12:32 2022 +*************** +*** 191,201 **** + { + var7 = 1.0F - var7; + } + + int var8 = var5.getPistonOrientation(); +! this.minX = var6.getMinX() - (double)((float)Facing.offsetsXForSide[var8] * var7); + this.minY = var6.getBlockBoundsMinY() - (double)((float)Facing.offsetsYForSide[var8] * var7); + this.minZ = var6.getBlockBoundsMinZ() - (double)((float)Facing.offsetsZForSide[var8] * var7); + this.maxX = var6.getBlockBoundsMaxX() - (double)((float)Facing.offsetsXForSide[var8] * var7); + this.maxY = var6.getBlockBoundsMaxY() - (double)((float)Facing.offsetsYForSide[var8] * var7); + this.maxZ = var6.getBlockBoundsMaxZ() - (double)((float)Facing.offsetsZForSide[var8] * var7); +--- 191,201 ---- + { + var7 = 1.0F - var7; + } + + int var8 = var5.getPistonOrientation(); +! this.minX = var6.getBlockBoundsMinX() - (double)((float)Facing.offsetsXForSide[var8] * var7); + this.minY = var6.getBlockBoundsMinY() - (double)((float)Facing.offsetsYForSide[var8] * var7); + this.minZ = var6.getBlockBoundsMinZ() - (double)((float)Facing.offsetsZForSide[var8] * var7); + this.maxX = var6.getBlockBoundsMaxX() - (double)((float)Facing.offsetsXForSide[var8] * var7); + this.maxY = var6.getBlockBoundsMaxY() - (double)((float)Facing.offsetsYForSide[var8] * var7); + this.maxZ = var6.getBlockBoundsMaxZ() - (double)((float)Facing.offsetsZForSide[var8] * var7); +*************** +*** 255,261 **** +--- 255,278 ---- + */ + private TileEntityPiston getTileEntityAtLocation(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) + { + TileEntity var5 = par1IBlockAccess.getBlockTileEntity(par2, par3, par4); + return var5 instanceof TileEntityPiston ? (TileEntityPiston)var5 : null; ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return 0; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon("piston_top_normal"); + } + } +*** BlockPortal.java Sat Feb 5 04:13:12 2022 +--- BlockPortal.java Sat Feb 5 04:12:32 2022 +*************** +*** 214,236 **** +--- 214,312 ---- + } + } + } + + /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) ++ { ++ if (par1IBlockAccess.getBlockId(par2, par3, par4) == this.blockID) ++ { ++ return false; ++ } ++ else ++ { ++ boolean var6 = par1IBlockAccess.getBlockId(par2 - 1, par3, par4) == this.blockID && par1IBlockAccess.getBlockId(par2 - 2, par3, par4) != this.blockID; ++ boolean var7 = par1IBlockAccess.getBlockId(par2 + 1, par3, par4) == this.blockID && par1IBlockAccess.getBlockId(par2 + 2, par3, par4) != this.blockID; ++ boolean var8 = par1IBlockAccess.getBlockId(par2, par3, par4 - 1) == this.blockID && par1IBlockAccess.getBlockId(par2, par3, par4 - 2) != this.blockID; ++ boolean var9 = par1IBlockAccess.getBlockId(par2, par3, par4 + 1) == this.blockID && par1IBlockAccess.getBlockId(par2, par3, par4 + 2) != this.blockID; ++ boolean var10 = var6 || var7; ++ boolean var11 = var8 || var9; ++ return var10 && par5 == 4 ? true : (var10 && par5 == 5 ? true : (var11 && par5 == 2 ? true : var11 && par5 == 3)); ++ } ++ } ++ ++ /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random par1Random) + { + return 0; + } + + /** ++ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha ++ */ ++ public int getRenderBlockPass() ++ { ++ return 1; ++ } ++ ++ /** + * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity + */ + public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) + { + if (par5Entity.ridingEntity == null && par5Entity.riddenByEntity == null) + { + par5Entity.setInPortal(); + } ++ } ++ ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) ++ { ++ if (par5Random.nextInt(100) == 0) ++ { ++ par1World.playSound((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "portal.portal", 0.5F, par5Random.nextFloat() * 0.4F + 0.8F, false); ++ } ++ ++ for (int var6 = 0; var6 < 4; ++var6) ++ { ++ double var7 = (double)((float)par2 + par5Random.nextFloat()); ++ double var9 = (double)((float)par3 + par5Random.nextFloat()); ++ double var11 = (double)((float)par4 + par5Random.nextFloat()); ++ double var13 = 0.0D; ++ double var15 = 0.0D; ++ double var17 = 0.0D; ++ int var19 = par5Random.nextInt(2) * 2 - 1; ++ var13 = ((double)par5Random.nextFloat() - 0.5D) * 0.5D; ++ var15 = ((double)par5Random.nextFloat() - 0.5D) * 0.5D; ++ var17 = ((double)par5Random.nextFloat() - 0.5D) * 0.5D; ++ ++ if (par1World.getBlockId(par2 - 1, par3, par4) != this.blockID && par1World.getBlockId(par2 + 1, par3, par4) != this.blockID) ++ { ++ var7 = (double)par2 + 0.5D + 0.25D * (double)var19; ++ var13 = (double)(par5Random.nextFloat() * 2.0F * (float)var19); ++ } ++ else ++ { ++ var11 = (double)par4 + 0.5D + 0.25D * (double)var19; ++ var17 = (double)(par5Random.nextFloat() * 2.0F * (float)var19); ++ } ++ ++ par1World.spawnParticle("portal", var7, var9, var11, var13, var15, var17); ++ } ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return 0; + } + } +*** BlockPotato.java Sat Feb 5 04:13:12 2022 +--- BlockPotato.java Sat Feb 5 04:12:32 2022 +*************** +*** 1,15 **** +--- 1,37 ---- + package net.minecraft.src; + + public class BlockPotato extends BlockCrops + { ++ private Icon[] iconArray; ++ + public BlockPotato(int par1) + { + super(par1); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ if (par2 < 7) ++ { ++ if (par2 == 6) ++ { ++ par2 = 5; ++ } ++ ++ return this.iconArray[par2 >> 1]; ++ } ++ else ++ { ++ return this.iconArray[3]; ++ } ++ } ++ ++ /** + * Generate a seed ItemStack for this crop. + */ + protected int getSeedItem() + { + return Item.potato.itemID; +*************** +*** 34,41 **** +--- 56,77 ---- + { + if (par5 >= 7 && par1World.rand.nextInt(50) == 0) + { + this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.poisonousPotato)); + } ++ } ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.iconArray = new Icon[4]; ++ ++ for (int var2 = 0; var2 < this.iconArray.length; ++var2) ++ { ++ this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_stage_" + var2); + } + } + } +*** BlockPoweredOre.java Sat Feb 5 04:13:12 2022 +--- BlockPoweredOre.java Sat Feb 5 04:12:32 2022 +*** BlockPressurePlate.java Sat Feb 5 04:13:12 2022 +--- BlockPressurePlate.java Sat Feb 5 04:12:32 2022 +*** BlockPressurePlateWeighted.java Sat Feb 5 04:13:12 2022 +--- BlockPressurePlateWeighted.java Sat Feb 5 04:12:32 2022 +*** BlockPumpkin.java Sat Feb 5 04:13:12 2022 +--- BlockPumpkin.java Sat Feb 5 04:12:32 2022 +*************** +*** 2,21 **** +--- 2,31 ---- + + public class BlockPumpkin extends BlockDirectional + { + /** Boolean used to seperate different states of blocks */ + private boolean blockType; ++ private Icon field_94474_b; ++ private Icon field_94475_c; + + protected BlockPumpkin(int par1, boolean par2) + { + super(par1, Material.pumpkin); + this.setTickRandomly(true); + this.blockType = par2; + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return par1 == 1 ? this.field_94474_b : (par1 == 0 ? this.field_94474_b : (par2 == 2 && par1 == 2 ? this.field_94475_c : (par2 == 3 && par1 == 5 ? this.field_94475_c : (par2 == 0 && par1 == 3 ? this.field_94475_c : (par2 == 1 && par1 == 4 ? this.field_94475_c : this.blockIcon))))); ++ } ++ ++ /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World par1World, int par2, int par3, int par4) + { + super.onBlockAdded(par1World, par2, par3, par4); +*************** +*** 103,110 **** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) + { + int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; +! par1World.setBlockMetadata(par2, par3, par4, var7, 2); + } + } +--- 113,131 ---- + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) + { + int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); +! } +! +! /** +! * When this method is called, your block should register all the icons it needs with the given IconRegister. This +! * is the only chance you get to register icons. +! */ +! public void registerIcons(IconRegister par1IconRegister) +! { +! this.field_94475_c = par1IconRegister.registerIcon(this.getTextureName() + "_face_" + (this.blockType ? "on" : "off")); +! this.field_94474_b = par1IconRegister.registerIcon(this.getTextureName() + "_top"); +! this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); + } + } +*** BlockQuartz.java Sat Feb 5 04:13:12 2022 +--- BlockQuartz.java Sat Feb 5 04:12:32 2022 +*************** +*** 1,19 **** +--- 1,60 ---- + package net.minecraft.src; + ++ import java.util.List; ++ + public class BlockQuartz extends Block + { + public static final String[] quartzBlockTypes = new String[] {"default", "chiseled", "lines"}; + private static final String[] quartzBlockTextureTypes = new String[] {"side", "chiseled", "lines", null, null}; ++ private Icon[] quartzblockIcons; ++ private Icon quartzblock_chiseled_top; ++ private Icon quartzblock_lines_top; ++ private Icon quartzblock_top; ++ private Icon quartzblock_bottom; + + public BlockQuartz(int par1) + { + super(par1, Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ if (par2 != 2 && par2 != 3 && par2 != 4) ++ { ++ if (par1 != 1 && (par1 != 0 || par2 != 1)) ++ { ++ if (par1 == 0) ++ { ++ return this.quartzblock_bottom; ++ } ++ else ++ { ++ if (par2 < 0 || par2 >= this.quartzblockIcons.length) ++ { ++ par2 = 0; ++ } ++ ++ return this.quartzblockIcons[par2]; ++ } ++ } ++ else ++ { ++ return par2 == 1 ? this.quartzblock_chiseled_top : this.quartzblock_top; ++ } ++ } ++ else ++ { ++ return par2 == 2 && (par1 == 1 || par1 == 0) ? this.quartzblock_lines_top : (par2 == 3 && (par1 == 5 || par1 == 4) ? this.quartzblock_lines_top : (par2 == 4 && (par1 == 2 || par1 == 3) ? this.quartzblock_lines_top : this.quartzblockIcons[par2])); ++ } ++ } ++ ++ /** + * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata + */ + public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) + { + if (par9 == 2) +*************** +*** 60,66 **** +--- 101,143 ---- + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 39; ++ } ++ ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) ++ { ++ par3List.add(new ItemStack(par1, 1, 0)); ++ par3List.add(new ItemStack(par1, 1, 1)); ++ par3List.add(new ItemStack(par1, 1, 2)); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.quartzblockIcons = new Icon[quartzBlockTextureTypes.length]; ++ ++ for (int var2 = 0; var2 < this.quartzblockIcons.length; ++var2) ++ { ++ if (quartzBlockTextureTypes[var2] == null) ++ { ++ this.quartzblockIcons[var2] = this.quartzblockIcons[var2 - 1]; ++ } ++ else ++ { ++ this.quartzblockIcons[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + quartzBlockTextureTypes[var2]); ++ } ++ } ++ ++ this.quartzblock_top = par1IconRegister.registerIcon(this.getTextureName() + "_" + "top"); ++ this.quartzblock_chiseled_top = par1IconRegister.registerIcon(this.getTextureName() + "_" + "chiseled_top"); ++ this.quartzblock_lines_top = par1IconRegister.registerIcon(this.getTextureName() + "_" + "lines_top"); ++ this.quartzblock_bottom = par1IconRegister.registerIcon(this.getTextureName() + "_" + "bottom"); + } + } +*** BlockRail.java Sat Feb 5 04:13:12 2022 +--- BlockRail.java Sat Feb 5 04:12:32 2022 +*************** +*** 1,12 **** +--- 1,32 ---- + package net.minecraft.src; + + public class BlockRail extends BlockRailBase + { ++ private Icon theIcon; ++ + protected BlockRail(int par1) + { + super(par1, false); ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return par2 >= 6 ? this.theIcon : this.blockIcon; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ super.registerIcons(par1IconRegister); ++ this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_turned"); + } + + protected void func_94358_a(World par1World, int par2, int par3, int par4, int par5, int par6, int par7) + { + if (par7 > 0 && Block.blocksList[par7].canProvidePower() && (new BlockBaseRailLogic(this, par1World, par2, par3, par4)).getNumberOfAdjacentTracks() == 3) +*** BlockRailBase.java Sat Feb 5 04:13:12 2022 +--- BlockRailBase.java Sat Feb 5 04:12:32 2022 +*** BlockRailPowered.java Sat Feb 5 04:13:12 2022 +--- BlockRailPowered.java Sat Feb 5 04:12:32 2022 +*************** +*** 1,14 **** +--- 1,34 ---- + package net.minecraft.src; + + public class BlockRailPowered extends BlockRailBase + { ++ protected Icon theIcon; ++ + protected BlockRailPowered(int par1) + { + super(par1, true); + } + ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return (par2 & 8) == 0 ? this.blockIcon : this.theIcon; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ super.registerIcons(par1IconRegister); ++ this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_powered"); ++ } ++ + protected boolean func_94360_a(World par1World, int par2, int par3, int par4, int par5, boolean par6, int par7) + { + if (par7 >= 8) + { + return false; +*************** +*** 147,162 **** + var8 = var8 || this.func_94360_a(par1World, par2, par3, par4, par5, true, 0) || this.func_94360_a(par1World, par2, par3, par4, par5, false, 0); + boolean var9 = false; + + if (var8 && (par5 & 8) == 0) + { +! par1World.setBlockMetadata(par2, par3, par4, par6 | 8, 3); + var9 = true; + } + else if (!var8 && (par5 & 8) != 0) + { +! par1World.setBlockMetadata(par2, par3, par4, par6, 3); + var9 = true; + } + + if (var9) + { +--- 167,182 ---- + var8 = var8 || this.func_94360_a(par1World, par2, par3, par4, par5, true, 0) || this.func_94360_a(par1World, par2, par3, par4, par5, false, 0); + boolean var9 = false; + + if (var8 && (par5 & 8) == 0) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, par6 | 8, 3); + var9 = true; + } + else if (!var8 && (par5 & 8) != 0) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, par6, 3); + var9 = true; + } + + if (var9) + { +*** BlockRedstoneLight.java Sat Feb 5 04:13:12 2022 +--- BlockRedstoneLight.java Sat Feb 5 04:12:32 2022 +*************** +*** 71,76 **** +--- 71,84 ---- + */ + public int idDropped(int par1, Random par2Random, int par3) + { + return Block.redstoneLampIdle.blockID; + } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return Block.redstoneLampIdle.blockID; ++ } + } +*** BlockRedstoneLogic.java Sat Feb 5 04:13:12 2022 +--- BlockRedstoneLogic.java Sat Feb 5 04:12:32 2022 +*************** +*** 64,73 **** +--- 64,90 ---- + } + } + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return par1 == 0 ? (this.isRepeaterPowered ? Block.torchRedstoneActive.getBlockTextureFromSide(par1) : Block.torchRedstoneIdle.getBlockTextureFromSide(par1)) : (par1 == 1 ? this.blockIcon : Block.stoneDoubleSlab.getBlockTextureFromSide(1)); ++ } ++ ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) ++ { ++ return par5 != 0 && par5 != 1; ++ } ++ ++ /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 36; +*************** +*** 215,225 **** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) + { + int var7 = ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4; +! par1World.setBlockMetadata(par2, par3, par4, var7, 3); + boolean var8 = this.isGettingInput(par1World, par2, par3, par4, var7); + + if (var8) + { + par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, 1); +--- 232,242 ---- + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) + { + int var7 = ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4; +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 3); + boolean var8 = this.isGettingInput(par1World, par2, par3, par4, var7); + + if (var8) + { + par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, 1); +*** BlockRedstoneOre.java Sat Feb 5 04:13:12 2022 +--- BlockRedstoneOre.java Sat Feb 5 04:12:32 2022 +*************** +*** 114,123 **** +--- 114,134 ---- + this.dropXpOnBlockBreak(par1World, par2, par3, par4, var8); + } + } + + /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) ++ { ++ if (this.glowing) ++ { ++ this.sparkle(par1World, par2, par3, par4); ++ } ++ } ++ ++ /** + * The redstone ore sparkles. + */ + private void sparkle(World par1World, int par2, int par3, int par4) + { + Random var5 = par1World.rand; +*** BlockRedstoneRepeater.java Sat Feb 5 04:13:12 2022 +--- BlockRedstoneRepeater.java Sat Feb 5 04:12:32 2022 +*************** +*** 21,31 **** + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) + { + int var10 = par1World.getBlockMetadata(par2, par3, par4); + int var11 = (var10 & 12) >> 2; + var11 = var11 + 1 << 2 & 12; +! par1World.setBlockMetadata(par2, par3, par4, var11 | var10 & 3, 3); + return true; + } + + protected int func_94481_j_(int par1) + { +--- 21,31 ---- + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) + { + int var10 = par1World.getBlockMetadata(par2, par3, par4); + int var11 = (var10 & 12) >> 2; + var11 = var11 + 1 << 2 & 12; +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var11 | var10 & 3, 3); + return true; + } + + protected int func_94481_j_(int par1) + { +*************** +*** 49,58 **** +--- 49,66 ---- + { + return Item.redstoneRepeater.itemID; + } + + /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return Item.redstoneRepeater.itemID; ++ } ++ ++ /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 15; +*************** +*** 64,73 **** +--- 72,143 ---- + } + + protected boolean func_94477_d(int par1) + { + return isRedstoneRepeaterBlockID(par1); ++ } ++ ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) ++ { ++ if (this.isRepeaterPowered) ++ { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ int var7 = getDirection(var6); ++ double var8 = (double)((float)par2 + 0.5F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D; ++ double var10 = (double)((float)par3 + 0.4F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D; ++ double var12 = (double)((float)par4 + 0.5F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D; ++ double var14 = 0.0D; ++ double var16 = 0.0D; ++ ++ if (par5Random.nextInt(2) == 0) ++ { ++ switch (var7) ++ { ++ case 0: ++ var16 = -0.3125D; ++ break; ++ ++ case 1: ++ var14 = 0.3125D; ++ break; ++ ++ case 2: ++ var16 = 0.3125D; ++ break; ++ ++ case 3: ++ var14 = -0.3125D; ++ } ++ } ++ else ++ { ++ int var18 = (var6 & 12) >> 2; ++ ++ switch (var7) ++ { ++ case 0: ++ var16 = repeaterTorchOffset[var18]; ++ break; ++ ++ case 1: ++ var14 = -repeaterTorchOffset[var18]; ++ break; ++ ++ case 2: ++ var16 = -repeaterTorchOffset[var18]; ++ break; ++ ++ case 3: ++ var14 = repeaterTorchOffset[var18]; ++ } ++ } ++ ++ par1World.spawnParticle("reddust", var8 + var14, var10, var12 + var16, 0.0D, 0.0D, 0.0D); ++ } + } + + /** + * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a + * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old +*** BlockRedstoneTorch.java Sat Feb 5 04:13:12 2022 +--- BlockRedstoneTorch.java Sat Feb 5 04:12:32 2022 +*************** +*** 210,219 **** +--- 210,264 ---- + { + return true; + } + + /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) ++ { ++ if (this.torchActive) ++ { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ double var7 = (double)((float)par2 + 0.5F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D; ++ double var9 = (double)((float)par3 + 0.7F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D; ++ double var11 = (double)((float)par4 + 0.5F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D; ++ double var13 = 0.2199999988079071D; ++ double var15 = 0.27000001072883606D; ++ ++ if (var6 == 1) ++ { ++ par1World.spawnParticle("reddust", var7 - var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); ++ } ++ else if (var6 == 2) ++ { ++ par1World.spawnParticle("reddust", var7 + var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); ++ } ++ else if (var6 == 3) ++ { ++ par1World.spawnParticle("reddust", var7, var9 + var13, var11 - var15, 0.0D, 0.0D, 0.0D); ++ } ++ else if (var6 == 4) ++ { ++ par1World.spawnParticle("reddust", var7, var9 + var13, var11 + var15, 0.0D, 0.0D, 0.0D); ++ } ++ else ++ { ++ par1World.spawnParticle("reddust", var7, var9, var11, 0.0D, 0.0D, 0.0D); ++ } ++ } ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return Block.torchRedstoneActive.blockID; ++ } ++ ++ /** + * Returns true if the given block ID is equivalent to this one. Example: redstoneTorchOn matches itself and + * redstoneTorchOff, and vice versa. Most blocks only match themselves. + */ + public boolean isAssociatedBlockID(int par1) + { +*** BlockRedstoneWire.java Sat Feb 5 04:13:12 2022 +--- BlockRedstoneWire.java Sat Feb 5 04:12:32 2022 +*************** +*** 11,20 **** +--- 11,24 ---- + * When false, power transmission methods do not look at other redstone wires. Used internally during + * updateCurrentStrength. + */ + private boolean wiresProvidePower = true; + private Set blocksNeedingUpdate = new HashSet(); ++ private Icon field_94413_c; ++ private Icon field_94410_cO; ++ private Icon field_94411_cP; ++ private Icon field_94412_cQ; + + public BlockRedstoneWire(int par1) + { + super(par1, Material.circuits); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F); +*************** +*** 53,62 **** +--- 57,75 ---- + { + return 5; + } + + /** ++ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called ++ * when first determining what to render. ++ */ ++ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) ++ { ++ return 8388608; ++ } ++ ++ /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) + { + return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) || par1World.getBlockId(par2, par3 - 1, par4) == Block.glowStone.blockID; +*************** +*** 156,166 **** + var15 = var10; + } + + if (var8 != var15) + { +! par1World.setBlockMetadata(par2, par3, par4, var15, 2); + this.blocksNeedingUpdate.add(new ChunkPosition(par2, par3, par4)); + this.blocksNeedingUpdate.add(new ChunkPosition(par2 - 1, par3, par4)); + this.blocksNeedingUpdate.add(new ChunkPosition(par2 + 1, par3, par4)); + this.blocksNeedingUpdate.add(new ChunkPosition(par2, par3 - 1, par4)); + this.blocksNeedingUpdate.add(new ChunkPosition(par2, par3 + 1, par4)); +--- 169,179 ---- + var15 = var10; + } + + if (var8 != var15) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var15, 2); + this.blocksNeedingUpdate.add(new ChunkPosition(par2, par3, par4)); + this.blocksNeedingUpdate.add(new ChunkPosition(par2 - 1, par3, par4)); + this.blocksNeedingUpdate.add(new ChunkPosition(par2 + 1, par3, par4)); + this.blocksNeedingUpdate.add(new ChunkPosition(par2, par3 - 1, par4)); + this.blocksNeedingUpdate.add(new ChunkPosition(par2, par3 + 1, par4)); +*************** +*** 426,435 **** +--- 439,485 ---- + { + return this.wiresProvidePower; + } + + /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) ++ { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if (var6 > 0) ++ { ++ double var7 = (double)par2 + 0.5D + ((double)par5Random.nextFloat() - 0.5D) * 0.2D; ++ double var9 = (double)((float)par3 + 0.0625F); ++ double var11 = (double)par4 + 0.5D + ((double)par5Random.nextFloat() - 0.5D) * 0.2D; ++ float var13 = (float)var6 / 15.0F; ++ float var14 = var13 * 0.6F + 0.4F; ++ ++ if (var6 == 0) ++ { ++ var14 = 0.0F; ++ } ++ ++ float var15 = var13 * var13 * 0.7F - 0.5F; ++ float var16 = var13 * var13 * 0.6F - 0.7F; ++ ++ if (var15 < 0.0F) ++ { ++ var15 = 0.0F; ++ } ++ ++ if (var16 < 0.0F) ++ { ++ var16 = 0.0F; ++ } ++ ++ par1World.spawnParticle("reddust", var7, var9, var11, (double)var14, (double)var15, (double)var16); ++ } ++ } ++ ++ /** + * Returns true if redstone wire can connect to the specified block. Params: World, X, Y, Z, side (not a normal + * notch-side, this can be 0, 1, 2, 3 or -1) + */ + public static boolean isPowerProviderOrWire(IBlockAccess par0IBlockAccess, int par1, int par2, int par3, int par4) + { +*************** +*** 476,482 **** +--- 526,558 ---- + else + { + return false; + } + } ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return Item.redstone.itemID; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.field_94413_c = par1IconRegister.registerIcon(this.getTextureName() + "_" + "cross"); ++ this.field_94410_cO = par1IconRegister.registerIcon(this.getTextureName() + "_" + "line"); ++ this.field_94411_cP = par1IconRegister.registerIcon(this.getTextureName() + "_" + "cross_overlay"); ++ this.field_94412_cQ = par1IconRegister.registerIcon(this.getTextureName() + "_" + "line_overlay"); ++ this.blockIcon = this.field_94413_c; ++ } ++ ++ public static Icon getRedstoneWireIcon(String par0Str) ++ { ++ return par0Str.equals("cross") ? Block.redstoneWire.field_94413_c : (par0Str.equals("line") ? Block.redstoneWire.field_94410_cO : (par0Str.equals("cross_overlay") ? Block.redstoneWire.field_94411_cP : (par0Str.equals("line_overlay") ? Block.redstoneWire.field_94412_cQ : null))); + } + } +*** BlockReed.java Sat Feb 5 04:13:12 2022 +--- BlockReed.java Sat Feb 5 04:12:32 2022 +*************** +*** 31,45 **** + int var7 = par1World.getBlockMetadata(par2, par3, par4); + + if (var7 == 15) + { + par1World.setBlock(par2, par3 + 1, par4, this.blockID); +! par1World.setBlockMetadata(par2, par3, par4, 0, 4); + } + else + { +! par1World.setBlockMetadata(par2, par3, par4, var7 + 1, 4); + } + } + } + } + +--- 31,45 ---- + int var7 = par1World.getBlockMetadata(par2, par3, par4); + + if (var7 == 15) + { + par1World.setBlock(par2, par3 + 1, par4, this.blockID); +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 0, 4); + } + else + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 + 1, 4); + } + } + } + } + +*************** +*** 119,125 **** +--- 119,133 ---- + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 1; ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return Item.reed.itemID; + } + } +*** BlockRotatedPillar.java Sat Feb 5 04:13:12 2022 +--- BlockRotatedPillar.java Sat Feb 5 04:12:32 2022 +*************** +*** 1,9 **** +--- 1,11 ---- + package net.minecraft.src; + + public abstract class BlockRotatedPillar extends Block + { ++ protected Icon field_111051_a; ++ + protected BlockRotatedPillar(int par1, Material par2Material) + { + super(par1, par2Material); + } + +*************** +*** 39,48 **** +--- 41,73 ---- + case 5: + var11 = 4; + } + + return var10 | var11; ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ int var3 = par2 & 12; ++ int var4 = par2 & 3; ++ return var3 == 0 && (par1 == 1 || par1 == 0) ? this.getEndIcon(var4) : (var3 == 4 && (par1 == 5 || par1 == 4) ? this.getEndIcon(var4) : (var3 == 8 && (par1 == 2 || par1 == 3) ? this.getEndIcon(var4) : this.getSideIcon(var4))); ++ } ++ ++ /** ++ * The icon for the side of the block. ++ */ ++ protected abstract Icon getSideIcon(int var1); ++ ++ /** ++ * The icon for the tops and bottoms of the block. ++ */ ++ protected Icon getEndIcon(int par1) ++ { ++ return this.field_111051_a; + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ +*** BlockSand.java Sat Feb 5 04:13:12 2022 +--- BlockSand.java Sat Feb 5 04:12:32 2022 +*** BlockSandStone.java Sat Feb 5 04:13:12 2022 +--- BlockSandStone.java Sat Feb 5 04:12:32 2022 +*************** +*** 1,21 **** +--- 1,80 ---- + package net.minecraft.src; + ++ import java.util.List; ++ + public class BlockSandStone extends Block + { + public static final String[] SAND_STONE_TYPES = new String[] {"default", "chiseled", "smooth"}; + private static final String[] field_94405_b = new String[] {"normal", "carved", "smooth"}; ++ private Icon[] field_94406_c; ++ private Icon field_94403_cO; ++ private Icon field_94404_cP; + + public BlockSandStone(int par1) + { + super(par1, Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ if (par1 != 1 && (par1 != 0 || par2 != 1 && par2 != 2)) ++ { ++ if (par1 == 0) ++ { ++ return this.field_94404_cP; ++ } ++ else ++ { ++ if (par2 < 0 || par2 >= this.field_94406_c.length) ++ { ++ par2 = 0; ++ } ++ ++ return this.field_94406_c[par2]; ++ } ++ } ++ else ++ { ++ return this.field_94403_cO; ++ } ++ } ++ ++ /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int par1) + { + return par1; ++ } ++ ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) ++ { ++ par3List.add(new ItemStack(par1, 1, 0)); ++ par3List.add(new ItemStack(par1, 1, 1)); ++ par3List.add(new ItemStack(par1, 1, 2)); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.field_94406_c = new Icon[field_94405_b.length]; ++ ++ for (int var2 = 0; var2 < this.field_94406_c.length; ++var2) ++ { ++ this.field_94406_c[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + field_94405_b[var2]); ++ } ++ ++ this.field_94403_cO = par1IconRegister.registerIcon(this.getTextureName() + "_top"); ++ this.field_94404_cP = par1IconRegister.registerIcon(this.getTextureName() + "_bottom"); + } + } +*** BlockSapling.java Sat Feb 5 04:13:12 2022 +--- BlockSapling.java Sat Feb 5 04:12:32 2022 +*************** +*** 1,12 **** +--- 1,14 ---- + package net.minecraft.src; + ++ import java.util.List; + import java.util.Random; + + public class BlockSapling extends BlockFlower + { + public static final String[] WOOD_TYPES = new String[] {"oak", "spruce", "birch", "jungle"}; ++ private Icon[] saplingIcon; + + protected BlockSapling(int par1) + { + super(par1); + float var2 = 0.4F; +*************** +*** 28,44 **** + this.markOrGrowMarked(par1World, par2, par3, par4, par5Random); + } + } + } + + public void markOrGrowMarked(World par1World, int par2, int par3, int par4, Random par5Random) + { + int var6 = par1World.getBlockMetadata(par2, par3, par4); + + if ((var6 & 8) == 0) + { +! par1World.setBlockMetadata(par2, par3, par4, var6 | 8, 4); + } + else + { + this.growTree(par1World, par2, par3, par4, par5Random); + } +--- 30,55 ---- + this.markOrGrowMarked(par1World, par2, par3, par4, par5Random); + } + } + } + ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ par2 &= 3; ++ return this.saplingIcon[par2]; ++ } ++ + public void markOrGrowMarked(World par1World, int par2, int par3, int par4, Random par5Random) + { + int var6 = par1World.getBlockMetadata(par2, par3, par4); + + if ((var6 & 8) == 0) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 | 8, 4); + } + else + { + this.growTree(par1World, par2, par3, par4, par5Random); + } +*************** +*** 140,146 **** +--- 151,182 ---- + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int par1) + { + return par1 & 3; ++ } ++ ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) ++ { ++ par3List.add(new ItemStack(par1, 1, 0)); ++ par3List.add(new ItemStack(par1, 1, 1)); ++ par3List.add(new ItemStack(par1, 1, 2)); ++ par3List.add(new ItemStack(par1, 1, 3)); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.saplingIcon = new Icon[WOOD_TYPES.length]; ++ ++ for (int var2 = 0; var2 < this.saplingIcon.length; ++var2) ++ { ++ this.saplingIcon[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + WOOD_TYPES[var2]); ++ } + } + } +*** BlockSign.java Sat Feb 5 04:13:12 2022 +--- BlockSign.java Sat Feb 5 04:12:32 2022 +*************** +*** 18,36 **** +--- 18,53 ---- + float var5 = 1.0F; + this.setBlockBounds(0.5F - var4, 0.0F, 0.5F - var4, 0.5F + var4, var5, 0.5F + var4); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return Block.planks.getBlockTextureFromSide(par1); ++ } ++ ++ /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) + { + return null; + } + + /** ++ * Returns the bounding box of the wired rectangular prism to render. ++ */ ++ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) ++ { ++ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); ++ return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); ++ } ++ ++ /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) + { + if (!this.isFreestanding) +*************** +*** 165,170 **** +--- 182,201 ---- + par1World.setBlockToAir(par2, par3, par4); + } + + super.onNeighborBlockChange(par1World, par2, par3, par4, par5); + } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return Item.sign.itemID; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) {} + } +*** BlockSilverfish.java Sat Feb 5 04:13:12 2022 +--- BlockSilverfish.java Sat Feb 5 04:12:32 2022 +*************** +*** 1,7 **** +--- 1,8 ---- + package net.minecraft.src; + ++ import java.util.List; + import java.util.Random; + + public class BlockSilverfish extends Block + { + /** Block names that can be a silverfish stone. */ +*************** +*** 13,22 **** +--- 14,37 ---- + this.setHardness(0.0F); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return par2 == 1 ? Block.cobblestone.getBlockTextureFromSide(par1) : (par2 == 2 ? Block.stoneBrick.getBlockTextureFromSide(par1) : Block.stone.getBlockTextureFromSide(par1)); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) {} ++ ++ /** + * Called right before the block is destroyed by a player. Args: world, x, y, z, metaData + */ + public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) + { + if (!par1World.isRemote) +*************** +*** 80,86 **** +--- 95,112 ---- + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World par1World, int par2, int par3, int par4) + { + return par1World.getBlockMetadata(par2, par3, par4); ++ } ++ ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) ++ { ++ for (int var4 = 0; var4 < 3; ++var4) ++ { ++ par3List.add(new ItemStack(par1, 1, var4)); ++ } + } + } +*** BlockSkull.java Sat Feb 5 04:13:12 2022 +--- BlockSkull.java Sat Feb 5 04:12:32 2022 +*************** +*** 80,90 **** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) + { + int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; +! par1World.setBlockMetadata(par2, par3, par4, var7, 2); + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ +--- 80,90 ---- + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) + { + int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ +*************** +*** 92,101 **** +--- 92,109 ---- + { + return new TileEntitySkull(); + } + + /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return Item.skull.itemID; ++ } ++ ++ /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World par1World, int par2, int par3, int par4) + { + TileEntity var5 = par1World.getBlockTileEntity(par2, par3, par4); +*************** +*** 121,131 **** + public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) + { + if (par6EntityPlayer.capabilities.isCreativeMode) + { + par5 |= 8; +! par1World.setBlockMetadata(par2, par3, par4, par5, 4); + } + + super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer); + } + +--- 129,139 ---- + public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) + { + if (par6EntityPlayer.capabilities.isCreativeMode) + { + par5 |= 8; +! par1World.setBlockMetadataWithNotify(par2, par3, par4, par5, 4); + } + + super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer); + } + +*************** +*** 178,190 **** + + for (var7 = -2; var7 <= 0; ++var7) + { + if (par1World.getBlockId(par2, par3 - 1, par4 + var7) == var6 && par1World.getBlockId(par2, par3 - 1, par4 + var7 + 1) == var6 && par1World.getBlockId(par2, par3 - 2, par4 + var7 + 1) == var6 && par1World.getBlockId(par2, par3 - 1, par4 + var7 + 2) == var6 && this.func_82528_d(par1World, par2, par3, par4 + var7, 1) && this.func_82528_d(par1World, par2, par3, par4 + var7 + 1, 1) && this.func_82528_d(par1World, par2, par3, par4 + var7 + 2, 1)) + { +! par1World.setBlockMetadata(par2, par3, par4 + var7, 8, 2); +! par1World.setBlockMetadata(par2, par3, par4 + var7 + 1, 8, 2); +! par1World.setBlockMetadata(par2, par3, par4 + var7 + 2, 8, 2); + par1World.setBlock(par2, par3, par4 + var7, 0, 0, 2); + par1World.setBlock(par2, par3, par4 + var7 + 1, 0, 0, 2); + par1World.setBlock(par2, par3, par4 + var7 + 2, 0, 0, 2); + par1World.setBlock(par2, par3 - 1, par4 + var7, 0, 0, 2); + par1World.setBlock(par2, par3 - 1, par4 + var7 + 1, 0, 0, 2); +--- 186,198 ---- + + for (var7 = -2; var7 <= 0; ++var7) + { + if (par1World.getBlockId(par2, par3 - 1, par4 + var7) == var6 && par1World.getBlockId(par2, par3 - 1, par4 + var7 + 1) == var6 && par1World.getBlockId(par2, par3 - 2, par4 + var7 + 1) == var6 && par1World.getBlockId(par2, par3 - 1, par4 + var7 + 2) == var6 && this.func_82528_d(par1World, par2, par3, par4 + var7, 1) && this.func_82528_d(par1World, par2, par3, par4 + var7 + 1, 1) && this.func_82528_d(par1World, par2, par3, par4 + var7 + 2, 1)) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4 + var7, 8, 2); +! par1World.setBlockMetadataWithNotify(par2, par3, par4 + var7 + 1, 8, 2); +! par1World.setBlockMetadataWithNotify(par2, par3, par4 + var7 + 2, 8, 2); + par1World.setBlock(par2, par3, par4 + var7, 0, 0, 2); + par1World.setBlock(par2, par3, par4 + var7 + 1, 0, 0, 2); + par1World.setBlock(par2, par3, par4 + var7 + 2, 0, 0, 2); + par1World.setBlock(par2, par3 - 1, par4 + var7, 0, 0, 2); + par1World.setBlock(par2, par3 - 1, par4 + var7 + 1, 0, 0, 2); +*************** +*** 218,230 **** + + for (var7 = -2; var7 <= 0; ++var7) + { + if (par1World.getBlockId(par2 + var7, par3 - 1, par4) == var6 && par1World.getBlockId(par2 + var7 + 1, par3 - 1, par4) == var6 && par1World.getBlockId(par2 + var7 + 1, par3 - 2, par4) == var6 && par1World.getBlockId(par2 + var7 + 2, par3 - 1, par4) == var6 && this.func_82528_d(par1World, par2 + var7, par3, par4, 1) && this.func_82528_d(par1World, par2 + var7 + 1, par3, par4, 1) && this.func_82528_d(par1World, par2 + var7 + 2, par3, par4, 1)) + { +! par1World.setBlockMetadata(par2 + var7, par3, par4, 8, 2); +! par1World.setBlockMetadata(par2 + var7 + 1, par3, par4, 8, 2); +! par1World.setBlockMetadata(par2 + var7 + 2, par3, par4, 8, 2); + par1World.setBlock(par2 + var7, par3, par4, 0, 0, 2); + par1World.setBlock(par2 + var7 + 1, par3, par4, 0, 0, 2); + par1World.setBlock(par2 + var7 + 2, par3, par4, 0, 0, 2); + par1World.setBlock(par2 + var7, par3 - 1, par4, 0, 0, 2); + par1World.setBlock(par2 + var7 + 1, par3 - 1, par4, 0, 0, 2); +--- 226,238 ---- + + for (var7 = -2; var7 <= 0; ++var7) + { + if (par1World.getBlockId(par2 + var7, par3 - 1, par4) == var6 && par1World.getBlockId(par2 + var7 + 1, par3 - 1, par4) == var6 && par1World.getBlockId(par2 + var7 + 1, par3 - 2, par4) == var6 && par1World.getBlockId(par2 + var7 + 2, par3 - 1, par4) == var6 && this.func_82528_d(par1World, par2 + var7, par3, par4, 1) && this.func_82528_d(par1World, par2 + var7 + 1, par3, par4, 1) && this.func_82528_d(par1World, par2 + var7 + 2, par3, par4, 1)) + { +! par1World.setBlockMetadataWithNotify(par2 + var7, par3, par4, 8, 2); +! par1World.setBlockMetadataWithNotify(par2 + var7 + 1, par3, par4, 8, 2); +! par1World.setBlockMetadataWithNotify(par2 + var7 + 2, par3, par4, 8, 2); + par1World.setBlock(par2 + var7, par3, par4, 0, 0, 2); + par1World.setBlock(par2 + var7 + 1, par3, par4, 0, 0, 2); + par1World.setBlock(par2 + var7 + 2, par3, par4, 0, 0, 2); + par1World.setBlock(par2 + var7, par3 - 1, par4, 0, 0, 2); + par1World.setBlock(par2 + var7 + 1, par3 - 1, par4, 0, 0, 2); +*************** +*** 266,272 **** +--- 274,302 ---- + else + { + TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4); + return var6 != null && var6 instanceof TileEntitySkull ? ((TileEntitySkull)var6).getSkullType() == par5 : false; + } ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) {} ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return Block.slowSand.getBlockTextureFromSide(par1); ++ } ++ ++ /** ++ * Gets the icon name of the ItemBlock corresponding to this block. Used by hoppers. ++ */ ++ public String getItemIconName() ++ { ++ return this.getTextureName() + "_" + ItemSkull.field_94587_a[0]; + } + } +*** BlockSnow.java Sat Feb 5 04:13:12 2022 +--- BlockSnow.java Sat Feb 5 04:12:32 2022 +*************** +*** 12,21 **** +--- 12,30 ---- + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setBlockBoundsForSnowDepth(0); + } + + /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon("snow"); ++ } ++ ++ /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) + { +*************** +*** 139,145 **** +--- 148,163 ---- + if (par1World.getSavedLightValue(EnumSkyBlock.Block, par2, par3, par4) > 11) + { + this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); + par1World.setBlockToAir(par2, par3, par4); + } ++ } ++ ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) ++ { ++ return par5 == 1 ? true : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); + } + } +*** BlockSnowBlock.java Sat Feb 5 04:13:12 2022 +--- BlockSnowBlock.java Sat Feb 5 04:12:32 2022 +*** BlockSoulSand.java Sat Feb 5 04:13:12 2022 +--- BlockSoulSand.java Sat Feb 5 04:12:32 2022 +*** BlockSourceImpl.java Sat Feb 5 04:13:12 2022 +--- BlockSourceImpl.java Sat Feb 5 04:12:32 2022 +*** BlockSponge.java Sat Feb 5 04:13:12 2022 +--- BlockSponge.java Sat Feb 5 04:12:32 2022 +*** BlockStairs.java Sat Feb 5 04:13:12 2022 +--- BlockStairs.java Sat Feb 5 04:12:32 2022 +*************** +*** 355,364 **** +--- 355,372 ---- + + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) ++ { ++ this.modelBlock.randomDisplayTick(par1World, par2, par3, par4, par5Random); ++ } ++ ++ /** + * Called when the block is clicked by a player. Args: x, y, z, entityPlayer + */ + public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) + { + this.modelBlock.onBlockClicked(par1World, par2, par3, par4, par5EntityPlayer); +*************** +*** 371,396 **** +--- 379,444 ---- + { + this.modelBlock.onBlockDestroyedByPlayer(par1World, par2, par3, par4, par5); + } + + /** ++ * Goes straight to getLightBrightnessForSkyBlocks for Blocks, does some fancy computing for Fluids ++ */ ++ public int getMixedBrightnessForBlock(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) ++ { ++ return this.modelBlock.getMixedBrightnessForBlock(par1IBlockAccess, par2, par3, par4); ++ } ++ ++ /** ++ * How bright to render this block based on the light its receiving. Args: iBlockAccess, x, y, z ++ */ ++ public float getBlockBrightness(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) ++ { ++ return this.modelBlock.getBlockBrightness(par1IBlockAccess, par2, par3, par4); ++ } ++ ++ /** + * Returns how much this block can resist explosions from the passed in entity. + */ + public float getExplosionResistance(Entity par1Entity) + { + return this.modelBlock.getExplosionResistance(par1Entity); + } + + /** ++ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha ++ */ ++ public int getRenderBlockPass() ++ { ++ return this.modelBlock.getRenderBlockPass(); ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return this.modelBlock.getIcon(par1, this.modelBlockMetadata); ++ } ++ ++ /** + * How many world ticks before ticking + */ + public int tickRate(World par1World) + { + return this.modelBlock.tickRate(par1World); + } + + /** ++ * Returns the bounding box of the wired rectangular prism to render. ++ */ ++ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) ++ { ++ return this.modelBlock.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); ++ } ++ ++ /** + * Can add to the passed in vector for a movement vector to be applied to the entity. Args: x, y, z, entity, vec3d + */ + public void velocityToAddToEntity(World par1World, int par2, int par3, int par4, Entity par5Entity, Vec3 par6Vec3) + { + this.modelBlock.velocityToAddToEntity(par1World, par2, par3, par4, par5Entity, par6Vec3); +*************** +*** 403,413 **** + { + return this.modelBlock.isCollidable(); + } + + /** +! * Returns whether this block is collideable based on the arguments passed in Args: blockMetaData, unknownFlag + */ + public boolean canCollideCheck(int par1, boolean par2) + { + return this.modelBlock.canCollideCheck(par1, par2); + } +--- 451,462 ---- + { + return this.modelBlock.isCollidable(); + } + + /** +! * Returns whether this block is collideable based on the arguments passed in \n@param par1 block metaData \n@param +! * par2 whether the player right-clicked while holding a boat + */ + public boolean canCollideCheck(int par1, boolean par2) + { + return this.modelBlock.canCollideCheck(par1, par2); + } +*************** +*** 479,504 **** + int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + int var8 = par1World.getBlockMetadata(par2, par3, par4) & 4; + + if (var7 == 0) + { +! par1World.setBlockMetadata(par2, par3, par4, 2 | var8, 2); + } + + if (var7 == 1) + { +! par1World.setBlockMetadata(par2, par3, par4, 1 | var8, 2); + } + + if (var7 == 2) + { +! par1World.setBlockMetadata(par2, par3, par4, 3 | var8, 2); + } + + if (var7 == 3) + { +! par1World.setBlockMetadata(par2, par3, par4, 0 | var8, 2); + } + } + + /** + * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata +--- 528,553 ---- + int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + int var8 = par1World.getBlockMetadata(par2, par3, par4) & 4; + + if (var7 == 0) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 2 | var8, 2); + } + + if (var7 == 1) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 1 | var8, 2); + } + + if (var7 == 2) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 3 | var8, 2); + } + + if (var7 == 3) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 0 | var8, 2); + } + } + + /** + * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata +*************** +*** 573,578 **** +--- 622,633 ---- + } + } + + return var22; + } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) {} + } +*** BlockStationary.java Sat Feb 5 04:13:12 2022 +--- BlockStationary.java Sat Feb 5 04:12:32 2022 +*** BlockStem.java Sat Feb 5 04:13:12 2022 +--- BlockStem.java Sat Feb 5 04:12:32 2022 +*************** +*** 4,13 **** +--- 4,14 ---- + + public class BlockStem extends BlockFlower + { + /** Defines if it is a Melon or a Pumpkin that the stem is producing. */ + private final Block fruitType; ++ private Icon theIcon; + + protected BlockStem(int par1, Block par2Block) + { + super(par1); + this.fruitType = par2Block; +*************** +*** 42,52 **** + int var7 = par1World.getBlockMetadata(par2, par3, par4); + + if (var7 < 7) + { + ++var7; +! par1World.setBlockMetadata(par2, par3, par4, var7, 2); + } + else + { + if (par1World.getBlockId(par2 - 1, par3, par4) == this.fruitType.blockID) + { +--- 43,53 ---- + int var7 = par1World.getBlockMetadata(par2, par3, par4); + + if (var7 < 7) + { + ++var7; +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); + } + else + { + if (par1World.getBlockId(par2 - 1, par3, par4) == this.fruitType.blockID) + { +*************** +*** 110,120 **** + if (var5 > 7) + { + var5 = 7; + } + +! par1World.setBlockMetadata(par2, par3, par4, var5, 2); + } + + private float getGrowthModifier(World par1World, int par2, int par3, int par4) + { + float var5 = 1.0F; +--- 111,121 ---- + if (var5 > 7) + { + var5 = 7; + } + +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var5, 2); + } + + private float getGrowthModifier(World par1World, int par2, int par3, int par4) + { + float var5 = 1.0F; +*************** +*** 163,172 **** +--- 164,193 ---- + + return var5; + } + + /** ++ * Returns the color this block should be rendered. Used by leaves. ++ */ ++ public int getRenderColor(int par1) ++ { ++ int var2 = par1 * 32; ++ int var3 = 255 - par1 * 8; ++ int var4 = par1 * 4; ++ return var2 << 16 | var3 << 8 | var4; ++ } ++ ++ /** ++ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called ++ * when first determining what to render. ++ */ ++ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) ++ { ++ return this.getRenderColor(par1IBlockAccess.getBlockMetadata(par2, par3, par4)); ++ } ++ ++ /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() + { + float var1 = 0.125F; +*************** +*** 190,199 **** +--- 211,230 ---- + { + return 19; + } + + /** ++ * Returns the current state of the stem. Returns -1 if the stem is not fully grown, or a value between 0 and 3 ++ * based on the direction the stem is facing. ++ */ ++ public int getState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) ++ { ++ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); ++ return var5 < 7 ? -1 : (par1IBlockAccess.getBlockId(par2 - 1, par3, par4) == this.fruitType.blockID ? 0 : (par1IBlockAccess.getBlockId(par2 + 1, par3, par4) == this.fruitType.blockID ? 1 : (par1IBlockAccess.getBlockId(par2, par3, par4 - 1) == this.fruitType.blockID ? 2 : (par1IBlockAccess.getBlockId(par2, par3, par4 + 1) == this.fruitType.blockID ? 3 : -1)))); ++ } ++ ++ /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) + { + super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); +*************** +*** 234,240 **** +--- 265,294 ---- + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random par1Random) + { + return 1; ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return this.fruitType == Block.pumpkin ? Item.pumpkinSeeds.itemID : (this.fruitType == Block.melon ? Item.melonSeeds.itemID : 0); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_disconnected"); ++ this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_connected"); ++ } ++ ++ public Icon getStemIcon() ++ { ++ return this.theIcon; + } + } +*** BlockStep.java Sat Feb 5 04:13:12 2022 +--- BlockStep.java Sat Feb 5 04:12:32 2022 +*************** +*** 1,21 **** +--- 1,48 ---- + package net.minecraft.src; + ++ import java.util.List; + import java.util.Random; + + public class BlockStep extends BlockHalfSlab + { + /** The list of the types of step blocks. */ + public static final String[] blockStepTypes = new String[] {"stone", "sand", "wood", "cobble", "brick", "smoothStoneBrick", "netherBrick", "quartz"}; ++ private Icon theIcon; + + public BlockStep(int par1, boolean par2) + { + super(par1, par2, Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ int var3 = par2 & 7; ++ ++ if (this.isDoubleSlab && (par2 & 8) != 0) ++ { ++ par1 = 1; ++ } ++ ++ return var3 == 0 ? (par1 != 1 && par1 != 0 ? this.theIcon : this.blockIcon) : (var3 == 1 ? Block.sandStone.getBlockTextureFromSide(par1) : (var3 == 2 ? Block.planks.getBlockTextureFromSide(par1) : (var3 == 3 ? Block.cobblestone.getBlockTextureFromSide(par1) : (var3 == 4 ? Block.brick.getBlockTextureFromSide(par1) : (var3 == 5 ? Block.stoneBrick.getIcon(par1, 0) : (var3 == 6 ? Block.netherBrick.getBlockTextureFromSide(1) : (var3 == 7 ? Block.blockNetherQuartz.getBlockTextureFromSide(par1) : this.blockIcon))))))); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon("stone_slab_top"); ++ this.theIcon = par1IconRegister.registerIcon("stone_slab_side"); ++ } ++ ++ /** + * Returns the ID of the items to drop on destruction. + */ + public int idDropped(int par1, Random par2Random, int par3) + { + return Block.stoneSingleSlab.blockID; +*************** +*** 39,45 **** +--- 66,89 ---- + { + par1 = 0; + } + + return super.getUnlocalizedName() + "." + blockStepTypes[par1]; ++ } ++ ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) ++ { ++ if (par1 != Block.stoneDoubleSlab.blockID) ++ { ++ for (int var4 = 0; var4 <= 7; ++var4) ++ { ++ if (var4 != 2) ++ { ++ par3List.add(new ItemStack(par1, 1, var4)); ++ } ++ } ++ } + } + } +*** BlockStone.java Sat Feb 5 04:13:12 2022 +--- BlockStone.java Sat Feb 5 04:12:32 2022 +*** BlockStoneBrick.java Sat Feb 5 04:13:12 2022 +--- BlockStoneBrick.java Sat Feb 5 04:12:32 2022 +*************** +*** 1,21 **** +--- 1,69 ---- + package net.minecraft.src; + ++ import java.util.List; ++ + public class BlockStoneBrick extends Block + { + public static final String[] STONE_BRICK_TYPES = new String[] {"default", "mossy", "cracked", "chiseled"}; + public static final String[] field_94407_b = new String[] {null, "mossy", "cracked", "carved"}; ++ private Icon[] field_94408_c; + + public BlockStoneBrick(int par1) + { + super(par1, Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ if (par2 < 0 || par2 >= field_94407_b.length) ++ { ++ par2 = 0; ++ } ++ ++ return this.field_94408_c[par2]; ++ } ++ ++ /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int par1) + { + return par1; ++ } ++ ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) ++ { ++ for (int var4 = 0; var4 < 4; ++var4) ++ { ++ par3List.add(new ItemStack(par1, 1, var4)); ++ } ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.field_94408_c = new Icon[field_94407_b.length]; ++ ++ for (int var2 = 0; var2 < this.field_94408_c.length; ++var2) ++ { ++ String var3 = this.getTextureName(); ++ ++ if (field_94407_b[var2] != null) ++ { ++ var3 = var3 + "_" + field_94407_b[var2]; ++ } ++ ++ this.field_94408_c[var2] = par1IconRegister.registerIcon(var3); ++ } + } + } +*** BlockTallGrass.java Sat Feb 5 04:13:12 2022 +--- BlockTallGrass.java Sat Feb 5 04:12:32 2022 +*************** +*** 1,21 **** +--- 1,61 ---- + package net.minecraft.src; + ++ import java.util.List; + import java.util.Random; + + public class BlockTallGrass extends BlockFlower + { + private static final String[] grassTypes = new String[] {"deadbush", "tallgrass", "fern"}; ++ private Icon[] iconArray; + + protected BlockTallGrass(int par1) + { + super(par1, Material.vine); + float var2 = 0.4F; + this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, 0.8F, 0.5F + var2); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ if (par2 >= this.iconArray.length) ++ { ++ par2 = 0; ++ } ++ ++ return this.iconArray[par2]; ++ } ++ ++ public int getBlockColor() ++ { ++ double var1 = 0.5D; ++ double var3 = 1.0D; ++ return ColorizerGrass.getGrassColor(var1, var3); ++ } ++ ++ /** ++ * Returns the color this block should be rendered. Used by leaves. ++ */ ++ public int getRenderColor(int par1) ++ { ++ return par1 == 0 ? 16777215 : ColorizerFoliage.getFoliageColorBasic(); ++ } ++ ++ /** ++ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called ++ * when first determining what to render. ++ */ ++ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) ++ { ++ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); ++ return var5 == 0 ? 16777215 : par1IBlockAccess.getBiomeGenForCoords(par2, par4).getBiomeGrassColor(); ++ } ++ ++ /** + * Returns the ID of the items to drop on destruction. + */ + public int idDropped(int par1, Random par2Random, int par3) + { + return par2Random.nextInt(8) == 0 ? Item.seeds.itemID : -1; +*************** +*** 50,56 **** +--- 90,121 ---- + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World par1World, int par2, int par3, int par4) + { + return par1World.getBlockMetadata(par2, par3, par4); ++ } ++ ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) ++ { ++ for (int var4 = 1; var4 < 3; ++var4) ++ { ++ par3List.add(new ItemStack(par1, 1, var4)); ++ } ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.iconArray = new Icon[grassTypes.length]; ++ ++ for (int var2 = 0; var2 < this.iconArray.length; ++var2) ++ { ++ this.iconArray[var2] = par1IconRegister.registerIcon(grassTypes[var2]); ++ } + } + } +*** BlockTNT.java Sat Feb 5 04:13:12 2022 +--- BlockTNT.java Sat Feb 5 04:12:32 2022 +*************** +*** 2,18 **** +--- 2,29 ---- + + import java.util.Random; + + public class BlockTNT extends Block + { ++ private Icon field_94393_a; ++ private Icon field_94392_b; ++ + public BlockTNT(int par1) + { + super(par1, Material.tnt); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return par1 == 0 ? this.field_94392_b : (par1 == 1 ? this.field_94393_a : this.blockIcon); ++ } ++ ++ /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World par1World, int par2, int par3, int par4) + { + super.onBlockAdded(par1World, par2, par3, par4); +*************** +*** 121,127 **** +--- 132,149 ---- + * Return whether this block can drop from an explosion. + */ + public boolean canDropFromExplosion(Explosion par1Explosion) + { + return false; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); ++ this.field_94393_a = par1IconRegister.registerIcon(this.getTextureName() + "_top"); ++ this.field_94392_b = par1IconRegister.registerIcon(this.getTextureName() + "_bottom"); + } + } +*** BlockTorch.java Sat Feb 5 04:13:12 2022 +--- BlockTorch.java Sat Feb 5 04:12:32 2022 +*************** +*** 124,150 **** + { + if (par1World.getBlockMetadata(par2, par3, par4) == 0) + { + if (par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true)) + { +! par1World.setBlockMetadata(par2, par3, par4, 1, 2); + } + else if (par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true)) + { +! par1World.setBlockMetadata(par2, par3, par4, 2, 2); + } + else if (par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true)) + { +! par1World.setBlockMetadata(par2, par3, par4, 3, 2); + } + else if (par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true)) + { +! par1World.setBlockMetadata(par2, par3, par4, 4, 2); + } + else if (this.canPlaceTorchOn(par1World, par2, par3 - 1, par4)) + { +! par1World.setBlockMetadata(par2, par3, par4, 5, 2); + } + } + + this.dropTorchIfCantStay(par1World, par2, par3, par4); + } +--- 124,150 ---- + { + if (par1World.getBlockMetadata(par2, par3, par4) == 0) + { + if (par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true)) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 1, 2); + } + else if (par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true)) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2); + } + else if (par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true)) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); + } + else if (par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true)) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2); + } + else if (this.canPlaceTorchOn(par1World, par2, par3 - 1, par4)) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2); + } + } + + this.dropTorchIfCantStay(par1World, par2, par3, par4); + } +*************** +*** 259,265 **** +--- 259,304 ---- + var8 = 0.1F; + this.setBlockBounds(0.5F - var8, 0.0F, 0.5F - var8, 0.5F + var8, 0.6F, 0.5F + var8); + } + + return super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3, par6Vec3); ++ } ++ ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) ++ { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ double var7 = (double)((float)par2 + 0.5F); ++ double var9 = (double)((float)par3 + 0.7F); ++ double var11 = (double)((float)par4 + 0.5F); ++ double var13 = 0.2199999988079071D; ++ double var15 = 0.27000001072883606D; ++ ++ if (var6 == 1) ++ { ++ par1World.spawnParticle("smoke", var7 - var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); ++ par1World.spawnParticle("flame", var7 - var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); ++ } ++ else if (var6 == 2) ++ { ++ par1World.spawnParticle("smoke", var7 + var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); ++ par1World.spawnParticle("flame", var7 + var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); ++ } ++ else if (var6 == 3) ++ { ++ par1World.spawnParticle("smoke", var7, var9 + var13, var11 - var15, 0.0D, 0.0D, 0.0D); ++ par1World.spawnParticle("flame", var7, var9 + var13, var11 - var15, 0.0D, 0.0D, 0.0D); ++ } ++ else if (var6 == 4) ++ { ++ par1World.spawnParticle("smoke", var7, var9 + var13, var11 + var15, 0.0D, 0.0D, 0.0D); ++ par1World.spawnParticle("flame", var7, var9 + var13, var11 + var15, 0.0D, 0.0D, 0.0D); ++ } ++ else ++ { ++ par1World.spawnParticle("smoke", var7, var9, var11, 0.0D, 0.0D, 0.0D); ++ par1World.spawnParticle("flame", var7, var9, var11, 0.0D, 0.0D, 0.0D); ++ } + } + } +*** BlockTrapDoor.java Sat Feb 5 04:13:12 2022 +--- BlockTrapDoor.java Sat Feb 5 04:12:32 2022 +*************** +*** 40,49 **** +--- 40,58 ---- + { + return 0; + } + + /** ++ * Returns the bounding box of the wired rectangular prism to render. ++ */ ++ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) ++ { ++ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); ++ return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); ++ } ++ ++ /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) + { +*************** +*** 120,130 **** + return true; + } + else + { + int var10 = par1World.getBlockMetadata(par2, par3, par4); +! par1World.setBlockMetadata(par2, par3, par4, var10 ^ 4, 2); + par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0); + return true; + } + } + +--- 129,139 ---- + return true; + } + else + { + int var10 = par1World.getBlockMetadata(par2, par3, par4); +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var10 ^ 4, 2); + par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0); + return true; + } + } + +*************** +*** 133,143 **** + int var6 = par1World.getBlockMetadata(par2, par3, par4); + boolean var7 = (var6 & 4) > 0; + + if (var7 != par5) + { +! par1World.setBlockMetadata(par2, par3, par4, var6 ^ 4, 2); + par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0); + } + } + + /** +--- 142,152 ---- + int var6 = par1World.getBlockMetadata(par2, par3, par4); + boolean var7 = (var6 & 4) > 0; + + if (var7 != par5) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 ^ 4, 2); + par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0); + } + } + + /** +*** BlockTripWire.java Sat Feb 5 04:13:12 2022 +--- BlockTripWire.java Sat Feb 5 04:12:33 2022 +*************** +*** 46,55 **** +--- 46,63 ---- + { + return false; + } + + /** ++ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha ++ */ ++ public int getRenderBlockPass() ++ { ++ return 1; ++ } ++ ++ /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 30; +*************** +*** 62,71 **** +--- 70,87 ---- + { + return Item.silk.itemID; + } + + /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) ++ { ++ return Item.silk.itemID; ++ } ++ ++ /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor blockID + */ + public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) + { +*************** +*** 107,117 **** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World par1World, int par2, int par3, int par4) + { + int var5 = par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) ? 0 : 2; +! par1World.setBlockMetadata(par2, par3, par4, var5, 3); + this.func_72149_e(par1World, par2, par3, par4, var5); + } + + /** + * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a +--- 123,133 ---- + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World par1World, int par2, int par3, int par4) + { + int var5 = par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) ? 0 : 2; +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var5, 3); + this.func_72149_e(par1World, par2, par3, par4, var5); + } + + /** + * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a +*************** +*** 130,140 **** + { + if (!par1World.isRemote) + { + if (par6EntityPlayer.getCurrentEquippedItem() != null && par6EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.itemID) + { +! par1World.setBlockMetadata(par2, par3, par4, par5 | 8, 4); + } + } + } + + private void func_72149_e(World par1World, int par2, int par3, int par4, int par5) +--- 146,156 ---- + { + if (!par1World.isRemote) + { + if (par6EntityPlayer.getCurrentEquippedItem() != null && par6EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.itemID) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, par5 | 8, 4); + } + } + } + + private void func_72149_e(World par1World, int par2, int par3, int par4, int par5) +*************** +*** 236,250 **** + var5 &= -2; + } + + if (var7 != var6) + { +! par1World.setBlockMetadata(par2, par3, par4, var5, 3); + this.func_72149_e(par1World, par2, par3, par4, var5); + } + + if (var7) + { + par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); + } + } + } +--- 252,292 ---- + var5 &= -2; + } + + if (var7 != var6) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var5, 3); + this.func_72149_e(par1World, par2, par3, par4, var5); + } + + if (var7) + { + par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); ++ } ++ } ++ ++ public static boolean func_72148_a(IBlockAccess par0IBlockAccess, int par1, int par2, int par3, int par4, int par5) ++ { ++ int var6 = par1 + Direction.offsetX[par5]; ++ int var8 = par3 + Direction.offsetZ[par5]; ++ int var9 = par0IBlockAccess.getBlockId(var6, par2, var8); ++ boolean var10 = (par4 & 2) == 2; ++ int var11; ++ ++ if (var9 == Block.tripWireSource.blockID) ++ { ++ var11 = par0IBlockAccess.getBlockMetadata(var6, par2, var8); ++ int var13 = var11 & 3; ++ return var13 == Direction.rotateOpposite[par5]; ++ } ++ else if (var9 == Block.tripWire.blockID) ++ { ++ var11 = par0IBlockAccess.getBlockMetadata(var6, par2, var8); ++ boolean var12 = (var11 & 2) == 2; ++ return var10 == var12; ++ } ++ else ++ { ++ return false; + } + } + } +*** BlockTripWireSource.java Sat Feb 5 04:13:12 2022 +--- BlockTripWireSource.java Sat Feb 5 04:12:33 2022 +*************** +*** 217,236 **** + if (var18 > 0) + { + var21 = par2 + var16 * var18; + var22 = par4 + var17 * var18; + var23 = Direction.rotateOpposite[var10]; +! par1World.setBlockMetadata(var21, par3, var22, var23 | var20, 3); + this.notifyNeighborOfChange(par1World, var21, par3, var22, var23); + this.playSoundEffect(par1World, var21, par3, var22, var13, var14, var11, var12); + } + + this.playSoundEffect(par1World, par2, par3, par4, var13, var14, var11, var12); + + if (par5 > 0) + { +! par1World.setBlockMetadata(par2, par3, par4, par6, 3); + + if (par7) + { + this.notifyNeighborOfChange(par1World, par2, par3, par4, var10); + } +--- 217,236 ---- + if (var18 > 0) + { + var21 = par2 + var16 * var18; + var22 = par4 + var17 * var18; + var23 = Direction.rotateOpposite[var10]; +! par1World.setBlockMetadataWithNotify(var21, par3, var22, var23 | var20, 3); + this.notifyNeighborOfChange(par1World, var21, par3, var22, var23); + this.playSoundEffect(par1World, var21, par3, var22, var13, var14, var11, var12); + } + + this.playSoundEffect(par1World, par2, par3, par4, var13, var14, var11, var12); + + if (par5 > 0) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, par6, 3); + + if (par7) + { + this.notifyNeighborOfChange(par1World, par2, par3, par4, var10); + } +*************** +*** 253,263 **** + else + { + var24 &= -5; + } + +! par1World.setBlockMetadata(var22, par3, var23, var24, 3); + } + } + } + } + +--- 253,263 ---- + else + { + var24 &= -5; + } + +! par1World.setBlockMetadataWithNotify(var22, par3, var23, var24, 3); + } + } + } + } + +*** BlockVine.java Sat Feb 5 04:13:12 2022 +--- BlockVine.java Sat Feb 5 04:12:33 2022 +*************** +*** 195,211 **** + } + else + { + if (var6 != var5) + { +! par1World.setBlockMetadata(par2, par3, par4, var6, 2); + } + + return true; + } + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor blockID + */ + public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) +--- 195,233 ---- + } + else + { + if (var6 != var5) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 2); + } + + return true; + } + } + ++ public int getBlockColor() ++ { ++ return ColorizerFoliage.getFoliageColorBasic(); ++ } ++ ++ /** ++ * Returns the color this block should be rendered. Used by leaves. ++ */ ++ public int getRenderColor(int par1) ++ { ++ return ColorizerFoliage.getFoliageColorBasic(); ++ } ++ ++ /** ++ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called ++ * when first determining what to render. ++ */ ++ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) ++ { ++ return par1IBlockAccess.getBiomeGenForCoords(par2, par4).getBiomeFoliageColor(); ++ } ++ + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor blockID + */ + public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) +*************** +*** 298,308 **** + + if (var12 != 0 && Block.blocksList[var12] != null) + { + if (Block.blocksList[var12].blockMaterial.isOpaque() && Block.blocksList[var12].renderAsNormalBlock()) + { +! par1World.setBlockMetadata(par2, par3, par4, var9 | 1 << var11, 2); + } + } + else + { + var13 = var11 + 1 & 3; +--- 320,330 ---- + + if (var12 != 0 && Block.blocksList[var12] != null) + { + if (Block.blocksList[var12].blockMaterial.isOpaque() && Block.blocksList[var12].renderAsNormalBlock()) + { +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var9 | 1 << var11, 2); + } + } + else + { + var13 = var11 + 1 & 3; +*************** +*** 348,358 **** + var13 = par1World.rand.nextInt(16) & var9; + var14 = par1World.getBlockMetadata(par2, par3 - 1, par4); + + if (var14 != (var14 | var13)) + { +! par1World.setBlockMetadata(par2, par3 - 1, par4, var14 | var13, 2); + } + } + } + } + } +--- 370,380 ---- + var13 = par1World.rand.nextInt(16) & var9; + var14 = par1World.getBlockMetadata(par2, par3 - 1, par4); + + if (var14 != (var14 | var13)) + { +! par1World.setBlockMetadataWithNotify(par2, par3 - 1, par4, var14 | var13, 2); + } + } + } + } + } +*** BlockWall.java Sat Feb 5 04:13:12 2022 +--- BlockWall.java Sat Feb 5 04:12:33 2022 +*************** +*** 1,7 **** +--- 1,9 ---- + package net.minecraft.src; + ++ import java.util.List; ++ + public class BlockWall extends Block + { + /** The types of the wall. */ + public static final String[] types = new String[] {"normal", "mossy"}; + +*************** +*** 13,22 **** +--- 15,32 ---- + this.setStepSound(par2Block.stepSound); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return par2 == 1 ? Block.cobblestoneMossy.getBlockTextureFromSide(par1) : Block.cobblestone.getBlockTextureFromSide(par1); ++ } ++ ++ /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 32; +*************** +*** 123,134 **** +--- 133,168 ---- + return true; + } + } + + /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) ++ { ++ par3List.add(new ItemStack(par1, 1, 0)); ++ par3List.add(new ItemStack(par1, 1, 1)); ++ } ++ ++ /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int par1) + { + return par1; + } ++ ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) ++ { ++ return par5 == 0 ? super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5) : true; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) {} + } +*** BlockWeb.java Sat Feb 5 04:13:12 2022 +--- BlockWeb.java Sat Feb 5 04:12:33 2022 +*** BlockWood.java Sat Feb 5 04:13:12 2022 +--- BlockWood.java Sat Feb 5 04:12:33 2022 +*************** +*** 1,21 **** +--- 1,62 ---- + package net.minecraft.src; + ++ import java.util.List; ++ + public class BlockWood extends Block + { + /** The type of tree this block came from. */ + public static final String[] woodType = new String[] {"oak", "spruce", "birch", "jungle"}; ++ private Icon[] iconArray; + + public BlockWood(int par1) + { + super(par1, Material.wood); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ if (par2 < 0 || par2 >= this.iconArray.length) ++ { ++ par2 = 0; ++ } ++ ++ return this.iconArray[par2]; ++ } ++ ++ /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int par1) + { + return par1; ++ } ++ ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) ++ { ++ par3List.add(new ItemStack(par1, 1, 0)); ++ par3List.add(new ItemStack(par1, 1, 1)); ++ par3List.add(new ItemStack(par1, 1, 2)); ++ par3List.add(new ItemStack(par1, 1, 3)); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.iconArray = new Icon[woodType.length]; ++ ++ for (int var2 = 0; var2 < this.iconArray.length; ++var2) ++ { ++ this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + woodType[var2]); ++ } + } + } +*** BlockWoodSlab.java Sat Feb 5 04:13:12 2022 +--- BlockWoodSlab.java Sat Feb 5 04:12:33 2022 +*************** +*** 1,7 **** +--- 1,8 ---- + package net.minecraft.src; + ++ import java.util.List; + import java.util.Random; + + public class BlockWoodSlab extends BlockHalfSlab + { + /** The type of tree this slab came from. */ +*************** +*** 12,21 **** +--- 13,30 ---- + super(par1, par2, Material.wood); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return Block.planks.getIcon(par1, par2 & 7); ++ } ++ ++ /** + * Returns the ID of the items to drop on destruction. + */ + public int idDropped(int par1, Random par2Random, int par3) + { + return Block.woodSingleSlab.blockID; +*************** +*** 40,45 **** +--- 49,74 ---- + par1 = 0; + } + + return super.getUnlocalizedName() + "." + woodType[par1]; + } ++ ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) ++ { ++ if (par1 != Block.woodDoubleSlab.blockID) ++ { ++ for (int var4 = 0; var4 < 4; ++var4) ++ { ++ par3List.add(new ItemStack(par1, 1, var4)); ++ } ++ } ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) {} + } +*** BlockWorkbench.java Sat Feb 5 04:13:12 2022 +--- BlockWorkbench.java Sat Feb 5 04:12:33 2022 +*************** +*** 1,13 **** +--- 1,35 ---- + package net.minecraft.src; + + public class BlockWorkbench extends Block + { ++ private Icon workbenchIconTop; ++ private Icon workbenchIconFront; ++ + protected BlockWorkbench(int par1) + { + super(par1, Material.wood); + this.setCreativeTab(CreativeTabs.tabDecorations); ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) ++ { ++ return par1 == 1 ? this.workbenchIconTop : (par1 == 0 ? Block.planks.getBlockTextureFromSide(par1) : (par1 != 2 && par1 != 4 ? this.blockIcon : this.workbenchIconFront)); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This ++ * is the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); ++ this.workbenchIconTop = par1IconRegister.registerIcon(this.getTextureName() + "_top"); ++ this.workbenchIconFront = par1IconRegister.registerIcon(this.getTextureName() + "_front"); + } + + /** + * Called upon block activation (right click on the block.) + */ +*** /dev/null Thu Jan 1 01:00:00 1970 +--- BossStatus.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,17 ---- ++ package net.minecraft.src; ++ ++ public final class BossStatus ++ { ++ public static float healthScale; ++ public static int statusBarLength; ++ public static String bossName; ++ public static boolean field_82825_d; ++ ++ public static void setBossStatus(IBossDisplayData par0IBossDisplayData, boolean par1) ++ { ++ healthScale = par0IBossDisplayData.getHealth() / par0IBossDisplayData.getMaxHealth(); ++ statusBarLength = 100; ++ bossName = par0IBossDisplayData.getEntityName(); ++ field_82825_d = par1; ++ } ++ } +*** CallableBlockDataValue.java Sat Feb 5 04:13:12 2022 +--- CallableBlockDataValue.java Sat Feb 5 04:12:33 2022 +*** CallableBlockLocation.java Sat Feb 5 04:13:12 2022 +--- CallableBlockLocation.java Sat Feb 5 04:12:33 2022 +*** CallableBlockType.java Sat Feb 5 04:13:12 2022 +--- CallableBlockType.java Sat Feb 5 04:12:33 2022 +*** CallableChunkPosHash.java Sat Feb 5 04:13:12 2022 +--- CallableChunkPosHash.java Sat Feb 5 04:12:33 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- CallableClientMemoryStats.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,23 ---- ++ package net.minecraft.src; ++ ++ import java.util.concurrent.Callable; ++ ++ class CallableClientMemoryStats implements Callable ++ { ++ final Minecraft theMinecraft; ++ ++ CallableClientMemoryStats(Minecraft par1Minecraft) ++ { ++ this.theMinecraft = par1Minecraft; ++ } ++ ++ public String callClientMemoryStats() ++ { ++ return this.theMinecraft.mcProfiler.profilingEnabled ? this.theMinecraft.mcProfiler.getNameOfLastSection() : "N/A (disabled)"; ++ } ++ ++ public Object call() ++ { ++ return this.callClientMemoryStats(); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- CallableClientProfiler.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,23 ---- ++ package net.minecraft.src; ++ ++ import java.util.concurrent.Callable; ++ ++ class CallableClientProfiler implements Callable ++ { ++ final Minecraft theMinecraft; ++ ++ CallableClientProfiler(Minecraft par1Minecraft) ++ { ++ this.theMinecraft = par1Minecraft; ++ } ++ ++ public String callClientProfilerInfo() ++ { ++ return Minecraft.func_142024_b(this.theMinecraft).getCurrentLanguage().toString(); ++ } ++ ++ public Object call() ++ { ++ return this.callClientProfilerInfo(); ++ } ++ } +*** CallableConnectionName.java Sat Feb 5 04:13:12 2022 +--- CallableConnectionName.java Sat Feb 5 04:12:33 2022 +*** CallableCrashMemoryReport.java Sat Feb 5 04:13:12 2022 +--- CallableCrashMemoryReport.java Sat Feb 5 04:12:33 2022 +*** CallableEntityName.java Sat Feb 5 04:13:12 2022 +--- CallableEntityName.java Sat Feb 5 04:12:33 2022 +*** CallableEntityTracker.java Sat Feb 5 04:13:12 2022 +--- CallableEntityTracker.java Sat Feb 5 04:12:33 2022 +*** CallableEntityType.java Sat Feb 5 04:13:12 2022 +--- CallableEntityType.java Sat Feb 5 04:12:33 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- CallableGLInfo.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,25 ---- ++ package net.minecraft.src; ++ ++ import java.util.concurrent.Callable; ++ import org.lwjgl.opengl.GL11; ++ ++ class CallableGLInfo implements Callable ++ { ++ /** The Minecraft instance. */ ++ final Minecraft mc; ++ ++ CallableGLInfo(Minecraft par1Minecraft) ++ { ++ this.mc = par1Minecraft; ++ } ++ ++ public String getTexturePack() ++ { ++ return GL11.glGetString(GL11.GL_RENDERER) + " GL version " + GL11.glGetString(GL11.GL_VERSION) + ", " + GL11.glGetString(GL11.GL_VENDOR); ++ } ++ ++ public Object call() ++ { ++ return this.getTexturePack(); ++ } ++ } +*** CallableIntCache.java Sat Feb 5 04:13:12 2022 +--- CallableIntCache.java Sat Feb 5 04:12:33 2022 +*** CallableIsFeatureChunk.java Sat Feb 5 04:13:12 2022 +--- CallableIsFeatureChunk.java Sat Feb 5 04:12:33 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- CallableIsModded.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,38 ---- ++ package net.minecraft.src; ++ ++ import java.util.concurrent.Callable; ++ import net.minecraft.client.ClientBrandRetriever; ++ ++ class CallableIsModded implements Callable ++ { ++ /** Reference to the IntegratedServer object. */ ++ final IntegratedServer theIntegratedServer; ++ ++ CallableIsModded(IntegratedServer par1IntegratedServer) ++ { ++ this.theIntegratedServer = par1IntegratedServer; ++ } ++ ++ /** ++ * Gets if your Minecraft is Modded. ++ */ ++ public String getMinecraftIsModded() ++ { ++ String var1 = ClientBrandRetriever.getClientModName(); ++ ++ if (!var1.equals("vanilla")) ++ { ++ return "Definitely; Client brand changed to \'" + var1 + "\'"; ++ } ++ else ++ { ++ var1 = this.theIntegratedServer.getServerModName(); ++ return !var1.equals("vanilla") ? "Definitely; Server brand changed to \'" + var1 + "\'" : (Minecraft.class.getSigners() == null ? "Very likely; Jar signature invalidated" : "Probably not. Jar signature remains and both client + server brands are untouched."); ++ } ++ } ++ ++ public Object call() ++ { ++ return this.getMinecraftIsModded(); ++ } ++ } +*** CallableIsServerModded.java Sat Feb 5 04:13:12 2022 +--- CallableIsServerModded.java Sat Feb 5 04:12:33 2022 +*** CallableItemName.java Sat Feb 5 04:13:12 2022 +--- CallableItemName.java Sat Feb 5 04:12:33 2022 +*** CallableJavaInfo.java Sat Feb 5 04:13:12 2022 +--- CallableJavaInfo.java Sat Feb 5 04:12:33 2022 +*** CallableJavaInfo2.java Sat Feb 5 04:13:12 2022 +--- CallableJavaInfo2.java Sat Feb 5 04:12:33 2022 +*** CallableJVMFlags.java Sat Feb 5 04:13:12 2022 +--- CallableJVMFlags.java Sat Feb 5 04:12:33 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- CallableLaunchedVersion.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,24 ---- ++ package net.minecraft.src; ++ ++ import java.util.concurrent.Callable; ++ ++ class CallableLaunchedVersion implements Callable ++ { ++ /** Reference to the Minecraft object. */ ++ final Minecraft mc; ++ ++ CallableLaunchedVersion(Minecraft par1Minecraft) ++ { ++ this.mc = par1Minecraft; ++ } ++ ++ public String getLWJGLVersion() ++ { ++ return Minecraft.getLaunchedVersion(this.mc); ++ } ++ ++ public Object call() ++ { ++ return this.getLWJGLVersion(); ++ } ++ } +*** CallableLevelDimension.java Sat Feb 5 04:13:12 2022 +--- CallableLevelDimension.java Sat Feb 5 04:12:33 2022 +*** CallableLevelGamemode.java Sat Feb 5 04:13:12 2022 +--- CallableLevelGamemode.java Sat Feb 5 04:12:33 2022 +*** CallableLevelGenerator.java Sat Feb 5 04:13:12 2022 +--- CallableLevelGenerator.java Sat Feb 5 04:12:33 2022 +*** CallableLevelGeneratorOptions.java Sat Feb 5 04:13:12 2022 +--- CallableLevelGeneratorOptions.java Sat Feb 5 04:12:33 2022 +*** CallableLevelSeed.java Sat Feb 5 04:13:12 2022 +--- CallableLevelSeed.java Sat Feb 5 04:12:33 2022 +*** CallableLevelSpawnLocation.java Sat Feb 5 04:13:12 2022 +--- CallableLevelSpawnLocation.java Sat Feb 5 04:12:33 2022 +*** CallableLevelStorageVersion.java Sat Feb 5 04:13:12 2022 +--- CallableLevelStorageVersion.java Sat Feb 5 04:12:33 2022 +*** CallableLevelTime.java Sat Feb 5 04:13:12 2022 +--- CallableLevelTime.java Sat Feb 5 04:12:33 2022 +*** CallableLevelWeather.java Sat Feb 5 04:13:12 2022 +--- CallableLevelWeather.java Sat Feb 5 04:12:33 2022 +*** CallableLvl1.java Sat Feb 5 04:13:12 2022 +--- CallableLvl1.java Sat Feb 5 04:12:33 2022 +*** CallableLvl2.java Sat Feb 5 04:13:12 2022 +--- CallableLvl2.java Sat Feb 5 04:12:33 2022 +*** CallableLvl3.java Sat Feb 5 04:13:12 2022 +--- CallableLvl3.java Sat Feb 5 04:12:33 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- CallableLWJGLVersion.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,25 ---- ++ package net.minecraft.src; ++ ++ import java.util.concurrent.Callable; ++ import org.lwjgl.Sys; ++ ++ class CallableLWJGLVersion implements Callable ++ { ++ /** Reference to the Minecraft object. */ ++ final Minecraft mc; ++ ++ CallableLWJGLVersion(Minecraft par1Minecraft) ++ { ++ this.mc = par1Minecraft; ++ } ++ ++ public String getType() ++ { ++ return Sys.getVersion(); ++ } ++ ++ public Object call() ++ { ++ return this.getType(); ++ } ++ } +*** CallableMemoryInfo.java Sat Feb 5 04:13:12 2022 +--- CallableMemoryInfo.java Sat Feb 5 04:12:33 2022 +*** CallableMinecraftVersion.java Sat Feb 5 04:13:12 2022 +--- CallableMinecraftVersion.java Sat Feb 5 04:12:33 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- CallableModded.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,29 ---- ++ package net.minecraft.src; ++ ++ import java.util.concurrent.Callable; ++ import net.minecraft.client.ClientBrandRetriever; ++ ++ class CallableModded implements Callable ++ { ++ /** Reference to the Minecraft object. */ ++ final Minecraft mc; ++ ++ CallableModded(Minecraft par1Minecraft) ++ { ++ this.mc = par1Minecraft; ++ } ++ ++ /** ++ * Gets if Client Profiler (aka Snooper) is enabled. ++ */ ++ public String getClientProfilerEnabled() ++ { ++ String var1 = ClientBrandRetriever.getClientModName(); ++ return !var1.equals("vanilla") ? "Definitely; Client brand changed to \'" + var1 + "\'" : (Minecraft.class.getSigners() == null ? "Very likely; Jar signature invalidated" : "Probably not. Jar signature remains and client brand is untouched."); ++ } ++ ++ public Object call() ++ { ++ return this.getClientProfilerEnabled(); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- CallableMouseLocation.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,30 ---- ++ package net.minecraft.src; ++ ++ import java.util.concurrent.Callable; ++ import org.lwjgl.input.Mouse; ++ ++ class CallableMouseLocation implements Callable ++ { ++ final int field_90026_a; ++ ++ final int field_90024_b; ++ ++ final EntityRenderer theEntityRenderer; ++ ++ CallableMouseLocation(EntityRenderer par1EntityRenderer, int par2, int par3) ++ { ++ this.theEntityRenderer = par1EntityRenderer; ++ this.field_90026_a = par2; ++ this.field_90024_b = par3; ++ } ++ ++ public String callMouseLocation() ++ { ++ return String.format("Scaled: (%d, %d). Absolute: (%d, %d)", new Object[] {Integer.valueOf(this.field_90026_a), Integer.valueOf(this.field_90024_b), Integer.valueOf(Mouse.getX()), Integer.valueOf(Mouse.getY())}); ++ } ++ ++ public Object call() ++ { ++ return this.callMouseLocation(); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- CallableMPL1.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,27 ---- ++ package net.minecraft.src; ++ ++ import java.util.concurrent.Callable; ++ ++ class CallableMPL1 implements Callable ++ { ++ /** Reference to the WorldClient object. */ ++ final WorldClient theWorldClient; ++ ++ CallableMPL1(WorldClient par1WorldClient) ++ { ++ this.theWorldClient = par1WorldClient; ++ } ++ ++ /** ++ * Returns the size and contents of the entity list. ++ */ ++ public String getEntityCountAndList() ++ { ++ return WorldClient.getEntityList(this.theWorldClient).size() + " total; " + WorldClient.getEntityList(this.theWorldClient).toString(); ++ } ++ ++ public Object call() ++ { ++ return this.getEntityCountAndList(); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- CallableMPL2.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,27 ---- ++ package net.minecraft.src; ++ ++ import java.util.concurrent.Callable; ++ ++ class CallableMPL2 implements Callable ++ { ++ /** Reference to the WorldClient object. */ ++ final WorldClient theWorldClient; ++ ++ CallableMPL2(WorldClient par1WorldClient) ++ { ++ this.theWorldClient = par1WorldClient; ++ } ++ ++ /** ++ * Returns the size and contents of the entity spawn queue. ++ */ ++ public String getEntitySpawnQueueCountAndList() ++ { ++ return WorldClient.getEntitySpawnQueue(this.theWorldClient).size() + " total; " + WorldClient.getEntitySpawnQueue(this.theWorldClient).toString(); ++ } ++ ++ public Object call() ++ { ++ return this.getEntitySpawnQueueCountAndList(); ++ } ++ } +*** CallableOSInfo.java Sat Feb 5 04:13:12 2022 +--- CallableOSInfo.java Sat Feb 5 04:12:33 2022 +*** CallablePacketClass.java Sat Feb 5 04:13:12 2022 +--- CallablePacketClass.java Sat Feb 5 04:12:33 2022 +*** CallablePacketID.java Sat Feb 5 04:13:12 2022 +--- CallablePacketID.java Sat Feb 5 04:12:33 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- CallableParticlePositionInfo.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,32 ---- ++ package net.minecraft.src; ++ ++ import java.util.concurrent.Callable; ++ ++ class CallableParticlePositionInfo implements Callable ++ { ++ final double posX; ++ ++ final double posY; ++ ++ final double posZ; ++ ++ final RenderGlobal globalRenderer; ++ ++ CallableParticlePositionInfo(RenderGlobal par1RenderGlobal, double par2, double par4, double par6) ++ { ++ this.globalRenderer = par1RenderGlobal; ++ this.posX = par2; ++ this.posY = par4; ++ this.posZ = par6; ++ } ++ ++ public String callParticlePositionInfo() ++ { ++ return CrashReportCategory.func_85074_a(this.posX, this.posY, this.posZ); ++ } ++ ++ public Object call() ++ { ++ return this.callParticlePositionInfo(); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- CallableParticleScreenName.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,23 ---- ++ package net.minecraft.src; ++ ++ import java.util.concurrent.Callable; ++ ++ class CallableParticleScreenName implements Callable ++ { ++ final Minecraft theMinecraft; ++ ++ CallableParticleScreenName(Minecraft par1Minecraft) ++ { ++ this.theMinecraft = par1Minecraft; ++ } ++ ++ public String callParticleScreenName() ++ { ++ return this.theMinecraft.currentScreen.getClass().getCanonicalName(); ++ } ++ ++ public Object call() ++ { ++ return this.callParticleScreenName(); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- CallableScreenName.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,23 ---- ++ package net.minecraft.src; ++ ++ import java.util.concurrent.Callable; ++ ++ class CallableScreenName implements Callable ++ { ++ final EntityRenderer entityRender; ++ ++ CallableScreenName(EntityRenderer par1EntityRenderer) ++ { ++ this.entityRender = par1EntityRenderer; ++ } ++ ++ public String callScreenName() ++ { ++ return EntityRenderer.getRendererMinecraft(this.entityRender).currentScreen.getClass().getCanonicalName(); ++ } ++ ++ public Object call() ++ { ++ return this.callScreenName(); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- CallableScreenSize.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,26 ---- ++ package net.minecraft.src; ++ ++ import java.util.concurrent.Callable; ++ ++ class CallableScreenSize implements Callable ++ { ++ final ScaledResolution theScaledResolution; ++ ++ final EntityRenderer theEntityRenderer; ++ ++ CallableScreenSize(EntityRenderer par1EntityRenderer, ScaledResolution par2ScaledResolution) ++ { ++ this.theEntityRenderer = par1EntityRenderer; ++ this.theScaledResolution = par2ScaledResolution; ++ } ++ ++ public String callScreenSize() ++ { ++ return String.format("Scaled: (%d, %d). Absolute: (%d, %d). Scale factor of %d", new Object[] {Integer.valueOf(this.theScaledResolution.getScaledWidth()), Integer.valueOf(this.theScaledResolution.getScaledHeight()), Integer.valueOf(EntityRenderer.getRendererMinecraft(this.theEntityRenderer).displayWidth), Integer.valueOf(EntityRenderer.getRendererMinecraft(this.theEntityRenderer).displayHeight), Integer.valueOf(this.theScaledResolution.getScaleFactor())}); ++ } ++ ++ public Object call() ++ { ++ return this.callScreenSize(); ++ } ++ } +*** CallableServerMemoryStats.java Sat Feb 5 04:13:12 2022 +--- CallableServerMemoryStats.java Sat Feb 5 04:12:33 2022 +*** CallableServerProfiler.java Sat Feb 5 04:13:12 2022 +--- CallableServerProfiler.java Sat Feb 5 04:12:33 2022 +*** CallableServerType.java Sat Feb 5 04:13:12 2022 +--- CallableServerType.java Sat Feb 5 04:12:33 2022 +*** CallableStructureType.java Sat Feb 5 04:13:12 2022 +--- CallableStructureType.java Sat Feb 5 04:12:33 2022 +*** CallableSuspiciousClasses.java Sat Feb 5 04:13:12 2022 +--- CallableSuspiciousClasses.java Sat Feb 5 04:12:33 2022 +*** CallableTagCompound1.java Sat Feb 5 04:13:12 2022 +--- CallableTagCompound1.java Sat Feb 5 04:12:33 2022 +*** CallableTagCompound2.java Sat Feb 5 04:13:12 2022 +--- CallableTagCompound2.java Sat Feb 5 04:12:33 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- CallableTexturePack.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,23 ---- ++ package net.minecraft.src; ++ ++ import java.util.concurrent.Callable; ++ ++ class CallableTexturePack implements Callable ++ { ++ final Minecraft theMinecraft; ++ ++ CallableTexturePack(Minecraft par1Minecraft) ++ { ++ this.theMinecraft = par1Minecraft; ++ } ++ ++ public String callTexturePack() ++ { ++ return this.theMinecraft.gameSettings.skin; ++ } ++ ++ public Object call() ++ { ++ return this.callTexturePack(); ++ } ++ } +*** CallableTileEntityData.java Sat Feb 5 04:13:12 2022 +--- CallableTileEntityData.java Sat Feb 5 04:12:33 2022 +*** CallableTileEntityID.java Sat Feb 5 04:13:12 2022 +--- CallableTileEntityID.java Sat Feb 5 04:12:33 2022 +*** CallableTileEntityName.java Sat Feb 5 04:13:12 2022 +--- CallableTileEntityName.java Sat Feb 5 04:12:33 2022 +*** CallableType.java Sat Feb 5 04:13:12 2022 +--- CallableType.java Sat Feb 5 04:12:33 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- CallableType2.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,23 ---- ++ package net.minecraft.src; ++ ++ import java.util.concurrent.Callable; ++ ++ class CallableType2 implements Callable ++ { ++ final Minecraft mc; ++ ++ CallableType2(Minecraft par1Minecraft) ++ { ++ this.mc = par1Minecraft; ++ } ++ ++ public String func_82886_a() ++ { ++ return "Client (map_client.txt)"; ++ } ++ ++ public Object call() ++ { ++ return this.func_82886_a(); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- CallableType3.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,24 ---- ++ package net.minecraft.src; ++ ++ import java.util.concurrent.Callable; ++ ++ class CallableType3 implements Callable ++ { ++ /** Reference to the IntegratedServer object. */ ++ final IntegratedServer theIntegratedServer; ++ ++ CallableType3(IntegratedServer par1IntegratedServer) ++ { ++ this.theIntegratedServer = par1IntegratedServer; ++ } ++ ++ public String getType() ++ { ++ return "Integrated Server (map_client.txt)"; ++ } ++ ++ public Object call() ++ { ++ return this.getType(); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- CallableUpdatingScreenName.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,23 ---- ++ package net.minecraft.src; ++ ++ import java.util.concurrent.Callable; ++ ++ class CallableUpdatingScreenName implements Callable ++ { ++ final Minecraft theMinecraft; ++ ++ CallableUpdatingScreenName(Minecraft par1Minecraft) ++ { ++ this.theMinecraft = par1Minecraft; ++ } ++ ++ public String callUpdatingScreenName() ++ { ++ return this.theMinecraft.currentScreen.getClass().getCanonicalName(); ++ } ++ ++ public Object call() ++ { ++ return this.callUpdatingScreenName(); ++ } ++ } +*** ChatAllowedCharacters.java Sat Feb 5 04:13:12 2022 +--- ChatAllowedCharacters.java Sat Feb 5 04:12:33 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ChatClickData.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,94 ---- ++ package net.minecraft.src; ++ ++ import java.net.URI; ++ import java.net.URISyntaxException; ++ import java.util.regex.Matcher; ++ import java.util.regex.Pattern; ++ ++ public class ChatClickData ++ { ++ public static final Pattern pattern = Pattern.compile("^(?:(https?)://)?([-\\w_\\.]{2,}\\.[a-z]{2,4})(/\\S*)?$"); ++ private final FontRenderer fontR; ++ private final ChatLine line; ++ private final int field_78312_d; ++ private final int field_78313_e; ++ private final String field_78310_f; ++ ++ /** The URL which was clicked on. */ ++ private final String clickedUrl; ++ ++ public ChatClickData(FontRenderer par1FontRenderer, ChatLine par2ChatLine, int par3, int par4) ++ { ++ this.fontR = par1FontRenderer; ++ this.line = par2ChatLine; ++ this.field_78312_d = par3; ++ this.field_78313_e = par4; ++ this.field_78310_f = par1FontRenderer.trimStringToWidth(par2ChatLine.getChatLineString(), par3); ++ this.clickedUrl = this.findClickedUrl(); ++ } ++ ++ /** ++ * Gets the URL which was clicked on. ++ */ ++ public String getClickedUrl() ++ { ++ return this.clickedUrl; ++ } ++ ++ /** ++ * computes the URI from the clicked chat data object ++ */ ++ public URI getURI() ++ { ++ String var1 = this.getClickedUrl(); ++ ++ if (var1 == null) ++ { ++ return null; ++ } ++ else ++ { ++ Matcher var2 = pattern.matcher(var1); ++ ++ if (var2.matches()) ++ { ++ try ++ { ++ String var3 = var2.group(0); ++ ++ if (var2.group(1) == null) ++ { ++ var3 = "http://" + var3; ++ } ++ ++ return new URI(var3); ++ } ++ catch (URISyntaxException var4) ++ { ++ Minecraft.getMinecraft().getLogAgent().logSevereException("Couldn\'t create URI from chat", var4); ++ } ++ } ++ ++ return null; ++ } ++ } ++ ++ private String findClickedUrl() ++ { ++ int var1 = this.field_78310_f.lastIndexOf(" ", this.field_78310_f.length()) + 1; ++ ++ if (var1 < 0) ++ { ++ var1 = 0; ++ } ++ ++ int var2 = this.line.getChatLineString().indexOf(" ", var1); ++ ++ if (var2 < 0) ++ { ++ var2 = this.line.getChatLineString().length(); ++ } ++ ++ return StringUtils.stripControlCodes(this.line.getChatLineString().substring(var1, var2)); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ChatLine.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,35 ---- ++ package net.minecraft.src; ++ ++ public class ChatLine ++ { ++ /** GUI Update Counter value this Line was created at */ ++ private final int updateCounterCreated; ++ private final String lineString; ++ ++ /** ++ * int value to refer to existing Chat Lines, can be 0 which means unreferrable ++ */ ++ private final int chatLineID; ++ ++ public ChatLine(int par1, String par2Str, int par3) ++ { ++ this.lineString = par2Str; ++ this.updateCounterCreated = par1; ++ this.chatLineID = par3; ++ } ++ ++ public String getChatLineString() ++ { ++ return this.lineString; ++ } ++ ++ public int getUpdatedCounter() ++ { ++ return this.updateCounterCreated; ++ } ++ ++ public int getChatLineID() ++ { ++ return this.chatLineID; ++ } ++ } +*** ChatMessageComponent.java Sat Feb 5 04:13:12 2022 +--- ChatMessageComponent.java Sat Feb 5 04:12:33 2022 +*************** +*** 32,42 **** + this.field_111091_i = par1ChatMessageComponent.field_111091_i == null ? null : Lists.newArrayList(par1ChatMessageComponent.field_111091_i); + } + + public ChatMessageComponent setColor(EnumChatFormatting par1EnumChatFormatting) + { +! if (par1EnumChatFormatting != null && !par1EnumChatFormatting.Checks()) + { + throw new IllegalArgumentException("Argument is not a valid color!"); + } + else + { +--- 32,42 ---- + this.field_111091_i = par1ChatMessageComponent.field_111091_i == null ? null : Lists.newArrayList(par1ChatMessageComponent.field_111091_i); + } + + public ChatMessageComponent setColor(EnumChatFormatting par1EnumChatFormatting) + { +! if (par1EnumChatFormatting != null && !par1EnumChatFormatting.isColor()) + { + throw new IllegalArgumentException("Argument is not a valid color!"); + } + else + { +*************** +*** 327,336 **** +--- 327,351 ---- + } + + if (par5) + { + par0StringBuilder.append(EnumChatFormatting.OBFUSCATED); ++ } ++ } ++ ++ public static ChatMessageComponent createFromJson(String par0Str) ++ { ++ try ++ { ++ return (ChatMessageComponent)field_111089_a.fromJson(par0Str, ChatMessageComponent.class); ++ } ++ catch (Throwable var4) ++ { ++ CrashReport var2 = CrashReport.makeCrashReport(var4, "Deserializing Message"); ++ CrashReportCategory var3 = var2.makeCategory("Serialized Message"); ++ var3.addCrashSection("JSON string", par0Str); ++ throw new ReportedException(var2); + } + } + + public static ChatMessageComponent createFromText(String par0Str) + { +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ChestItemRenderHelper.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,33 ---- ++ package net.minecraft.src; ++ ++ public class ChestItemRenderHelper ++ { ++ /** The static instance of ChestItemRenderHelper. */ ++ public static ChestItemRenderHelper instance = new ChestItemRenderHelper(); ++ ++ /** Instance of Chest's Tile Entity. */ ++ private TileEntityChest theChest = new TileEntityChest(0); ++ private TileEntityChest field_142033_c = new TileEntityChest(1); ++ ++ /** Instance of Ender Chest's Tile Entity. */ ++ private TileEntityEnderChest theEnderChest = new TileEntityEnderChest(); ++ ++ /** ++ * Renders a chest at 0,0,0 - used for item rendering ++ */ ++ public void renderChest(Block par1Block, int par2, float par3) ++ { ++ if (par1Block.blockID == Block.enderChest.blockID) ++ { ++ TileEntityRenderer.instance.renderTileEntityAt(this.theEnderChest, 0.0D, 0.0D, 0.0D, 0.0F); ++ } ++ else if (par1Block.blockID == Block.chestTrapped.blockID) ++ { ++ TileEntityRenderer.instance.renderTileEntityAt(this.field_142033_c, 0.0D, 0.0D, 0.0D, 0.0F); ++ } ++ else ++ { ++ TileEntityRenderer.instance.renderTileEntityAt(this.theChest, 0.0D, 0.0D, 0.0D, 0.0F); ++ } ++ } ++ } +*** Chunk.java Sat Feb 5 04:13:12 2022 +--- Chunk.java Sat Feb 5 04:12:33 2022 +*************** +*** 180,189 **** +--- 180,229 ---- + { + return this.storageArrays; + } + + /** ++ * Generates the height map for a chunk from scratch ++ */ ++ public void generateHeightMap() ++ { ++ int var1 = this.getTopFilledSegment(); ++ ++ for (int var2 = 0; var2 < 16; ++var2) ++ { ++ int var3 = 0; ++ ++ while (var3 < 16) ++ { ++ this.precipitationHeightMap[var2 + (var3 << 4)] = -999; ++ int var4 = var1 + 16 - 1; ++ ++ while (true) ++ { ++ if (var4 > 0) ++ { ++ int var5 = this.getBlockID(var2, var4 - 1, var3); ++ ++ if (Block.lightOpacity[var5] == 0) ++ { ++ --var4; ++ continue; ++ } ++ ++ this.heightMap[var3 << 4 | var2] = var4; ++ } ++ ++ ++var3; ++ break; ++ } ++ } ++ } ++ ++ this.isModified = true; ++ } ++ ++ /** + * Generates the initial skylight map for the chunk upon generation or load. + */ + public void generateSkylightMap() + { + int var1 = this.getTopFilledSegment(); +*************** +*** 503,514 **** + return var4 != null ? var4.getExtBlockMetadata(par1, par2 & 15, par3) : 0; + } + } + + /** +! * Sets a blockID of a position within a chunk with metadata. Args: x, y, z, blockID, metadata. Return true if the +! * id or meta was changed. + */ + public boolean setBlockIDWithMetadata(int par1, int par2, int par3, int par4, int par5) + { + int var6 = par3 << 4 | par1; + +--- 543,553 ---- + return var4 != null ? var4.getExtBlockMetadata(par1, par2 & 15, par3) : 0; + } + } + + /** +! * Sets a blockID of a position within a chunk with metadata. Args: x, y, z, blockID, metadata + */ + public boolean setBlockIDWithMetadata(int par1, int par2, int par3, int par4, int par5) + { + int var6 = par3 << 4 | par1; + +*************** +*** 1188,1197 **** +--- 1227,1350 ---- + { + this.storageArrays = par1ArrayOfExtendedBlockStorage; + } + + /** ++ * Initialise this chunk with new binary data ++ */ ++ public void fillChunk(byte[] par1ArrayOfByte, int par2, int par3, boolean par4) ++ { ++ int var5 = 0; ++ boolean var6 = !this.worldObj.provider.hasNoSky; ++ int var7; ++ ++ for (var7 = 0; var7 < this.storageArrays.length; ++var7) ++ { ++ if ((par2 & 1 << var7) != 0) ++ { ++ if (this.storageArrays[var7] == null) ++ { ++ this.storageArrays[var7] = new ExtendedBlockStorage(var7 << 4, var6); ++ } ++ ++ byte[] var8 = this.storageArrays[var7].getBlockLSBArray(); ++ System.arraycopy(par1ArrayOfByte, var5, var8, 0, var8.length); ++ var5 += var8.length; ++ } ++ else if (par4 && this.storageArrays[var7] != null) ++ { ++ this.storageArrays[var7] = null; ++ } ++ } ++ ++ NibbleArray var9; ++ ++ for (var7 = 0; var7 < this.storageArrays.length; ++var7) ++ { ++ if ((par2 & 1 << var7) != 0 && this.storageArrays[var7] != null) ++ { ++ var9 = this.storageArrays[var7].getMetadataArray(); ++ System.arraycopy(par1ArrayOfByte, var5, var9.data, 0, var9.data.length); ++ var5 += var9.data.length; ++ } ++ } ++ ++ for (var7 = 0; var7 < this.storageArrays.length; ++var7) ++ { ++ if ((par2 & 1 << var7) != 0 && this.storageArrays[var7] != null) ++ { ++ var9 = this.storageArrays[var7].getBlocklightArray(); ++ System.arraycopy(par1ArrayOfByte, var5, var9.data, 0, var9.data.length); ++ var5 += var9.data.length; ++ } ++ } ++ ++ if (var6) ++ { ++ for (var7 = 0; var7 < this.storageArrays.length; ++var7) ++ { ++ if ((par2 & 1 << var7) != 0 && this.storageArrays[var7] != null) ++ { ++ var9 = this.storageArrays[var7].getSkylightArray(); ++ System.arraycopy(par1ArrayOfByte, var5, var9.data, 0, var9.data.length); ++ var5 += var9.data.length; ++ } ++ } ++ } ++ ++ for (var7 = 0; var7 < this.storageArrays.length; ++var7) ++ { ++ if ((par3 & 1 << var7) != 0) ++ { ++ if (this.storageArrays[var7] == null) ++ { ++ var5 += 2048; ++ } ++ else ++ { ++ var9 = this.storageArrays[var7].getBlockMSBArray(); ++ ++ if (var9 == null) ++ { ++ var9 = this.storageArrays[var7].createBlockMSBArray(); ++ } ++ ++ System.arraycopy(par1ArrayOfByte, var5, var9.data, 0, var9.data.length); ++ var5 += var9.data.length; ++ } ++ } ++ else if (par4 && this.storageArrays[var7] != null && this.storageArrays[var7].getBlockMSBArray() != null) ++ { ++ this.storageArrays[var7].clearMSBArray(); ++ } ++ } ++ ++ if (par4) ++ { ++ System.arraycopy(par1ArrayOfByte, var5, this.blockBiomeArray, 0, this.blockBiomeArray.length); ++ int var10000 = var5 + this.blockBiomeArray.length; ++ } ++ ++ for (var7 = 0; var7 < this.storageArrays.length; ++var7) ++ { ++ if (this.storageArrays[var7] != null && (par2 & 1 << var7) != 0) ++ { ++ this.storageArrays[var7].removeInvalidBlocks(); ++ } ++ } ++ ++ this.generateHeightMap(); ++ Iterator var11 = this.chunkTileEntityMap.values().iterator(); ++ ++ while (var11.hasNext()) ++ { ++ TileEntity var10 = (TileEntity)var11.next(); ++ var10.updateContainingBlockInfo(); ++ } ++ } ++ ++ /** + * This method retrieves the biome at a set of coordinates + */ + public BiomeGenBase getBiomeGenForWorldCoords(int par1, int par2, WorldChunkManager par3WorldChunkManager) + { + int var4 = this.blockBiomeArray[par2 << 4 | par1] & 255; +*************** +*** 1230,1242 **** + { + this.queuedLightChecks = 0; + } + + /** +! * Called once-per-chunk-per-tick, and advances the round-robin relight check index by up to 8 blocks at a time. In +! * a worst-case scenario, can potentially take up to 25.6 seconds, calculated via (4096/8)/20, to re-check all +! * blocks in a chunk, which may explain lagging light updates on initial world generation. + */ + public void enqueueRelightChecks() + { + for (int var1 = 0; var1 < 8; ++var1) + { +--- 1383,1396 ---- + { + this.queuedLightChecks = 0; + } + + /** +! * Called once-per-chunk-per-tick, and advances the round-robin relight check index per-storage-block by up to 8 +! * blocks at a time. In a worst-case scenario, can potentially take up to 1.6 seconds, calculated via +! * (4096/(8*16))/20, to re-check all blocks in a chunk, which could explain both lagging light updates in certain +! * cases as well as Nether relight + */ + public void enqueueRelightChecks() + { + for (int var1 = 0; var1 < 8; ++var1) + { +*** ChunkCache.java Sat Feb 5 04:13:12 2022 +--- ChunkCache.java Sat Feb 5 04:12:33 2022 +*************** +*** 4,15 **** + { + private int chunkX; + private int chunkZ; + private Chunk[][] chunkArray; + +! /** set by !chunk.getAreLevelsEmpty */ +! private boolean hasExtendedLevels; + + /** Reference to the World object. */ + private World worldObj; + + public ChunkCache(World par1World, int par2, int par3, int par4, int par5, int par6, int par7, int par8) +--- 4,15 ---- + { + private int chunkX; + private int chunkZ; + private Chunk[][] chunkArray; + +! /** True if the chunk cache is empty. */ +! private boolean isEmpty; + + /** Reference to the World object. */ + private World worldObj; + + public ChunkCache(World par1World, int par2, int par3, int par4, int par5, int par6, int par7, int par8) +*************** +*** 18,28 **** + this.chunkX = par2 - par8 >> 4; + this.chunkZ = par4 - par8 >> 4; + int var9 = par5 + par8 >> 4; + int var10 = par7 + par8 >> 4; + this.chunkArray = new Chunk[var9 - this.chunkX + 1][var10 - this.chunkZ + 1]; +! this.hasExtendedLevels = true; + int var11; + int var12; + Chunk var13; + + for (var11 = this.chunkX; var11 <= var9; ++var11) +--- 18,28 ---- + this.chunkX = par2 - par8 >> 4; + this.chunkZ = par4 - par8 >> 4; + int var9 = par5 + par8 >> 4; + int var10 = par7 + par8 >> 4; + this.chunkArray = new Chunk[var9 - this.chunkX + 1][var10 - this.chunkZ + 1]; +! this.isEmpty = true; + int var11; + int var12; + Chunk var13; + + for (var11 = this.chunkX; var11 <= var9; ++var11) +*************** +*** 44,60 **** + { + var13 = this.chunkArray[var11 - this.chunkX][var12 - this.chunkZ]; + + if (var13 != null && !var13.getAreLevelsEmpty(par3, par6)) + { +! this.hasExtendedLevels = false; + } + } + } + } + + /** + * Returns the block ID at coords x,y,z + */ + public int getBlockId(int par1, int par2, int par3) + { + if (par2 < 0) +--- 44,68 ---- + { + var13 = this.chunkArray[var11 - this.chunkX][var12 - this.chunkZ]; + + if (var13 != null && !var13.getAreLevelsEmpty(par3, par6)) + { +! this.isEmpty = false; + } + } + } + } + + /** ++ * set by !chunk.getAreLevelsEmpty ++ */ ++ public boolean extendedLevelsInChunkCache() ++ { ++ return this.isEmpty; ++ } ++ ++ /** + * Returns the block ID at coords x,y,z + */ + public int getBlockId(int par1, int par2, int par3) + { + if (par2 < 0) +*************** +*** 90,99 **** +--- 98,226 ---- + int var4 = (par1 >> 4) - this.chunkX; + int var5 = (par3 >> 4) - this.chunkZ; + return this.chunkArray[var4][var5].getChunkBlockTileEntity(par1 & 15, par2, par3 & 15); + } + ++ public float getBrightness(int par1, int par2, int par3, int par4) ++ { ++ int var5 = this.getLightValue(par1, par2, par3); ++ ++ if (var5 < par4) ++ { ++ var5 = par4; ++ } ++ ++ return this.worldObj.provider.lightBrightnessTable[var5]; ++ } ++ ++ /** ++ * Any Light rendered on a 1.8 Block goes through here ++ */ ++ public int getLightBrightnessForSkyBlocks(int par1, int par2, int par3, int par4) ++ { ++ int var5 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Sky, par1, par2, par3); ++ int var6 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Block, par1, par2, par3); ++ ++ if (var6 < par4) ++ { ++ var6 = par4; ++ } ++ ++ return var5 << 20 | var6 << 4; ++ } ++ ++ /** ++ * Returns how bright the block is shown as which is the block's light value looked up in a lookup table (light ++ * values aren't linear for brightness). Args: x, y, z ++ */ ++ public float getLightBrightness(int par1, int par2, int par3) ++ { ++ return this.worldObj.provider.lightBrightnessTable[this.getLightValue(par1, par2, par3)]; ++ } ++ ++ /** ++ * Gets the light value of the specified block coords. Args: x, y, z ++ */ ++ public int getLightValue(int par1, int par2, int par3) ++ { ++ return this.getLightValueExt(par1, par2, par3, true); ++ } ++ ++ /** ++ * Get light value with flag ++ */ ++ public int getLightValueExt(int par1, int par2, int par3, boolean par4) ++ { ++ if (par1 >= -30000000 && par3 >= -30000000 && par1 < 30000000 && par3 <= 30000000) ++ { ++ int var5; ++ int var6; ++ ++ if (par4) ++ { ++ var5 = this.getBlockId(par1, par2, par3); ++ ++ if (var5 == Block.stoneSingleSlab.blockID || var5 == Block.woodSingleSlab.blockID || var5 == Block.tilledField.blockID || var5 == Block.stairsWoodOak.blockID || var5 == Block.stairsCobblestone.blockID) ++ { ++ var6 = this.getLightValueExt(par1, par2 + 1, par3, false); ++ int var7 = this.getLightValueExt(par1 + 1, par2, par3, false); ++ int var8 = this.getLightValueExt(par1 - 1, par2, par3, false); ++ int var9 = this.getLightValueExt(par1, par2, par3 + 1, false); ++ int var10 = this.getLightValueExt(par1, par2, par3 - 1, false); ++ ++ if (var7 > var6) ++ { ++ var6 = var7; ++ } ++ ++ if (var8 > var6) ++ { ++ var6 = var8; ++ } ++ ++ if (var9 > var6) ++ { ++ var6 = var9; ++ } ++ ++ if (var10 > var6) ++ { ++ var6 = var10; ++ } ++ ++ return var6; ++ } ++ } ++ ++ if (par2 < 0) ++ { ++ return 0; ++ } ++ else if (par2 >= 256) ++ { ++ var5 = 15 - this.worldObj.skylightSubtracted; ++ ++ if (var5 < 0) ++ { ++ var5 = 0; ++ } ++ ++ return var5; ++ } ++ else ++ { ++ var5 = (par1 >> 4) - this.chunkX; ++ var6 = (par3 >> 4) - this.chunkZ; ++ return this.chunkArray[var5][var6].getBlockLightValue(par1 & 15, par2, par3 & 15, this.worldObj.skylightSubtracted); ++ } ++ } ++ else ++ { ++ return 15; ++ } ++ } ++ + /** + * Returns the block metadata at coords x,y,z + */ + public int getBlockMetadata(int par1, int par2, int par3) + { +*************** +*** 121,144 **** +--- 248,412 ---- + int var4 = this.getBlockId(par1, par2, par3); + return var4 == 0 ? Material.air : Block.blocksList[var4].blockMaterial; + } + + /** ++ * Gets the biome for a given set of x/z coordinates ++ */ ++ public BiomeGenBase getBiomeGenForCoords(int par1, int par2) ++ { ++ return this.worldObj.getBiomeGenForCoords(par1, par2); ++ } ++ ++ /** + * Returns true if the block at the specified coordinates is an opaque cube. Args: x, y, z + */ ++ public boolean isBlockOpaqueCube(int par1, int par2, int par3) ++ { ++ Block var4 = Block.blocksList[this.getBlockId(par1, par2, par3)]; ++ return var4 == null ? false : var4.isOpaqueCube(); ++ } ++ ++ /** ++ * Indicate if a material is a normal solid opaque cube. ++ */ + public boolean isBlockNormalCube(int par1, int par2, int par3) + { + Block var4 = Block.blocksList[this.getBlockId(par1, par2, par3)]; + return var4 == null ? false : var4.blockMaterial.blocksMovement() && var4.renderAsNormalBlock(); + } + + /** ++ * Returns true if the block at the given coordinate has a solid (buildable) top surface. ++ */ ++ public boolean doesBlockHaveSolidTopSurface(int par1, int par2, int par3) ++ { ++ Block var4 = Block.blocksList[this.getBlockId(par1, par2, par3)]; ++ return this.worldObj.isBlockTopFacingSurfaceSolid(var4, this.getBlockMetadata(par1, par2, par3)); ++ } ++ ++ /** + * Return the Vec3Pool object for this world. + */ + public Vec3Pool getWorldVec3Pool() + { + return this.worldObj.getWorldVec3Pool(); ++ } ++ ++ /** ++ * Returns true if the block at the specified coordinates is empty ++ */ ++ public boolean isAirBlock(int par1, int par2, int par3) ++ { ++ Block var4 = Block.blocksList[this.getBlockId(par1, par2, par3)]; ++ return var4 == null; ++ } ++ ++ /** ++ * Brightness for SkyBlock.Sky is clear white and (through color computing it is assumed) DEPENDENT ON DAYTIME. ++ * Brightness for SkyBlock.Block is yellowish and independent. ++ */ ++ public int getSkyBlockTypeBrightness(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4) ++ { ++ if (par3 < 0) ++ { ++ par3 = 0; ++ } ++ ++ if (par3 >= 256) ++ { ++ par3 = 255; ++ } ++ ++ if (par3 >= 0 && par3 < 256 && par2 >= -30000000 && par4 >= -30000000 && par2 < 30000000 && par4 <= 30000000) ++ { ++ if (par1EnumSkyBlock == EnumSkyBlock.Sky && this.worldObj.provider.hasNoSky) ++ { ++ return 0; ++ } ++ else ++ { ++ int var5; ++ int var6; ++ ++ if (Block.useNeighborBrightness[this.getBlockId(par2, par3, par4)]) ++ { ++ var5 = this.getSpecialBlockBrightness(par1EnumSkyBlock, par2, par3 + 1, par4); ++ var6 = this.getSpecialBlockBrightness(par1EnumSkyBlock, par2 + 1, par3, par4); ++ int var7 = this.getSpecialBlockBrightness(par1EnumSkyBlock, par2 - 1, par3, par4); ++ int var8 = this.getSpecialBlockBrightness(par1EnumSkyBlock, par2, par3, par4 + 1); ++ int var9 = this.getSpecialBlockBrightness(par1EnumSkyBlock, par2, par3, par4 - 1); ++ ++ if (var6 > var5) ++ { ++ var5 = var6; ++ } ++ ++ if (var7 > var5) ++ { ++ var5 = var7; ++ } ++ ++ if (var8 > var5) ++ { ++ var5 = var8; ++ } ++ ++ if (var9 > var5) ++ { ++ var5 = var9; ++ } ++ ++ return var5; ++ } ++ else ++ { ++ var5 = (par2 >> 4) - this.chunkX; ++ var6 = (par4 >> 4) - this.chunkZ; ++ return this.chunkArray[var5][var6].getSavedLightValue(par1EnumSkyBlock, par2 & 15, par3, par4 & 15); ++ } ++ } ++ } ++ else ++ { ++ return par1EnumSkyBlock.defaultLightValue; ++ } ++ } ++ ++ /** ++ * is only used on stairs and tilled fields ++ */ ++ public int getSpecialBlockBrightness(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4) ++ { ++ if (par3 < 0) ++ { ++ par3 = 0; ++ } ++ ++ if (par3 >= 256) ++ { ++ par3 = 255; ++ } ++ ++ if (par3 >= 0 && par3 < 256 && par2 >= -30000000 && par4 >= -30000000 && par2 < 30000000 && par4 <= 30000000) ++ { ++ int var5 = (par2 >> 4) - this.chunkX; ++ int var6 = (par4 >> 4) - this.chunkZ; ++ return this.chunkArray[var5][var6].getSavedLightValue(par1EnumSkyBlock, par2 & 15, par3, par4 & 15); ++ } ++ else ++ { ++ return par1EnumSkyBlock.defaultLightValue; ++ } ++ } ++ ++ /** ++ * Returns current world height. ++ */ ++ public int getHeight() ++ { ++ return 256; + } + + /** + * Is this block powering in the specified direction Args: x, y, z, direction + */ +*** ChunkCoordinates.java Sat Feb 5 04:13:12 2022 +--- ChunkCoordinates.java Sat Feb 5 04:12:33 2022 +*** ChunkCoordIntPair.java Sat Feb 5 04:13:12 2022 +--- ChunkCoordIntPair.java Sat Feb 5 04:12:33 2022 +*** ChunkLoader.java Sat Feb 5 04:13:12 2022 +--- ChunkLoader.java Sat Feb 5 04:12:33 2022 +*** ChunkPosition.java Sat Feb 5 04:13:12 2022 +--- ChunkPosition.java Sat Feb 5 04:12:33 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ChunkProviderClient.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,146 ---- ++ package net.minecraft.src; ++ ++ import java.util.ArrayList; ++ import java.util.List; ++ ++ public class ChunkProviderClient implements IChunkProvider ++ { ++ /** ++ * The completely empty chunk used by ChunkProviderClient when chunkMapping doesn't contain the requested ++ * coordinates. ++ */ ++ private Chunk blankChunk; ++ ++ /** ++ * The mapping between ChunkCoordinates and Chunks that ChunkProviderClient maintains. ++ */ ++ private LongHashMap chunkMapping = new LongHashMap(); ++ ++ /** ++ * This may have been intended to be an iterable version of all currently loaded chunks (MultiplayerChunkCache), ++ * with identical contents to chunkMapping's values. However it is never actually added to. ++ */ ++ private List chunkListing = new ArrayList(); ++ ++ /** Reference to the World object. */ ++ private World worldObj; ++ ++ public ChunkProviderClient(World par1World) ++ { ++ this.blankChunk = new EmptyChunk(par1World, 0, 0); ++ this.worldObj = par1World; ++ } ++ ++ /** ++ * Checks to see if a chunk exists at x, y ++ */ ++ public boolean chunkExists(int par1, int par2) ++ { ++ return true; ++ } ++ ++ /** ++ * Unload chunk from ChunkProviderClient's hashmap. Called in response to a Packet50PreChunk with its mode field set ++ * to false ++ */ ++ public void unloadChunk(int par1, int par2) ++ { ++ Chunk var3 = this.provideChunk(par1, par2); ++ ++ if (!var3.isEmpty()) ++ { ++ var3.onChunkUnload(); ++ } ++ ++ this.chunkMapping.remove(ChunkCoordIntPair.chunkXZ2Int(par1, par2)); ++ this.chunkListing.remove(var3); ++ } ++ ++ /** ++ * loads or generates the chunk at the chunk location specified ++ */ ++ public Chunk loadChunk(int par1, int par2) ++ { ++ Chunk var3 = new Chunk(this.worldObj, par1, par2); ++ this.chunkMapping.add(ChunkCoordIntPair.chunkXZ2Int(par1, par2), var3); ++ var3.isChunkLoaded = true; ++ return var3; ++ } ++ ++ /** ++ * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the ++ * specified chunk from the map seed and chunk seed ++ */ ++ public Chunk provideChunk(int par1, int par2) ++ { ++ Chunk var3 = (Chunk)this.chunkMapping.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(par1, par2)); ++ return var3 == null ? this.blankChunk : var3; ++ } ++ ++ /** ++ * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. ++ * Return true if all chunks have been saved. ++ */ ++ public boolean saveChunks(boolean par1, IProgressUpdate par2IProgressUpdate) ++ { ++ return true; ++ } ++ ++ /** ++ * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently ++ * unimplemented. ++ */ ++ public void saveExtraData() {} ++ ++ /** ++ * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. ++ */ ++ public boolean unloadQueuedChunks() ++ { ++ return false; ++ } ++ ++ /** ++ * Returns if the IChunkProvider supports saving. ++ */ ++ public boolean canSave() ++ { ++ return false; ++ } ++ ++ /** ++ * Populates chunk with ores etc etc ++ */ ++ public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) {} ++ ++ /** ++ * Converts the instance data to a readable string. ++ */ ++ public String makeString() ++ { ++ return "MultiplayerChunkCache: " + this.chunkMapping.getNumHashElements(); ++ } ++ ++ /** ++ * Returns a list of creatures of the specified type that can spawn at the given location. ++ */ ++ public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) ++ { ++ return null; ++ } ++ ++ /** ++ * Returns the location of the closest structure of the specified type. If not found returns null. ++ */ ++ public ChunkPosition findClosestStructure(World par1World, String par2Str, int par3, int par4, int par5) ++ { ++ return null; ++ } ++ ++ public int getLoadedChunkCount() ++ { ++ return this.chunkListing.size(); ++ } ++ ++ public void recreateStructures(int par1, int par2) {} ++ } +*** ChunkProviderEnd.java Sat Feb 5 04:13:12 2022 +--- ChunkProviderEnd.java Sat Feb 5 04:12:33 2022 +*** ChunkProviderFlat.java Sat Feb 5 04:13:12 2022 +--- ChunkProviderFlat.java Sat Feb 5 04:12:33 2022 +*** ChunkProviderGenerate.java Sat Feb 5 04:13:12 2022 +--- ChunkProviderGenerate.java Sat Feb 5 04:12:33 2022 +*** ChunkProviderHell.java Sat Feb 5 04:13:12 2022 +--- ChunkProviderHell.java Sat Feb 5 04:12:33 2022 +*** ChunkProviderServer.java Sat Feb 5 04:13:12 2022 +--- ChunkProviderServer.java Sat Feb 5 04:12:33 2022 +*************** +*** 7,71 **** + import java.util.List; + import java.util.Set; + + public class ChunkProviderServer implements IChunkProvider + { +- private Set droppedChunksSet = new HashSet(); +- +- /** a dummy chunk, returned in place of an actual chunk. */ +- private Chunk dummyChunk; +- + /** +! * chunk generator object. Calls to load nonexistent chunks are forwarded to this object. + */ +! private IChunkProvider serverChunkGenerator; +! private IChunkLoader chunkLoader; + + /** +! * if set, this flag forces a request to load a chunk to load the chunk rather than defaulting to the dummy if +! * possible + */ +! public boolean chunkLoadOverride = true; +! +! /** map of chunk Id's to Chunk instances */ +! private LongHashMap id2ChunkMap = new LongHashMap(); + private List loadedChunks = new ArrayList(); + private WorldServer worldObj; + + public ChunkProviderServer(WorldServer par1WorldServer, IChunkLoader par2IChunkLoader, IChunkProvider par3IChunkProvider) + { +! this.dummyChunk = new EmptyChunk(par1WorldServer, 0, 0); + this.worldObj = par1WorldServer; +! this.chunkLoader = par2IChunkLoader; +! this.serverChunkGenerator = par3IChunkProvider; + } + + /** + * Checks to see if a chunk exists at x, y + */ + public boolean chunkExists(int par1, int par2) + { +! return this.id2ChunkMap.containsItem(ChunkCoordIntPair.chunkXZ2Int(par1, par2)); + } + +! public void dropChunk(int par1, int par2) + { + if (this.worldObj.provider.canRespawnHere()) + { + ChunkCoordinates var3 = this.worldObj.getSpawnPoint(); + int var4 = par1 * 16 + 8 - var3.posX; + int var5 = par2 * 16 + 8 - var3.posZ; + short var6 = 128; + + if (var4 < -var6 || var4 > var6 || var5 < -var6 || var5 > var6) + { +! this.droppedChunksSet.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(par1, par2))); + } + } + else + { +! this.droppedChunksSet.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(par1, par2))); + } + } + + /** + * marks all chunks for unload, ignoring those near the spawn +--- 7,70 ---- + import java.util.List; + import java.util.Set; + + public class ChunkProviderServer implements IChunkProvider + { + /** +! * used by unload100OldestChunks to iterate the loadedChunkHashMap for unload (underlying assumption, first in, +! * first out) + */ +! private Set chunksToUnload = new HashSet(); +! private Chunk defaultEmptyChunk; +! private IChunkProvider currentChunkProvider; +! private IChunkLoader currentChunkLoader; + + /** +! * if this is false, the defaultEmptyChunk will be returned by the provider + */ +! public boolean loadChunkOnProvideRequest = true; +! private LongHashMap loadedChunkHashMap = new LongHashMap(); + private List loadedChunks = new ArrayList(); + private WorldServer worldObj; + + public ChunkProviderServer(WorldServer par1WorldServer, IChunkLoader par2IChunkLoader, IChunkProvider par3IChunkProvider) + { +! this.defaultEmptyChunk = new EmptyChunk(par1WorldServer, 0, 0); + this.worldObj = par1WorldServer; +! this.currentChunkLoader = par2IChunkLoader; +! this.currentChunkProvider = par3IChunkProvider; + } + + /** + * Checks to see if a chunk exists at x, y + */ + public boolean chunkExists(int par1, int par2) + { +! return this.loadedChunkHashMap.containsItem(ChunkCoordIntPair.chunkXZ2Int(par1, par2)); + } + +! /** +! * marks chunk for unload by "unload100OldestChunks" if there is no spawn point, or if the center of the chunk is +! * outside 200 blocks (x or z) of the spawn +! */ +! public void unloadChunksIfNotNearSpawn(int par1, int par2) + { + if (this.worldObj.provider.canRespawnHere()) + { + ChunkCoordinates var3 = this.worldObj.getSpawnPoint(); + int var4 = par1 * 16 + 8 - var3.posX; + int var5 = par2 * 16 + 8 - var3.posZ; + short var6 = 128; + + if (var4 < -var6 || var4 > var6 || var5 < -var6 || var5 > var6) + { +! this.chunksToUnload.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(par1, par2))); + } + } + else + { +! this.chunksToUnload.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(par1, par2))); + } + } + + /** + * marks all chunks for unload, ignoring those near the spawn +*************** +*** 75,126 **** + Iterator var1 = this.loadedChunks.iterator(); + + while (var1.hasNext()) + { + Chunk var2 = (Chunk)var1.next(); +! this.dropChunk(var2.xPosition, var2.zPosition); + } + } + + /** + * loads or generates the chunk at the chunk location specified + */ + public Chunk loadChunk(int par1, int par2) + { + long var3 = ChunkCoordIntPair.chunkXZ2Int(par1, par2); +! this.droppedChunksSet.remove(Long.valueOf(var3)); +! Chunk var5 = (Chunk)this.id2ChunkMap.getValueByKey(var3); + + if (var5 == null) + { +! var5 = this.loadChunkFromFile(par1, par2); + + if (var5 == null) + { +! if (this.serverChunkGenerator == null) + { +! var5 = this.dummyChunk; + } + else + { + try + { +! var5 = this.serverChunkGenerator.provideChunk(par1, par2); + } + catch (Throwable var9) + { + CrashReport var7 = CrashReport.makeCrashReport(var9, "Exception generating new chunk"); + CrashReportCategory var8 = var7.makeCategory("Chunk to be generated"); + var8.addCrashSection("Location", String.format("%d,%d", new Object[] {Integer.valueOf(par1), Integer.valueOf(par2)})); + var8.addCrashSection("Position hash", Long.valueOf(var3)); +! var8.addCrashSection("Generator", this.serverChunkGenerator.makeString()); + throw new ReportedException(var7); + } + } + } + +! this.id2ChunkMap.add(var3, var5); + this.loadedChunks.add(var5); + + if (var5 != null) + { + var5.onChunkLoad(); +--- 74,125 ---- + Iterator var1 = this.loadedChunks.iterator(); + + while (var1.hasNext()) + { + Chunk var2 = (Chunk)var1.next(); +! this.unloadChunksIfNotNearSpawn(var2.xPosition, var2.zPosition); + } + } + + /** + * loads or generates the chunk at the chunk location specified + */ + public Chunk loadChunk(int par1, int par2) + { + long var3 = ChunkCoordIntPair.chunkXZ2Int(par1, par2); +! this.chunksToUnload.remove(Long.valueOf(var3)); +! Chunk var5 = (Chunk)this.loadedChunkHashMap.getValueByKey(var3); + + if (var5 == null) + { +! var5 = this.safeLoadChunk(par1, par2); + + if (var5 == null) + { +! if (this.currentChunkProvider == null) + { +! var5 = this.defaultEmptyChunk; + } + else + { + try + { +! var5 = this.currentChunkProvider.provideChunk(par1, par2); + } + catch (Throwable var9) + { + CrashReport var7 = CrashReport.makeCrashReport(var9, "Exception generating new chunk"); + CrashReportCategory var8 = var7.makeCategory("Chunk to be generated"); + var8.addCrashSection("Location", String.format("%d,%d", new Object[] {Integer.valueOf(par1), Integer.valueOf(par2)})); + var8.addCrashSection("Position hash", Long.valueOf(var3)); +! var8.addCrashSection("Generator", this.currentChunkProvider.makeString()); + throw new ReportedException(var7); + } + } + } + +! this.loadedChunkHashMap.add(var3, var5); + this.loadedChunks.add(var5); + + if (var5 != null) + { + var5.onChunkLoad(); +*************** +*** 136,168 **** + * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the + * specified chunk from the map seed and chunk seed + */ + public Chunk provideChunk(int par1, int par2) + { +! Chunk var3 = (Chunk)this.id2ChunkMap.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(par1, par2)); +! return var3 == null ? (!this.worldObj.findingSpawnPoint && !this.chunkLoadOverride ? this.dummyChunk : this.loadChunk(par1, par2)) : var3; + } + +! private Chunk loadChunkFromFile(int par1, int par2) + { +! if (this.chunkLoader == null) + { + return null; + } + else + { + try + { +! Chunk var3 = this.chunkLoader.loadChunk(this.worldObj, par1, par2); + + if (var3 != null) + { + var3.lastSaveTime = this.worldObj.getTotalWorldTime(); + +! if (this.serverChunkGenerator != null) + { +! this.serverChunkGenerator.recreateStructures(par1, par2); + } + } + + return var3; + } +--- 135,170 ---- + * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the + * specified chunk from the map seed and chunk seed + */ + public Chunk provideChunk(int par1, int par2) + { +! Chunk var3 = (Chunk)this.loadedChunkHashMap.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(par1, par2)); +! return var3 == null ? (!this.worldObj.findingSpawnPoint && !this.loadChunkOnProvideRequest ? this.defaultEmptyChunk : this.loadChunk(par1, par2)) : var3; + } + +! /** +! * used by loadChunk, but catches any exceptions if the load fails. +! */ +! private Chunk safeLoadChunk(int par1, int par2) + { +! if (this.currentChunkLoader == null) + { + return null; + } + else + { + try + { +! Chunk var3 = this.currentChunkLoader.loadChunk(this.worldObj, par1, par2); + + if (var3 != null) + { + var3.lastSaveTime = this.worldObj.getTotalWorldTime(); + +! if (this.currentChunkProvider != null) + { +! this.currentChunkProvider.recreateStructures(par1, par2); + } + } + + return var3; + } +*************** +*** 172,204 **** + return null; + } + } + } + +! private void saveChunkExtraData(Chunk par1Chunk) + { +! if (this.chunkLoader != null) + { + try + { +! this.chunkLoader.saveExtraChunkData(this.worldObj, par1Chunk); + } + catch (Exception var3) + { + var3.printStackTrace(); + } + } + } + +! private void saveChunkData(Chunk par1Chunk) + { +! if (this.chunkLoader != null) + { + try + { + par1Chunk.lastSaveTime = this.worldObj.getTotalWorldTime(); +! this.chunkLoader.saveChunk(this.worldObj, par1Chunk); + } + catch (IOException var3) + { + var3.printStackTrace(); + } +--- 174,212 ---- + return null; + } + } + } + +! /** +! * used by saveChunks, but catches any exceptions if the save fails. +! */ +! private void safeSaveExtraChunkData(Chunk par1Chunk) + { +! if (this.currentChunkLoader != null) + { + try + { +! this.currentChunkLoader.saveExtraChunkData(this.worldObj, par1Chunk); + } + catch (Exception var3) + { + var3.printStackTrace(); + } + } + } + +! /** +! * used by saveChunks, but catches any exceptions if the save fails. +! */ +! private void safeSaveChunk(Chunk par1Chunk) + { +! if (this.currentChunkLoader != null) + { + try + { + par1Chunk.lastSaveTime = this.worldObj.getTotalWorldTime(); +! this.currentChunkLoader.saveChunk(this.worldObj, par1Chunk); + } + catch (IOException var3) + { + var3.printStackTrace(); + } +*************** +*** 218,230 **** + + if (!var4.isTerrainPopulated) + { + var4.isTerrainPopulated = true; + +! if (this.serverChunkGenerator != null) + { +! this.serverChunkGenerator.populate(par1IChunkProvider, par2, par3); + var4.setChunkModified(); + } + } + } + +--- 226,238 ---- + + if (!var4.isTerrainPopulated) + { + var4.isTerrainPopulated = true; + +! if (this.currentChunkProvider != null) + { +! this.currentChunkProvider.populate(par1IChunkProvider, par2, par3); + var4.setChunkModified(); + } + } + } + +*************** +*** 240,255 **** + { + Chunk var5 = (Chunk)this.loadedChunks.get(var4); + + if (par1) + { +! this.saveChunkExtraData(var5); + } + + if (var5.needsSaving(par1)) + { +! this.saveChunkData(var5); + var5.isModified = false; + ++var3; + + if (var3 == 24 && !par1) + { +--- 248,263 ---- + { + Chunk var5 = (Chunk)this.loadedChunks.get(var4); + + if (par1) + { +! this.safeSaveExtraChunkData(var5); + } + + if (var5.needsSaving(par1)) + { +! this.safeSaveChunk(var5); + var5.isModified = false; + ++var3; + + if (var3 == 24 && !par1) + { +*************** +*** 265,345 **** + * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently + * unimplemented. + */ + public void saveExtraData() + { +! if (this.chunkLoader != null) + { +! this.chunkLoader.saveExtraData(); + } + } + + /** + * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. + */ + public boolean unloadQueuedChunks() + { +! if (!this.worldObj.levelSaving) + { + for (int var1 = 0; var1 < 100; ++var1) + { +! if (!this.droppedChunksSet.isEmpty()) + { +! Long var2 = (Long)this.droppedChunksSet.iterator().next(); +! Chunk var3 = (Chunk)this.id2ChunkMap.getValueByKey(var2.longValue()); + var3.onChunkUnload(); +! this.saveChunkData(var3); +! this.saveChunkExtraData(var3); +! this.droppedChunksSet.remove(var2); +! this.id2ChunkMap.remove(var2.longValue()); + this.loadedChunks.remove(var3); + } + } + +! if (this.chunkLoader != null) + { +! this.chunkLoader.chunkTick(); + } + } + +! return this.serverChunkGenerator.unloadQueuedChunks(); + } + + /** + * Returns if the IChunkProvider supports saving. + */ + public boolean canSave() + { +! return !this.worldObj.levelSaving; + } + + /** + * Converts the instance data to a readable string. + */ + public String makeString() + { +! return "ServerChunkCache: " + this.id2ChunkMap.getNumHashElements() + " Drop: " + this.droppedChunksSet.size(); + } + + /** + * Returns a list of creatures of the specified type that can spawn at the given location. + */ + public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) + { +! return this.serverChunkGenerator.getPossibleCreatures(par1EnumCreatureType, par2, par3, par4); + } + + /** + * Returns the location of the closest structure of the specified type. If not found returns null. + */ + public ChunkPosition findClosestStructure(World par1World, String par2Str, int par3, int par4, int par5) + { +! return this.serverChunkGenerator.findClosestStructure(par1World, par2Str, par3, par4, par5); + } + + public int getLoadedChunkCount() + { +! return this.id2ChunkMap.getNumHashElements(); + } + + public void recreateStructures(int par1, int par2) {} + } +--- 273,353 ---- + * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently + * unimplemented. + */ + public void saveExtraData() + { +! if (this.currentChunkLoader != null) + { +! this.currentChunkLoader.saveExtraData(); + } + } + + /** + * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. + */ + public boolean unloadQueuedChunks() + { +! if (!this.worldObj.canNotSave) + { + for (int var1 = 0; var1 < 100; ++var1) + { +! if (!this.chunksToUnload.isEmpty()) + { +! Long var2 = (Long)this.chunksToUnload.iterator().next(); +! Chunk var3 = (Chunk)this.loadedChunkHashMap.getValueByKey(var2.longValue()); + var3.onChunkUnload(); +! this.safeSaveChunk(var3); +! this.safeSaveExtraChunkData(var3); +! this.chunksToUnload.remove(var2); +! this.loadedChunkHashMap.remove(var2.longValue()); + this.loadedChunks.remove(var3); + } + } + +! if (this.currentChunkLoader != null) + { +! this.currentChunkLoader.chunkTick(); + } + } + +! return this.currentChunkProvider.unloadQueuedChunks(); + } + + /** + * Returns if the IChunkProvider supports saving. + */ + public boolean canSave() + { +! return !this.worldObj.canNotSave; + } + + /** + * Converts the instance data to a readable string. + */ + public String makeString() + { +! return "ServerChunkCache: " + this.loadedChunkHashMap.getNumHashElements() + " Drop: " + this.chunksToUnload.size(); + } + + /** + * Returns a list of creatures of the specified type that can spawn at the given location. + */ + public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) + { +! return this.currentChunkProvider.getPossibleCreatures(par1EnumCreatureType, par2, par3, par4); + } + + /** + * Returns the location of the closest structure of the specified type. If not found returns null. + */ + public ChunkPosition findClosestStructure(World par1World, String par2Str, int par3, int par4, int par5) + { +! return this.currentChunkProvider.findClosestStructure(par1World, par2Str, par3, par4, par5); + } + + public int getLoadedChunkCount() + { +! return this.loadedChunkHashMap.getNumHashElements(); + } + + public void recreateStructures(int par1, int par2) {} + } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ClippingHelper.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,25 ---- ++ package net.minecraft.src; ++ ++ public class ClippingHelper ++ { ++ public float[][] frustum = new float[16][16]; ++ public float[] projectionMatrix = new float[16]; ++ public float[] modelviewMatrix = new float[16]; ++ public float[] clippingMatrix = new float[16]; ++ ++ /** ++ * Returns true if the box is inside all 6 clipping planes, otherwise returns false. ++ */ ++ public boolean isBoxInFrustum(double par1, double par3, double par5, double par7, double par9, double par11) ++ { ++ for (int var13 = 0; var13 < 6; ++var13) ++ { ++ if ((double)this.frustum[var13][0] * par1 + (double)this.frustum[var13][1] * par3 + (double)this.frustum[var13][2] * par5 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * par7 + (double)this.frustum[var13][1] * par3 + (double)this.frustum[var13][2] * par5 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * par1 + (double)this.frustum[var13][1] * par9 + (double)this.frustum[var13][2] * par5 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * par7 + (double)this.frustum[var13][1] * par9 + (double)this.frustum[var13][2] * par5 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * par1 + (double)this.frustum[var13][1] * par3 + (double)this.frustum[var13][2] * par11 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * par7 + (double)this.frustum[var13][1] * par3 + (double)this.frustum[var13][2] * par11 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * par1 + (double)this.frustum[var13][1] * par9 + (double)this.frustum[var13][2] * par11 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * par7 + (double)this.frustum[var13][1] * par9 + (double)this.frustum[var13][2] * par11 + (double)this.frustum[var13][3] <= 0.0D) ++ { ++ return false; ++ } ++ } ++ ++ return true; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ClippingHelperImpl.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,92 ---- ++ package net.minecraft.src; ++ ++ import java.nio.FloatBuffer; ++ import org.lwjgl.opengl.GL11; ++ ++ public class ClippingHelperImpl extends ClippingHelper ++ { ++ private static ClippingHelperImpl instance = new ClippingHelperImpl(); ++ private FloatBuffer projectionMatrixBuffer = GLAllocation.createDirectFloatBuffer(16); ++ private FloatBuffer modelviewMatrixBuffer = GLAllocation.createDirectFloatBuffer(16); ++ private FloatBuffer field_78564_h = GLAllocation.createDirectFloatBuffer(16); ++ ++ /** ++ * Initialises the ClippingHelper object then returns an instance of it. ++ */ ++ public static ClippingHelper getInstance() ++ { ++ instance.init(); ++ return instance; ++ } ++ ++ /** ++ * Normalize the frustum. ++ */ ++ private void normalize(float[][] par1ArrayOfFloat, int par2) ++ { ++ float var3 = MathHelper.sqrt_float(par1ArrayOfFloat[par2][0] * par1ArrayOfFloat[par2][0] + par1ArrayOfFloat[par2][1] * par1ArrayOfFloat[par2][1] + par1ArrayOfFloat[par2][2] * par1ArrayOfFloat[par2][2]); ++ par1ArrayOfFloat[par2][0] /= var3; ++ par1ArrayOfFloat[par2][1] /= var3; ++ par1ArrayOfFloat[par2][2] /= var3; ++ par1ArrayOfFloat[par2][3] /= var3; ++ } ++ ++ private void init() ++ { ++ this.projectionMatrixBuffer.clear(); ++ this.modelviewMatrixBuffer.clear(); ++ this.field_78564_h.clear(); ++ GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, this.projectionMatrixBuffer); ++ GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, this.modelviewMatrixBuffer); ++ this.projectionMatrixBuffer.flip().limit(16); ++ this.projectionMatrixBuffer.get(this.projectionMatrix); ++ this.modelviewMatrixBuffer.flip().limit(16); ++ this.modelviewMatrixBuffer.get(this.modelviewMatrix); ++ this.clippingMatrix[0] = this.modelviewMatrix[0] * this.projectionMatrix[0] + this.modelviewMatrix[1] * this.projectionMatrix[4] + this.modelviewMatrix[2] * this.projectionMatrix[8] + this.modelviewMatrix[3] * this.projectionMatrix[12]; ++ this.clippingMatrix[1] = this.modelviewMatrix[0] * this.projectionMatrix[1] + this.modelviewMatrix[1] * this.projectionMatrix[5] + this.modelviewMatrix[2] * this.projectionMatrix[9] + this.modelviewMatrix[3] * this.projectionMatrix[13]; ++ this.clippingMatrix[2] = this.modelviewMatrix[0] * this.projectionMatrix[2] + this.modelviewMatrix[1] * this.projectionMatrix[6] + this.modelviewMatrix[2] * this.projectionMatrix[10] + this.modelviewMatrix[3] * this.projectionMatrix[14]; ++ this.clippingMatrix[3] = this.modelviewMatrix[0] * this.projectionMatrix[3] + this.modelviewMatrix[1] * this.projectionMatrix[7] + this.modelviewMatrix[2] * this.projectionMatrix[11] + this.modelviewMatrix[3] * this.projectionMatrix[15]; ++ this.clippingMatrix[4] = this.modelviewMatrix[4] * this.projectionMatrix[0] + this.modelviewMatrix[5] * this.projectionMatrix[4] + this.modelviewMatrix[6] * this.projectionMatrix[8] + this.modelviewMatrix[7] * this.projectionMatrix[12]; ++ this.clippingMatrix[5] = this.modelviewMatrix[4] * this.projectionMatrix[1] + this.modelviewMatrix[5] * this.projectionMatrix[5] + this.modelviewMatrix[6] * this.projectionMatrix[9] + this.modelviewMatrix[7] * this.projectionMatrix[13]; ++ this.clippingMatrix[6] = this.modelviewMatrix[4] * this.projectionMatrix[2] + this.modelviewMatrix[5] * this.projectionMatrix[6] + this.modelviewMatrix[6] * this.projectionMatrix[10] + this.modelviewMatrix[7] * this.projectionMatrix[14]; ++ this.clippingMatrix[7] = this.modelviewMatrix[4] * this.projectionMatrix[3] + this.modelviewMatrix[5] * this.projectionMatrix[7] + this.modelviewMatrix[6] * this.projectionMatrix[11] + this.modelviewMatrix[7] * this.projectionMatrix[15]; ++ this.clippingMatrix[8] = this.modelviewMatrix[8] * this.projectionMatrix[0] + this.modelviewMatrix[9] * this.projectionMatrix[4] + this.modelviewMatrix[10] * this.projectionMatrix[8] + this.modelviewMatrix[11] * this.projectionMatrix[12]; ++ this.clippingMatrix[9] = this.modelviewMatrix[8] * this.projectionMatrix[1] + this.modelviewMatrix[9] * this.projectionMatrix[5] + this.modelviewMatrix[10] * this.projectionMatrix[9] + this.modelviewMatrix[11] * this.projectionMatrix[13]; ++ this.clippingMatrix[10] = this.modelviewMatrix[8] * this.projectionMatrix[2] + this.modelviewMatrix[9] * this.projectionMatrix[6] + this.modelviewMatrix[10] * this.projectionMatrix[10] + this.modelviewMatrix[11] * this.projectionMatrix[14]; ++ this.clippingMatrix[11] = this.modelviewMatrix[8] * this.projectionMatrix[3] + this.modelviewMatrix[9] * this.projectionMatrix[7] + this.modelviewMatrix[10] * this.projectionMatrix[11] + this.modelviewMatrix[11] * this.projectionMatrix[15]; ++ this.clippingMatrix[12] = this.modelviewMatrix[12] * this.projectionMatrix[0] + this.modelviewMatrix[13] * this.projectionMatrix[4] + this.modelviewMatrix[14] * this.projectionMatrix[8] + this.modelviewMatrix[15] * this.projectionMatrix[12]; ++ this.clippingMatrix[13] = this.modelviewMatrix[12] * this.projectionMatrix[1] + this.modelviewMatrix[13] * this.projectionMatrix[5] + this.modelviewMatrix[14] * this.projectionMatrix[9] + this.modelviewMatrix[15] * this.projectionMatrix[13]; ++ this.clippingMatrix[14] = this.modelviewMatrix[12] * this.projectionMatrix[2] + this.modelviewMatrix[13] * this.projectionMatrix[6] + this.modelviewMatrix[14] * this.projectionMatrix[10] + this.modelviewMatrix[15] * this.projectionMatrix[14]; ++ this.clippingMatrix[15] = this.modelviewMatrix[12] * this.projectionMatrix[3] + this.modelviewMatrix[13] * this.projectionMatrix[7] + this.modelviewMatrix[14] * this.projectionMatrix[11] + this.modelviewMatrix[15] * this.projectionMatrix[15]; ++ this.frustum[0][0] = this.clippingMatrix[3] - this.clippingMatrix[0]; ++ this.frustum[0][1] = this.clippingMatrix[7] - this.clippingMatrix[4]; ++ this.frustum[0][2] = this.clippingMatrix[11] - this.clippingMatrix[8]; ++ this.frustum[0][3] = this.clippingMatrix[15] - this.clippingMatrix[12]; ++ this.normalize(this.frustum, 0); ++ this.frustum[1][0] = this.clippingMatrix[3] + this.clippingMatrix[0]; ++ this.frustum[1][1] = this.clippingMatrix[7] + this.clippingMatrix[4]; ++ this.frustum[1][2] = this.clippingMatrix[11] + this.clippingMatrix[8]; ++ this.frustum[1][3] = this.clippingMatrix[15] + this.clippingMatrix[12]; ++ this.normalize(this.frustum, 1); ++ this.frustum[2][0] = this.clippingMatrix[3] + this.clippingMatrix[1]; ++ this.frustum[2][1] = this.clippingMatrix[7] + this.clippingMatrix[5]; ++ this.frustum[2][2] = this.clippingMatrix[11] + this.clippingMatrix[9]; ++ this.frustum[2][3] = this.clippingMatrix[15] + this.clippingMatrix[13]; ++ this.normalize(this.frustum, 2); ++ this.frustum[3][0] = this.clippingMatrix[3] - this.clippingMatrix[1]; ++ this.frustum[3][1] = this.clippingMatrix[7] - this.clippingMatrix[5]; ++ this.frustum[3][2] = this.clippingMatrix[11] - this.clippingMatrix[9]; ++ this.frustum[3][3] = this.clippingMatrix[15] - this.clippingMatrix[13]; ++ this.normalize(this.frustum, 3); ++ this.frustum[4][0] = this.clippingMatrix[3] - this.clippingMatrix[2]; ++ this.frustum[4][1] = this.clippingMatrix[7] - this.clippingMatrix[6]; ++ this.frustum[4][2] = this.clippingMatrix[11] - this.clippingMatrix[10]; ++ this.frustum[4][3] = this.clippingMatrix[15] - this.clippingMatrix[14]; ++ this.normalize(this.frustum, 4); ++ this.frustum[5][0] = this.clippingMatrix[3] + this.clippingMatrix[2]; ++ this.frustum[5][1] = this.clippingMatrix[7] + this.clippingMatrix[6]; ++ this.frustum[5][2] = this.clippingMatrix[11] + this.clippingMatrix[10]; ++ this.frustum[5][3] = this.clippingMatrix[15] + this.clippingMatrix[14]; ++ this.normalize(this.frustum, 5); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ColorizerFoliage.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,44 ---- ++ package net.minecraft.src; ++ ++ public class ColorizerFoliage ++ { ++ /** Color buffer for foliage */ ++ private static int[] foliageBuffer = new int[65536]; ++ ++ public static void setFoliageBiomeColorizer(int[] par0ArrayOfInteger) ++ { ++ foliageBuffer = par0ArrayOfInteger; ++ } ++ ++ /** ++ * Gets foliage color from temperature and humidity. Args: temperature, humidity ++ */ ++ public static int getFoliageColor(double par0, double par2) ++ { ++ par2 *= par0; ++ int var4 = (int)((1.0D - par0) * 255.0D); ++ int var5 = (int)((1.0D - par2) * 255.0D); ++ return foliageBuffer[var5 << 8 | var4]; ++ } ++ ++ /** ++ * Gets the foliage color for pine type (metadata 1) trees ++ */ ++ public static int getFoliageColorPine() ++ { ++ return 6396257; ++ } ++ ++ /** ++ * Gets the foliage color for birch type (metadata 2) trees ++ */ ++ public static int getFoliageColorBirch() ++ { ++ return 8431445; ++ } ++ ++ public static int getFoliageColorBasic() ++ { ++ return 4764952; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ColorizerGrass.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,23 ---- ++ package net.minecraft.src; ++ ++ public class ColorizerGrass ++ { ++ /** Color buffer for grass */ ++ private static int[] grassBuffer = new int[65536]; ++ ++ public static void setGrassBiomeColorizer(int[] par0ArrayOfInteger) ++ { ++ grassBuffer = par0ArrayOfInteger; ++ } ++ ++ /** ++ * Gets grass color from temperature and humidity. Args: temperature, humidity ++ */ ++ public static int getGrassColor(double par0, double par2) ++ { ++ par2 *= par0; ++ int var4 = (int)((1.0D - par0) * 255.0D); ++ int var5 = (int)((1.0D - par2) * 255.0D); ++ return grassBuffer[var5 << 8 | var4]; ++ } ++ } +*** CombatEntry.java Sat Feb 5 04:13:12 2022 +--- CombatEntry.java Sat Feb 5 04:12:33 2022 +*** CombatTracker.java Sat Feb 5 04:13:12 2022 +--- CombatTracker.java Sat Feb 5 04:12:33 2022 +*** CommandBase.java Sat Feb 5 04:13:12 2022 +--- CommandBase.java Sat Feb 5 04:12:33 2022 +*************** +*** 173,183 **** + { + return var2; + } + else + { +! var2 = MinecraftServer.getServer().getConfigurationManager().getPlayerEntity(par1Str); + + if (var2 == null) + { + throw new PlayerNotFoundException(); + } +--- 173,183 ---- + { + return var2; + } + else + { +! var2 = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(par1Str); + + if (var2 == null) + { + throw new PlayerNotFoundException(); + } +*** CommandClearInventory.java Sat Feb 5 04:13:12 2022 +--- CommandClearInventory.java Sat Feb 5 04:12:33 2022 +*** CommandDebug.java Sat Feb 5 04:13:12 2022 +--- CommandDebug.java Sat Feb 5 04:12:33 2022 +*************** +*** 39,49 **** + { + if (par2ArrayOfStr[0].equals("start")) + { + notifyAdmins(par1ICommandSender, "commands.debug.start", new Object[0]); + MinecraftServer.getServer().enableProfiling(); +! this.startTime = MinecraftServer.getCurrentTimeMillis(); + this.startTicks = MinecraftServer.getServer().getTickCounter(); + return; + } + + if (par2ArrayOfStr[0].equals("stop")) +--- 39,49 ---- + { + if (par2ArrayOfStr[0].equals("start")) + { + notifyAdmins(par1ICommandSender, "commands.debug.start", new Object[0]); + MinecraftServer.getServer().enableProfiling(); +! this.startTime = MinecraftServer.getSystemTimeMillis(); + this.startTicks = MinecraftServer.getServer().getTickCounter(); + return; + } + + if (par2ArrayOfStr[0].equals("stop")) +*************** +*** 51,61 **** + if (!MinecraftServer.getServer().theProfiler.profilingEnabled) + { + throw new CommandException("commands.debug.notStarted", new Object[0]); + } + +! long var3 = MinecraftServer.getCurrentTimeMillis(); + int var5 = MinecraftServer.getServer().getTickCounter(); + long var6 = var3 - this.startTime; + int var8 = var5 - this.startTicks; + this.saveProfilerResults(var6, var8); + MinecraftServer.getServer().theProfiler.profilingEnabled = false; +--- 51,61 ---- + if (!MinecraftServer.getServer().theProfiler.profilingEnabled) + { + throw new CommandException("commands.debug.notStarted", new Object[0]); + } + +! long var3 = MinecraftServer.getSystemTimeMillis(); + int var5 = MinecraftServer.getServer().getTickCounter(); + long var6 = var3 - this.startTime; + int var8 = var5 - this.startTicks; + this.saveProfilerResults(var6, var8); + MinecraftServer.getServer().theProfiler.profilingEnabled = false; +*** CommandDefaultGameMode.java Sat Feb 5 04:13:12 2022 +--- CommandDefaultGameMode.java Sat Feb 5 04:12:33 2022 +*** CommandDifficulty.java Sat Feb 5 04:13:12 2022 +--- CommandDifficulty.java Sat Feb 5 04:12:33 2022 +*** CommandEffect.java Sat Feb 5 04:13:12 2022 +--- CommandEffect.java Sat Feb 5 04:12:33 2022 +*** CommandEnchant.java Sat Feb 5 04:13:12 2022 +--- CommandEnchant.java Sat Feb 5 04:12:33 2022 +*** CommandException.java Sat Feb 5 04:13:12 2022 +--- CommandException.java Sat Feb 5 04:12:33 2022 +*** CommandGameMode.java Sat Feb 5 04:13:12 2022 +--- CommandGameMode.java Sat Feb 5 04:12:33 2022 +*** CommandGameRule.java Sat Feb 5 04:13:12 2022 +--- CommandGameRule.java Sat Feb 5 04:12:33 2022 +*** CommandGive.java Sat Feb 5 04:13:12 2022 +--- CommandGive.java Sat Feb 5 04:12:33 2022 +*** CommandHandler.java Sat Feb 5 04:13:12 2022 +--- CommandHandler.java Sat Feb 5 04:12:33 2022 +*** CommandHelp.java Sat Feb 5 04:13:12 2022 +--- CommandHelp.java Sat Feb 5 04:12:33 2022 +*** CommandKill.java Sat Feb 5 04:13:12 2022 +--- CommandKill.java Sat Feb 5 04:12:33 2022 +*** CommandNotFoundException.java Sat Feb 5 04:13:12 2022 +--- CommandNotFoundException.java Sat Feb 5 04:12:33 2022 +*** CommandPlaySound.java Sat Feb 5 04:13:12 2022 +--- CommandPlaySound.java Sat Feb 5 04:12:33 2022 +*************** +*** 30,42 **** + { + byte var3 = 0; + int var36 = var3 + 1; + String var4 = par2ArrayOfStr[var3]; + EntityPlayerMP var5 = getPlayer(par1ICommandSender, par2ArrayOfStr[var36++]); +! double var6 = (double)var5.getCommandSenderPosition().posX; +! double var8 = (double)var5.getCommandSenderPosition().posY; +! double var10 = (double)var5.getCommandSenderPosition().posZ; + double var12 = 1.0D; + double var14 = 1.0D; + double var16 = 0.0D; + + if (par2ArrayOfStr.length > var36) +--- 30,42 ---- + { + byte var3 = 0; + int var36 = var3 + 1; + String var4 = par2ArrayOfStr[var3]; + EntityPlayerMP var5 = getPlayer(par1ICommandSender, par2ArrayOfStr[var36++]); +! double var6 = (double)var5.getPlayerCoordinates().posX; +! double var8 = (double)var5.getPlayerCoordinates().posY; +! double var10 = (double)var5.getPlayerCoordinates().posZ; + double var12 = 1.0D; + double var14 = 1.0D; + double var16 = 0.0D; + + if (par2ArrayOfStr.length > var36) +*************** +*** 92,106 **** + var30 += var22 / var28 * 2.0D; + var32 += var24 / var28 * 2.0D; + var34 += var26 / var28 * 2.0D; + } + +! var5.playerNetServerHandler.sendPacket(new Packet62LevelSound(var4, var30, var32, var34, (float)var16, (float)var14)); + } + else + { +! var5.playerNetServerHandler.sendPacket(new Packet62LevelSound(var4, var6, var8, var10, (float)var12, (float)var14)); + } + + notifyAdmins(par1ICommandSender, "commands.playsound.success", new Object[] {var4, var5.getEntityName()}); + } + } +--- 92,106 ---- + var30 += var22 / var28 * 2.0D; + var32 += var24 / var28 * 2.0D; + var34 += var26 / var28 * 2.0D; + } + +! var5.playerNetServerHandler.sendPacketToPlayer(new Packet62LevelSound(var4, var30, var32, var34, (float)var16, (float)var14)); + } + else + { +! var5.playerNetServerHandler.sendPacketToPlayer(new Packet62LevelSound(var4, var6, var8, var10, (float)var12, (float)var14)); + } + + notifyAdmins(par1ICommandSender, "commands.playsound.success", new Object[] {var4, var5.getEntityName()}); + } + } +*** CommandServerBan.java Sat Feb 5 04:13:12 2022 +--- CommandServerBan.java Sat Feb 5 04:12:33 2022 +*************** +*** 33,43 **** + + public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) + { + if (par2ArrayOfStr.length >= 1 && par2ArrayOfStr[0].length() > 0) + { +! EntityPlayerMP var3 = MinecraftServer.getServer().getConfigurationManager().getPlayerEntity(par2ArrayOfStr[0]); + BanEntry var4 = new BanEntry(par2ArrayOfStr[0]); + var4.setBannedBy(par1ICommandSender.getCommandSenderName()); + + if (par2ArrayOfStr.length >= 2) + { +--- 33,43 ---- + + public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) + { + if (par2ArrayOfStr.length >= 1 && par2ArrayOfStr[0].length() > 0) + { +! EntityPlayerMP var3 = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(par2ArrayOfStr[0]); + BanEntry var4 = new BanEntry(par2ArrayOfStr[0]); + var4.setBannedBy(par1ICommandSender.getCommandSenderName()); + + if (par2ArrayOfStr.length >= 2) + { +*************** +*** 46,56 **** + + MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().put(var4); + + if (var3 != null) + { +! var3.playerNetServerHandler.kickPlayer("You are banned from this server."); + } + + notifyAdmins(par1ICommandSender, "commands.ban.success", new Object[] {par2ArrayOfStr[0]}); + } + else +--- 46,56 ---- + + MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().put(var4); + + if (var3 != null) + { +! var3.playerNetServerHandler.kickPlayerFromServer("You are banned from this server."); + } + + notifyAdmins(par1ICommandSender, "commands.ban.success", new Object[] {par2ArrayOfStr[0]}); + } + else +*** CommandServerBanIp.java Sat Feb 5 04:13:12 2022 +--- CommandServerBanIp.java Sat Feb 5 04:12:33 2022 +*************** +*** 52,62 **** + { + this.banIP(par1ICommandSender, par2ArrayOfStr[0], var4); + } + else + { +! EntityPlayerMP var5 = MinecraftServer.getServer().getConfigurationManager().getPlayerEntity(par2ArrayOfStr[0]); + + if (var5 == null) + { + throw new PlayerNotFoundException("commands.banip.invalid", new Object[0]); + } +--- 52,62 ---- + { + this.banIP(par1ICommandSender, par2ArrayOfStr[0], var4); + } + else + { +! EntityPlayerMP var5 = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(par2ArrayOfStr[0]); + + if (var5 == null) + { + throw new PlayerNotFoundException("commands.banip.invalid", new Object[0]); + } +*************** +*** 98,108 **** + EntityPlayerMP var9; + + for (Iterator var8 = var5.iterator(); var8.hasNext(); var6[var7++] = var9.getEntityName()) + { + var9 = (EntityPlayerMP)var8.next(); +! var9.playerNetServerHandler.kickPlayer("You have been IP banned."); + } + + if (var5.isEmpty()) + { + notifyAdmins(par1ICommandSender, "commands.banip.success", new Object[] {par2Str}); +--- 98,108 ---- + EntityPlayerMP var9; + + for (Iterator var8 = var5.iterator(); var8.hasNext(); var6[var7++] = var9.getEntityName()) + { + var9 = (EntityPlayerMP)var8.next(); +! var9.playerNetServerHandler.kickPlayerFromServer("You have been IP banned."); + } + + if (var5.isEmpty()) + { + notifyAdmins(par1ICommandSender, "commands.banip.success", new Object[] {par2Str}); +*** CommandServerBanlist.java Sat Feb 5 04:13:12 2022 +--- CommandServerBanlist.java Sat Feb 5 04:12:33 2022 +*** CommandServerDeop.java Sat Feb 5 04:13:12 2022 +--- CommandServerDeop.java Sat Feb 5 04:12:33 2022 +*** CommandServerEmote.java Sat Feb 5 04:13:12 2022 +--- CommandServerEmote.java Sat Feb 5 04:12:33 2022 +*** CommandServerKick.java Sat Feb 5 04:13:12 2022 +--- CommandServerKick.java Sat Feb 5 04:12:33 2022 +*************** +*** 25,35 **** + + public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) + { + if (par2ArrayOfStr.length > 0 && par2ArrayOfStr[0].length() > 1) + { +! EntityPlayerMP var3 = MinecraftServer.getServer().getConfigurationManager().getPlayerEntity(par2ArrayOfStr[0]); + String var4 = "Kicked by an operator."; + boolean var5 = false; + + if (var3 == null) + { +--- 25,35 ---- + + public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) + { + if (par2ArrayOfStr.length > 0 && par2ArrayOfStr[0].length() > 1) + { +! EntityPlayerMP var3 = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(par2ArrayOfStr[0]); + String var4 = "Kicked by an operator."; + boolean var5 = false; + + if (var3 == null) + { +*************** +*** 41,51 **** + { + var4 = func_82360_a(par1ICommandSender, par2ArrayOfStr, 1); + var5 = true; + } + +! var3.playerNetServerHandler.kickPlayer(var4); + + if (var5) + { + notifyAdmins(par1ICommandSender, "commands.kick.success.reason", new Object[] {var3.getEntityName(), var4}); + } +--- 41,51 ---- + { + var4 = func_82360_a(par1ICommandSender, par2ArrayOfStr, 1); + var5 = true; + } + +! var3.playerNetServerHandler.kickPlayerFromServer(var4); + + if (var5) + { + notifyAdmins(par1ICommandSender, "commands.kick.success.reason", new Object[] {var3.getEntityName(), var4}); + } +*** CommandServerList.java Sat Feb 5 04:13:12 2022 +--- CommandServerList.java Sat Feb 5 04:12:33 2022 +*** CommandServerMessage.java Sat Feb 5 04:13:12 2022 +--- CommandServerMessage.java Sat Feb 5 04:12:33 2022 +*** CommandServerOp.java Sat Feb 5 04:13:12 2022 +--- CommandServerOp.java Sat Feb 5 04:12:33 2022 +*** CommandServerPardon.java Sat Feb 5 04:13:12 2022 +--- CommandServerPardon.java Sat Feb 5 04:12:33 2022 +*** CommandServerPardonIp.java Sat Feb 5 04:13:12 2022 +--- CommandServerPardonIp.java Sat Feb 5 04:12:33 2022 +*** CommandServerPublishLocal.java Sat Feb 5 04:13:12 2022 +--- CommandServerPublishLocal.java Sat Feb 5 04:12:33 2022 +*** CommandServerSaveAll.java Sat Feb 5 04:13:12 2022 +--- CommandServerSaveAll.java Sat Feb 5 04:12:33 2022 +*************** +*** 41,54 **** + for (var4 = 0; var4 < var3.worldServers.length; ++var4) + { + if (var3.worldServers[var4] != null) + { + var5 = var3.worldServers[var4]; +! var6 = var5.levelSaving; +! var5.levelSaving = false; + var5.saveAllChunks(true, (IProgressUpdate)null); +! var5.levelSaving = var6; + } + } + + if (par2ArrayOfStr.length > 0 && "flush".equals(par2ArrayOfStr[0])) + { +--- 41,54 ---- + for (var4 = 0; var4 < var3.worldServers.length; ++var4) + { + if (var3.worldServers[var4] != null) + { + var5 = var3.worldServers[var4]; +! var6 = var5.canNotSave; +! var5.canNotSave = false; + var5.saveAllChunks(true, (IProgressUpdate)null); +! var5.canNotSave = var6; + } + } + + if (par2ArrayOfStr.length > 0 && "flush".equals(par2ArrayOfStr[0])) + { +*************** +*** 57,70 **** + for (var4 = 0; var4 < var3.worldServers.length; ++var4) + { + if (var3.worldServers[var4] != null) + { + var5 = var3.worldServers[var4]; +! var6 = var5.levelSaving; +! var5.levelSaving = false; + var5.saveChunkData(); +! var5.levelSaving = var6; + } + } + + par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.save.flushEnd")); + } +--- 57,70 ---- + for (var4 = 0; var4 < var3.worldServers.length; ++var4) + { + if (var3.worldServers[var4] != null) + { + var5 = var3.worldServers[var4]; +! var6 = var5.canNotSave; +! var5.canNotSave = false; + var5.saveChunkData(); +! var5.canNotSave = var6; + } + } + + par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.save.flushEnd")); + } +*** CommandServerSaveOff.java Sat Feb 5 04:13:12 2022 +--- CommandServerSaveOff.java Sat Feb 5 04:12:33 2022 +*************** +*** 31,43 **** + { + if (var3.worldServers[var5] != null) + { + WorldServer var6 = var3.worldServers[var5]; + +! if (!var6.levelSaving) + { +! var6.levelSaving = true; + var4 = true; + } + } + } + +--- 31,43 ---- + { + if (var3.worldServers[var5] != null) + { + WorldServer var6 = var3.worldServers[var5]; + +! if (!var6.canNotSave) + { +! var6.canNotSave = true; + var4 = true; + } + } + } + +*** CommandServerSaveOn.java Sat Feb 5 04:13:12 2022 +--- CommandServerSaveOn.java Sat Feb 5 04:12:33 2022 +*************** +*** 31,43 **** + { + if (var3.worldServers[var5] != null) + { + WorldServer var6 = var3.worldServers[var5]; + +! if (var6.levelSaving) + { +! var6.levelSaving = false; + var4 = true; + } + } + } + +--- 31,43 ---- + { + if (var3.worldServers[var5] != null) + { + WorldServer var6 = var3.worldServers[var5]; + +! if (var6.canNotSave) + { +! var6.canNotSave = false; + var4 = true; + } + } + } + +*** CommandServerSay.java Sat Feb 5 04:13:12 2022 +--- CommandServerSay.java Sat Feb 5 04:12:33 2022 +*** CommandServerStop.java Sat Feb 5 04:13:12 2022 +--- CommandServerStop.java Sat Feb 5 04:12:33 2022 +*** CommandServerTp.java Sat Feb 5 04:13:12 2022 +--- CommandServerTp.java Sat Feb 5 04:12:33 2022 +*** CommandServerWhitelist.java Sat Feb 5 04:13:12 2022 +--- CommandServerWhitelist.java Sat Feb 5 04:12:33 2022 +*** CommandSetPlayerTimeout.java Sat Feb 5 04:13:12 2022 +--- CommandSetPlayerTimeout.java Sat Feb 5 04:12:33 2022 +*** CommandSetSpawnpoint.java Sat Feb 5 04:13:12 2022 +--- CommandSetSpawnpoint.java Sat Feb 5 04:12:33 2022 +*************** +*** 46,56 **** + if (par2ArrayOfStr.length > 1) + { + throw new WrongUsageException("commands.spawnpoint.usage", new Object[0]); + } + +! ChunkCoordinates var10 = var3.getCommandSenderPosition(); + var3.setSpawnChunk(var10, true); + notifyAdmins(par1ICommandSender, "commands.spawnpoint.success", new Object[] {var3.getEntityName(), Integer.valueOf(var10.posX), Integer.valueOf(var10.posY), Integer.valueOf(var10.posZ)}); + } + } + +--- 46,56 ---- + if (par2ArrayOfStr.length > 1) + { + throw new WrongUsageException("commands.spawnpoint.usage", new Object[0]); + } + +! ChunkCoordinates var10 = var3.getPlayerCoordinates(); + var3.setSpawnChunk(var10, true); + notifyAdmins(par1ICommandSender, "commands.spawnpoint.success", new Object[] {var3.getEntityName(), Integer.valueOf(var10.posX), Integer.valueOf(var10.posY), Integer.valueOf(var10.posZ)}); + } + } + +*** CommandShowSeed.java Sat Feb 5 04:13:12 2022 +--- CommandShowSeed.java Sat Feb 5 04:12:33 2022 +*** CommandSpreadPlayers.java Sat Feb 5 04:13:12 2022 +--- CommandSpreadPlayers.java Sat Feb 5 04:12:33 2022 +*************** +*** 66,76 **** + + Collections.addAll(var13, var17); + } + else + { +! EntityPlayerMP var15 = MinecraftServer.getServer().getConfigurationManager().getPlayerEntity(var14); + + if (var15 == null) + { + throw new PlayerNotFoundException(); + } +--- 66,76 ---- + + Collections.addAll(var13, var17); + } + else + { +! EntityPlayerMP var15 = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(var14); + + if (var15 == null) + { + throw new PlayerNotFoundException(); + } +*** CommandSpreadPlayersPosition.java Sat Feb 5 04:13:12 2022 +--- CommandSpreadPlayersPosition.java Sat Feb 5 04:12:33 2022 +*** CommandTime.java Sat Feb 5 04:13:12 2022 +--- CommandTime.java Sat Feb 5 04:12:33 2022 +*** CommandToggleDownfall.java Sat Feb 5 04:13:12 2022 +--- CommandToggleDownfall.java Sat Feb 5 04:12:33 2022 +*************** +*** 31,39 **** + /** + * Toggle rain and enable thundering. + */ + protected void toggleDownfall() + { +! MinecraftServer.getServer().worldServers[0].commandToggleDownfall(); + MinecraftServer.getServer().worldServers[0].getWorldInfo().setThundering(true); + } + } +--- 31,39 ---- + /** + * Toggle rain and enable thundering. + */ + protected void toggleDownfall() + { +! MinecraftServer.getServer().worldServers[0].toggleRain(); + MinecraftServer.getServer().worldServers[0].getWorldInfo().setThundering(true); + } + } +*** CommandWeather.java Sat Feb 5 04:13:12 2022 +--- CommandWeather.java Sat Feb 5 04:12:33 2022 +*** CommandXP.java Sat Feb 5 04:13:12 2022 +--- CommandXP.java Sat Feb 5 04:12:33 2022 +*** ComparatorClassSorter.java Sat Feb 5 04:13:12 2022 +--- ComparatorClassSorter.java Sat Feb 5 04:12:33 2022 +*** ComponentMineshaftCorridor.java Sat Feb 5 04:13:12 2022 +--- ComponentMineshaftCorridor.java Sat Feb 5 04:12:33 2022 +*** ComponentMineshaftCross.java Sat Feb 5 04:13:12 2022 +--- ComponentMineshaftCross.java Sat Feb 5 04:12:33 2022 +*** ComponentMineshaftRoom.java Sat Feb 5 04:13:12 2022 +--- ComponentMineshaftRoom.java Sat Feb 5 04:12:33 2022 +*** ComponentMineshaftStairs.java Sat Feb 5 04:13:12 2022 +--- ComponentMineshaftStairs.java Sat Feb 5 04:12:33 2022 +*** ComponentNetherBridgeCorridor.java Sat Feb 5 04:13:12 2022 +--- ComponentNetherBridgeCorridor.java Sat Feb 5 04:12:33 2022 +*** ComponentNetherBridgeCorridor2.java Sat Feb 5 04:13:12 2022 +--- ComponentNetherBridgeCorridor2.java Sat Feb 5 04:12:33 2022 +*** ComponentNetherBridgeCorridor3.java Sat Feb 5 04:13:12 2022 +--- ComponentNetherBridgeCorridor3.java Sat Feb 5 04:12:33 2022 +*** ComponentNetherBridgeCorridor4.java Sat Feb 5 04:13:12 2022 +--- ComponentNetherBridgeCorridor4.java Sat Feb 5 04:12:33 2022 +*** ComponentNetherBridgeCorridor5.java Sat Feb 5 04:13:12 2022 +--- ComponentNetherBridgeCorridor5.java Sat Feb 5 04:12:33 2022 +*** ComponentNetherBridgeCrossing.java Sat Feb 5 04:13:12 2022 +--- ComponentNetherBridgeCrossing.java Sat Feb 5 04:12:33 2022 +*** ComponentNetherBridgeCrossing2.java Sat Feb 5 04:13:12 2022 +--- ComponentNetherBridgeCrossing2.java Sat Feb 5 04:12:33 2022 +*** ComponentNetherBridgeCrossing3.java Sat Feb 5 04:13:12 2022 +--- ComponentNetherBridgeCrossing3.java Sat Feb 5 04:12:33 2022 +*** ComponentNetherBridgeEnd.java Sat Feb 5 04:13:12 2022 +--- ComponentNetherBridgeEnd.java Sat Feb 5 04:12:33 2022 +*** ComponentNetherBridgeEntrance.java Sat Feb 5 04:13:12 2022 +--- ComponentNetherBridgeEntrance.java Sat Feb 5 04:12:33 2022 +*** ComponentNetherBridgeNetherStalkRoom.java Sat Feb 5 04:13:12 2022 +--- ComponentNetherBridgeNetherStalkRoom.java Sat Feb 5 04:12:33 2022 +*** ComponentNetherBridgePiece.java Sat Feb 5 04:13:12 2022 +--- ComponentNetherBridgePiece.java Sat Feb 5 04:12:33 2022 +*** ComponentNetherBridgeStairs.java Sat Feb 5 04:13:12 2022 +--- ComponentNetherBridgeStairs.java Sat Feb 5 04:12:33 2022 +*** ComponentNetherBridgeStartPiece.java Sat Feb 5 04:13:12 2022 +--- ComponentNetherBridgeStartPiece.java Sat Feb 5 04:12:33 2022 +*** ComponentNetherBridgeStraight.java Sat Feb 5 04:13:12 2022 +--- ComponentNetherBridgeStraight.java Sat Feb 5 04:12:33 2022 +*** ComponentNetherBridgeThrone.java Sat Feb 5 04:13:12 2022 +--- ComponentNetherBridgeThrone.java Sat Feb 5 04:12:33 2022 +*** ComponentScatteredFeature.java Sat Feb 5 04:13:12 2022 +--- ComponentScatteredFeature.java Sat Feb 5 04:12:33 2022 +*** ComponentScatteredFeatureDesertPyramid.java Sat Feb 5 04:13:12 2022 +--- ComponentScatteredFeatureDesertPyramid.java Sat Feb 5 04:12:33 2022 +*** ComponentScatteredFeatureJunglePyramid.java Sat Feb 5 04:13:12 2022 +--- ComponentScatteredFeatureJunglePyramid.java Sat Feb 5 04:12:33 2022 +*** ComponentScatteredFeaturePieces.java Sat Feb 5 04:13:12 2022 +--- ComponentScatteredFeaturePieces.java Sat Feb 5 04:12:33 2022 +*** ComponentScatteredFeaturePieces2.java Sat Feb 5 04:13:12 2022 +--- ComponentScatteredFeaturePieces2.java Sat Feb 5 04:12:33 2022 +*** ComponentScatteredFeatureSwampHut.java Sat Feb 5 04:13:12 2022 +--- ComponentScatteredFeatureSwampHut.java Sat Feb 5 04:12:33 2022 +*** ComponentStronghold.java Sat Feb 5 04:13:12 2022 +--- ComponentStronghold.java Sat Feb 5 04:12:33 2022 +*** ComponentStrongholdChestCorridor.java Sat Feb 5 04:13:12 2022 +--- ComponentStrongholdChestCorridor.java Sat Feb 5 04:12:33 2022 +*** ComponentStrongholdCorridor.java Sat Feb 5 04:13:12 2022 +--- ComponentStrongholdCorridor.java Sat Feb 5 04:12:33 2022 +*** ComponentStrongholdCrossing.java Sat Feb 5 04:13:12 2022 +--- ComponentStrongholdCrossing.java Sat Feb 5 04:12:33 2022 +*** ComponentStrongholdLeftTurn.java Sat Feb 5 04:13:12 2022 +--- ComponentStrongholdLeftTurn.java Sat Feb 5 04:12:33 2022 +*** ComponentStrongholdLibrary.java Sat Feb 5 04:13:12 2022 +--- ComponentStrongholdLibrary.java Sat Feb 5 04:12:33 2022 +*** ComponentStrongholdPortalRoom.java Sat Feb 5 04:13:12 2022 +--- ComponentStrongholdPortalRoom.java Sat Feb 5 04:12:33 2022 +*** ComponentStrongholdPrison.java Sat Feb 5 04:13:12 2022 +--- ComponentStrongholdPrison.java Sat Feb 5 04:12:33 2022 +*** ComponentStrongholdRightTurn.java Sat Feb 5 04:13:12 2022 +--- ComponentStrongholdRightTurn.java Sat Feb 5 04:12:33 2022 +*** ComponentStrongholdRoomCrossing.java Sat Feb 5 04:13:12 2022 +--- ComponentStrongholdRoomCrossing.java Sat Feb 5 04:12:33 2022 +*** ComponentStrongholdStairs.java Sat Feb 5 04:13:12 2022 +--- ComponentStrongholdStairs.java Sat Feb 5 04:12:33 2022 +*** ComponentStrongholdStairs2.java Sat Feb 5 04:13:12 2022 +--- ComponentStrongholdStairs2.java Sat Feb 5 04:12:33 2022 +*** ComponentStrongholdStairsStraight.java Sat Feb 5 04:13:12 2022 +--- ComponentStrongholdStairsStraight.java Sat Feb 5 04:12:33 2022 +*** ComponentStrongholdStraight.java Sat Feb 5 04:13:12 2022 +--- ComponentStrongholdStraight.java Sat Feb 5 04:12:33 2022 +*** ComponentVillage.java Sat Feb 5 04:13:12 2022 +--- ComponentVillage.java Sat Feb 5 04:12:33 2022 +*** ComponentVillageChurch.java Sat Feb 5 04:13:12 2022 +--- ComponentVillageChurch.java Sat Feb 5 04:12:33 2022 +*** ComponentVillageField.java Sat Feb 5 04:13:12 2022 +--- ComponentVillageField.java Sat Feb 5 04:12:33 2022 +*** ComponentVillageField2.java Sat Feb 5 04:13:12 2022 +--- ComponentVillageField2.java Sat Feb 5 04:12:33 2022 +*** ComponentVillageHall.java Sat Feb 5 04:13:12 2022 +--- ComponentVillageHall.java Sat Feb 5 04:12:33 2022 +*** ComponentVillageHouse1.java Sat Feb 5 04:13:12 2022 +--- ComponentVillageHouse1.java Sat Feb 5 04:12:33 2022 +*** ComponentVillageHouse2.java Sat Feb 5 04:13:12 2022 +--- ComponentVillageHouse2.java Sat Feb 5 04:12:33 2022 +*** ComponentVillageHouse3.java Sat Feb 5 04:13:12 2022 +--- ComponentVillageHouse3.java Sat Feb 5 04:12:33 2022 +*** ComponentVillageHouse4_Garden.java Sat Feb 5 04:13:12 2022 +--- ComponentVillageHouse4_Garden.java Sat Feb 5 04:12:33 2022 +*** ComponentVillagePathGen.java Sat Feb 5 04:13:12 2022 +--- ComponentVillagePathGen.java Sat Feb 5 04:12:33 2022 +*** ComponentVillageRoadPiece.java Sat Feb 5 04:13:12 2022 +--- ComponentVillageRoadPiece.java Sat Feb 5 04:12:33 2022 +*** ComponentVillageStartPiece.java Sat Feb 5 04:13:12 2022 +--- ComponentVillageStartPiece.java Sat Feb 5 04:12:33 2022 +*** ComponentVillageTorch.java Sat Feb 5 04:13:12 2022 +--- ComponentVillageTorch.java Sat Feb 5 04:12:33 2022 +*** ComponentVillageWell.java Sat Feb 5 04:13:12 2022 +--- ComponentVillageWell.java Sat Feb 5 04:12:33 2022 +*** ComponentVillageWoodHut.java Sat Feb 5 04:13:12 2022 +--- ComponentVillageWoodHut.java Sat Feb 5 04:12:33 2022 +*** CompressedStreamTools.java Sat Feb 5 04:13:12 2022 +--- CompressedStreamTools.java Sat Feb 5 04:12:33 2022 +*************** +*** 5,14 **** +--- 5,17 ---- + import java.io.ByteArrayOutputStream; + import java.io.DataInput; + import java.io.DataInputStream; + import java.io.DataOutput; + import java.io.DataOutputStream; ++ import java.io.File; ++ import java.io.FileInputStream; ++ import java.io.FileOutputStream; + import java.io.IOException; + import java.io.InputStream; + import java.io.OutputStream; + import java.util.zip.GZIPInputStream; + import java.util.zip.GZIPOutputStream; +*************** +*** 82,91 **** +--- 85,158 ---- + { + var2.close(); + } + + return var1.toByteArray(); ++ } ++ ++ public static void safeWrite(NBTTagCompound par0NBTTagCompound, File par1File) throws IOException ++ { ++ File var2 = new File(par1File.getAbsolutePath() + "_tmp"); ++ ++ if (var2.exists()) ++ { ++ var2.delete(); ++ } ++ ++ write(par0NBTTagCompound, var2); ++ ++ if (par1File.exists()) ++ { ++ par1File.delete(); ++ } ++ ++ if (par1File.exists()) ++ { ++ throw new IOException("Failed to delete " + par1File); ++ } ++ else ++ { ++ var2.renameTo(par1File); ++ } ++ } ++ ++ public static void write(NBTTagCompound par0NBTTagCompound, File par1File) throws IOException ++ { ++ DataOutputStream var2 = new DataOutputStream(new FileOutputStream(par1File)); ++ ++ try ++ { ++ write(par0NBTTagCompound, var2); ++ } ++ finally ++ { ++ var2.close(); ++ } ++ } ++ ++ public static NBTTagCompound read(File par0File) throws IOException ++ { ++ if (!par0File.exists()) ++ { ++ return null; ++ } ++ else ++ { ++ DataInputStream var1 = new DataInputStream(new FileInputStream(par0File)); ++ NBTTagCompound var2; ++ ++ try ++ { ++ var2 = read(var1); ++ } ++ finally ++ { ++ var1.close(); ++ } ++ ++ return var2; ++ } + } + + /** + * Reads from a CompressedStream. + */ +*** Container.java Sat Feb 5 04:13:12 2022 +--- Container.java Sat Feb 5 04:12:33 2022 +*************** +*** 12,21 **** +--- 12,22 ---- + public List inventoryItemStacks = new ArrayList(); + + /** the list of all slots in the inventory */ + public List inventorySlots = new ArrayList(); + public int windowId; ++ private short transactionID; + private int field_94535_f = -1; + private int field_94536_g; + private final Set field_94537_h = new HashSet(); + + /** +*************** +*** 23,57 **** + */ + protected List crafters = new ArrayList(); + private Set playerList = new HashSet(); + + /** +! * Adds an item slot to this container + */ + protected Slot addSlotToContainer(Slot par1Slot) + { + par1Slot.slotNumber = this.inventorySlots.size(); + this.inventorySlots.add(par1Slot); + this.inventoryItemStacks.add((Object)null); + return par1Slot; + } + +! public void onCraftGuiOpened(ICrafting par1ICrafting) + { + if (this.crafters.contains(par1ICrafting)) + { + throw new IllegalArgumentException("Listener already listening"); + } + else + { + this.crafters.add(par1ICrafting); +! par1ICrafting.updateCraftingInventory(this, this.getInventory()); + this.detectAndSendChanges(); + } + } + + /** + * returns a list if itemStacks, for each slot. + */ + public List getInventory() + { + ArrayList var1 = new ArrayList(); +--- 24,66 ---- + */ + protected List crafters = new ArrayList(); + private Set playerList = new HashSet(); + + /** +! * the slot is assumed empty + */ + protected Slot addSlotToContainer(Slot par1Slot) + { + par1Slot.slotNumber = this.inventorySlots.size(); + this.inventorySlots.add(par1Slot); + this.inventoryItemStacks.add((Object)null); + return par1Slot; + } + +! public void addCraftingToCrafters(ICrafting par1ICrafting) + { + if (this.crafters.contains(par1ICrafting)) + { + throw new IllegalArgumentException("Listener already listening"); + } + else + { + this.crafters.add(par1ICrafting); +! par1ICrafting.sendContainerAndContentsToPlayer(this, this.getInventory()); + this.detectAndSendChanges(); + } + } + + /** ++ * Remove this crafting listener from the listener list. ++ */ ++ public void removeCraftingFromCrafters(ICrafting par1ICrafting) ++ { ++ this.crafters.remove(par1ICrafting); ++ } ++ ++ /** + * returns a list if itemStacks, for each slot. + */ + public List getInventory() + { + ArrayList var1 = new ArrayList(); +*************** +*** 99,109 **** + { + for (int var3 = 0; var3 < this.inventorySlots.size(); ++var3) + { + Slot var4 = (Slot)this.inventorySlots.get(var3); + +! if (var4.isHere(par1IInventory, par2)) + { + return var4; + } + } + +--- 108,118 ---- + { + for (int var3 = 0; var3 < this.inventorySlots.size(); ++var3) + { + Slot var4 = (Slot)this.inventorySlots.get(var3); + +! if (var4.isSlotInInventory(par1IInventory, par2)) + { + return var4; + } + } + +*************** +*** 114,124 **** + { + return (Slot)this.inventorySlots.get(par1); + } + + /** +! * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + Slot var3 = (Slot)this.inventorySlots.get(par2); + return var3 != null ? var3.getStack() : null; +--- 123,133 ---- + { + return (Slot)this.inventorySlots.get(par1); + } + + /** +! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + Slot var3 = (Slot)this.inventorySlots.get(par2); + return var3 != null ? var3.getStack() : null; +*************** +*** 531,551 **** + { + this.getSlot(par1).putStack(par2ItemStack); + } + + /** +! * gets whether or not the player can craft in this inventory or not + */ +! public boolean getCanCraft(EntityPlayer par1EntityPlayer) + { + return !this.playerList.contains(par1EntityPlayer); + } + + /** +! * sets whether the player can craft in this inventory or not + */ +! public void setCanCraft(EntityPlayer par1EntityPlayer, boolean par2) + { + if (par2) + { + this.playerList.remove(par1EntityPlayer); + } +--- 540,582 ---- + { + this.getSlot(par1).putStack(par2ItemStack); + } + + /** +! * places itemstacks in first x slots, x being aitemstack.lenght + */ +! public void putStacksInSlots(ItemStack[] par1ArrayOfItemStack) +! { +! for (int var2 = 0; var2 < par1ArrayOfItemStack.length; ++var2) +! { +! this.getSlot(var2).putStack(par1ArrayOfItemStack[var2]); +! } +! } +! +! public void updateProgressBar(int par1, int par2) {} +! +! /** +! * Gets a unique transaction ID. Parameter is unused. +! */ +! public short getNextTransactionID(InventoryPlayer par1InventoryPlayer) +! { +! ++this.transactionID; +! return this.transactionID; +! } +! +! /** +! * NotUsing because adding a player twice is an error +! */ +! public boolean isPlayerNotUsingContainer(EntityPlayer par1EntityPlayer) + { + return !this.playerList.contains(par1EntityPlayer); + } + + /** +! * adds or removes the player from the container based on par2 + */ +! public void setPlayerIsPresent(EntityPlayer par1EntityPlayer, boolean par2) + { + if (par2) + { + this.playerList.remove(par1EntityPlayer); + } +*************** +*** 656,665 **** +--- 687,701 ---- + } + + public static int func_94532_c(int par0) + { + return par0 & 3; ++ } ++ ++ public static int func_94534_d(int par0, int par1) ++ { ++ return par0 & 3 | (par1 & 3) << 2; + } + + public static boolean func_94528_d(int par0) + { + return par0 == 0 || par0 == 1; +*** ContainerBeacon.java Sat Feb 5 04:13:12 2022 +--- ContainerBeacon.java Sat Feb 5 04:12:33 2022 +*************** +*** 36,53 **** + this.field_82865_g = par2TileEntityBeacon.getLevels(); + this.field_82867_h = par2TileEntityBeacon.getPrimaryEffect(); + this.field_82868_i = par2TileEntityBeacon.getSecondaryEffect(); + } + +! public void onCraftGuiOpened(ICrafting par1ICrafting) + { +! super.onCraftGuiOpened(par1ICrafting); + par1ICrafting.sendProgressBarUpdate(this, 0, this.field_82865_g); + par1ICrafting.sendProgressBarUpdate(this, 1, this.field_82867_h); + par1ICrafting.sendProgressBarUpdate(this, 2, this.field_82868_i); + } + + /** + * Returns the Tile Entity behind this beacon inventory / container + */ + public TileEntityBeacon getBeacon() + { +--- 36,71 ---- + this.field_82865_g = par2TileEntityBeacon.getLevels(); + this.field_82867_h = par2TileEntityBeacon.getPrimaryEffect(); + this.field_82868_i = par2TileEntityBeacon.getSecondaryEffect(); + } + +! public void addCraftingToCrafters(ICrafting par1ICrafting) + { +! super.addCraftingToCrafters(par1ICrafting); + par1ICrafting.sendProgressBarUpdate(this, 0, this.field_82865_g); + par1ICrafting.sendProgressBarUpdate(this, 1, this.field_82867_h); + par1ICrafting.sendProgressBarUpdate(this, 2, this.field_82868_i); + } + ++ public void updateProgressBar(int par1, int par2) ++ { ++ if (par1 == 0) ++ { ++ this.theBeacon.setLevels(par2); ++ } ++ ++ if (par1 == 1) ++ { ++ this.theBeacon.setPrimaryEffect(par2); ++ } ++ ++ if (par1 == 2) ++ { ++ this.theBeacon.setSecondaryEffect(par2); ++ } ++ } ++ + /** + * Returns the Tile Entity behind this beacon inventory / container + */ + public TileEntityBeacon getBeacon() + { +*************** +*** 58,68 **** + { + return this.theBeacon.isUseableByPlayer(par1EntityPlayer); + } + + /** +! * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(par2); +--- 76,86 ---- + { + return this.theBeacon.isUseableByPlayer(par1EntityPlayer); + } + + /** +! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(par2); +*** ContainerBrewingStand.java Sat Feb 5 04:13:12 2022 +--- ContainerBrewingStand.java Sat Feb 5 04:12:33 2022 +*************** +*** 29,41 **** + { + this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142)); + } + } + +! public void onCraftGuiOpened(ICrafting par1ICrafting) + { +! super.onCraftGuiOpened(par1ICrafting); + par1ICrafting.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getBrewTime()); + } + + /** + * Looks for changes made in the container, sends them to every listener. +--- 29,41 ---- + { + this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142)); + } + } + +! public void addCraftingToCrafters(ICrafting par1ICrafting) + { +! super.addCraftingToCrafters(par1ICrafting); + par1ICrafting.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getBrewTime()); + } + + /** + * Looks for changes made in the container, sends them to every listener. +*************** +*** 55,71 **** + } + + this.brewTime = this.tileBrewingStand.getBrewTime(); + } + + public boolean canInteractWith(EntityPlayer par1EntityPlayer) + { + return this.tileBrewingStand.isUseableByPlayer(par1EntityPlayer); + } + + /** +! * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(par2); +--- 55,79 ---- + } + + this.brewTime = this.tileBrewingStand.getBrewTime(); + } + ++ public void updateProgressBar(int par1, int par2) ++ { ++ if (par1 == 0) ++ { ++ this.tileBrewingStand.setBrewTime(par2); ++ } ++ } ++ + public boolean canInteractWith(EntityPlayer par1EntityPlayer) + { + return this.tileBrewingStand.isUseableByPlayer(par1EntityPlayer); + } + + /** +! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(par2); +*** ContainerChest.java Sat Feb 5 04:13:12 2022 +--- ContainerChest.java Sat Feb 5 04:12:33 2022 +*************** +*** 40,50 **** + { + return this.lowerChestInventory.isUseableByPlayer(par1EntityPlayer); + } + + /** +! * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(par2); +--- 40,50 ---- + { + return this.lowerChestInventory.isUseableByPlayer(par1EntityPlayer); + } + + /** +! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(par2); +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ContainerCreative.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,109 ---- ++ package net.minecraft.src; ++ ++ import java.util.ArrayList; ++ import java.util.List; ++ ++ class ContainerCreative extends Container ++ { ++ /** the list of items in this container */ ++ public List itemList = new ArrayList(); ++ ++ public ContainerCreative(EntityPlayer par1EntityPlayer) ++ { ++ InventoryPlayer var2 = par1EntityPlayer.inventory; ++ int var3; ++ ++ for (var3 = 0; var3 < 5; ++var3) ++ { ++ for (int var4 = 0; var4 < 9; ++var4) ++ { ++ this.addSlotToContainer(new Slot(GuiContainerCreative.getInventory(), var3 * 9 + var4, 9 + var4 * 18, 18 + var3 * 18)); ++ } ++ } ++ ++ for (var3 = 0; var3 < 9; ++var3) ++ { ++ this.addSlotToContainer(new Slot(var2, var3, 9 + var3 * 18, 112)); ++ } ++ ++ this.scrollTo(0.0F); ++ } ++ ++ public boolean canInteractWith(EntityPlayer par1EntityPlayer) ++ { ++ return true; ++ } ++ ++ /** ++ * Updates the gui slots ItemStack's based on scroll position. ++ */ ++ public void scrollTo(float par1) ++ { ++ int var2 = this.itemList.size() / 9 - 5 + 1; ++ int var3 = (int)((double)(par1 * (float)var2) + 0.5D); ++ ++ if (var3 < 0) ++ { ++ var3 = 0; ++ } ++ ++ for (int var4 = 0; var4 < 5; ++var4) ++ { ++ for (int var5 = 0; var5 < 9; ++var5) ++ { ++ int var6 = var5 + (var4 + var3) * 9; ++ ++ if (var6 >= 0 && var6 < this.itemList.size()) ++ { ++ GuiContainerCreative.getInventory().setInventorySlotContents(var5 + var4 * 9, (ItemStack)this.itemList.get(var6)); ++ } ++ else ++ { ++ GuiContainerCreative.getInventory().setInventorySlotContents(var5 + var4 * 9, (ItemStack)null); ++ } ++ } ++ } ++ } ++ ++ /** ++ * theCreativeContainer seems to be hard coded to 9x5 items ++ */ ++ public boolean hasMoreThan1PageOfItemsInList() ++ { ++ return this.itemList.size() > 45; ++ } ++ ++ protected void retrySlotClick(int par1, int par2, boolean par3, EntityPlayer par4EntityPlayer) {} ++ ++ /** ++ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. ++ */ ++ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) ++ { ++ if (par2 >= this.inventorySlots.size() - 9 && par2 < this.inventorySlots.size()) ++ { ++ Slot var3 = (Slot)this.inventorySlots.get(par2); ++ ++ if (var3 != null && var3.getHasStack()) ++ { ++ var3.putStack((ItemStack)null); ++ } ++ } ++ ++ return null; ++ } ++ ++ public boolean func_94530_a(ItemStack par1ItemStack, Slot par2Slot) ++ { ++ return par2Slot.yDisplayPosition > 90; ++ } ++ ++ /** ++ * Returns true if the player can "drag-spilt" items into this slot,. returns true by default. Called to check if ++ * the slot can be added to a list of Slots to split the held ItemStack across. ++ */ ++ public boolean canDragIntoSlot(Slot par1Slot) ++ { ++ return par1Slot.inventory instanceof InventoryPlayer || par1Slot.yDisplayPosition > 90 && par1Slot.xDisplayPosition <= 162; ++ } ++ } +*** ContainerDispenser.java Sat Feb 5 04:13:12 2022 +--- ContainerDispenser.java Sat Feb 5 04:12:33 2022 +*************** +*** 36,46 **** + { + return this.tileEntityDispenser.isUseableByPlayer(par1EntityPlayer); + } + + /** +! * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(par2); +--- 36,46 ---- + { + return this.tileEntityDispenser.isUseableByPlayer(par1EntityPlayer); + } + + /** +! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(par2); +*** ContainerEnchantment.java Sat Feb 5 04:13:12 2022 +--- ContainerEnchantment.java Sat Feb 5 04:12:33 2022 +*************** +*** 42,54 **** + { + this.addSlotToContainer(new Slot(par1InventoryPlayer, var6, 8 + var6 * 18, 142)); + } + } + +! public void onCraftGuiOpened(ICrafting par1ICrafting) + { +! super.onCraftGuiOpened(par1ICrafting); + par1ICrafting.sendProgressBarUpdate(this, 0, this.enchantLevels[0]); + par1ICrafting.sendProgressBarUpdate(this, 1, this.enchantLevels[1]); + par1ICrafting.sendProgressBarUpdate(this, 2, this.enchantLevels[2]); + } + +--- 42,54 ---- + { + this.addSlotToContainer(new Slot(par1InventoryPlayer, var6, 8 + var6 * 18, 142)); + } + } + +! public void addCraftingToCrafters(ICrafting par1ICrafting) + { +! super.addCraftingToCrafters(par1ICrafting); + par1ICrafting.sendProgressBarUpdate(this, 0, this.enchantLevels[0]); + par1ICrafting.sendProgressBarUpdate(this, 1, this.enchantLevels[1]); + par1ICrafting.sendProgressBarUpdate(this, 2, this.enchantLevels[2]); + } + +*************** +*** 66,75 **** +--- 66,87 ---- + var2.sendProgressBarUpdate(this, 1, this.enchantLevels[1]); + var2.sendProgressBarUpdate(this, 2, this.enchantLevels[2]); + } + } + ++ public void updateProgressBar(int par1, int par2) ++ { ++ if (par1 >= 0 && par1 <= 2) ++ { ++ this.enchantLevels[par1] = par2; ++ } ++ else ++ { ++ super.updateProgressBar(par1, par2); ++ } ++ } ++ + /** + * Callback for when the crafting matrix is changed. + */ + public void onCraftMatrixChanged(IInventory par1IInventory) + { +*************** +*** 223,233 **** + { + return this.worldPointer.getBlockId(this.posX, this.posY, this.posZ) != Block.enchantmentTable.blockID ? false : par1EntityPlayer.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D; + } + + /** +! * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(par2); +--- 235,245 ---- + { + return this.worldPointer.getBlockId(this.posX, this.posY, this.posZ) != Block.enchantmentTable.blockID ? false : par1EntityPlayer.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D; + } + + /** +! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(par2); +*** ContainerFurnace.java Sat Feb 5 04:13:12 2022 +--- ContainerFurnace.java Sat Feb 5 04:12:33 2022 +*************** +*** 27,39 **** + { + this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142)); + } + } + +! public void onCraftGuiOpened(ICrafting par1ICrafting) + { +! super.onCraftGuiOpened(par1ICrafting); + par1ICrafting.sendProgressBarUpdate(this, 0, this.furnace.furnaceCookTime); + par1ICrafting.sendProgressBarUpdate(this, 1, this.furnace.furnaceBurnTime); + par1ICrafting.sendProgressBarUpdate(this, 2, this.furnace.currentItemBurnTime); + } + +--- 27,39 ---- + { + this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142)); + } + } + +! public void addCraftingToCrafters(ICrafting par1ICrafting) + { +! super.addCraftingToCrafters(par1ICrafting); + par1ICrafting.sendProgressBarUpdate(this, 0, this.furnace.furnaceCookTime); + par1ICrafting.sendProgressBarUpdate(this, 1, this.furnace.furnaceBurnTime); + par1ICrafting.sendProgressBarUpdate(this, 2, this.furnace.currentItemBurnTime); + } + +*************** +*** 67,83 **** + this.lastCookTime = this.furnace.furnaceCookTime; + this.lastBurnTime = this.furnace.furnaceBurnTime; + this.lastItemBurnTime = this.furnace.currentItemBurnTime; + } + + public boolean canInteractWith(EntityPlayer par1EntityPlayer) + { + return this.furnace.isUseableByPlayer(par1EntityPlayer); + } + + /** +! * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(par2); +--- 67,101 ---- + this.lastCookTime = this.furnace.furnaceCookTime; + this.lastBurnTime = this.furnace.furnaceBurnTime; + this.lastItemBurnTime = this.furnace.currentItemBurnTime; + } + ++ public void updateProgressBar(int par1, int par2) ++ { ++ if (par1 == 0) ++ { ++ this.furnace.furnaceCookTime = par2; ++ } ++ ++ if (par1 == 1) ++ { ++ this.furnace.furnaceBurnTime = par2; ++ } ++ ++ if (par1 == 2) ++ { ++ this.furnace.currentItemBurnTime = par2; ++ } ++ } ++ + public boolean canInteractWith(EntityPlayer par1EntityPlayer) + { + return this.furnace.isUseableByPlayer(par1EntityPlayer); + } + + /** +! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(par2); +*** ContainerHopper.java Sat Feb 5 04:13:12 2022 +--- ContainerHopper.java Sat Feb 5 04:12:33 2022 +*************** +*** 34,44 **** + { + return this.field_94538_a.isUseableByPlayer(par1EntityPlayer); + } + + /** +! * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(par2); +--- 34,44 ---- + { + return this.field_94538_a.isUseableByPlayer(par1EntityPlayer); + } + + /** +! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(par2); +*** ContainerHorseInventory.java Sat Feb 5 04:13:12 2022 +--- ContainerHorseInventory.java Sat Feb 5 04:12:33 2022 +*************** +*** 46,56 **** + { + return this.field_111243_a.isUseableByPlayer(par1EntityPlayer) && this.theHorse.isEntityAlive() && this.theHorse.getDistanceToEntity(par1EntityPlayer) < 8.0F; + } + + /** +! * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(par2); +--- 46,56 ---- + { + return this.field_111243_a.isUseableByPlayer(par1EntityPlayer) && this.theHorse.isEntityAlive() && this.theHorse.getDistanceToEntity(par1EntityPlayer) < 8.0F; + } + + /** +! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(par2); +*** ContainerHorseInventorySlotArmor.java Sat Feb 5 04:13:12 2022 +--- ContainerHorseInventorySlotArmor.java Sat Feb 5 04:12:33 2022 +*************** +*** 18,23 **** +--- 18,28 ---- + */ + public boolean isItemValid(ItemStack par1ItemStack) + { + return super.isItemValid(par1ItemStack) && this.theHorse.func_110259_cr() && EntityHorse.func_110211_v(par1ItemStack.itemID); + } ++ ++ public boolean func_111238_b() ++ { ++ return this.theHorse.func_110259_cr(); ++ } + } +*** ContainerHorseInventorySlotSaddle.java Sat Feb 5 04:13:12 2022 +--- ContainerHorseInventorySlotSaddle.java Sat Feb 5 04:12:33 2022 +*** ContainerMerchant.java Sat Feb 5 04:13:12 2022 +--- ContainerMerchant.java Sat Feb 5 04:12:33 2022 +*************** +*** 36,48 **** + public InventoryMerchant getMerchantInventory() + { + return this.merchantInventory; + } + +! public void onCraftGuiOpened(ICrafting par1ICrafting) + { +! super.onCraftGuiOpened(par1ICrafting); + } + + /** + * Looks for changes made in the container, sends them to every listener. + */ +--- 36,48 ---- + public InventoryMerchant getMerchantInventory() + { + return this.merchantInventory; + } + +! public void addCraftingToCrafters(ICrafting par1ICrafting) + { +! super.addCraftingToCrafters(par1ICrafting); + } + + /** + * Looks for changes made in the container, sends them to every listener. + */ +*************** +*** 63,79 **** + public void setCurrentRecipeIndex(int par1) + { + this.merchantInventory.setCurrentRecipeIndex(par1); + } + + public boolean canInteractWith(EntityPlayer par1EntityPlayer) + { + return this.theMerchant.getCustomer() == par1EntityPlayer; + } + + /** +! * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(par2); +--- 63,81 ---- + public void setCurrentRecipeIndex(int par1) + { + this.merchantInventory.setCurrentRecipeIndex(par1); + } + ++ public void updateProgressBar(int par1, int par2) {} ++ + public boolean canInteractWith(EntityPlayer par1EntityPlayer) + { + return this.theMerchant.getCustomer() == par1EntityPlayer; + } + + /** +! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(par2); +*** ContainerPlayer.java Sat Feb 5 04:13:12 2022 +--- ContainerPlayer.java Sat Feb 5 04:12:33 2022 +*************** +*** 79,89 **** + { + return true; + } + + /** +! * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(par2); +--- 79,89 ---- + { + return true; + } + + /** +! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(par2); +*** ContainerRepair.java Sat Feb 5 04:13:12 2022 +--- ContainerRepair.java Sat Feb 5 04:12:33 2022 +*************** +*** 355,370 **** + this.outputSlot.setInventorySlotContents(0, var5); + this.detectAndSendChanges(); + } + } + +! public void onCraftGuiOpened(ICrafting par1ICrafting) + { +! super.onCraftGuiOpened(par1ICrafting); + par1ICrafting.sendProgressBarUpdate(this, 0, this.maximumCost); + } + + /** + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer par1EntityPlayer) + { +--- 355,378 ---- + this.outputSlot.setInventorySlotContents(0, var5); + this.detectAndSendChanges(); + } + } + +! public void addCraftingToCrafters(ICrafting par1ICrafting) + { +! super.addCraftingToCrafters(par1ICrafting); + par1ICrafting.sendProgressBarUpdate(this, 0, this.maximumCost); + } + ++ public void updateProgressBar(int par1, int par2) ++ { ++ if (par1 == 0) ++ { ++ this.maximumCost = par2; ++ } ++ } ++ + /** + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer par1EntityPlayer) + { +*************** +*** 388,398 **** + { + return this.theWorld.getBlockId(this.field_82861_i, this.field_82858_j, this.field_82859_k) != Block.anvil.blockID ? false : par1EntityPlayer.getDistanceSq((double)this.field_82861_i + 0.5D, (double)this.field_82858_j + 0.5D, (double)this.field_82859_k + 0.5D) <= 64.0D; + } + + /** +! * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(par2); +--- 396,406 ---- + { + return this.theWorld.getBlockId(this.field_82861_i, this.field_82858_j, this.field_82859_k) != Block.anvil.blockID ? false : par1EntityPlayer.getDistanceSq((double)this.field_82861_i + 0.5D, (double)this.field_82858_j + 0.5D, (double)this.field_82859_k + 0.5D) <= 64.0D; + } + + /** +! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(par2); +*** ContainerRepairINNER1.java Sat Feb 5 04:13:12 2022 +--- ContainerRepairINNER1.java Sat Feb 5 04:12:33 2022 +*** ContainerRepairINNER2.java Sat Feb 5 04:13:12 2022 +--- ContainerRepairINNER2.java Sat Feb 5 04:12:33 2022 +*************** +*** 80,90 **** + this.field_135071_a.setBlockToAir(this.field_135069_b, this.field_135070_c, this.field_135067_d); + this.field_135071_a.playAuxSFX(1020, this.field_135069_b, this.field_135070_c, this.field_135067_d, 0); + } + else + { +! this.field_135071_a.setBlockMetadata(this.field_135069_b, this.field_135070_c, this.field_135067_d, var4 | var5 << 2, 2); + this.field_135071_a.playAuxSFX(1021, this.field_135069_b, this.field_135070_c, this.field_135067_d, 0); + } + } + else if (!this.field_135071_a.isRemote) + { +--- 80,90 ---- + this.field_135071_a.setBlockToAir(this.field_135069_b, this.field_135070_c, this.field_135067_d); + this.field_135071_a.playAuxSFX(1020, this.field_135069_b, this.field_135070_c, this.field_135067_d, 0); + } + else + { +! this.field_135071_a.setBlockMetadataWithNotify(this.field_135069_b, this.field_135070_c, this.field_135067_d, var4 | var5 << 2, 2); + this.field_135071_a.playAuxSFX(1021, this.field_135069_b, this.field_135070_c, this.field_135067_d, 0); + } + } + else if (!this.field_135071_a.isRemote) + { +*** ContainerSheep.java Sat Feb 5 04:13:12 2022 +--- ContainerSheep.java Sat Feb 5 04:12:33 2022 +*** ContainerWorkbench.java Sat Feb 5 04:13:12 2022 +--- ContainerWorkbench.java Sat Feb 5 04:12:33 2022 +*************** +*** 77,87 **** + { + return this.worldObj.getBlockId(this.posX, this.posY, this.posZ) != Block.workbench.blockID ? false : par1EntityPlayer.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D; + } + + /** +! * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(par2); +--- 77,87 ---- + { + return this.worldObj.getBlockId(this.posX, this.posY, this.posZ) != Block.workbench.blockID ? false : par1EntityPlayer.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D; + } + + /** +! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(par2); +*** ConvertingProgressUpdate.java Sat Feb 5 04:13:12 2022 +--- ConvertingProgressUpdate.java Sat Feb 5 04:12:33 2022 +*************** +*** 10,39 **** + final MinecraftServer mcServer; + + public ConvertingProgressUpdate(MinecraftServer par1MinecraftServer) + { + this.mcServer = par1MinecraftServer; +! this.field_96245_b = MinecraftServer.getCurrentTimeMillis(); + } + + /** +! * Shows the 'Saving level' string. + */ +! public void displaySavingString(String par1Str) {} + + /** + * Updates the progress bar on the loading screen to the specified amount. Args: loadProgress + */ + public void setLoadingProgress(int par1) + { +! if (MinecraftServer.getCurrentTimeMillis() - this.field_96245_b >= 1000L) + { +! this.field_96245_b = MinecraftServer.getCurrentTimeMillis(); + this.mcServer.getLogAgent().logInfo("Converting... " + par1 + "%"); + } + } + + /** +! * Displays a string on the loading screen supposed to indicate what is being done currently. + */ +! public void displayLoadingString(String par1Str) {} + } +--- 10,39 ---- + final MinecraftServer mcServer; + + public ConvertingProgressUpdate(MinecraftServer par1MinecraftServer) + { + this.mcServer = par1MinecraftServer; +! this.field_96245_b = MinecraftServer.getSystemTimeMillis(); + } + + /** +! * "Saving level", or the loading,or downloading equivelent + */ +! public void displayProgressMessage(String par1Str) {} + + /** + * Updates the progress bar on the loading screen to the specified amount. Args: loadProgress + */ + public void setLoadingProgress(int par1) + { +! if (MinecraftServer.getSystemTimeMillis() - this.field_96245_b >= 1000L) + { +! this.field_96245_b = MinecraftServer.getSystemTimeMillis(); + this.mcServer.getLogAgent().logInfo("Converting... " + par1 + "%"); + } + } + + /** +! * This is called with "Working..." by resetProgressAndMessage + */ +! public void resetProgresAndWorkingMessage(String par1Str) {} + } +*** CraftingManager.java Sat Feb 5 04:13:12 2022 +--- CraftingManager.java Sat Feb 5 04:12:33 2022 +*************** +*** 89,99 **** + this.addRecipe(new ItemStack(Item.cauldron, 1), new Object[] {"# #", "# #", "###", '#', Item.ingotIron}); + this.addRecipe(new ItemStack(Item.brewingStand, 1), new Object[] {" B ", "###", '#', Block.cobblestone, 'B', Item.blazeRod}); + this.addRecipe(new ItemStack(Block.pumpkinLantern, 1), new Object[] {"A", "B", 'A', Block.pumpkin, 'B', Block.torchWood}); + this.addRecipe(new ItemStack(Item.minecartCrate, 1), new Object[] {"A", "B", 'A', Block.chest, 'B', Item.minecartEmpty}); + this.addRecipe(new ItemStack(Item.minecartPowered, 1), new Object[] {"A", "B", 'A', Block.furnaceIdle, 'B', Item.minecartEmpty}); +! this.addRecipe(new ItemStack(Item.tntMinecart, 1), new Object[] {"A", "B", 'A', Block.tnt, 'B', Item.minecartEmpty}); + this.addRecipe(new ItemStack(Item.minecartHopper, 1), new Object[] {"A", "B", 'A', Block.hopperBlock, 'B', Item.minecartEmpty}); + this.addRecipe(new ItemStack(Item.boat, 1), new Object[] {"# #", "###", '#', Block.planks}); + this.addRecipe(new ItemStack(Item.bucketEmpty, 1), new Object[] {"# #", " # ", '#', Item.ingotIron}); + this.addRecipe(new ItemStack(Item.flowerPot, 1), new Object[] {"# #", " # ", '#', Item.brick}); + this.addRecipe(new ItemStack(Item.flintAndSteel, 1), new Object[] {"A ", " B", 'A', Item.ingotIron, 'B', Item.flint}); +--- 89,99 ---- + this.addRecipe(new ItemStack(Item.cauldron, 1), new Object[] {"# #", "# #", "###", '#', Item.ingotIron}); + this.addRecipe(new ItemStack(Item.brewingStand, 1), new Object[] {" B ", "###", '#', Block.cobblestone, 'B', Item.blazeRod}); + this.addRecipe(new ItemStack(Block.pumpkinLantern, 1), new Object[] {"A", "B", 'A', Block.pumpkin, 'B', Block.torchWood}); + this.addRecipe(new ItemStack(Item.minecartCrate, 1), new Object[] {"A", "B", 'A', Block.chest, 'B', Item.minecartEmpty}); + this.addRecipe(new ItemStack(Item.minecartPowered, 1), new Object[] {"A", "B", 'A', Block.furnaceIdle, 'B', Item.minecartEmpty}); +! this.addRecipe(new ItemStack(Item.minecartTnt, 1), new Object[] {"A", "B", 'A', Block.tnt, 'B', Item.minecartEmpty}); + this.addRecipe(new ItemStack(Item.minecartHopper, 1), new Object[] {"A", "B", 'A', Block.hopperBlock, 'B', Item.minecartEmpty}); + this.addRecipe(new ItemStack(Item.boat, 1), new Object[] {"# #", "###", '#', Block.planks}); + this.addRecipe(new ItemStack(Item.bucketEmpty, 1), new Object[] {"# #", " # ", '#', Item.ingotIron}); + this.addRecipe(new ItemStack(Item.flowerPot, 1), new Object[] {"# #", " # ", '#', Item.brick}); + this.addRecipe(new ItemStack(Item.flintAndSteel, 1), new Object[] {"A ", " B", 'A', Item.ingotIron, 'B', Item.flint}); +*** CrashReport.java Sat Feb 5 04:13:12 2022 +--- CrashReport.java Sat Feb 5 04:12:33 2022 +*************** +*** 169,178 **** +--- 169,186 ---- + this.getSectionsInStringBuilder(var1); + return var1.toString(); + } + + /** ++ * Gets the file this crash report is saved into. ++ */ ++ public File getFile() ++ { ++ return this.crashReportFile; ++ } ++ ++ /** + * Saves the complete crash report to the given File. + */ + public boolean saveToFile(File par1File, ILogAgent par2ILogAgent) + { + if (this.crashReportFile != null) +*** CrashReportCategory.java Sat Feb 5 04:13:12 2022 +--- CrashReportCategory.java Sat Feb 5 04:12:33 2022 +*************** +*** 16,25 **** +--- 16,30 ---- + { + this.theCrashReport = par1CrashReport; + this.field_85076_b = par2Str; + } + ++ public static String func_85074_a(double par0, double par2, double par4) ++ { ++ return String.format("%.2f,%.2f,%.2f - %s", new Object[] {Double.valueOf(par0), Double.valueOf(par2), Double.valueOf(par4), getLocationInfo(MathHelper.floor_double(par0), MathHelper.floor_double(par2), MathHelper.floor_double(par4))}); ++ } ++ + /** + * Returns a string with world information on location.Args:x,y,z + */ + public static String getLocationInfo(int par0, int par1, int par2) + { +*** CrashReportCategoryEntry.java Sat Feb 5 04:13:12 2022 +--- CrashReportCategoryEntry.java Sat Feb 5 04:12:33 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- CreativeCrafting.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,31 ---- ++ package net.minecraft.src; ++ ++ import java.util.List; ++ ++ public class CreativeCrafting implements ICrafting ++ { ++ private final Minecraft mc; ++ ++ public CreativeCrafting(Minecraft par1Minecraft) ++ { ++ this.mc = par1Minecraft; ++ } ++ ++ public void sendContainerAndContentsToPlayer(Container par1Container, List par2List) {} ++ ++ /** ++ * Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual ++ * contents of that slot. Args: Container, slot number, slot contents ++ */ ++ public void sendSlotContents(Container par1Container, int par2, ItemStack par3ItemStack) ++ { ++ this.mc.playerController.sendSlotPacket(par3ItemStack, par2); ++ } ++ ++ /** ++ * Sends two ints to the client-side Container. Used for furnace burning time, smelting progress, brewing progress, ++ * and enchanting level. Normally the first int identifies which variable to update, and the second contains the new ++ * value. Both are truncated to shorts in non-local SMP. ++ */ ++ public void sendProgressBarUpdate(Container par1Container, int par2, int par3) {} ++ } +*** CreativeTabBlock.java Sat Feb 5 04:13:12 2022 +--- CreativeTabBlock.java Sat Feb 5 04:12:33 2022 +*************** +*** 4,9 **** +--- 4,17 ---- + { + CreativeTabBlock(int par1, String par2Str) + { + super(par1, par2Str); + } ++ ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ ++ public int getTabIconItemIndex() ++ { ++ return Block.plantRed.blockID; ++ } + } +*** CreativeTabBrewing.java Sat Feb 5 04:13:12 2022 +--- CreativeTabBrewing.java Sat Feb 5 04:12:33 2022 +*************** +*** 4,9 **** +--- 4,17 ---- + { + CreativeTabBrewing(int par1, String par2Str) + { + super(par1, par2Str); + } ++ ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ ++ public int getTabIconItemIndex() ++ { ++ return Item.potion.itemID; ++ } + } +*** CreativeTabCombat.java Sat Feb 5 04:13:12 2022 +--- CreativeTabCombat.java Sat Feb 5 04:12:33 2022 +*************** +*** 4,9 **** +--- 4,17 ---- + { + CreativeTabCombat(int par1, String par2Str) + { + super(par1, par2Str); + } ++ ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ ++ public int getTabIconItemIndex() ++ { ++ return Block.brick.blockID; ++ } + } +*** CreativeTabDeco.java Sat Feb 5 04:13:12 2022 +--- CreativeTabDeco.java Sat Feb 5 04:12:33 2022 +*************** +*** 4,9 **** +--- 4,17 ---- + { + CreativeTabDeco(int par1, String par2Str) + { + super(par1, par2Str); + } ++ ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ ++ public int getTabIconItemIndex() ++ { ++ return Item.redstone.itemID; ++ } + } +*** CreativeTabFood.java Sat Feb 5 04:13:12 2022 +--- CreativeTabFood.java Sat Feb 5 04:12:33 2022 +*************** +*** 4,9 **** +--- 4,17 ---- + { + CreativeTabFood(int par1, String par2Str) + { + super(par1, par2Str); + } ++ ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ ++ public int getTabIconItemIndex() ++ { ++ return Item.axeIron.itemID; ++ } + } +*** CreativeTabInventory.java Sat Feb 5 04:13:12 2022 +--- CreativeTabInventory.java Sat Feb 5 04:12:33 2022 +*************** +*** 4,9 **** +--- 4,17 ---- + { + CreativeTabInventory(int par1, String par2Str) + { + super(par1, par2Str); + } ++ ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ ++ public int getTabIconItemIndex() ++ { ++ return Block.chest.blockID; ++ } + } +*** CreativeTabMaterial.java Sat Feb 5 04:13:12 2022 +--- CreativeTabMaterial.java Sat Feb 5 04:12:33 2022 +*************** +*** 4,9 **** +--- 4,17 ---- + { + CreativeTabMaterial(int par1, String par2Str) + { + super(par1, par2Str); + } ++ ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ ++ public int getTabIconItemIndex() ++ { ++ return Item.stick.itemID; ++ } + } +*** CreativeTabMisc.java Sat Feb 5 04:13:12 2022 +--- CreativeTabMisc.java Sat Feb 5 04:12:33 2022 +*************** +*** 4,9 **** +--- 4,17 ---- + { + CreativeTabMisc(int par1, String par2Str) + { + super(par1, par2Str); + } ++ ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ ++ public int getTabIconItemIndex() ++ { ++ return Item.compass.itemID; ++ } + } +*** CreativeTabRedstone.java Sat Feb 5 04:13:12 2022 +--- CreativeTabRedstone.java Sat Feb 5 04:12:33 2022 +*************** +*** 4,9 **** +--- 4,17 ---- + { + CreativeTabRedstone(int par1, String par2Str) + { + super(par1, par2Str); + } ++ ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ ++ public int getTabIconItemIndex() ++ { ++ return Block.railPowered.blockID; ++ } + } +*** CreativeTabs.java Sat Feb 5 04:13:13 2022 +--- CreativeTabs.java Sat Feb 5 04:12:33 2022 +*************** +*** 1,7 **** +--- 1,9 ---- + package net.minecraft.src; + ++ import java.util.List; ++ + public class CreativeTabs + { + public static final CreativeTabs[] creativeTabArray = new CreativeTabs[12]; + public static final CreativeTabs tabBlock = new CreativeTabCombat(0, "buildingBlocks"); + public static final CreativeTabs tabDecorations = new CreativeTabBlock(1, "decorations"); +*************** +*** 17,27 **** + public static final CreativeTabs tabInventory = (new CreativeTabInventory(11, "inventory")).setBackgroundImageName("inventory.png").setNoScrollbar().setNoTitle(); + private final int tabIndex; + private final String tabLabel; + + /** Texture to use. */ +! private String theTexture = "items.png"; + private boolean hasScrollbar = true; + + /** Whether to draw the title in the foreground of the creative GUI */ + private boolean drawTitle = true; + private EnumEnchantmentType[] field_111230_s; +--- 19,29 ---- + public static final CreativeTabs tabInventory = (new CreativeTabInventory(11, "inventory")).setBackgroundImageName("inventory.png").setNoScrollbar().setNoTitle(); + private final int tabIndex; + private final String tabLabel; + + /** Texture to use. */ +! private String backgroundImageName = "items.png"; + private boolean hasScrollbar = true; + + /** Whether to draw the title in the foreground of the creative GUI */ + private boolean drawTitle = true; + private EnumEnchantmentType[] field_111230_s; +*************** +*** 31,59 **** + this.tabIndex = par1; + this.tabLabel = par2Str; + creativeTabArray[par1] = this; + } + + public CreativeTabs setBackgroundImageName(String par1Str) + { +! this.theTexture = par1Str; + return this; + } + + public CreativeTabs setNoTitle() + { + this.drawTitle = false; + return this; + } + + public CreativeTabs setNoScrollbar() + { + this.hasScrollbar = false; + return this; + } + + public CreativeTabs func_111229_a(EnumEnchantmentType ... par1ArrayOfEnumEnchantmentType) + { + this.field_111230_s = par1ArrayOfEnumEnchantmentType; + return this; + } + } +--- 33,209 ---- + this.tabIndex = par1; + this.tabLabel = par2Str; + creativeTabArray[par1] = this; + } + ++ public int getTabIndex() ++ { ++ return this.tabIndex; ++ } ++ ++ public String getTabLabel() ++ { ++ return this.tabLabel; ++ } ++ ++ /** ++ * Gets the translated Label. ++ */ ++ public String getTranslatedTabLabel() ++ { ++ return "itemGroup." + this.getTabLabel(); ++ } ++ ++ public Item getTabIconItem() ++ { ++ return Item.itemsList[this.getTabIconItemIndex()]; ++ } ++ ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ ++ public int getTabIconItemIndex() ++ { ++ return 1; ++ } ++ ++ public String getBackgroundImageName() ++ { ++ return this.backgroundImageName; ++ } ++ + public CreativeTabs setBackgroundImageName(String par1Str) + { +! this.backgroundImageName = par1Str; + return this; + } + ++ public boolean drawInForegroundOfTab() ++ { ++ return this.drawTitle; ++ } ++ + public CreativeTabs setNoTitle() + { + this.drawTitle = false; + return this; + } + ++ public boolean shouldHidePlayerInventory() ++ { ++ return this.hasScrollbar; ++ } ++ + public CreativeTabs setNoScrollbar() + { + this.hasScrollbar = false; + return this; + } + ++ /** ++ * returns index % 6 ++ */ ++ public int getTabColumn() ++ { ++ return this.tabIndex % 6; ++ } ++ ++ /** ++ * returns tabIndex < 6 ++ */ ++ public boolean isTabInFirstRow() ++ { ++ return this.tabIndex < 6; ++ } ++ ++ public EnumEnchantmentType[] func_111225_m() ++ { ++ return this.field_111230_s; ++ } ++ + public CreativeTabs func_111229_a(EnumEnchantmentType ... par1ArrayOfEnumEnchantmentType) + { + this.field_111230_s = par1ArrayOfEnumEnchantmentType; + return this; ++ } ++ ++ public boolean func_111226_a(EnumEnchantmentType par1EnumEnchantmentType) ++ { ++ if (this.field_111230_s == null) ++ { ++ return false; ++ } ++ else ++ { ++ EnumEnchantmentType[] var2 = this.field_111230_s; ++ int var3 = var2.length; ++ ++ for (int var4 = 0; var4 < var3; ++var4) ++ { ++ EnumEnchantmentType var5 = var2[var4]; ++ ++ if (var5 == par1EnumEnchantmentType) ++ { ++ return true; ++ } ++ } ++ ++ return false; ++ } ++ } ++ ++ /** ++ * only shows items which have tabToDisplayOn == this ++ */ ++ public void displayAllReleventItems(List par1List) ++ { ++ Item[] var2 = Item.itemsList; ++ int var3 = var2.length; ++ ++ for (int var4 = 0; var4 < var3; ++var4) ++ { ++ Item var5 = var2[var4]; ++ ++ if (var5 != null && var5.getCreativeTab() == this) ++ { ++ var5.getSubItems(var5.itemID, this, par1List); ++ } ++ } ++ ++ if (this.func_111225_m() != null) ++ { ++ this.addEnchantmentBooksToList(par1List, this.func_111225_m()); ++ } ++ } ++ ++ /** ++ * Adds the enchantment books from the supplied EnumEnchantmentType to the given list. ++ */ ++ public void addEnchantmentBooksToList(List par1List, EnumEnchantmentType ... par2ArrayOfEnumEnchantmentType) ++ { ++ Enchantment[] var3 = Enchantment.enchantmentsList; ++ int var4 = var3.length; ++ ++ for (int var5 = 0; var5 < var4; ++var5) ++ { ++ Enchantment var6 = var3[var5]; ++ ++ if (var6 != null && var6.type != null) ++ { ++ boolean var7 = false; ++ ++ for (int var8 = 0; var8 < par2ArrayOfEnumEnchantmentType.length && !var7; ++var8) ++ { ++ if (var6.type == par2ArrayOfEnumEnchantmentType[var8]) ++ { ++ var7 = true; ++ } ++ } ++ ++ if (var7) ++ { ++ par1List.add(Item.enchantedBook.getEnchantedItemStack(new EnchantmentData(var6, var6.getMaxLevel()))); ++ } ++ } ++ } + } + } +*** CreativeTabSearch.java Sat Feb 5 04:13:13 2022 +--- CreativeTabSearch.java Sat Feb 5 04:12:33 2022 +*************** +*** 4,9 **** +--- 4,17 ---- + { + CreativeTabSearch(int par1, String par2Str) + { + super(par1, par2Str); + } ++ ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ ++ public int getTabIconItemIndex() ++ { ++ return Item.appleRed.itemID; ++ } + } +*** CreativeTabTools.java Sat Feb 5 04:13:13 2022 +--- CreativeTabTools.java Sat Feb 5 04:12:33 2022 +*************** +*** 4,9 **** +--- 4,17 ---- + { + CreativeTabTools(int par1, String par2Str) + { + super(par1, par2Str); + } ++ ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ ++ public int getTabIconItemIndex() ++ { ++ return Item.swordGold.itemID; ++ } + } +*** CreativeTabTransport.java Sat Feb 5 04:13:13 2022 +--- CreativeTabTransport.java Sat Feb 5 04:12:33 2022 +*************** +*** 4,9 **** +--- 4,17 ---- + { + CreativeTabTransport(int par1, String par2Str) + { + super(par1, par2Str); + } ++ ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ ++ public int getTabIconItemIndex() ++ { ++ return Item.bucketLava.itemID; ++ } + } +*** CryptManager.java Sat Feb 5 04:13:13 2022 +--- CryptManager.java Sat Feb 5 04:12:33 2022 +*************** +*** 10,29 **** +--- 10,32 ---- + import java.security.KeyPairGenerator; + import java.security.MessageDigest; + import java.security.NoSuchAlgorithmException; + import java.security.PrivateKey; + import java.security.PublicKey; ++ import java.security.SecureRandom; + import java.security.Security; + import java.security.spec.InvalidKeySpecException; + import java.security.spec.X509EncodedKeySpec; + import javax.crypto.BadPaddingException; + import javax.crypto.Cipher; + import javax.crypto.IllegalBlockSizeException; + import javax.crypto.NoSuchPaddingException; + import javax.crypto.SecretKey; + import javax.crypto.spec.SecretKeySpec; + import org.bouncycastle.crypto.BufferedBlockCipher; ++ import org.bouncycastle.crypto.CipherKeyGenerator; ++ import org.bouncycastle.crypto.KeyGenerationParameters; + import org.bouncycastle.crypto.engines.AESFastEngine; + import org.bouncycastle.crypto.io.CipherInputStream; + import org.bouncycastle.crypto.io.CipherOutputStream; + import org.bouncycastle.crypto.modes.CFBBlockCipher; + import org.bouncycastle.crypto.params.KeyParameter; +*************** +*** 31,43 **** + import org.bouncycastle.jce.provider.BouncyCastleProvider; + + public class CryptManager + { + /** +! * Generates RSA KeyPair + */ +! public static KeyPair generateKeyPair() + { + try + { + KeyPairGenerator var0 = KeyPairGenerator.getInstance("RSA"); + var0.initialize(1024); +--- 34,53 ---- + import org.bouncycastle.jce.provider.BouncyCastleProvider; + + public class CryptManager + { + /** +! * Generate a new shared secret AES key from a secure random source + */ +! public static SecretKey createNewSharedKey() +! { +! CipherKeyGenerator var0 = new CipherKeyGenerator(); +! var0.init(new KeyGenerationParameters(new SecureRandom(), 128)); +! return new SecretKeySpec(var0.generateKey(), "AES"); +! } +! +! public static KeyPair createNewKeyPair() + { + try + { + KeyPairGenerator var0 = KeyPairGenerator.getInstance("RSA"); + var0.initialize(1024); +*************** +*** 121,130 **** +--- 131,148 ---- + * Decrypt shared secret AES key using RSA private key + */ + public static SecretKey decryptSharedKey(PrivateKey par0PrivateKey, byte[] par1ArrayOfByte) + { + return new SecretKeySpec(decryptData(par0PrivateKey, par1ArrayOfByte), "AES"); ++ } ++ ++ /** ++ * Encrypt byte[] data with RSA public key ++ */ ++ public static byte[] encryptData(Key par0Key, byte[] par1ArrayOfByte) ++ { ++ return cipherOperation(1, par0Key, par1ArrayOfByte); + } + + /** + * Decrypt byte[] data with RSA private key + */ +*** DamageSource.java Sat Feb 5 04:13:13 2022 +--- DamageSource.java Sat Feb 5 04:12:33 2022 +*************** +*** 30,41 **** + + /** + * Whether this damage source will have its damage amount scaled based on the current difficulty. + */ + private boolean difficultyScaled; +- +- /** Whether the damage is magic based. */ + private boolean magicDamage; + private boolean explosion; + public String damageType; + + public static DamageSource causeMobDamage(EntityLivingBase par0EntityLivingBase) +--- 30,39 ---- +*** DataWatcher.java Sat Feb 5 04:13:13 2022 +--- DataWatcher.java Sat Feb 5 04:12:33 2022 +*************** +*** 149,162 **** + { + WatchableObject.setWatchableObjectWatched(this.getWatchedObject(par1), true); + this.objectChanged = true; + } + +! /** +! * true if one or more object was changed +! */ +! public boolean hasObjectChanged() + { + return this.objectChanged; + } + + /** +--- 149,159 ---- + { + WatchableObject.setWatchableObjectWatched(this.getWatchedObject(par1), true); + this.objectChanged = true; + } + +! public boolean hasChanges() + { + return this.objectChanged; + } + + /** +*************** +*** 336,345 **** +--- 333,362 ---- + + var1.add(var5); + } + + return var1; ++ } ++ ++ public void updateWatchedObjectsFromList(List par1List) ++ { ++ this.lock.writeLock().lock(); ++ Iterator var2 = par1List.iterator(); ++ ++ while (var2.hasNext()) ++ { ++ WatchableObject var3 = (WatchableObject)var2.next(); ++ WatchableObject var4 = (WatchableObject)this.watchedObjects.get(Integer.valueOf(var3.getDataValueId())); ++ ++ if (var4 != null) ++ { ++ var4.setObject(var3.getObject()); ++ } ++ } ++ ++ this.lock.writeLock().unlock(); ++ this.objectChanged = true; + } + + public boolean getIsBlank() + { + return this.isBlank; +*** DedicatedPlayerList.java Sat Feb 5 04:13:13 2022 +--- DedicatedPlayerList.java Sat Feb 5 04:12:33 2022 +*** DedicatedServer.java Sat Feb 5 04:13:13 2022 +--- DedicatedServer.java Sat Feb 5 04:12:33 2022 +*************** +*** 51,69 **** + this.setHostname("127.0.0.1"); + } + else + { + this.setOnlineMode(this.settings.getBooleanProperty("online-mode", true)); +! this.setHostname(this.settings.getStringProperty("server-ip", "")); + } + + this.setCanSpawnAnimals(this.settings.getBooleanProperty("spawn-animals", true)); + this.setCanSpawnNPCs(this.settings.getBooleanProperty("spawn-npcs", true)); + this.setAllowPvp(this.settings.getBooleanProperty("pvp", true)); + this.setAllowFlight(this.settings.getBooleanProperty("allow-flight", false)); +! this.setTexturePack(this.settings.getStringProperty("texture-pack", "")); +! this.setMOTD(this.settings.getStringProperty("motd", "A Minecraft Server")); + this.setForceGamemode(this.settings.getBooleanProperty("force-gamemode", false)); + this.func_143006_e(this.settings.getIntProperty("player-idle-timeout", 0)); + + if (this.settings.getIntProperty("difficulty", 1) < 0) + { +--- 51,69 ---- + this.setHostname("127.0.0.1"); + } + else + { + this.setOnlineMode(this.settings.getBooleanProperty("online-mode", true)); +! this.setHostname(this.settings.getProperty("server-ip", "")); + } + + this.setCanSpawnAnimals(this.settings.getBooleanProperty("spawn-animals", true)); + this.setCanSpawnNPCs(this.settings.getBooleanProperty("spawn-npcs", true)); + this.setAllowPvp(this.settings.getBooleanProperty("pvp", true)); + this.setAllowFlight(this.settings.getBooleanProperty("allow-flight", false)); +! this.setTexturePack(this.settings.getProperty("texture-pack", "")); +! this.setMOTD(this.settings.getProperty("motd", "A Minecraft Server")); + this.setForceGamemode(this.settings.getBooleanProperty("force-gamemode", false)); + this.func_143006_e(this.settings.getIntProperty("player-idle-timeout", 0)); + + if (this.settings.getIntProperty("difficulty", 1) < 0) + { +*************** +*** 89,99 **** + { + this.setServerPort(this.settings.getIntProperty("server-port", 25565)); + } + + this.getLogAgent().logInfo("Generating keypair"); +! this.setKeyPair(CryptManager.generateKeyPair()); + this.getLogAgent().logInfo("Starting Minecraft server on " + (this.getServerHostname().length() == 0 ? "*" : this.getServerHostname()) + ":" + this.getServerPort()); + + try + { + this.networkThread = new DedicatedServerListenThread(this, var3, this.getServerPort()); +--- 89,99 ---- + { + this.setServerPort(this.settings.getIntProperty("server-port", 25565)); + } + + this.getLogAgent().logInfo("Generating keypair"); +! this.setKeyPair(CryptManager.createNewKeyPair()); + this.getLogAgent().logInfo("Starting Minecraft server on " + (this.getServerHostname().length() == 0 ? "*" : this.getServerHostname()) + ":" + this.getServerPort()); + + try + { + this.networkThread = new DedicatedServerListenThread(this, var3, this.getServerPort()); +*************** +*** 117,132 **** + this.setConfigurationManager(new DedicatedPlayerList(this)); + long var4 = System.nanoTime(); + + if (this.getFolderName() == null) + { +! this.setFolderName(this.settings.getStringProperty("level-name", "world")); + } + +! String var6 = this.settings.getStringProperty("level-seed", ""); +! String var7 = this.settings.getStringProperty("level-type", "DEFAULT"); +! String var8 = this.settings.getStringProperty("generator-settings", ""); + long var9 = (new Random()).nextLong(); + + if (var6.length() > 0) + { + try +--- 117,132 ---- + this.setConfigurationManager(new DedicatedPlayerList(this)); + long var4 = System.nanoTime(); + + if (this.getFolderName() == null) + { +! this.setFolderName(this.settings.getProperty("level-name", "world")); + } + +! String var6 = this.settings.getProperty("level-seed", ""); +! String var7 = this.settings.getProperty("level-type", "DEFAULT"); +! String var8 = this.settings.getProperty("generator-settings", ""); + long var9 = (new Random()).nextLong(); + + if (var6.length() > 0) + { + try +*************** +*** 314,324 **** + /** + * Gets a string property. If it does not exist, set it to the specified value. + */ + public String getStringProperty(String par1Str, String par2Str) + { +! return this.settings.getStringProperty(par1Str, par2Str); + } + + /** + * Gets a boolean property. If it does not exist, set it to the specified value. + */ +--- 314,324 ---- + /** + * Gets a string property. If it does not exist, set it to the specified value. + */ + public String getStringProperty(String par1Str, String par2Str) + { +! return this.settings.getProperty(par1Str, par2Str); + } + + /** + * Gets a boolean property. If it does not exist, set it to the specified value. + */ +*************** +*** 348,363 **** + */ + public String getSettingsFilename() + { + File var1 = this.settings.getPropertiesFile(); + return var1 != null ? var1.getAbsolutePath() : "No settings file"; +- } +- +- public void func_120011_ar() +- { +- MinecraftServerGui.func_120016_a(this); +- this.guiIsEnabled = true; + } + + public boolean getGuiEnabled() + { + return this.guiIsEnabled; +--- 348,357 ---- +*** DedicatedServerCommandThread.java Sat Feb 5 04:13:13 2022 +--- DedicatedServerCommandThread.java Sat Feb 5 04:12:33 2022 +*** DedicatedServerListenThread.java Sat Feb 5 04:13:13 2022 +--- DedicatedServerListenThread.java Sat Feb 5 04:12:33 2022 +*************** +*** 22,37 **** + this.theServerListenThread.func_71768_b(); + this.theServerListenThread.interrupt(); + } + + /** +! * Handles all incoming connections and packets + */ +! public void handleNetworkListenThread() + { + this.theServerListenThread.processPendingConnections(); +! super.handleNetworkListenThread(); + } + + public DedicatedServer getDedicatedServer() + { + return (DedicatedServer)super.getServer(); +--- 22,37 ---- + this.theServerListenThread.func_71768_b(); + this.theServerListenThread.interrupt(); + } + + /** +! * processes packets and pending connections + */ +! public void networkTick() + { + this.theServerListenThread.processPendingConnections(); +! super.networkTick(); + } + + public DedicatedServer getDedicatedServer() + { + return (DedicatedServer)super.getServer(); +*** DedicatedServerSleepThread.java Sat Feb 5 04:13:13 2022 +--- DedicatedServerSleepThread.java Sat Feb 5 04:12:33 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- DefaultResourcePack.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,103 ---- ++ package net.minecraft.src; ++ ++ import com.google.common.collect.ImmutableSet; ++ import com.google.common.collect.Maps; ++ import java.awt.image.BufferedImage; ++ import java.io.File; ++ import java.io.FileInputStream; ++ import java.io.FileNotFoundException; ++ import java.io.IOException; ++ import java.io.InputStream; ++ import java.util.Map; ++ import java.util.Set; ++ import javax.imageio.ImageIO; ++ ++ public class DefaultResourcePack implements ResourcePack ++ { ++ public static final Set defaultResourceDomains = ImmutableSet.of("minecraft"); ++ private final Map mapResourceFiles = Maps.newHashMap(); ++ private final File fileAssets; ++ ++ public DefaultResourcePack(File par1File) ++ { ++ this.fileAssets = par1File; ++ this.readAssetsDir(this.fileAssets); ++ } ++ ++ public InputStream getInputStream(ResourceLocation par1ResourceLocation) throws IOException ++ { ++ InputStream var2 = this.getResourceStream(par1ResourceLocation); ++ ++ if (var2 != null) ++ { ++ return var2; ++ } ++ else ++ { ++ File var3 = (File)this.mapResourceFiles.get(par1ResourceLocation.toString()); ++ ++ if (var3 != null) ++ { ++ return new FileInputStream(var3); ++ } ++ else ++ { ++ throw new FileNotFoundException(par1ResourceLocation.getResourcePath()); ++ } ++ } ++ } ++ ++ private InputStream getResourceStream(ResourceLocation par1ResourceLocation) ++ { ++ return DefaultResourcePack.class.getResourceAsStream("/assets/minecraft/" + par1ResourceLocation.getResourcePath()); ++ } ++ ++ public void addResourceFile(String par1Str, File par2File) ++ { ++ this.mapResourceFiles.put((new ResourceLocation(par1Str)).toString(), par2File); ++ } ++ ++ public boolean resourceExists(ResourceLocation par1ResourceLocation) ++ { ++ return this.getResourceStream(par1ResourceLocation) != null || this.mapResourceFiles.containsKey(par1ResourceLocation.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 MetadataSection getPackMetadata(MetadataSerializer par1MetadataSerializer, String par2Str) throws IOException ++ { ++ return AbstractResourcePack.readMetadata(par1MetadataSerializer, DefaultResourcePack.class.getResourceAsStream("/" + (new ResourceLocation("pack.mcmeta")).getResourcePath()), par2Str); ++ } ++ ++ public BufferedImage getPackImage() throws IOException ++ { ++ return ImageIO.read(DefaultResourcePack.class.getResourceAsStream("/" + (new ResourceLocation("pack.png")).getResourcePath())); ++ } ++ ++ public String getPackName() ++ { ++ return "Default"; ++ } ++ } +*** DemoWorldManager.java Sat Feb 5 04:13:13 2022 +--- DemoWorldManager.java Sat Feb 5 04:12:33 2022 +*************** +*** 20,30 **** + long var3 = var1 / 24000L + 1L; + + if (!this.field_73105_c && this.field_73102_f > 20) + { + this.field_73105_c = true; +! this.thisPlayerMP.playerNetServerHandler.sendPacket(new Packet70GameEvent(5, 0)); + } + + this.demoTimeExpired = var1 > 120500L; + + if (this.demoTimeExpired) +--- 20,30 ---- + long var3 = var1 / 24000L + 1L; + + if (!this.field_73105_c && this.field_73102_f > 20) + { + this.field_73105_c = true; +! this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 0)); + } + + this.demoTimeExpired = var1 > 120500L; + + if (this.demoTimeExpired) +*************** +*** 41,59 **** + } + else if (var3 == 1L) + { + if (var1 == 100L) + { +! this.thisPlayerMP.playerNetServerHandler.sendPacket(new Packet70GameEvent(5, 101)); + } + else if (var1 == 175L) + { +! this.thisPlayerMP.playerNetServerHandler.sendPacket(new Packet70GameEvent(5, 102)); + } + else if (var1 == 250L) + { +! this.thisPlayerMP.playerNetServerHandler.sendPacket(new Packet70GameEvent(5, 103)); + } + } + else if (var3 == 5L && var1 % 24000L == 22000L) + { + this.thisPlayerMP.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("demo.day.warning")); +--- 41,59 ---- + } + else if (var3 == 1L) + { + if (var1 == 100L) + { +! this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 101)); + } + else if (var1 == 175L) + { +! this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 102)); + } + else if (var1 == 250L) + { +! this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 103)); + } + } + else if (var3 == 5L && var1 % 24000L == 22000L) + { + this.thisPlayerMP.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("demo.day.warning")); +*************** +*** 86,100 **** + { + super.onBlockClicked(par1, par2, par3, par4); + } + } + +! public void blockRemoving(int par1, int par2, int par3) + { + if (!this.demoTimeExpired) + { +! super.blockRemoving(par1, par2, par3); + } + } + + /** + * Attempts to harvest a block at the given coordinate +--- 86,100 ---- + { + super.onBlockClicked(par1, par2, par3, par4); + } + } + +! public void uncheckedTryHarvestBlock(int par1, int par2, int par3) + { + if (!this.demoTimeExpired) + { +! super.uncheckedTryHarvestBlock(par1, par2, par3); + } + } + + /** + * Attempts to harvest a block at the given coordinate +*** DemoWorldServer.java Sat Feb 5 04:13:13 2022 +--- DemoWorldServer.java Sat Feb 5 04:12:33 2022 +*** DerivedWorldInfo.java Sat Feb 5 04:13:13 2022 +--- DerivedWorldInfo.java Sat Feb 5 04:12:33 2022 +*************** +*** 69,89 **** + public long getWorldTime() + { + return this.theWorldInfo.getWorldTime(); + } + + /** + * Returns the player's NBTTagCompound to be loaded + */ + public NBTTagCompound getPlayerNBTTagCompound() + { + return this.theWorldInfo.getPlayerNBTTagCompound(); + } + +! public int getDimension() + { +! return this.theWorldInfo.getDimension(); + } + + /** + * Get current world name + */ +--- 69,98 ---- + public long getWorldTime() + { + return this.theWorldInfo.getWorldTime(); + } + ++ public long getSizeOnDisk() ++ { ++ return this.theWorldInfo.getSizeOnDisk(); ++ } ++ + /** + * Returns the player's NBTTagCompound to be loaded + */ + public NBTTagCompound getPlayerNBTTagCompound() + { + return this.theWorldInfo.getPlayerNBTTagCompound(); + } + +! /** +! * Returns vanilla MC dimension (-1,0,1). For custom dimension compatibility, always prefer +! * WorldProvider.dimensionID accessed from World.provider.dimensionID +! */ +! public int getVanillaDimension() + { +! return this.theWorldInfo.getVanillaDimension(); + } + + /** + * Get current world name + */ +*************** +*** 99,108 **** +--- 108,125 ---- + { + return this.theWorldInfo.getSaveVersion(); + } + + /** ++ * Return the last time the player was in this world. ++ */ ++ public long getLastTimePlayed() ++ { ++ return this.theWorldInfo.getLastTimePlayed(); ++ } ++ ++ /** + * Returns true if it is thundering, false otherwise. + */ + public boolean isThundering() + { + return this.theWorldInfo.isThundering(); +*************** +*** 137,146 **** +--- 154,178 ---- + */ + public EnumGameType getGameType() + { + return this.theWorldInfo.getGameType(); + } ++ ++ /** ++ * Set the x spawn position to the passed in value ++ */ ++ public void setSpawnX(int par1) {} ++ ++ /** ++ * Sets the y spawn position ++ */ ++ public void setSpawnY(int par1) {} ++ ++ /** ++ * Set the z spawn position to the passed in value ++ */ ++ public void setSpawnZ(int par1) {} + + public void incrementTotalWorldTime(long par1) {} + + /** + * Set current world time +*** /dev/null Thu Jan 1 01:00:00 1970 +--- DestroyBlockProgress.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,81 ---- ++ package net.minecraft.src; ++ ++ public class DestroyBlockProgress ++ { ++ /** ++ * entity ID of the player associated with this partially destroyed Block. Used to identify the Blocks in the client ++ * Renderer, max 1 per player on a server ++ */ ++ private final int miningPlayerEntId; ++ private final int partialBlockX; ++ private final int partialBlockY; ++ private final int partialBlockZ; ++ ++ /** ++ * damage ranges from 1 to 10. -1 causes the client to delete the partial block renderer. ++ */ ++ private int partialBlockProgress; ++ ++ /** ++ * keeps track of how many ticks this PartiallyDestroyedBlock already exists ++ */ ++ private int createdAtCloudUpdateTick; ++ ++ public DestroyBlockProgress(int par1, int par2, int par3, int par4) ++ { ++ this.miningPlayerEntId = par1; ++ this.partialBlockX = par2; ++ this.partialBlockY = par3; ++ this.partialBlockZ = par4; ++ } ++ ++ public int getPartialBlockX() ++ { ++ return this.partialBlockX; ++ } ++ ++ public int getPartialBlockY() ++ { ++ return this.partialBlockY; ++ } ++ ++ public int getPartialBlockZ() ++ { ++ return this.partialBlockZ; ++ } ++ ++ /** ++ * inserts damage value into this partially destroyed Block. -1 causes client renderer to delete it, otherwise ++ * ranges from 1 to 10 ++ */ ++ public void setPartialBlockDamage(int par1) ++ { ++ if (par1 > 10) ++ { ++ par1 = 10; ++ } ++ ++ this.partialBlockProgress = par1; ++ } ++ ++ public int getPartialBlockDamage() ++ { ++ return this.partialBlockProgress; ++ } ++ ++ /** ++ * saves the current Cloud update tick into the PartiallyDestroyedBlock ++ */ ++ public void setCloudUpdateTick(int par1) ++ { ++ this.createdAtCloudUpdateTick = par1; ++ } ++ ++ /** ++ * retrieves the 'date' at which the PartiallyDestroyedBlock was created ++ */ ++ public int getCreationCloudUpdateTick() ++ { ++ return this.createdAtCloudUpdateTick; ++ } ++ } +*** Direction.java Sat Feb 5 04:13:13 2022 +--- Direction.java Sat Feb 5 04:12:33 2022 +*************** +*** 12,22 **** + /** Maps a Facing value (3D) to a Direction value (2D). */ + public static final int[] facingToDirection = new int[] { -1, -1, 2, 0, 1, 3}; + + /** Maps a direction to that opposite of it. */ + public static final int[] rotateOpposite = new int[] {2, 3, 0, 1}; +! public static final int[] enderEyeMetaToDirection = new int[] {1, 2, 3, 0}; + + /** Maps a direction to that to the left of it. */ + public static final int[] rotateLeft = new int[] {3, 0, 1, 2}; + public static final int[][] bedDirection = new int[][] {{1, 0, 3, 2, 5, 4}, {1, 0, 5, 4, 2, 3}, {1, 0, 2, 3, 4, 5}, {1, 0, 4, 5, 3, 2}}; + +--- 12,24 ---- + /** Maps a Facing value (3D) to a Direction value (2D). */ + public static final int[] facingToDirection = new int[] { -1, -1, 2, 0, 1, 3}; + + /** Maps a direction to that opposite of it. */ + public static final int[] rotateOpposite = new int[] {2, 3, 0, 1}; +! +! /** Maps a direction to that to the right of it. */ +! public static final int[] rotateRight = new int[] {1, 2, 3, 0}; + + /** Maps a direction to that to the left of it. */ + public static final int[] rotateLeft = new int[] {3, 0, 1, 2}; + public static final int[][] bedDirection = new int[][] {{1, 0, 3, 2, 5, 4}, {1, 0, 5, 4, 2, 3}, {1, 0, 2, 3, 4, 5}, {1, 0, 4, 5, 3, 2}}; + +*** DispenserBehaviorArrow.java Sat Feb 5 04:13:13 2022 +--- DispenserBehaviorArrow.java Sat Feb 5 04:12:33 2022 +*** DispenserBehaviorBoat.java Sat Feb 5 04:13:13 2022 +--- DispenserBehaviorBoat.java Sat Feb 5 04:12:33 2022 +*** DispenserBehaviorDye.java Sat Feb 5 04:13:13 2022 +--- DispenserBehaviorDye.java Sat Feb 5 04:12:33 2022 +*** DispenserBehaviorEgg.java Sat Feb 5 04:13:13 2022 +--- DispenserBehaviorEgg.java Sat Feb 5 04:12:33 2022 +*** DispenserBehaviorEmptyBucket.java Sat Feb 5 04:13:13 2022 +--- DispenserBehaviorEmptyBucket.java Sat Feb 5 04:12:33 2022 +*** DispenserBehaviorExperience.java Sat Feb 5 04:13:13 2022 +--- DispenserBehaviorExperience.java Sat Feb 5 04:12:33 2022 +*** DispenserBehaviorFilledBucket.java Sat Feb 5 04:13:13 2022 +--- DispenserBehaviorFilledBucket.java Sat Feb 5 04:12:33 2022 +*** DispenserBehaviorFire.java Sat Feb 5 04:13:13 2022 +--- DispenserBehaviorFire.java Sat Feb 5 04:12:33 2022 +*** DispenserBehaviorFireball.java Sat Feb 5 04:13:13 2022 +--- DispenserBehaviorFireball.java Sat Feb 5 04:12:33 2022 +*** DispenserBehaviorFireworks.java Sat Feb 5 04:13:13 2022 +--- DispenserBehaviorFireworks.java Sat Feb 5 04:12:33 2022 +*** DispenserBehaviorMobEgg.java Sat Feb 5 04:13:13 2022 +--- DispenserBehaviorMobEgg.java Sat Feb 5 04:12:33 2022 +*** DispenserBehaviorPotion.java Sat Feb 5 04:13:13 2022 +--- DispenserBehaviorPotion.java Sat Feb 5 04:12:33 2022 +*** DispenserBehaviorPotionProjectile.java Sat Feb 5 04:13:13 2022 +--- DispenserBehaviorPotionProjectile.java Sat Feb 5 04:12:33 2022 +*** DispenserBehaviors.java Sat Feb 5 04:13:13 2022 +--- DispenserBehaviors.java Sat Feb 5 04:12:33 2022 +*** DispenserBehaviorSnowball.java Sat Feb 5 04:13:13 2022 +--- DispenserBehaviorSnowball.java Sat Feb 5 04:12:33 2022 +*** DispenserBehaviorTNT.java Sat Feb 5 04:13:13 2022 +--- DispenserBehaviorTNT.java Sat Feb 5 04:12:33 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- DynamicTexture.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,42 ---- ++ 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; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EffectRenderer.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,230 ---- ++ package net.minecraft.src; ++ ++ import java.util.ArrayList; ++ import java.util.List; ++ import java.util.Random; ++ import org.lwjgl.opengl.GL11; ++ ++ public class EffectRenderer ++ { ++ private static final ResourceLocation particleTextures = new ResourceLocation("textures/particle/particles.png"); ++ ++ /** Reference to the World object. */ ++ protected World worldObj; ++ private List[] fxLayers = new List[4]; ++ private TextureManager renderer; ++ ++ /** RNG. */ ++ private Random rand = new Random(); ++ ++ public EffectRenderer(World par1World, TextureManager par2TextureManager) ++ { ++ if (par1World != null) ++ { ++ this.worldObj = par1World; ++ } ++ ++ this.renderer = par2TextureManager; ++ ++ for (int var3 = 0; var3 < 4; ++var3) ++ { ++ this.fxLayers[var3] = new ArrayList(); ++ } ++ } ++ ++ public void addEffect(EntityFX par1EntityFX) ++ { ++ int var2 = par1EntityFX.getFXLayer(); ++ ++ if (this.fxLayers[var2].size() >= 4000) ++ { ++ this.fxLayers[var2].remove(0); ++ } ++ ++ this.fxLayers[var2].add(par1EntityFX); ++ } ++ ++ public void updateEffects() ++ { ++ for (int var1 = 0; var1 < 4; ++var1) ++ { ++ for (int var2 = 0; var2 < this.fxLayers[var1].size(); ++var2) ++ { ++ EntityFX var3 = (EntityFX)this.fxLayers[var1].get(var2); ++ var3.onUpdate(); ++ ++ if (var3.isDead) ++ { ++ this.fxLayers[var1].remove(var2--); ++ } ++ } ++ } ++ } ++ ++ /** ++ * Renders all current particles. Args player, partialTickTime ++ */ ++ public void renderParticles(Entity par1Entity, float par2) ++ { ++ float var3 = ActiveRenderInfo.rotationX; ++ float var4 = ActiveRenderInfo.rotationZ; ++ float var5 = ActiveRenderInfo.rotationYZ; ++ float var6 = ActiveRenderInfo.rotationXY; ++ float var7 = ActiveRenderInfo.rotationXZ; ++ EntityFX.interpPosX = par1Entity.lastTickPosX + (par1Entity.posX - par1Entity.lastTickPosX) * (double)par2; ++ EntityFX.interpPosY = par1Entity.lastTickPosY + (par1Entity.posY - par1Entity.lastTickPosY) * (double)par2; ++ EntityFX.interpPosZ = par1Entity.lastTickPosZ + (par1Entity.posZ - par1Entity.lastTickPosZ) * (double)par2; ++ ++ for (int var8 = 0; var8 < 3; ++var8) ++ { ++ if (!this.fxLayers[var8].isEmpty()) ++ { ++ switch (var8) ++ { ++ case 0: ++ default: ++ this.renderer.bindTexture(particleTextures); ++ break; ++ ++ case 1: ++ this.renderer.bindTexture(TextureMap.locationBlocksTexture); ++ break; ++ ++ case 2: ++ this.renderer.bindTexture(TextureMap.locationItemsTexture); ++ } ++ ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glDepthMask(false); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F); ++ Tessellator var9 = Tessellator.instance; ++ var9.startDrawingQuads(); ++ ++ for (int var10 = 0; var10 < this.fxLayers[var8].size(); ++var10) ++ { ++ EntityFX var11 = (EntityFX)this.fxLayers[var8].get(var10); ++ var9.setBrightness(var11.getBrightnessForRender(par2)); ++ var11.renderParticle(var9, par2, var3, var7, var4, var5, var6); ++ } ++ ++ var9.draw(); ++ GL11.glDisable(GL11.GL_BLEND); ++ GL11.glDepthMask(true); ++ GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); ++ } ++ } ++ } ++ ++ public void renderLitParticles(Entity par1Entity, float par2) ++ { ++ float var3 = 0.017453292F; ++ float var4 = MathHelper.cos(par1Entity.rotationYaw * 0.017453292F); ++ float var5 = MathHelper.sin(par1Entity.rotationYaw * 0.017453292F); ++ float var6 = -var5 * MathHelper.sin(par1Entity.rotationPitch * 0.017453292F); ++ float var7 = var4 * MathHelper.sin(par1Entity.rotationPitch * 0.017453292F); ++ float var8 = MathHelper.cos(par1Entity.rotationPitch * 0.017453292F); ++ byte var9 = 3; ++ List var10 = this.fxLayers[var9]; ++ ++ if (!var10.isEmpty()) ++ { ++ Tessellator var11 = Tessellator.instance; ++ ++ for (int var12 = 0; var12 < var10.size(); ++var12) ++ { ++ EntityFX var13 = (EntityFX)var10.get(var12); ++ var11.setBrightness(var13.getBrightnessForRender(par2)); ++ var13.renderParticle(var11, par2, var4, var8, var5, var6, var7); ++ } ++ } ++ } ++ ++ public void clearEffects(World par1World) ++ { ++ this.worldObj = par1World; ++ ++ for (int var2 = 0; var2 < 4; ++var2) ++ { ++ this.fxLayers[var2].clear(); ++ } ++ } ++ ++ public void addBlockDestroyEffects(int par1, int par2, int par3, int par4, int par5) ++ { ++ if (par4 != 0) ++ { ++ Block var6 = Block.blocksList[par4]; ++ byte var7 = 4; ++ ++ for (int var8 = 0; var8 < var7; ++var8) ++ { ++ for (int var9 = 0; var9 < var7; ++var9) ++ { ++ for (int var10 = 0; var10 < var7; ++var10) ++ { ++ double var11 = (double)par1 + ((double)var8 + 0.5D) / (double)var7; ++ double var13 = (double)par2 + ((double)var9 + 0.5D) / (double)var7; ++ double var15 = (double)par3 + ((double)var10 + 0.5D) / (double)var7; ++ this.addEffect((new EntityDiggingFX(this.worldObj, var11, var13, var15, var11 - (double)par1 - 0.5D, var13 - (double)par2 - 0.5D, var15 - (double)par3 - 0.5D, var6, par5)).applyColourMultiplier(par1, par2, par3)); ++ } ++ } ++ } ++ } ++ } ++ ++ /** ++ * Adds block hit particles for the specified block. Args: x, y, z, sideHit ++ */ ++ public void addBlockHitEffects(int par1, int par2, int par3, int par4) ++ { ++ int var5 = this.worldObj.getBlockId(par1, par2, par3); ++ ++ if (var5 != 0) ++ { ++ Block var6 = Block.blocksList[var5]; ++ float var7 = 0.1F; ++ double var8 = (double)par1 + this.rand.nextDouble() * (var6.getBlockBoundsMaxX() - var6.getBlockBoundsMinX() - (double)(var7 * 2.0F)) + (double)var7 + var6.getBlockBoundsMinX(); ++ double var10 = (double)par2 + this.rand.nextDouble() * (var6.getBlockBoundsMaxY() - var6.getBlockBoundsMinY() - (double)(var7 * 2.0F)) + (double)var7 + var6.getBlockBoundsMinY(); ++ double var12 = (double)par3 + this.rand.nextDouble() * (var6.getBlockBoundsMaxZ() - var6.getBlockBoundsMinZ() - (double)(var7 * 2.0F)) + (double)var7 + var6.getBlockBoundsMinZ(); ++ ++ if (par4 == 0) ++ { ++ var10 = (double)par2 + var6.getBlockBoundsMinY() - (double)var7; ++ } ++ ++ if (par4 == 1) ++ { ++ var10 = (double)par2 + var6.getBlockBoundsMaxY() + (double)var7; ++ } ++ ++ if (par4 == 2) ++ { ++ var12 = (double)par3 + var6.getBlockBoundsMinZ() - (double)var7; ++ } ++ ++ if (par4 == 3) ++ { ++ var12 = (double)par3 + var6.getBlockBoundsMaxZ() + (double)var7; ++ } ++ ++ if (par4 == 4) ++ { ++ var8 = (double)par1 + var6.getBlockBoundsMinX() - (double)var7; ++ } ++ ++ if (par4 == 5) ++ { ++ var8 = (double)par1 + var6.getBlockBoundsMaxX() + (double)var7; ++ } ++ ++ this.addEffect((new EntityDiggingFX(this.worldObj, var8, var10, var12, 0.0D, 0.0D, 0.0D, var6, this.worldObj.getBlockMetadata(par1, par2, par3))).applyColourMultiplier(par1, par2, par3).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F)); ++ } ++ } ++ ++ public String getStatistics() ++ { ++ return "" + (this.fxLayers[0].size() + this.fxLayers[1].size() + this.fxLayers[2].size()); ++ } ++ } +*** Empty3.java Sat Feb 5 04:13:13 2022 +--- Empty3.java Sat Feb 5 04:12:33 2022 +*** EmptyChunk.java Sat Feb 5 04:13:13 2022 +--- EmptyChunk.java Sat Feb 5 04:12:33 2022 +*************** +*** 25,34 **** +--- 25,39 ---- + { + return 0; + } + + /** ++ * Generates the height map for a chunk from scratch ++ */ ++ public void generateHeightMap() {} ++ ++ /** + * Generates the initial skylight map for the chunk upon generation or load. + */ + public void generateSkylightMap() {} + + /** +*************** +*** 43,54 **** + { + return 255; + } + + /** +! * Sets a blockID of a position within a chunk with metadata. Args: x, y, z, blockID, metadata. Return true if the +! * id or meta was changed. + */ + public boolean setBlockIDWithMetadata(int par1, int par2, int par3, int par4, int par5) + { + return true; + } +--- 48,58 ---- + { + return 255; + } + + /** +! * Sets a blockID of a position within a chunk with metadata. Args: x, y, z, blockID, metadata + */ + public boolean setBlockIDWithMetadata(int par1, int par2, int par3, int par4, int par5) + { + return true; + } +*** Enchantment.java Sat Feb 5 04:13:13 2022 +--- Enchantment.java Sat Feb 5 04:12:33 2022 +*** EnchantmentArrowDamage.java Sat Feb 5 04:13:13 2022 +--- EnchantmentArrowDamage.java Sat Feb 5 04:12:33 2022 +*** EnchantmentArrowFire.java Sat Feb 5 04:13:13 2022 +--- EnchantmentArrowFire.java Sat Feb 5 04:12:33 2022 +*** EnchantmentArrowInfinite.java Sat Feb 5 04:13:13 2022 +--- EnchantmentArrowInfinite.java Sat Feb 5 04:12:33 2022 +*** EnchantmentArrowKnockback.java Sat Feb 5 04:13:13 2022 +--- EnchantmentArrowKnockback.java Sat Feb 5 04:12:33 2022 +*** EnchantmentDamage.java Sat Feb 5 04:13:13 2022 +--- EnchantmentDamage.java Sat Feb 5 04:12:33 2022 +*** EnchantmentData.java Sat Feb 5 04:13:13 2022 +--- EnchantmentData.java Sat Feb 5 04:12:33 2022 +*** EnchantmentDigging.java Sat Feb 5 04:13:13 2022 +--- EnchantmentDigging.java Sat Feb 5 04:12:33 2022 +*** EnchantmentDurability.java Sat Feb 5 04:13:13 2022 +--- EnchantmentDurability.java Sat Feb 5 04:12:33 2022 +*** EnchantmentFireAspect.java Sat Feb 5 04:13:13 2022 +--- EnchantmentFireAspect.java Sat Feb 5 04:12:33 2022 +*** EnchantmentHelper.java Sat Feb 5 04:13:13 2022 +--- EnchantmentHelper.java Sat Feb 5 04:12:33 2022 +*************** +*** 228,238 **** + /** + * Returns the 'Water Breathing' modifier of enchantments on player equipped armors. + */ + public static int getRespiration(EntityLivingBase par0EntityLivingBase) + { +! return getMaxEnchantmentLevel(Enchantment.respiration.effectId, par0EntityLivingBase.getInventory()); + } + + /** + * Return the extra efficiency of tools based on enchantments on equipped player item. + */ +--- 228,238 ---- + /** + * Returns the 'Water Breathing' modifier of enchantments on player equipped armors. + */ + public static int getRespiration(EntityLivingBase par0EntityLivingBase) + { +! return getMaxEnchantmentLevel(Enchantment.respiration.effectId, par0EntityLivingBase.getLastActiveItems()); + } + + /** + * Return the extra efficiency of tools based on enchantments on equipped player item. + */ +*************** +*** 268,288 **** + /** + * Returns the aqua affinity status of enchantments on current equipped item of player. + */ + public static boolean getAquaAffinityModifier(EntityLivingBase par0EntityLivingBase) + { +! return getMaxEnchantmentLevel(Enchantment.aquaAffinity.effectId, par0EntityLivingBase.getInventory()) > 0; + } + + public static int func_92098_i(EntityLivingBase par0EntityLivingBase) + { +! return getMaxEnchantmentLevel(Enchantment.thorns.effectId, par0EntityLivingBase.getInventory()); + } + + public static ItemStack func_92099_a(Enchantment par0Enchantment, EntityLivingBase par1EntityLivingBase) + { +! ItemStack[] var2 = par1EntityLivingBase.getInventory(); + int var3 = var2.length; + + for (int var4 = 0; var4 < var3; ++var4) + { + ItemStack var5 = var2[var4]; +--- 268,288 ---- + /** + * Returns the aqua affinity status of enchantments on current equipped item of player. + */ + public static boolean getAquaAffinityModifier(EntityLivingBase par0EntityLivingBase) + { +! return getMaxEnchantmentLevel(Enchantment.aquaAffinity.effectId, par0EntityLivingBase.getLastActiveItems()) > 0; + } + + public static int func_92098_i(EntityLivingBase par0EntityLivingBase) + { +! return getMaxEnchantmentLevel(Enchantment.thorns.effectId, par0EntityLivingBase.getLastActiveItems()); + } + + public static ItemStack func_92099_a(Enchantment par0Enchantment, EntityLivingBase par1EntityLivingBase) + { +! ItemStack[] var2 = par1EntityLivingBase.getLastActiveItems(); + int var3 = var2.length; + + for (int var4 = 0; var4 < var3; ++var4) + { + ItemStack var5 = var2[var4]; +*** EnchantmentKnockback.java Sat Feb 5 04:13:13 2022 +--- EnchantmentKnockback.java Sat Feb 5 04:12:33 2022 +*** EnchantmentLootBonus.java Sat Feb 5 04:13:13 2022 +--- EnchantmentLootBonus.java Sat Feb 5 04:12:33 2022 +*** EnchantmentModifierDamage.java Sat Feb 5 04:13:13 2022 +--- EnchantmentModifierDamage.java Sat Feb 5 04:12:33 2022 +*** EnchantmentModifierLiving.java Sat Feb 5 04:13:13 2022 +--- EnchantmentModifierLiving.java Sat Feb 5 04:12:33 2022 +*************** +*** 4,13 **** +--- 4,17 ---- + { + /** + * Used to calculate the (magic) extra damage based on enchantments of current equipped player item. + */ + public float livingModifier; ++ ++ /** ++ * Used as parameter to calculate the (magic) extra damage based on enchantments of current equipped player item. ++ */ + public EntityLivingBase entityLiving; + + private EnchantmentModifierLiving() {} + + /** +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EnchantmentNameParts.java Sat Feb 5 04:12:33 2022 +*************** +*** 0 **** +--- 1,44 ---- ++ package net.minecraft.src; ++ ++ import java.util.Random; ++ ++ public class EnchantmentNameParts ++ { ++ /** The static instance of this class. */ ++ public static final EnchantmentNameParts instance = new EnchantmentNameParts(); ++ ++ /** The RNG used to generate enchant names. */ ++ private Random rand = new Random(); ++ ++ /** List of words used to generate an enchant name. */ ++ private String[] wordList = "the elder scrolls klaatu berata niktu xyzzy bless curse light darkness fire air earth water hot dry cold wet ignite snuff embiggen twist shorten stretch fiddle destroy imbue galvanize enchant free limited range of towards inside sphere cube self other ball mental physical grow shrink demon elemental spirit animal creature beast humanoid undead fresh stale ".split(" "); ++ ++ /** ++ * Generates a random enchant name. ++ */ ++ public String generateRandomEnchantName() ++ { ++ int var1 = this.rand.nextInt(2) + 3; ++ String var2 = ""; ++ ++ for (int var3 = 0; var3 < var1; ++var3) ++ { ++ if (var3 > 0) ++ { ++ var2 = var2 + " "; ++ } ++ ++ var2 = var2 + this.wordList[this.rand.nextInt(this.wordList.length)]; ++ } ++ ++ return var2; ++ } ++ ++ /** ++ * Sets the seed for the enchant name RNG. ++ */ ++ public void setRandSeed(long par1) ++ { ++ this.rand.setSeed(par1); ++ } ++ } +*** EnchantmentOxygen.java Sat Feb 5 04:13:13 2022 +--- EnchantmentOxygen.java Sat Feb 5 04:12:33 2022 +*** EnchantmentProtection.java Sat Feb 5 04:13:13 2022 +--- EnchantmentProtection.java Sat Feb 5 04:12:33 2022 +*************** +*** 105,115 **** + /** + * Gets the amount of ticks an entity should be set fire, adjusted for fire protection. + */ + public static int getFireTimeForEntity(Entity par0Entity, int par1) + { +! int var2 = EnchantmentHelper.getMaxEnchantmentLevel(Enchantment.fireProtection.effectId, par0Entity.getInventory()); + + if (var2 > 0) + { + par1 -= MathHelper.floor_float((float)par1 * (float)var2 * 0.15F); + } +--- 105,115 ---- + /** + * Gets the amount of ticks an entity should be set fire, adjusted for fire protection. + */ + public static int getFireTimeForEntity(Entity par0Entity, int par1) + { +! int var2 = EnchantmentHelper.getMaxEnchantmentLevel(Enchantment.fireProtection.effectId, par0Entity.getLastActiveItems()); + + if (var2 > 0) + { + par1 -= MathHelper.floor_float((float)par1 * (float)var2 * 0.15F); + } +*************** +*** 117,127 **** + return par1; + } + + public static double func_92092_a(Entity par0Entity, double par1) + { +! int var3 = EnchantmentHelper.getMaxEnchantmentLevel(Enchantment.blastProtection.effectId, par0Entity.getInventory()); + + if (var3 > 0) + { + par1 -= (double)MathHelper.floor_double(par1 * (double)((float)var3 * 0.15F)); + } +--- 117,127 ---- + return par1; + } + + public static double func_92092_a(Entity par0Entity, double par1) + { +! int var3 = EnchantmentHelper.getMaxEnchantmentLevel(Enchantment.blastProtection.effectId, par0Entity.getLastActiveItems()); + + if (var3 > 0) + { + par1 -= (double)MathHelper.floor_double(par1 * (double)((float)var3 * 0.15F)); + } +*** EnchantmentThorns.java Sat Feb 5 04:13:13 2022 +--- EnchantmentThorns.java Sat Feb 5 04:12:33 2022 +*** EnchantmentUntouching.java Sat Feb 5 04:13:13 2022 +--- EnchantmentUntouching.java Sat Feb 5 04:12:33 2022 +*** EnchantmentWaterWorker.java Sat Feb 5 04:13:13 2022 +--- EnchantmentWaterWorker.java Sat Feb 5 04:12:33 2022 +*** Entity.java Sat Feb 5 04:13:13 2022 +--- Entity.java Sat Feb 5 04:12:33 2022 +*************** +*** 77,87 **** + public boolean velocityChanged; + protected boolean isInWeb; + public boolean field_70135_K; + + /** +! * gets set by setEntityDead, so this must be the flag whether an Entity is dead (inactive may be better term) + */ + public boolean isDead; + public float yOffset; + + /** How wide this entity is considered to be */ +--- 77,87 ---- + public boolean velocityChanged; + protected boolean isInWeb; + public boolean field_70135_K; + + /** +! * Gets set by setDead, so this must be the flag whether an Entity is dead (inactive may be better term) + */ + public boolean isDead; + public float yOffset; + + /** How wide this entity is considered to be */ +*************** +*** 163,172 **** +--- 163,175 ---- + /** Has this entity been added to the chunk its within */ + public boolean addedToChunk; + public int chunkCoordX; + public int chunkCoordY; + public int chunkCoordZ; ++ public int serverPosX; ++ public int serverPosY; ++ public int serverPosZ; + + /** + * Render entity even if it is outside the camera frustum. Only true in EntityFish for now. Used in RenderGlobal: + * render if ignoreFrustumCheck or in frustum. + */ +*************** +*** 229,238 **** +--- 232,266 ---- + { + return this.entityId; + } + + /** ++ * Keeps moving the entity up so it isn't colliding with blocks and other requirements for this entity to be spawned ++ * (only actually used on players though its also on Entity) ++ */ ++ protected void preparePlayerToSpawn() ++ { ++ if (this.worldObj != null) ++ { ++ while (this.posY > 0.0D) ++ { ++ this.setPosition(this.posX, this.posY, this.posZ); ++ ++ if (this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty()) ++ { ++ break; ++ } ++ ++ ++this.posY; ++ } ++ ++ this.motionX = this.motionY = this.motionZ = 0.0D; ++ this.rotationPitch = 0.0F; ++ } ++ } ++ ++ /** + * Will get destroyed next tick. + */ + public void setDead() + { + this.isDead = true; +*************** +*** 287,297 **** + this.myEntitySize = EnumEntitySize.SIZE_6; + } + } + + /** +! * Sets the rotation of the entity. Args: yaw, pitch (both in degrees) + */ + protected void setRotation(float par1, float par2) + { + this.rotationYaw = par1 % 360.0F; + this.rotationPitch = par2 % 360.0F; +--- 315,325 ---- + this.myEntitySize = EnumEntitySize.SIZE_6; + } + } + + /** +! * Sets the rotation of the entity + */ + protected void setRotation(float par1, float par2) + { + this.rotationYaw = par1 % 360.0F; + this.rotationPitch = par2 % 360.0F; +*************** +*** 309,318 **** +--- 337,371 ---- + float var8 = this.height; + this.boundingBox.setBounds(par1 - (double)var7, par3 - (double)this.yOffset + (double)this.ySize, par5 - (double)var7, par1 + (double)var7, par3 - (double)this.yOffset + (double)this.ySize + (double)var8, par5 + (double)var7); + } + + /** ++ * Adds par1*0.15 to the entity's yaw, and *subtracts* par2*0.15 from the pitch. Clamps pitch from -90 to 90. Both ++ * arguments in degrees. ++ */ ++ public void setAngles(float par1, float par2) ++ { ++ float var3 = this.rotationPitch; ++ float var4 = this.rotationYaw; ++ this.rotationYaw = (float)((double)this.rotationYaw + (double)par1 * 0.15D); ++ this.rotationPitch = (float)((double)this.rotationPitch - (double)par2 * 0.15D); ++ ++ if (this.rotationPitch < -90.0F) ++ { ++ this.rotationPitch = -90.0F; ++ } ++ ++ if (this.rotationPitch > 90.0F) ++ { ++ this.rotationPitch = 90.0F; ++ } ++ ++ this.prevRotationPitch += this.rotationPitch - var3; ++ this.prevRotationYaw += this.rotationYaw - var4; ++ } ++ ++ /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.onEntityUpdate(); +*************** +*** 1125,1134 **** +--- 1178,1204 ---- + this.motionX += (double)(par1 * var6 - par2 * var5); + this.motionZ += (double)(par2 * var6 + par1 * var5); + } + } + ++ public int getBrightnessForRender(float par1) ++ { ++ int var2 = MathHelper.floor_double(this.posX); ++ int var3 = MathHelper.floor_double(this.posZ); ++ ++ if (this.worldObj.blockExists(var2, 0, var3)) ++ { ++ double var4 = (this.boundingBox.maxY - this.boundingBox.minY) * 0.66D; ++ int var6 = MathHelper.floor_double(this.posY - (double)this.yOffset + var4); ++ return this.worldObj.getLightBrightnessForSkyBlocks(var2, var6, var3, 0); ++ } ++ else ++ { ++ return 0; ++ } ++ } ++ + /** + * Gets how bright this entity is. + */ + public float getBrightness(float par1) + { +*************** +*** 1335,1344 **** +--- 1405,1437 ---- + * entity, scoreToAdd + */ + public void addToPlayerScore(Entity par1Entity, int par2) {} + + /** ++ * Checks using a Vec3d to determine if this entity is within range of that vector to be rendered. Args: vec3D ++ */ ++ public boolean isInRangeToRenderVec3D(Vec3 par1Vec3) ++ { ++ double var2 = this.posX - par1Vec3.xCoord; ++ double var4 = this.posY - par1Vec3.yCoord; ++ double var6 = this.posZ - par1Vec3.zCoord; ++ double var8 = var2 * var2 + var4 * var4 + var6 * var6; ++ return this.isInRangeToRenderDist(var8); ++ } ++ ++ /** ++ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge ++ * length * 64 * renderDistanceWeight Args: distance ++ */ ++ public boolean isInRangeToRenderDist(double par1) ++ { ++ double var3 = this.boundingBox.getAverageEdgeLength(); ++ var3 *= 64.0D * this.renderDistanceWeight; ++ return par1 < var3 * var3; ++ } ++ ++ /** + * Like writeToNBTOptional but does not check if the entity is ridden. Used for saving ridden entities with their + * riders. + */ + public boolean writeMountToNBT(NBTTagCompound par1NBTTagCompound) + { +*************** +*** 1541,1550 **** +--- 1634,1648 ---- + } + + return var2; + } + ++ public float getShadowSize() ++ { ++ return this.height / 2.0F; ++ } ++ + /** + * Drops an item stack at the entity's position. Args: itemID, count + */ + public EntityItem dropItem(int par1, int par2) + { +*************** +*** 1748,1757 **** +--- 1846,1884 ---- + this.ridingEntity = par1Entity; + par1Entity.riddenByEntity = this; + } + } + ++ /** ++ * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, ++ * posY, posZ, yaw, pitch ++ */ ++ public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) ++ { ++ this.setPosition(par1, par3, par5); ++ this.setRotation(par7, par8); ++ List var10 = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.contract(0.03125D, 0.0D, 0.03125D)); ++ ++ if (!var10.isEmpty()) ++ { ++ double var11 = 0.0D; ++ ++ for (int var13 = 0; var13 < var10.size(); ++var13) ++ { ++ AxisAlignedBB var14 = (AxisAlignedBB)var10.get(var13); ++ ++ if (var14.maxY > var11) ++ { ++ var11 = var14.maxY; ++ } ++ } ++ ++ par3 += var11 - this.boundingBox.minY; ++ this.setPosition(par1, par3, par5); ++ } ++ } ++ + public float getCollisionBorderSize() + { + return 0.1F; + } + +*************** +*** 1793,1805 **** + { + return 900; + } + + /** +! * returns the inventory of this entity (only used in EntityPlayerMP it seems) + */ +! public ItemStack[] getInventory() + { + return null; + } + + /** +--- 1920,1946 ---- + { + return 900; + } + + /** +! * Sets the velocity to the args. Args: x, y, z + */ +! public void setVelocity(double par1, double par3, double par5) +! { +! this.motionX = par1; +! this.motionY = par3; +! this.motionZ = par5; +! } +! +! public void handleHealthUpdate(byte par1) {} +! +! /** +! * Setups the entity to do the hurt animation. Only used by packets in multiplayer. +! */ +! public void performHurtAnimation() {} +! +! public ItemStack[] getLastActiveItems() + { + return null; + } + + /** +*************** +*** 1859,1873 **** +--- 2000,2029 ---- + public boolean isInvisible() + { + return this.getFlag(5); + } + ++ /** ++ * Only used by renderer in EntityLivingBase subclasses.\nDetermines if an entity is visible or not to a specfic ++ * player, if the entity is normally invisible.\nFor EntityLivingBase subclasses, returning false when invisible ++ * will render the entity semitransparent. ++ */ ++ public boolean isInvisibleToPlayer(EntityPlayer par1EntityPlayer) ++ { ++ return this.isInvisible(); ++ } ++ + public void setInvisible(boolean par1) + { + this.setFlag(5, par1); + } + ++ public boolean isEating() ++ { ++ return this.getFlag(4); ++ } ++ + public void setEating(boolean par1) + { + this.setFlag(4, par1); + } + +*************** +*** 2064,2073 **** +--- 2220,2234 ---- + { + return 0.0F; + } + + /** ++ * Sets the head's yaw rotation of the entity. ++ */ ++ public void setRotationYawHead(float par1) {} ++ ++ /** + * If returns false, the item will not inflict any damage against entities. + */ + public boolean canAttackWithItem() + { + return true; +*************** +*** 2206,2215 **** +--- 2367,2384 ---- + par1CrashReportCategory.addCrashSection("Entity ID", Integer.valueOf(this.entityId)); + par1CrashReportCategory.addCrashSectionCallable("Entity Name", new CallableEntityName(this)); + par1CrashReportCategory.addCrashSection("Entity\'s Exact location", String.format("%.2f, %.2f, %.2f", new Object[] {Double.valueOf(this.posX), Double.valueOf(this.posY), Double.valueOf(this.posZ)})); + par1CrashReportCategory.addCrashSection("Entity\'s Block location", CrashReportCategory.getLocationInfo(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))); + par1CrashReportCategory.addCrashSection("Entity\'s Momentum", String.format("%.2f, %.2f, %.2f", new Object[] {Double.valueOf(this.motionX), Double.valueOf(this.motionY), Double.valueOf(this.motionZ)})); ++ } ++ ++ /** ++ * Return whether this entity should be rendered as on fire. ++ */ ++ public boolean canRenderOnFire() ++ { ++ return this.isBurning(); + } + + public UUID getUniqueID() + { + return this.entityUniqueID; +*** EntityAgeable.java Sat Feb 5 04:13:13 2022 +--- EntityAgeable.java Sat Feb 5 04:12:33 2022 +*** EntityAIArrowAttack.java Sat Feb 5 04:13:13 2022 +--- EntityAIArrowAttack.java Sat Feb 5 04:12:33 2022 +*** EntityAIAttackOnCollide.java Sat Feb 5 04:13:13 2022 +--- EntityAIAttackOnCollide.java Sat Feb 5 04:12:33 2022 +*************** +*** 7,19 **** + + /** + * An amount of decrementing ticks that allows the entity to attack once the tick reaches 0. + */ + int attackTick; +! +! /** The speed with which the mob will approach the target */ +! double speedTowardsTarget; + + /** + * When true, the mob will continue chasing its target, even if it can't find a path to them right now. + */ + boolean longMemory; +--- 7,17 ---- + + /** + * An amount of decrementing ticks that allows the entity to attack once the tick reaches 0. + */ + int attackTick; +! double field_75440_e; + + /** + * When true, the mob will continue chasing its target, even if it can't find a path to them right now. + */ + boolean longMemory; +*************** +*** 31,41 **** + + public EntityAIAttackOnCollide(EntityCreature par1EntityCreature, double par2, boolean par4) + { + this.attacker = par1EntityCreature; + this.worldObj = par1EntityCreature.worldObj; +! this.speedTowardsTarget = par2; + this.longMemory = par4; + this.setMutexBits(3); + } + + /** +--- 29,39 ---- + + public EntityAIAttackOnCollide(EntityCreature par1EntityCreature, double par2, boolean par4) + { + this.attacker = par1EntityCreature; + this.worldObj = par1EntityCreature.worldObj; +! this.field_75440_e = par2; + this.longMemory = par4; + this.setMutexBits(3); + } + + /** +*************** +*** 76,86 **** + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { +! this.attacker.getNavigator().setPath(this.entityPathEntity, this.speedTowardsTarget); + this.field_75445_i = 0; + } + + /** + * Resets the task +--- 74,84 ---- + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { +! this.attacker.getNavigator().setPath(this.entityPathEntity, this.field_75440_e); + this.field_75445_i = 0; + } + + /** + * Resets the task +*************** +*** 99,109 **** + this.attacker.getLookHelper().setLookPositionWithEntity(var1, 30.0F, 30.0F); + + if ((this.longMemory || this.attacker.getEntitySenses().canSee(var1)) && --this.field_75445_i <= 0) + { + this.field_75445_i = 4 + this.attacker.getRNG().nextInt(7); +! this.attacker.getNavigator().tryMoveToEntityLiving(var1, this.speedTowardsTarget); + } + + this.attackTick = Math.max(this.attackTick - 1, 0); + double var2 = (double)(this.attacker.width * 2.0F * this.attacker.width * 2.0F + var1.width); + +--- 97,107 ---- + this.attacker.getLookHelper().setLookPositionWithEntity(var1, 30.0F, 30.0F); + + if ((this.longMemory || this.attacker.getEntitySenses().canSee(var1)) && --this.field_75445_i <= 0) + { + this.field_75445_i = 4 + this.attacker.getRNG().nextInt(7); +! this.attacker.getNavigator().tryMoveToEntityLiving(var1, this.field_75440_e); + } + + this.attackTick = Math.max(this.attackTick - 1, 0); + double var2 = (double)(this.attacker.width * 2.0F * this.attacker.width * 2.0F + var1.width); + +*** EntityAIAvoidEntity.java Sat Feb 5 04:13:13 2022 +--- EntityAIAvoidEntity.java Sat Feb 5 04:12:33 2022 +*** EntityAIAvoidEntitySelector.java Sat Feb 5 04:13:13 2022 +--- EntityAIAvoidEntitySelector.java Sat Feb 5 04:12:34 2022 +*** EntityAIBase.java Sat Feb 5 04:13:13 2022 +--- EntityAIBase.java Sat Feb 5 04:12:34 2022 +*************** +*** 20,32 **** + { + return this.shouldExecute(); + } + + /** +! * Returns whether the task requires multiple updates or not + */ +! public boolean isContinuous() + { + return true; + } + + /** +--- 20,32 ---- + { + return this.shouldExecute(); + } + + /** +! * Determine if this AI Task is interruptible by a higher (= lower value) priority task. + */ +! public boolean isInterruptible() + { + return true; + } + + /** +*** EntityAIBeg.java Sat Feb 5 04:13:13 2022 +--- EntityAIBeg.java Sat Feb 5 04:12:34 2022 +*** EntityAIBreakDoor.java Sat Feb 5 04:13:13 2022 +--- EntityAIBreakDoor.java Sat Feb 5 04:12:34 2022 +*** EntityAIControlledByPlayer.java Sat Feb 5 04:13:13 2022 +--- EntityAIControlledByPlayer.java Sat Feb 5 04:12:34 2022 +*** EntityAICreeperSwell.java Sat Feb 5 04:13:13 2022 +--- EntityAICreeperSwell.java Sat Feb 5 04:12:34 2022 +*** EntityAIDefendVillage.java Sat Feb 5 04:13:13 2022 +--- EntityAIDefendVillage.java Sat Feb 5 04:12:34 2022 +*** EntityAIDoorInteract.java Sat Feb 5 04:13:13 2022 +--- EntityAIDoorInteract.java Sat Feb 5 04:12:34 2022 +*** EntityAIEatGrass.java Sat Feb 5 04:13:13 2022 +--- EntityAIEatGrass.java Sat Feb 5 04:12:34 2022 +*** EntityAIFleeSun.java Sat Feb 5 04:13:13 2022 +--- EntityAIFleeSun.java Sat Feb 5 04:12:34 2022 +*** EntityAIFollowGolem.java Sat Feb 5 04:13:13 2022 +--- EntityAIFollowGolem.java Sat Feb 5 04:12:34 2022 +*** EntityAIFollowOwner.java Sat Feb 5 04:13:13 2022 +--- EntityAIFollowOwner.java Sat Feb 5 04:12:34 2022 +*** EntityAIFollowParent.java Sat Feb 5 04:13:13 2022 +--- EntityAIFollowParent.java Sat Feb 5 04:12:34 2022 +*** EntityAIHurtByTarget.java Sat Feb 5 04:13:13 2022 +--- EntityAIHurtByTarget.java Sat Feb 5 04:12:34 2022 +*** EntityAILeapAtTarget.java Sat Feb 5 04:13:13 2022 +--- EntityAILeapAtTarget.java Sat Feb 5 04:12:34 2022 +*** EntityAILookAtTradePlayer.java Sat Feb 5 04:13:13 2022 +--- EntityAILookAtTradePlayer.java Sat Feb 5 04:12:34 2022 +*** EntityAILookAtVillager.java Sat Feb 5 04:13:13 2022 +--- EntityAILookAtVillager.java Sat Feb 5 04:12:34 2022 +*** EntityAILookIdle.java Sat Feb 5 04:13:13 2022 +--- EntityAILookIdle.java Sat Feb 5 04:12:34 2022 +*** EntityAIMate.java Sat Feb 5 04:13:13 2022 +--- EntityAIMate.java Sat Feb 5 04:12:34 2022 +*** EntityAIMoveIndoors.java Sat Feb 5 04:13:13 2022 +--- EntityAIMoveIndoors.java Sat Feb 5 04:12:34 2022 +*** EntityAIMoveThroughVillage.java Sat Feb 5 04:13:13 2022 +--- EntityAIMoveThroughVillage.java Sat Feb 5 04:12:34 2022 +*** EntityAIMoveTowardsRestriction.java Sat Feb 5 04:13:13 2022 +--- EntityAIMoveTowardsRestriction.java Sat Feb 5 04:12:34 2022 +*** EntityAIMoveTowardsTarget.java Sat Feb 5 04:13:13 2022 +--- EntityAIMoveTowardsTarget.java Sat Feb 5 04:12:34 2022 +*** EntityAINearestAttackableTarget.java Sat Feb 5 04:13:13 2022 +--- EntityAINearestAttackableTarget.java Sat Feb 5 04:12:34 2022 +*** EntityAINearestAttackableTargetSelector.java Sat Feb 5 04:13:13 2022 +--- EntityAINearestAttackableTargetSelector.java Sat Feb 5 04:12:34 2022 +*** EntityAINearestAttackableTargetSorter.java Sat Feb 5 04:13:13 2022 +--- EntityAINearestAttackableTargetSorter.java Sat Feb 5 04:12:34 2022 +*** EntityAIOcelotAttack.java Sat Feb 5 04:13:13 2022 +--- EntityAIOcelotAttack.java Sat Feb 5 04:12:34 2022 +*** EntityAIOcelotSit.java Sat Feb 5 04:13:13 2022 +--- EntityAIOcelotSit.java Sat Feb 5 04:12:34 2022 +*** EntityAIOpenDoor.java Sat Feb 5 04:13:13 2022 +--- EntityAIOpenDoor.java Sat Feb 5 04:12:34 2022 +*** EntityAIOwnerHurtByTarget.java Sat Feb 5 04:13:13 2022 +--- EntityAIOwnerHurtByTarget.java Sat Feb 5 04:12:34 2022 +*** EntityAIOwnerHurtTarget.java Sat Feb 5 04:13:13 2022 +--- EntityAIOwnerHurtTarget.java Sat Feb 5 04:12:34 2022 +*** EntityAIPanic.java Sat Feb 5 04:13:13 2022 +--- EntityAIPanic.java Sat Feb 5 04:12:34 2022 +*** EntityAIPlay.java Sat Feb 5 04:13:13 2022 +--- EntityAIPlay.java Sat Feb 5 04:12:34 2022 +*** EntityAIRestrictOpenDoor.java Sat Feb 5 04:13:13 2022 +--- EntityAIRestrictOpenDoor.java Sat Feb 5 04:12:34 2022 +*** EntityAIRestrictSun.java Sat Feb 5 04:13:13 2022 +--- EntityAIRestrictSun.java Sat Feb 5 04:12:34 2022 +*** EntityAIRunAroundLikeCrazy.java Sat Feb 5 04:13:13 2022 +--- EntityAIRunAroundLikeCrazy.java Sat Feb 5 04:12:34 2022 +*** EntityAISit.java Sat Feb 5 04:13:13 2022 +--- EntityAISit.java Sat Feb 5 04:12:34 2022 +*** EntityAISwimming.java Sat Feb 5 04:13:13 2022 +--- EntityAISwimming.java Sat Feb 5 04:12:34 2022 +*** EntityAITarget.java Sat Feb 5 04:13:13 2022 +--- EntityAITarget.java Sat Feb 5 04:12:34 2022 +*** EntityAITargetNonTamed.java Sat Feb 5 04:13:13 2022 +--- EntityAITargetNonTamed.java Sat Feb 5 04:12:34 2022 +*** EntityAITaskEntry.java Sat Feb 5 04:13:13 2022 +--- EntityAITaskEntry.java Sat Feb 5 04:12:34 2022 +*** EntityAITasks.java Sat Feb 5 04:13:13 2022 +--- EntityAITasks.java Sat Feb 5 04:12:34 2022 +*************** +*** 157,167 **** + { + this.theProfiler.endSection(); + return false; + } + } +! else if (this.executingTaskEntries.contains(var3) && !var3.action.isContinuous()) + { + this.theProfiler.endSection(); + return false; + } + } +--- 157,167 ---- + { + this.theProfiler.endSection(); + return false; + } + } +! else if (this.executingTaskEntries.contains(var3) && !var3.action.isInterruptible()) + { + this.theProfiler.endSection(); + return false; + } + } +*** EntityAITempt.java Sat Feb 5 04:13:13 2022 +--- EntityAITempt.java Sat Feb 5 04:12:34 2022 +*** EntityAITradePlayer.java Sat Feb 5 04:13:13 2022 +--- EntityAITradePlayer.java Sat Feb 5 04:12:34 2022 +*** EntityAIVillagerMate.java Sat Feb 5 04:13:13 2022 +--- EntityAIVillagerMate.java Sat Feb 5 04:12:34 2022 +*** EntityAIWander.java Sat Feb 5 04:13:13 2022 +--- EntityAIWander.java Sat Feb 5 04:12:34 2022 +*** EntityAIWatchClosest.java Sat Feb 5 04:13:13 2022 +--- EntityAIWatchClosest.java Sat Feb 5 04:12:34 2022 +*** EntityAIWatchClosest2.java Sat Feb 5 04:13:13 2022 +--- EntityAIWatchClosest2.java Sat Feb 5 04:12:34 2022 +*** EntityAmbientCreature.java Sat Feb 5 04:13:13 2022 +--- EntityAmbientCreature.java Sat Feb 5 04:12:34 2022 +*** EntityAnimal.java Sat Feb 5 04:13:13 2022 +--- EntityAnimal.java Sat Feb 5 04:12:34 2022 +*************** +*** 381,386 **** +--- 381,404 ---- + */ + public boolean canMateWith(EntityAnimal par1EntityAnimal) + { + return par1EntityAnimal == this ? false : (par1EntityAnimal.getClass() != this.getClass() ? false : this.isInLove() && par1EntityAnimal.isInLove()); + } ++ ++ public void handleHealthUpdate(byte par1) ++ { ++ if (par1 == 18) ++ { ++ for (int var2 = 0; var2 < 7; ++var2) ++ { ++ double var3 = this.rand.nextGaussian() * 0.02D; ++ double var5 = this.rand.nextGaussian() * 0.02D; ++ double var7 = this.rand.nextGaussian() * 0.02D; ++ this.worldObj.spawnParticle("heart", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var3, var5, var7); ++ } ++ } ++ else ++ { ++ super.handleHealthUpdate(par1); ++ } ++ } + } +*** EntityArrow.java Sat Feb 5 04:13:13 2022 +--- EntityArrow.java Sat Feb 5 04:12:34 2022 +*************** +*** 124,133 **** +--- 124,164 ---- + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var10) * 180.0D / Math.PI); + this.ticksInGround = 0; + } + + /** ++ * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, ++ * posY, posZ, yaw, pitch ++ */ ++ public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) ++ { ++ this.setPosition(par1, par3, par5); ++ this.setRotation(par7, par8); ++ } ++ ++ /** ++ * Sets the velocity to the args. Args: x, y, z ++ */ ++ public void setVelocity(double par1, double par3, double par5) ++ { ++ this.motionX = par1; ++ this.motionY = par3; ++ this.motionZ = par5; ++ ++ if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) ++ { ++ float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); ++ this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI); ++ this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var7) * 180.0D / Math.PI); ++ this.prevRotationPitch = this.rotationPitch; ++ this.prevRotationYaw = this.rotationYaw; ++ this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); ++ this.ticksInGround = 0; ++ } ++ } ++ ++ /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); +*************** +*** 184,194 **** + else + { + ++this.ticksInAir; + Vec3 var17 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + Vec3 var3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); +! MovingObjectPosition var4 = this.worldObj.rayTraceBlocks(var17, var3, false, true); + var17 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + var3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (var4 != null) + { +--- 215,225 ---- + else + { + ++this.ticksInAir; + Vec3 var17 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + Vec3 var3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); +! MovingObjectPosition var4 = this.worldObj.rayTraceBlocks_do_do(var17, var3, false, true); + var17 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + var3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (var4 != null) + { +*************** +*** 296,306 **** + EnchantmentThorns.func_92096_a(this.shootingEntity, var25, this.rand); + } + + if (this.shootingEntity != null && var4.entityHit != this.shootingEntity && var4.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP) + { +! ((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacket(new Packet70GameEvent(6, 0)); + } + } + + this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); + +--- 327,337 ---- + EnchantmentThorns.func_92096_a(this.shootingEntity, var25, this.rand); + } + + if (this.shootingEntity != null && var4.entityHit != this.shootingEntity && var4.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP) + { +! ((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(6, 0)); + } + } + + this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); + +*************** +*** 476,485 **** +--- 507,521 ---- + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() + { + return false; ++ } ++ ++ public float getShadowSize() ++ { ++ return 0.0F; + } + + public void setDamage(double par1) + { + this.damage = par1; +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityAuraFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,40 ---- ++ package net.minecraft.src; ++ ++ public class EntityAuraFX extends EntityFX ++ { ++ public EntityAuraFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) ++ { ++ super(par1World, par2, par4, par6, par8, par10, par12); ++ float var14 = this.rand.nextFloat() * 0.1F + 0.2F; ++ this.particleRed = var14; ++ this.particleGreen = var14; ++ this.particleBlue = var14; ++ this.setParticleTextureIndex(0); ++ this.setSize(0.02F, 0.02F); ++ this.particleScale *= this.rand.nextFloat() * 0.6F + 0.5F; ++ this.motionX *= 0.019999999552965164D; ++ this.motionY *= 0.019999999552965164D; ++ this.motionZ *= 0.019999999552965164D; ++ this.particleMaxAge = (int)(20.0D / (Math.random() * 0.8D + 0.2D)); ++ this.noClip = true; ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ this.prevPosX = this.posX; ++ this.prevPosY = this.posY; ++ this.prevPosZ = this.posZ; ++ this.moveEntity(this.motionX, this.motionY, this.motionZ); ++ this.motionX *= 0.99D; ++ this.motionY *= 0.99D; ++ this.motionZ *= 0.99D; ++ ++ if (this.particleMaxAge-- <= 0) ++ { ++ this.setDead(); ++ } ++ } ++ } +*** EntityBat.java Sat Feb 5 04:13:13 2022 +--- EntityBat.java Sat Feb 5 04:12:34 2022 +*************** +*** 2,13 **** + + import java.util.Calendar; + + public class EntityBat extends EntityAmbientCreature + { +! /** Coordinates of where the bat spawned. */ +! private ChunkCoordinates spawnPosition; + + public EntityBat(World par1World) + { + super(par1World); + this.setSize(0.5F, 0.9F); +--- 2,16 ---- + + import java.util.Calendar; + + public class EntityBat extends EntityAmbientCreature + { +! /** +! * randomly selected ChunkCoordinates in a 7x6x7 box around the bat (y offset -2 to 4) towards which it will fly. +! * upon getting close a new target will be selected +! */ +! private ChunkCoordinates currentFlightTarget; + + public EntityBat(World par1World) + { + super(par1World); + this.setSize(0.5F, 0.9F); +*************** +*** 148,170 **** + } + } + } + else + { +! if (this.spawnPosition != null && (!this.worldObj.isAirBlock(this.spawnPosition.posX, this.spawnPosition.posY, this.spawnPosition.posZ) || this.spawnPosition.posY < 1)) + { +! this.spawnPosition = null; + } + +! if (this.spawnPosition == null || this.rand.nextInt(30) == 0 || this.spawnPosition.getDistanceSquared((int)this.posX, (int)this.posY, (int)this.posZ) < 4.0F) + { +! this.spawnPosition = new ChunkCoordinates((int)this.posX + this.rand.nextInt(7) - this.rand.nextInt(7), (int)this.posY + this.rand.nextInt(6) - 2, (int)this.posZ + this.rand.nextInt(7) - this.rand.nextInt(7)); + } + +! double var1 = (double)this.spawnPosition.posX + 0.5D - this.posX; +! double var3 = (double)this.spawnPosition.posY + 0.1D - this.posY; +! double var5 = (double)this.spawnPosition.posZ + 0.5D - this.posZ; + this.motionX += (Math.signum(var1) * 0.5D - this.motionX) * 0.10000000149011612D; + this.motionY += (Math.signum(var3) * 0.699999988079071D - this.motionY) * 0.10000000149011612D; + this.motionZ += (Math.signum(var5) * 0.5D - this.motionZ) * 0.10000000149011612D; + float var7 = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) - 90.0F; + float var8 = MathHelper.wrapAngleTo180_float(var7 - this.rotationYaw); +--- 151,173 ---- + } + } + } + else + { +! if (this.currentFlightTarget != null && (!this.worldObj.isAirBlock(this.currentFlightTarget.posX, this.currentFlightTarget.posY, this.currentFlightTarget.posZ) || this.currentFlightTarget.posY < 1)) + { +! this.currentFlightTarget = null; + } + +! if (this.currentFlightTarget == null || this.rand.nextInt(30) == 0 || this.currentFlightTarget.getDistanceSquared((int)this.posX, (int)this.posY, (int)this.posZ) < 4.0F) + { +! this.currentFlightTarget = new ChunkCoordinates((int)this.posX + this.rand.nextInt(7) - this.rand.nextInt(7), (int)this.posY + this.rand.nextInt(6) - 2, (int)this.posZ + this.rand.nextInt(7) - this.rand.nextInt(7)); + } + +! double var1 = (double)this.currentFlightTarget.posX + 0.5D - this.posX; +! double var3 = (double)this.currentFlightTarget.posY + 0.1D - this.posY; +! double var5 = (double)this.currentFlightTarget.posZ + 0.5D - this.posZ; + this.motionX += (Math.signum(var1) * 0.5D - this.motionX) * 0.10000000149011612D; + this.motionY += (Math.signum(var3) * 0.699999988079071D - this.motionY) * 0.10000000149011612D; + this.motionZ += (Math.signum(var5) * 0.5D - this.motionZ) * 0.10000000149011612D; + float var7 = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) - 90.0F; + float var8 = MathHelper.wrapAngleTo180_float(var7 - this.rotationYaw); +*** EntityBlaze.java Sat Feb 5 04:13:13 2022 +--- EntityBlaze.java Sat Feb 5 04:12:34 2022 +*************** +*** 50,59 **** +--- 50,64 ---- + protected String getDeathSound() + { + return "mob.blaze.death"; + } + ++ public int getBrightnessForRender(float par1) ++ { ++ return 15728880; ++ } ++ + /** + * Gets how bright this entity is. + */ + public float getBrightness(float par1) + { +*************** +*** 180,190 **** + { + return this.func_70845_n(); + } + + /** +! * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean par1, int par2) + { + if (par1) + { +--- 185,196 ---- + { + return this.func_70845_n(); + } + + /** +! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param +! * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean par1, int par2) + { + if (par1) + { +*** EntityBoat.java Sat Feb 5 04:13:13 2022 +--- EntityBoat.java Sat Feb 5 04:12:34 2022 +*************** +*** 10,19 **** +--- 10,22 ---- + private double boatX; + private double boatY; + private double boatZ; + private double boatYaw; + private double boatPitch; ++ private double velocityX; ++ private double velocityY; ++ private double velocityZ; + + public EntityBoat(World par1World) + { + super(par1World); + this.field_70279_a = true; +*************** +*** 123,140 **** +--- 126,198 ---- + return true; + } + } + + /** ++ * Setups the entity to do the hurt animation. Only used by packets in multiplayer. ++ */ ++ public void performHurtAnimation() ++ { ++ this.setForwardDirection(-this.getForwardDirection()); ++ this.setTimeSinceHit(10); ++ this.setDamageTaken(this.getDamageTaken() * 11.0F); ++ } ++ ++ /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() + { + return !this.isDead; + } + + /** ++ * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, ++ * posY, posZ, yaw, pitch ++ */ ++ public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) ++ { ++ if (this.field_70279_a) ++ { ++ this.boatPosRotationIncrements = par9 + 5; ++ } ++ else ++ { ++ double var10 = par1 - this.posX; ++ double var12 = par3 - this.posY; ++ double var14 = par5 - this.posZ; ++ double var16 = var10 * var10 + var12 * var12 + var14 * var14; ++ ++ if (var16 <= 1.0D) ++ { ++ return; ++ } ++ ++ this.boatPosRotationIncrements = 3; ++ } ++ ++ this.boatX = par1; ++ this.boatY = par3; ++ this.boatZ = par5; ++ this.boatYaw = (double)par7; ++ this.boatPitch = (double)par8; ++ this.motionX = this.velocityX; ++ this.motionY = this.velocityY; ++ this.motionZ = this.velocityZ; ++ } ++ ++ /** ++ * Sets the velocity to the args. Args: x, y, z ++ */ ++ public void setVelocity(double par1, double par3, double par5) ++ { ++ this.velocityX = this.motionX = par1; ++ this.velocityY = this.motionY = par3; ++ this.velocityZ = this.motionZ = par5; ++ } ++ ++ /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); +*************** +*** 417,426 **** +--- 475,489 ---- + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {} + ++ public float getShadowSize() ++ { ++ return 0.0F; ++ } ++ + /** + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer par1EntityPlayer) + { +*************** +*** 483,489 **** +--- 546,557 ---- + * Gets the forward direction of the entity. + */ + public int getForwardDirection() + { + return this.dataWatcher.getWatchableObjectInt(18); ++ } ++ ++ public void func_70270_d(boolean par1) ++ { ++ this.field_70279_a = par1; + } + } +*** EntityBodyHelper.java Sat Feb 5 04:13:13 2022 +--- EntityBodyHelper.java Sat Feb 5 04:12:34 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityBreakingFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,61 ---- ++ package net.minecraft.src; ++ ++ public class EntityBreakingFX extends EntityFX ++ { ++ public EntityBreakingFX(World par1World, double par2, double par4, double par6, Item par8Item) ++ { ++ this(par1World, par2, par4, par6, par8Item, 0); ++ } ++ ++ public EntityBreakingFX(World par1World, double par2, double par4, double par6, Item par8Item, int par9) ++ { ++ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); ++ this.setParticleIcon(par8Item.getIconFromDamage(par9)); ++ this.particleRed = this.particleGreen = this.particleBlue = 1.0F; ++ this.particleGravity = Block.blockSnow.blockParticleGravity; ++ this.particleScale /= 2.0F; ++ } ++ ++ public EntityBreakingFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, Item par14Item, int par15) ++ { ++ this(par1World, par2, par4, par6, par14Item, par15); ++ this.motionX *= 0.10000000149011612D; ++ this.motionY *= 0.10000000149011612D; ++ this.motionZ *= 0.10000000149011612D; ++ this.motionX += par8; ++ this.motionY += par10; ++ this.motionZ += par12; ++ } ++ ++ public int getFXLayer() ++ { ++ return 2; ++ } ++ ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ float var8 = ((float)this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F; ++ float var9 = var8 + 0.015609375F; ++ float var10 = ((float)this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F; ++ float var11 = var10 + 0.015609375F; ++ float var12 = 0.1F * this.particleScale; ++ ++ if (this.particleIcon != null) ++ { ++ var8 = this.particleIcon.getInterpolatedU((double)(this.particleTextureJitterX / 4.0F * 16.0F)); ++ var9 = this.particleIcon.getInterpolatedU((double)((this.particleTextureJitterX + 1.0F) / 4.0F * 16.0F)); ++ var10 = this.particleIcon.getInterpolatedV((double)(this.particleTextureJitterY / 4.0F * 16.0F)); ++ var11 = this.particleIcon.getInterpolatedV((double)((this.particleTextureJitterY + 1.0F) / 4.0F * 16.0F)); ++ } ++ ++ float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX); ++ float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY); ++ float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ); ++ float var16 = 1.0F; ++ par1Tessellator.setColorOpaque_F(var16 * this.particleRed, var16 * this.particleGreen, var16 * this.particleBlue); ++ par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 - par5 * var12 - par7 * var12), (double)var8, (double)var11); ++ par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 - par5 * var12 + par7 * var12), (double)var8, (double)var10); ++ par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 + par5 * var12 + par7 * var12), (double)var9, (double)var10); ++ par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 + par5 * var12 - par7 * var12), (double)var9, (double)var11); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityBubbleFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,44 ---- ++ package net.minecraft.src; ++ ++ public class EntityBubbleFX extends EntityFX ++ { ++ public EntityBubbleFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) ++ { ++ super(par1World, par2, par4, par6, par8, par10, par12); ++ this.particleRed = 1.0F; ++ this.particleGreen = 1.0F; ++ this.particleBlue = 1.0F; ++ this.setParticleTextureIndex(32); ++ this.setSize(0.02F, 0.02F); ++ this.particleScale *= this.rand.nextFloat() * 0.6F + 0.2F; ++ this.motionX = par8 * 0.20000000298023224D + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.02F); ++ this.motionY = par10 * 0.20000000298023224D + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.02F); ++ this.motionZ = par12 * 0.20000000298023224D + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.02F); ++ this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ this.prevPosX = this.posX; ++ this.prevPosY = this.posY; ++ this.prevPosZ = this.posZ; ++ this.motionY += 0.002D; ++ this.moveEntity(this.motionX, this.motionY, this.motionZ); ++ this.motionX *= 0.8500000238418579D; ++ this.motionY *= 0.8500000238418579D; ++ this.motionZ *= 0.8500000238418579D; ++ ++ if (this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) != Material.water) ++ { ++ this.setDead(); ++ } ++ ++ if (this.particleMaxAge-- <= 0) ++ { ++ this.setDead(); ++ } ++ } ++ } +*** EntityCaveSpider.java Sat Feb 5 04:13:13 2022 +--- EntityCaveSpider.java Sat Feb 5 04:12:34 2022 +*** EntityChicken.java Sat Feb 5 04:13:13 2022 +--- EntityChicken.java Sat Feb 5 04:12:34 2022 +*************** +*** 128,138 **** + { + return Item.feather.itemID; + } + + /** +! * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.rand.nextInt(3) + this.rand.nextInt(1 + par2); + +--- 128,139 ---- + { + return Item.feather.itemID; + } + + /** +! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param +! * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.rand.nextInt(3) + this.rand.nextInt(1 + par2); + +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityClientPlayerMP.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,288 ---- ++ package net.minecraft.src; ++ ++ public class EntityClientPlayerMP extends EntityPlayerSP ++ { ++ public NetClientHandler sendQueue; ++ private double oldPosX; ++ ++ /** Old Minimum Y of the bounding box */ ++ private double oldMinY; ++ private double oldPosY; ++ private double oldPosZ; ++ private float oldRotationYaw; ++ private float oldRotationPitch; ++ ++ /** Check if was on ground last update */ ++ private boolean wasOnGround; ++ ++ /** should the player stop sneaking? */ ++ private boolean shouldStopSneaking; ++ private boolean wasSneaking; ++ private int field_71168_co; ++ ++ /** has the client player's health been set? */ ++ private boolean hasSetHealth; ++ private String field_142022_ce; ++ ++ public EntityClientPlayerMP(Minecraft par1Minecraft, World par2World, Session par3Session, NetClientHandler par4NetClientHandler) ++ { ++ super(par1Minecraft, par2World, par3Session, 0); ++ this.sendQueue = par4NetClientHandler; ++ } ++ ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) ++ { ++ return false; ++ } ++ ++ /** ++ * Heal living entity (param: amount of half-hearts) ++ */ ++ public void heal(float par1) {} ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ if (this.worldObj.blockExists(MathHelper.floor_double(this.posX), 0, MathHelper.floor_double(this.posZ))) ++ { ++ super.onUpdate(); ++ ++ if (this.isRiding()) ++ { ++ this.sendQueue.addToSendQueue(new Packet12PlayerLook(this.rotationYaw, this.rotationPitch, this.onGround)); ++ this.sendQueue.addToSendQueue(new Packet27PlayerInput(this.moveStrafing, this.moveForward, this.movementInput.jump, this.movementInput.sneak)); ++ } ++ else ++ { ++ this.sendMotionUpdates(); ++ } ++ } ++ } ++ ++ /** ++ * Send updated motion and position information to the server ++ */ ++ public void sendMotionUpdates() ++ { ++ boolean var1 = this.isSprinting(); ++ ++ if (var1 != this.wasSneaking) ++ { ++ if (var1) ++ { ++ this.sendQueue.addToSendQueue(new Packet19EntityAction(this, 4)); ++ } ++ else ++ { ++ this.sendQueue.addToSendQueue(new Packet19EntityAction(this, 5)); ++ } ++ ++ this.wasSneaking = var1; ++ } ++ ++ boolean var2 = this.isSneaking(); ++ ++ if (var2 != this.shouldStopSneaking) ++ { ++ if (var2) ++ { ++ this.sendQueue.addToSendQueue(new Packet19EntityAction(this, 1)); ++ } ++ else ++ { ++ this.sendQueue.addToSendQueue(new Packet19EntityAction(this, 2)); ++ } ++ ++ this.shouldStopSneaking = var2; ++ } ++ ++ double var3 = this.posX - this.oldPosX; ++ double var5 = this.boundingBox.minY - this.oldMinY; ++ double var7 = this.posZ - this.oldPosZ; ++ double var9 = (double)(this.rotationYaw - this.oldRotationYaw); ++ double var11 = (double)(this.rotationPitch - this.oldRotationPitch); ++ boolean var13 = var3 * var3 + var5 * var5 + var7 * var7 > 9.0E-4D || this.field_71168_co >= 20; ++ boolean var14 = var9 != 0.0D || var11 != 0.0D; ++ ++ if (this.ridingEntity != null) ++ { ++ this.sendQueue.addToSendQueue(new Packet13PlayerLookMove(this.motionX, -999.0D, -999.0D, this.motionZ, this.rotationYaw, this.rotationPitch, this.onGround)); ++ var13 = false; ++ } ++ else if (var13 && var14) ++ { ++ this.sendQueue.addToSendQueue(new Packet13PlayerLookMove(this.posX, this.boundingBox.minY, this.posY, this.posZ, this.rotationYaw, this.rotationPitch, this.onGround)); ++ } ++ else if (var13) ++ { ++ this.sendQueue.addToSendQueue(new Packet11PlayerPosition(this.posX, this.boundingBox.minY, this.posY, this.posZ, this.onGround)); ++ } ++ else if (var14) ++ { ++ this.sendQueue.addToSendQueue(new Packet12PlayerLook(this.rotationYaw, this.rotationPitch, this.onGround)); ++ } ++ else ++ { ++ this.sendQueue.addToSendQueue(new Packet10Flying(this.onGround)); ++ } ++ ++ ++this.field_71168_co; ++ this.wasOnGround = this.onGround; ++ ++ if (var13) ++ { ++ this.oldPosX = this.posX; ++ this.oldMinY = this.boundingBox.minY; ++ this.oldPosY = this.posY; ++ this.oldPosZ = this.posZ; ++ this.field_71168_co = 0; ++ } ++ ++ if (var14) ++ { ++ this.oldRotationYaw = this.rotationYaw; ++ this.oldRotationPitch = this.rotationPitch; ++ } ++ } ++ ++ /** ++ * Called when player presses the drop item key ++ */ ++ public EntityItem dropOneItem(boolean par1) ++ { ++ int var2 = par1 ? 3 : 4; ++ this.sendQueue.addToSendQueue(new Packet14BlockDig(var2, 0, 0, 0, 0)); ++ return null; ++ } ++ ++ /** ++ * Joins the passed in entity item with the world. Args: entityItem ++ */ ++ protected void joinEntityItemWithWorld(EntityItem par1EntityItem) {} ++ ++ /** ++ * Sends a chat message from the player. Args: chatMessage ++ */ ++ public void sendChatMessage(String par1Str) ++ { ++ this.sendQueue.addToSendQueue(new Packet3Chat(par1Str)); ++ } ++ ++ /** ++ * Swings the item the player is holding. ++ */ ++ public void swingItem() ++ { ++ super.swingItem(); ++ this.sendQueue.addToSendQueue(new Packet18Animation(this, 1)); ++ } ++ ++ public void respawnPlayer() ++ { ++ this.sendQueue.addToSendQueue(new Packet205ClientCommand(1)); ++ } ++ ++ /** ++ * Deals damage to the entity. If its a EntityPlayer then will take damage from the armor first and then health ++ * second with the reduced value. Args: damageAmount ++ */ ++ protected void damageEntity(DamageSource par1DamageSource, float par2) ++ { ++ if (!this.isEntityInvulnerable()) ++ { ++ this.setHealth(this.getHealth() - par2); ++ } ++ } ++ ++ /** ++ * sets current screen to null (used on escape buttons of GUIs) ++ */ ++ public void closeScreen() ++ { ++ this.sendQueue.addToSendQueue(new Packet101CloseWindow(this.openContainer.windowId)); ++ this.func_92015_f(); ++ } ++ ++ public void func_92015_f() ++ { ++ this.inventory.setItemStack((ItemStack)null); ++ super.closeScreen(); ++ } ++ ++ /** ++ * Updates health locally. ++ */ ++ public void setPlayerSPHealth(float par1) ++ { ++ if (this.hasSetHealth) ++ { ++ super.setPlayerSPHealth(par1); ++ } ++ else ++ { ++ this.setHealth(par1); ++ this.hasSetHealth = true; ++ } ++ } ++ ++ /** ++ * Adds a value to a statistic field. ++ */ ++ public void addStat(StatBase par1StatBase, int par2) ++ { ++ if (par1StatBase != null) ++ { ++ if (par1StatBase.isIndependent) ++ { ++ super.addStat(par1StatBase, par2); ++ } ++ } ++ } ++ ++ /** ++ * Used by NetClientHandler.handleStatistic ++ */ ++ public void incrementStat(StatBase par1StatBase, int par2) ++ { ++ if (par1StatBase != null) ++ { ++ if (!par1StatBase.isIndependent) ++ { ++ super.addStat(par1StatBase, par2); ++ } ++ } ++ } ++ ++ /** ++ * Sends the player's abilities to the server (if there is one). ++ */ ++ public void sendPlayerAbilities() ++ { ++ this.sendQueue.addToSendQueue(new Packet202PlayerAbilities(this.capabilities)); ++ } ++ ++ protected void func_110318_g() ++ { ++ this.sendQueue.addToSendQueue(new Packet19EntityAction(this, 6, (int)(this.getHorseJumpPower() * 100.0F))); ++ } ++ ++ public void func_110322_i() ++ { ++ this.sendQueue.addToSendQueue(new Packet19EntityAction(this, 7)); ++ } ++ ++ public void func_142020_c(String par1Str) ++ { ++ this.field_142022_ce = par1Str; ++ } ++ ++ public String func_142021_k() ++ { ++ return this.field_142022_ce; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityCloudFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,78 ---- ++ package net.minecraft.src; ++ ++ public class EntityCloudFX extends EntityFX ++ { ++ float field_70569_a; ++ ++ public EntityCloudFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) ++ { ++ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); ++ float var14 = 2.5F; ++ this.motionX *= 0.10000000149011612D; ++ this.motionY *= 0.10000000149011612D; ++ this.motionZ *= 0.10000000149011612D; ++ this.motionX += par8; ++ this.motionY += par10; ++ this.motionZ += par12; ++ this.particleRed = this.particleGreen = this.particleBlue = 1.0F - (float)(Math.random() * 0.30000001192092896D); ++ this.particleScale *= 0.75F; ++ this.particleScale *= var14; ++ this.field_70569_a = this.particleScale; ++ this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.3D)); ++ this.particleMaxAge = (int)((float)this.particleMaxAge * var14); ++ this.noClip = false; ++ } ++ ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F; ++ ++ if (var8 < 0.0F) ++ { ++ var8 = 0.0F; ++ } ++ ++ if (var8 > 1.0F) ++ { ++ var8 = 1.0F; ++ } ++ ++ this.particleScale = this.field_70569_a * var8; ++ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ this.prevPosX = this.posX; ++ this.prevPosY = this.posY; ++ this.prevPosZ = this.posZ; ++ ++ if (this.particleAge++ >= this.particleMaxAge) ++ { ++ this.setDead(); ++ } ++ ++ this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); ++ this.moveEntity(this.motionX, this.motionY, this.motionZ); ++ this.motionX *= 0.9599999785423279D; ++ this.motionY *= 0.9599999785423279D; ++ this.motionZ *= 0.9599999785423279D; ++ EntityPlayer var1 = this.worldObj.getClosestPlayerToEntity(this, 2.0D); ++ ++ if (var1 != null && this.posY > var1.boundingBox.minY) ++ { ++ this.posY += (var1.boundingBox.minY - this.posY) * 0.2D; ++ this.motionY += (var1.motionY - this.motionY) * 0.2D; ++ this.setPosition(this.posX, this.posY, this.posZ); ++ } ++ ++ if (this.onGround) ++ { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ } ++ } ++ } +*** EntityCow.java Sat Feb 5 04:13:13 2022 +--- EntityCow.java Sat Feb 5 04:12:34 2022 +*************** +*** 79,89 **** + { + return Item.leather.itemID; + } + + /** +! * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.rand.nextInt(3) + this.rand.nextInt(1 + par2); + int var4; +--- 79,90 ---- + { + return Item.leather.itemID; + } + + /** +! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param +! * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.rand.nextInt(3) + this.rand.nextInt(1 + par2); + int var4; +*** EntityCreature.java Sat Feb 5 04:13:13 2022 +--- EntityCreature.java Sat Feb 5 04:12:34 2022 +*************** +*** 245,271 **** + int var3 = MathHelper.floor_double(this.posZ); + return super.getCanSpawnHere() && this.getBlockPathWeight(var1, var2, var3) >= 0.0F; + } + + /** +! * if the entity got a PathEntity it returns true, else false + */ + public boolean hasPath() + { + return this.pathToEntity != null; + } + + /** +! * sets the pathToEntity + */ + public void setPathToEntity(PathEntity par1PathEntity) + { + this.pathToEntity = par1PathEntity; + } + + /** +! * returns the target Entity + */ + public Entity getEntityToAttack() + { + return this.entityToAttack; + } +--- 245,271 ---- + int var3 = MathHelper.floor_double(this.posZ); + return super.getCanSpawnHere() && this.getBlockPathWeight(var1, var2, var3) >= 0.0F; + } + + /** +! * Returns true if entity has a path to follow + */ + public boolean hasPath() + { + return this.pathToEntity != null; + } + + /** +! * sets the Entities walk path in EntityCreature + */ + public void setPathToEntity(PathEntity par1PathEntity) + { + this.pathToEntity = par1PathEntity; + } + + /** +! * Returns current entities target + */ + public Entity getEntityToAttack() + { + return this.entityToAttack; + } +*** EntityCreeper.java Sat Feb 5 04:13:13 2022 +--- EntityCreeper.java Sat Feb 5 04:12:34 2022 +*************** +*** 198,207 **** +--- 198,215 ---- + { + return this.dataWatcher.getWatchableObjectByte(17) == 1; + } + + /** ++ * Params: (Float)Render tick. Returns the intensity of the creeper's flash when it is ignited. ++ */ ++ public float getCreeperFlashIntensity(float par1) ++ { ++ return ((float)this.lastActiveTime + (float)(this.timeSinceIgnited - this.lastActiveTime) * par1) / (float)(this.fuseTime - 2); ++ } ++ ++ /** + * Returns the item ID for the item the mob drops on death. + */ + protected int getDropItemId() + { + return Item.gunpowder.itemID; +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityCrit2FX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,59 ---- ++ package net.minecraft.src; ++ ++ public class EntityCrit2FX extends EntityFX ++ { ++ /** Entity that had been hit and done the Critical hit on. */ ++ private Entity theEntity; ++ private int currentLife; ++ private int maximumLife; ++ private String particleName; ++ ++ public EntityCrit2FX(World par1World, Entity par2Entity) ++ { ++ this(par1World, par2Entity, "crit"); ++ } ++ ++ public EntityCrit2FX(World par1World, Entity par2Entity, String par3Str) ++ { ++ super(par1World, par2Entity.posX, par2Entity.boundingBox.minY + (double)(par2Entity.height / 2.0F), par2Entity.posZ, par2Entity.motionX, par2Entity.motionY, par2Entity.motionZ); ++ this.theEntity = par2Entity; ++ this.maximumLife = 3; ++ this.particleName = par3Str; ++ this.onUpdate(); ++ } ++ ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {} ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ for (int var1 = 0; var1 < 16; ++var1) ++ { ++ double var2 = (double)(this.rand.nextFloat() * 2.0F - 1.0F); ++ double var4 = (double)(this.rand.nextFloat() * 2.0F - 1.0F); ++ double var6 = (double)(this.rand.nextFloat() * 2.0F - 1.0F); ++ ++ if (var2 * var2 + var4 * var4 + var6 * var6 <= 1.0D) ++ { ++ double var8 = this.theEntity.posX + var2 * (double)this.theEntity.width / 4.0D; ++ double var10 = this.theEntity.boundingBox.minY + (double)(this.theEntity.height / 2.0F) + var4 * (double)this.theEntity.height / 4.0D; ++ double var12 = this.theEntity.posZ + var6 * (double)this.theEntity.width / 4.0D; ++ this.worldObj.spawnParticle(this.particleName, var8, var10, var12, var2, var4 + 0.2D, var6); ++ } ++ } ++ ++ ++this.currentLife; ++ ++ if (this.currentLife >= this.maximumLife) ++ { ++ this.setDead(); ++ } ++ } ++ ++ public int getFXLayer() ++ { ++ return 3; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityCritFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,78 ---- ++ package net.minecraft.src; ++ ++ public class EntityCritFX extends EntityFX ++ { ++ float initialParticleScale; ++ ++ public EntityCritFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) ++ { ++ this(par1World, par2, par4, par6, par8, par10, par12, 1.0F); ++ } ++ ++ public EntityCritFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, float par14) ++ { ++ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); ++ this.motionX *= 0.10000000149011612D; ++ this.motionY *= 0.10000000149011612D; ++ this.motionZ *= 0.10000000149011612D; ++ this.motionX += par8 * 0.4D; ++ this.motionY += par10 * 0.4D; ++ this.motionZ += par12 * 0.4D; ++ this.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * 0.30000001192092896D + 0.6000000238418579D); ++ this.particleScale *= 0.75F; ++ this.particleScale *= par14; ++ this.initialParticleScale = this.particleScale; ++ this.particleMaxAge = (int)(6.0D / (Math.random() * 0.8D + 0.6D)); ++ this.particleMaxAge = (int)((float)this.particleMaxAge * par14); ++ this.noClip = false; ++ this.setParticleTextureIndex(65); ++ this.onUpdate(); ++ } ++ ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F; ++ ++ if (var8 < 0.0F) ++ { ++ var8 = 0.0F; ++ } ++ ++ if (var8 > 1.0F) ++ { ++ var8 = 1.0F; ++ } ++ ++ this.particleScale = this.initialParticleScale * var8; ++ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ this.prevPosX = this.posX; ++ this.prevPosY = this.posY; ++ this.prevPosZ = this.posZ; ++ ++ if (this.particleAge++ >= this.particleMaxAge) ++ { ++ this.setDead(); ++ } ++ ++ this.moveEntity(this.motionX, this.motionY, this.motionZ); ++ this.particleGreen = (float)((double)this.particleGreen * 0.96D); ++ this.particleBlue = (float)((double)this.particleBlue * 0.9D); ++ this.motionX *= 0.699999988079071D; ++ this.motionY *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ this.motionY -= 0.019999999552965164D; ++ ++ if (this.onGround) ++ { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ } ++ } ++ } +*** EntityDamageSource.java Sat Feb 5 04:13:13 2022 +--- EntityDamageSource.java Sat Feb 5 04:12:34 2022 +*** EntityDamageSourceIndirect.java Sat Feb 5 04:13:13 2022 +--- EntityDamageSourceIndirect.java Sat Feb 5 04:12:34 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityDiggingFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,86 ---- ++ package net.minecraft.src; ++ ++ public class EntityDiggingFX extends EntityFX ++ { ++ private Block blockInstance; ++ ++ public EntityDiggingFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, Block par14Block, int par15) ++ { ++ super(par1World, par2, par4, par6, par8, par10, par12); ++ this.blockInstance = par14Block; ++ this.setParticleIcon(par14Block.getIcon(0, par15)); ++ this.particleGravity = par14Block.blockParticleGravity; ++ this.particleRed = this.particleGreen = this.particleBlue = 0.6F; ++ this.particleScale /= 2.0F; ++ } ++ ++ /** ++ * If the block has a colour multiplier, copies it to this particle and returns this particle. ++ */ ++ public EntityDiggingFX applyColourMultiplier(int par1, int par2, int par3) ++ { ++ if (this.blockInstance == Block.grass) ++ { ++ return this; ++ } ++ else ++ { ++ int var4 = this.blockInstance.colorMultiplier(this.worldObj, par1, par2, par3); ++ this.particleRed *= (float)(var4 >> 16 & 255) / 255.0F; ++ this.particleGreen *= (float)(var4 >> 8 & 255) / 255.0F; ++ this.particleBlue *= (float)(var4 & 255) / 255.0F; ++ return this; ++ } ++ } ++ ++ /** ++ * Creates a new EntityDiggingFX with the block render color applied to the base particle color ++ */ ++ public EntityDiggingFX applyRenderColor(int par1) ++ { ++ if (this.blockInstance == Block.grass) ++ { ++ return this; ++ } ++ else ++ { ++ int var2 = this.blockInstance.getRenderColor(par1); ++ this.particleRed *= (float)(var2 >> 16 & 255) / 255.0F; ++ this.particleGreen *= (float)(var2 >> 8 & 255) / 255.0F; ++ this.particleBlue *= (float)(var2 & 255) / 255.0F; ++ return this; ++ } ++ } ++ ++ public int getFXLayer() ++ { ++ return 1; ++ } ++ ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ float var8 = ((float)this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F; ++ float var9 = var8 + 0.015609375F; ++ float var10 = ((float)this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F; ++ float var11 = var10 + 0.015609375F; ++ float var12 = 0.1F * this.particleScale; ++ ++ if (this.particleIcon != null) ++ { ++ var8 = this.particleIcon.getInterpolatedU((double)(this.particleTextureJitterX / 4.0F * 16.0F)); ++ var9 = this.particleIcon.getInterpolatedU((double)((this.particleTextureJitterX + 1.0F) / 4.0F * 16.0F)); ++ var10 = this.particleIcon.getInterpolatedV((double)(this.particleTextureJitterY / 4.0F * 16.0F)); ++ var11 = this.particleIcon.getInterpolatedV((double)((this.particleTextureJitterY + 1.0F) / 4.0F * 16.0F)); ++ } ++ ++ float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX); ++ float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY); ++ float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ); ++ float var16 = 1.0F; ++ par1Tessellator.setColorOpaque_F(var16 * this.particleRed, var16 * this.particleGreen, var16 * this.particleBlue); ++ par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 - par5 * var12 - par7 * var12), (double)var8, (double)var11); ++ par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 - par5 * var12 + par7 * var12), (double)var8, (double)var10); ++ par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 + par5 * var12 + par7 * var12), (double)var9, (double)var10); ++ par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 + par5 * var12 - par7 * var12), (double)var9, (double)var11); ++ } ++ } +*** EntityDragon.java Sat Feb 5 04:13:13 2022 +--- EntityDragon.java Sat Feb 5 04:12:34 2022 +*************** +*** 1,11 **** + package net.minecraft.src; + + import java.util.Iterator; + import java.util.List; + +! public class EntityDragon extends EntityLiving implements IEntityMultiPart, IMob + { + public double targetX; + public double targetY; + public double targetZ; + +--- 1,11 ---- + package net.minecraft.src; + + import java.util.Iterator; + import java.util.List; + +! public class EntityDragon extends EntityLiving implements IBossDisplayData, IEntityMultiPart, IMob + { + public double targetX; + public double targetY; + public double targetZ; + +*** EntityDragonPart.java Sat Feb 5 04:13:13 2022 +--- EntityDragonPart.java Sat Feb 5 04:12:34 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityDropParticleFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,125 ---- ++ package net.minecraft.src; ++ ++ public class EntityDropParticleFX extends EntityFX ++ { ++ /** the material type for dropped items/blocks */ ++ private Material materialType; ++ ++ /** The height of the current bob */ ++ private int bobTimer; ++ ++ public EntityDropParticleFX(World par1World, double par2, double par4, double par6, Material par8Material) ++ { ++ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); ++ this.motionX = this.motionY = this.motionZ = 0.0D; ++ ++ if (par8Material == Material.water) ++ { ++ this.particleRed = 0.0F; ++ this.particleGreen = 0.0F; ++ this.particleBlue = 1.0F; ++ } ++ else ++ { ++ this.particleRed = 1.0F; ++ this.particleGreen = 0.0F; ++ this.particleBlue = 0.0F; ++ } ++ ++ this.setParticleTextureIndex(113); ++ this.setSize(0.01F, 0.01F); ++ this.particleGravity = 0.06F; ++ this.materialType = par8Material; ++ this.bobTimer = 40; ++ this.particleMaxAge = (int)(64.0D / (Math.random() * 0.8D + 0.2D)); ++ this.motionX = this.motionY = this.motionZ = 0.0D; ++ } ++ ++ public int getBrightnessForRender(float par1) ++ { ++ return this.materialType == Material.water ? super.getBrightnessForRender(par1) : 257; ++ } ++ ++ /** ++ * Gets how bright this entity is. ++ */ ++ public float getBrightness(float par1) ++ { ++ return this.materialType == Material.water ? super.getBrightness(par1) : 1.0F; ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ this.prevPosX = this.posX; ++ this.prevPosY = this.posY; ++ this.prevPosZ = this.posZ; ++ ++ if (this.materialType == Material.water) ++ { ++ this.particleRed = 0.2F; ++ this.particleGreen = 0.3F; ++ this.particleBlue = 1.0F; ++ } ++ else ++ { ++ this.particleRed = 1.0F; ++ this.particleGreen = 16.0F / (float)(40 - this.bobTimer + 16); ++ this.particleBlue = 4.0F / (float)(40 - this.bobTimer + 8); ++ } ++ ++ this.motionY -= (double)this.particleGravity; ++ ++ if (this.bobTimer-- > 0) ++ { ++ this.motionX *= 0.02D; ++ this.motionY *= 0.02D; ++ this.motionZ *= 0.02D; ++ this.setParticleTextureIndex(113); ++ } ++ else ++ { ++ this.setParticleTextureIndex(112); ++ } ++ ++ this.moveEntity(this.motionX, this.motionY, this.motionZ); ++ this.motionX *= 0.9800000190734863D; ++ this.motionY *= 0.9800000190734863D; ++ this.motionZ *= 0.9800000190734863D; ++ ++ if (this.particleMaxAge-- <= 0) ++ { ++ this.setDead(); ++ } ++ ++ if (this.onGround) ++ { ++ if (this.materialType == Material.water) ++ { ++ this.setDead(); ++ this.worldObj.spawnParticle("splash", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); ++ } ++ else ++ { ++ this.setParticleTextureIndex(114); ++ } ++ ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ } ++ ++ Material var1 = this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); ++ ++ if (var1.isLiquid() || var1.isSolid()) ++ { ++ double var2 = (double)((float)(MathHelper.floor_double(this.posY) + 1) - BlockFluid.getFluidHeightPercent(this.worldObj.getBlockMetadata(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)))); ++ ++ if (this.posY < var2) ++ { ++ this.setDead(); ++ } ++ } ++ } ++ } +*** EntityEgg.java Sat Feb 5 04:13:13 2022 +--- EntityEgg.java Sat Feb 5 04:12:34 2022 +*** EntityEggInfo.java Sat Feb 5 04:13:13 2022 +--- EntityEggInfo.java Sat Feb 5 04:12:34 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityEnchantmentTableParticleFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,81 ---- ++ package net.minecraft.src; ++ ++ public class EntityEnchantmentTableParticleFX extends EntityFX ++ { ++ private float field_70565_a; ++ private double field_70568_aq; ++ private double field_70567_ar; ++ private double field_70566_as; ++ ++ public EntityEnchantmentTableParticleFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) ++ { ++ super(par1World, par2, par4, par6, par8, par10, par12); ++ this.motionX = par8; ++ this.motionY = par10; ++ this.motionZ = par12; ++ this.field_70568_aq = this.posX = par2; ++ this.field_70567_ar = this.posY = par4; ++ this.field_70566_as = this.posZ = par6; ++ float var14 = this.rand.nextFloat() * 0.6F + 0.4F; ++ this.field_70565_a = this.particleScale = this.rand.nextFloat() * 0.5F + 0.2F; ++ this.particleRed = this.particleGreen = this.particleBlue = 1.0F * var14; ++ this.particleGreen *= 0.9F; ++ this.particleRed *= 0.9F; ++ this.particleMaxAge = (int)(Math.random() * 10.0D) + 30; ++ this.noClip = true; ++ this.setParticleTextureIndex((int)(Math.random() * 26.0D + 1.0D + 224.0D)); ++ } ++ ++ public int getBrightnessForRender(float par1) ++ { ++ int var2 = super.getBrightnessForRender(par1); ++ float var3 = (float)this.particleAge / (float)this.particleMaxAge; ++ var3 *= var3; ++ var3 *= var3; ++ int var4 = var2 & 255; ++ int var5 = var2 >> 16 & 255; ++ var5 += (int)(var3 * 15.0F * 16.0F); ++ ++ if (var5 > 240) ++ { ++ var5 = 240; ++ } ++ ++ return var4 | var5 << 16; ++ } ++ ++ /** ++ * Gets how bright this entity is. ++ */ ++ public float getBrightness(float par1) ++ { ++ float var2 = super.getBrightness(par1); ++ float var3 = (float)this.particleAge / (float)this.particleMaxAge; ++ var3 *= var3; ++ var3 *= var3; ++ return var2 * (1.0F - var3) + var3; ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ this.prevPosX = this.posX; ++ this.prevPosY = this.posY; ++ this.prevPosZ = this.posZ; ++ float var1 = (float)this.particleAge / (float)this.particleMaxAge; ++ var1 = 1.0F - var1; ++ float var2 = 1.0F - var1; ++ var2 *= var2; ++ var2 *= var2; ++ this.posX = this.field_70568_aq + this.motionX * (double)var1; ++ this.posY = this.field_70567_ar + this.motionY * (double)var1 - (double)(var2 * 1.2F); ++ this.posZ = this.field_70566_as + this.motionZ * (double)var1; ++ ++ if (this.particleAge++ >= this.particleMaxAge) ++ { ++ this.setDead(); ++ } ++ } ++ } +*** EntityEnderCrystal.java Sat Feb 5 04:13:13 2022 +--- EntityEnderCrystal.java Sat Feb 5 04:12:34 2022 +*************** +*** 14,23 **** +--- 14,29 ---- + this.yOffset = this.height / 2.0F; + this.health = 5; + this.innerRotation = this.rand.nextInt(100000); + } + ++ public EntityEnderCrystal(World par1World, double par2, double par4, double par6) ++ { ++ this(par1World); ++ this.setPosition(par2, par4, par6); ++ } ++ + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() +*************** +*** 57,66 **** +--- 63,77 ---- + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {} ++ ++ public float getShadowSize() ++ { ++ return 0.0F; ++ } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() +*** EntityEnderEye.java Sat Feb 5 04:13:13 2022 +--- EntityEnderEye.java Sat Feb 5 04:12:34 2022 +*************** +*** 19,28 **** +--- 19,39 ---- + this.setSize(0.25F, 0.25F); + } + + protected void entityInit() {} + ++ /** ++ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge ++ * length * 64 * renderDistanceWeight Args: distance ++ */ ++ public boolean isInRangeToRenderDist(double par1) ++ { ++ double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; ++ var3 *= 64.0D; ++ return par1 < var3 * var3; ++ } ++ + public EntityEnderEye(World par1World, double par2, double par4, double par6) + { + super(par1World); + this.despawnTimer = 0; + this.setSize(0.25F, 0.25F); +*************** +*** 56,65 **** +--- 67,93 ---- + this.despawnTimer = 0; + this.shatterOrDrop = this.rand.nextInt(5) > 0; + } + + /** ++ * Sets the velocity to the args. Args: x, y, z ++ */ ++ public void setVelocity(double par1, double par3, double par5) ++ { ++ this.motionX = par1; ++ this.motionY = par3; ++ this.motionZ = par5; ++ ++ if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) ++ { ++ float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); ++ this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI); ++ this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var7) * 180.0D / Math.PI); ++ } ++ } ++ ++ /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.lastTickPosX = this.posX; +*************** +*** 165,180 **** +--- 193,218 ---- + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {} + ++ public float getShadowSize() ++ { ++ return 0.0F; ++ } ++ + /** + * Gets how bright this entity is. + */ + public float getBrightness(float par1) + { + return 1.0F; ++ } ++ ++ public int getBrightnessForRender(float par1) ++ { ++ return 15728880; + } + + /** + * If returns false, the item will not inflict any damage against entities. + */ +*** EntityEnderman.java Sat Feb 5 04:13:13 2022 +--- EntityEnderman.java Sat Feb 5 04:12:34 2022 +*************** +*** 380,390 **** + { + return Item.enderPearl.itemID; + } + + /** +! * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.getDropItemId(); + +--- 380,391 ---- + { + return Item.enderPearl.itemID; + } + + /** +! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param +! * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.getDropItemId(); + +*** EntityEnderPearl.java Sat Feb 5 04:13:13 2022 +--- EntityEnderPearl.java Sat Feb 5 04:12:34 2022 +*************** +*** 10,19 **** +--- 10,24 ---- + public EntityEnderPearl(World par1World, EntityLivingBase par2EntityLivingBase) + { + super(par1World, par2EntityLivingBase); + } + ++ public EntityEnderPearl(World par1World, double par2, double par4, double par6) ++ { ++ super(par1World, par2, par4, par6); ++ } ++ + /** + * Called when this EntityThrowable hits a block or entity. + */ + protected void onImpact(MovingObjectPosition par1MovingObjectPosition) + { +*** EntityExpBottle.java Sat Feb 5 04:13:13 2022 +--- EntityExpBottle.java Sat Feb 5 04:12:34 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityExplodeFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,43 ---- ++ package net.minecraft.src; ++ ++ public class EntityExplodeFX extends EntityFX ++ { ++ public EntityExplodeFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) ++ { ++ super(par1World, par2, par4, par6, par8, par10, par12); ++ this.motionX = par8 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); ++ this.motionY = par10 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); ++ this.motionZ = par12 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); ++ this.particleRed = this.particleGreen = this.particleBlue = this.rand.nextFloat() * 0.3F + 0.7F; ++ this.particleScale = this.rand.nextFloat() * this.rand.nextFloat() * 6.0F + 1.0F; ++ this.particleMaxAge = (int)(16.0D / ((double)this.rand.nextFloat() * 0.8D + 0.2D)) + 2; ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ this.prevPosX = this.posX; ++ this.prevPosY = this.posY; ++ this.prevPosZ = this.posZ; ++ ++ if (this.particleAge++ >= this.particleMaxAge) ++ { ++ this.setDead(); ++ } ++ ++ this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); ++ this.motionY += 0.004D; ++ this.moveEntity(this.motionX, this.motionY, this.motionZ); ++ this.motionX *= 0.8999999761581421D; ++ this.motionY *= 0.8999999761581421D; ++ this.motionZ *= 0.8999999761581421D; ++ ++ if (this.onGround) ++ { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ } ++ } ++ } +*** EntityFallingSand.java Sat Feb 5 04:13:13 2022 +--- EntityFallingSand.java Sat Feb 5 04:12:34 2022 +*************** +*** 274,286 **** +--- 274,304 ---- + { + this.blockID = Block.sand.blockID; + } + } + ++ public float getShadowSize() ++ { ++ return 0.0F; ++ } ++ ++ public World getWorld() ++ { ++ return this.worldObj; ++ } ++ + public void setIsAnvil(boolean par1) + { + this.isAnvil = par1; ++ } ++ ++ /** ++ * Return whether this entity should be rendered as on fire. ++ */ ++ public boolean canRenderOnFire() ++ { ++ return false; + } + + public void addEntityCrashInfo(CrashReportCategory par1CrashReportCategory) + { + super.addEntityCrashInfo(par1CrashReportCategory); +*** EntityFireball.java Sat Feb 5 04:13:13 2022 +--- EntityFireball.java Sat Feb 5 04:12:34 2022 +*************** +*** 22,31 **** +--- 22,42 ---- + this.setSize(1.0F, 1.0F); + } + + protected void entityInit() {} + ++ /** ++ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge ++ * length * 64 * renderDistanceWeight Args: distance ++ */ ++ public boolean isInRangeToRenderDist(double par1) ++ { ++ double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; ++ var3 *= 64.0D; ++ return par1 < var3 * var3; ++ } ++ + public EntityFireball(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) + { + super(par1World); + this.setSize(1.0F, 1.0F); + this.setLocationAndAngles(par2, par4, par6, this.rotationYaw, this.rotationPitch); +*************** +*** 96,106 **** + ++this.ticksInAir; + } + + Vec3 var15 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); +! MovingObjectPosition var3 = this.worldObj.rayTraceBlocks(var15, var2); + var15 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (var3 != null) + { +--- 107,117 ---- + ++this.ticksInAir; + } + + Vec3 var15 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); +! MovingObjectPosition var3 = this.worldObj.clip(var15, var2); + var15 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (var3 != null) + { +*************** +*** 298,310 **** +--- 309,331 ---- + return false; + } + } + } + ++ public float getShadowSize() ++ { ++ return 0.0F; ++ } ++ + /** + * Gets how bright this entity is. + */ + public float getBrightness(float par1) + { + return 1.0F; ++ } ++ ++ public int getBrightnessForRender(float par1) ++ { ++ return 15728880; + } + } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityFireworkOverlayFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,28 ---- ++ package net.minecraft.src; ++ ++ public class EntityFireworkOverlayFX extends EntityFX ++ { ++ protected EntityFireworkOverlayFX(World par1World, double par2, double par4, double par6) ++ { ++ super(par1World, par2, par4, par6); ++ this.particleMaxAge = 4; ++ } ++ ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ float var8 = 0.25F; ++ float var9 = var8 + 0.25F; ++ float var10 = 0.125F; ++ float var11 = var10 + 0.25F; ++ float var12 = 7.1F * MathHelper.sin(((float)this.particleAge + par2 - 1.0F) * 0.25F * (float)Math.PI); ++ this.particleAlpha = 0.6F - ((float)this.particleAge + par2 - 1.0F) * 0.25F * 0.5F; ++ float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX); ++ float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY); ++ float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ); ++ par1Tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha); ++ par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 - par5 * var12 - par7 * var12), (double)var9, (double)var11); ++ par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 - par5 * var12 + par7 * var12), (double)var9, (double)var10); ++ par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 + par5 * var12 + par7 * var12), (double)var8, (double)var10); ++ par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 + par5 * var12 - par7 * var12), (double)var8, (double)var11); ++ } ++ } +*** EntityFireworkRocket.java Sat Feb 5 04:13:13 2022 +--- EntityFireworkRocket.java Sat Feb 5 04:12:34 2022 +*************** +*** 19,28 **** +--- 19,37 ---- + protected void entityInit() + { + this.dataWatcher.addObjectByDataType(8, 5); + } + ++ /** ++ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge ++ * length * 64 * renderDistanceWeight Args: distance ++ */ ++ public boolean isInRangeToRenderDist(double par1) ++ { ++ return par1 < 4096.0D; ++ } ++ + public EntityFireworkRocket(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack) + { + super(par1World); + this.fireworkAge = 0; + this.setSize(0.25F, 0.25F); +*************** +*** 47,56 **** +--- 56,82 ---- + this.motionY = 0.05D; + this.lifetime = 10 * var9 + this.rand.nextInt(6) + this.rand.nextInt(7); + } + + /** ++ * Sets the velocity to the args. Args: x, y, z ++ */ ++ public void setVelocity(double par1, double par3, double par5) ++ { ++ this.motionX = par1; ++ this.motionY = par3; ++ this.motionZ = par5; ++ ++ if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) ++ { ++ float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); ++ this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI); ++ this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var7) * 180.0D / Math.PI); ++ } ++ } ++ ++ /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.lastTickPosX = this.posX; +*************** +*** 104,113 **** +--- 130,157 ---- + this.worldObj.setEntityState(this, (byte)17); + this.setDead(); + } + } + ++ public void handleHealthUpdate(byte par1) ++ { ++ if (par1 == 17 && this.worldObj.isRemote) ++ { ++ ItemStack var2 = this.dataWatcher.getWatchableObjectItemStack(8); ++ NBTTagCompound var3 = null; ++ ++ if (var2 != null && var2.hasTagCompound()) ++ { ++ var3 = var2.getTagCompound().getCompoundTag("Fireworks"); ++ } ++ ++ this.worldObj.func_92088_a(this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ, var3); ++ } ++ ++ super.handleHealthUpdate(par1); ++ } ++ + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { +*************** +*** 141,156 **** +--- 185,210 ---- + this.dataWatcher.updateObject(8, var3); + } + } + } + ++ public float getShadowSize() ++ { ++ return 0.0F; ++ } ++ + /** + * Gets how bright this entity is. + */ + public float getBrightness(float par1) + { + return super.getBrightness(par1); ++ } ++ ++ public int getBrightnessForRender(float par1) ++ { ++ return super.getBrightnessForRender(par1); + } + + /** + * If returns false, the item will not inflict any damage against entities. + */ +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityFireworkSparkFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,147 ---- ++ package net.minecraft.src; ++ ++ public class EntityFireworkSparkFX extends EntityFX ++ { ++ private int baseTextureIndex = 160; ++ private boolean field_92054_ax; ++ private boolean field_92048_ay; ++ private final EffectRenderer field_92047_az; ++ private float fadeColourRed; ++ private float fadeColourGreen; ++ private float fadeColourBlue; ++ private boolean hasFadeColour; ++ ++ public EntityFireworkSparkFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, EffectRenderer par14EffectRenderer) ++ { ++ super(par1World, par2, par4, par6); ++ this.motionX = par8; ++ this.motionY = par10; ++ this.motionZ = par12; ++ this.field_92047_az = par14EffectRenderer; ++ this.particleScale *= 0.75F; ++ this.particleMaxAge = 48 + this.rand.nextInt(12); ++ this.noClip = false; ++ } ++ ++ public void setTrail(boolean par1) ++ { ++ this.field_92054_ax = par1; ++ } ++ ++ public void setTwinkle(boolean par1) ++ { ++ this.field_92048_ay = par1; ++ } ++ ++ public void setColour(int par1) ++ { ++ float var2 = (float)((par1 & 16711680) >> 16) / 255.0F; ++ float var3 = (float)((par1 & 65280) >> 8) / 255.0F; ++ float var4 = (float)((par1 & 255) >> 0) / 255.0F; ++ float var5 = 1.0F; ++ this.setRBGColorF(var2 * var5, var3 * var5, var4 * var5); ++ } ++ ++ public void setFadeColour(int par1) ++ { ++ this.fadeColourRed = (float)((par1 & 16711680) >> 16) / 255.0F; ++ this.fadeColourGreen = (float)((par1 & 65280) >> 8) / 255.0F; ++ this.fadeColourBlue = (float)((par1 & 255) >> 0) / 255.0F; ++ this.hasFadeColour = true; ++ } ++ ++ /** ++ * returns the bounding box for this entity ++ */ ++ public AxisAlignedBB getBoundingBox() ++ { ++ return null; ++ } ++ ++ /** ++ * Returns true if this entity should push and be pushed by other entities when colliding. ++ */ ++ public boolean canBePushed() ++ { ++ return false; ++ } ++ ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ if (!this.field_92048_ay || this.particleAge < this.particleMaxAge / 3 || (this.particleAge + this.particleMaxAge) / 3 % 2 == 0) ++ { ++ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); ++ } ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ this.prevPosX = this.posX; ++ this.prevPosY = this.posY; ++ this.prevPosZ = this.posZ; ++ ++ if (this.particleAge++ >= this.particleMaxAge) ++ { ++ this.setDead(); ++ } ++ ++ if (this.particleAge > this.particleMaxAge / 2) ++ { ++ this.setAlphaF(1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / (float)this.particleMaxAge); ++ ++ if (this.hasFadeColour) ++ { ++ this.particleRed += (this.fadeColourRed - this.particleRed) * 0.2F; ++ this.particleGreen += (this.fadeColourGreen - this.particleGreen) * 0.2F; ++ this.particleBlue += (this.fadeColourBlue - this.particleBlue) * 0.2F; ++ } ++ } ++ ++ this.setParticleTextureIndex(this.baseTextureIndex + (7 - this.particleAge * 8 / this.particleMaxAge)); ++ this.motionY -= 0.004D; ++ this.moveEntity(this.motionX, this.motionY, this.motionZ); ++ this.motionX *= 0.9100000262260437D; ++ this.motionY *= 0.9100000262260437D; ++ this.motionZ *= 0.9100000262260437D; ++ ++ if (this.onGround) ++ { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ } ++ ++ if (this.field_92054_ax && this.particleAge < this.particleMaxAge / 2 && (this.particleAge + this.particleMaxAge) % 2 == 0) ++ { ++ EntityFireworkSparkFX var1 = new EntityFireworkSparkFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, this.field_92047_az); ++ var1.setRBGColorF(this.particleRed, this.particleGreen, this.particleBlue); ++ var1.particleAge = var1.particleMaxAge / 2; ++ ++ if (this.hasFadeColour) ++ { ++ var1.hasFadeColour = true; ++ var1.fadeColourRed = this.fadeColourRed; ++ var1.fadeColourGreen = this.fadeColourGreen; ++ var1.fadeColourBlue = this.fadeColourBlue; ++ } ++ ++ var1.field_92048_ay = this.field_92048_ay; ++ this.field_92047_az.addEffect(var1); ++ } ++ } ++ ++ public int getBrightnessForRender(float par1) ++ { ++ return 15728880; ++ } ++ ++ /** ++ * Gets how bright this entity is. ++ */ ++ public float getBrightness(float par1) ++ { ++ return 1.0F; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityFireworkStarterFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,257 ---- ++ package net.minecraft.src; ++ ++ public class EntityFireworkStarterFX extends EntityFX ++ { ++ private int fireworkAge; ++ private final EffectRenderer theEffectRenderer; ++ private NBTTagList fireworkExplosions; ++ boolean twinkle; ++ ++ public EntityFireworkStarterFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, EffectRenderer par14EffectRenderer, NBTTagCompound par15NBTTagCompound) ++ { ++ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); ++ this.motionX = par8; ++ this.motionY = par10; ++ this.motionZ = par12; ++ this.theEffectRenderer = par14EffectRenderer; ++ this.particleMaxAge = 8; ++ ++ if (par15NBTTagCompound != null) ++ { ++ this.fireworkExplosions = par15NBTTagCompound.getTagList("Explosions"); ++ ++ if (this.fireworkExplosions.tagCount() == 0) ++ { ++ this.fireworkExplosions = null; ++ } ++ else ++ { ++ this.particleMaxAge = this.fireworkExplosions.tagCount() * 2 - 1; ++ ++ for (int var16 = 0; var16 < this.fireworkExplosions.tagCount(); ++var16) ++ { ++ NBTTagCompound var17 = (NBTTagCompound)this.fireworkExplosions.tagAt(var16); ++ ++ if (var17.getBoolean("Flicker")) ++ { ++ this.twinkle = true; ++ this.particleMaxAge += 15; ++ break; ++ } ++ } ++ } ++ } ++ } ++ ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {} ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ boolean var1; ++ ++ if (this.fireworkAge == 0 && this.fireworkExplosions != null) ++ { ++ var1 = this.func_92037_i(); ++ boolean var2 = false; ++ ++ if (this.fireworkExplosions.tagCount() >= 3) ++ { ++ var2 = true; ++ } ++ else ++ { ++ for (int var3 = 0; var3 < this.fireworkExplosions.tagCount(); ++var3) ++ { ++ NBTTagCompound var4 = (NBTTagCompound)this.fireworkExplosions.tagAt(var3); ++ ++ if (var4.getByte("Type") == 1) ++ { ++ var2 = true; ++ break; ++ } ++ } ++ } ++ ++ String var15 = "fireworks." + (var2 ? "largeBlast" : "blast") + (var1 ? "_far" : ""); ++ this.worldObj.playSound(this.posX, this.posY, this.posZ, var15, 20.0F, 0.95F + this.rand.nextFloat() * 0.1F, true); ++ } ++ ++ if (this.fireworkAge % 2 == 0 && this.fireworkExplosions != null && this.fireworkAge / 2 < this.fireworkExplosions.tagCount()) ++ { ++ int var13 = this.fireworkAge / 2; ++ NBTTagCompound var14 = (NBTTagCompound)this.fireworkExplosions.tagAt(var13); ++ byte var17 = var14.getByte("Type"); ++ boolean var18 = var14.getBoolean("Trail"); ++ boolean var5 = var14.getBoolean("Flicker"); ++ int[] var6 = var14.getIntArray("Colors"); ++ int[] var7 = var14.getIntArray("FadeColors"); ++ ++ if (var17 == 1) ++ { ++ this.createBall(0.5D, 4, var6, var7, var18, var5); ++ } ++ else if (var17 == 2) ++ { ++ this.createShaped(0.5D, new double[][] {{0.0D, 1.0D}, {0.3455D, 0.309D}, {0.9511D, 0.309D}, {0.3795918367346939D, -0.12653061224489795D}, {0.6122448979591837D, -0.8040816326530612D}, {0.0D, -0.35918367346938773D}}, var6, var7, var18, var5, false); ++ } ++ else if (var17 == 3) ++ { ++ this.createShaped(0.5D, new double[][] {{0.0D, 0.2D}, {0.2D, 0.2D}, {0.2D, 0.6D}, {0.6D, 0.6D}, {0.6D, 0.2D}, {0.2D, 0.2D}, {0.2D, 0.0D}, {0.4D, 0.0D}, {0.4D, -0.6D}, {0.2D, -0.6D}, {0.2D, -0.4D}, {0.0D, -0.4D}}, var6, var7, var18, var5, true); ++ } ++ else if (var17 == 4) ++ { ++ this.createBurst(var6, var7, var18, var5); ++ } ++ else ++ { ++ this.createBall(0.25D, 2, var6, var7, var18, var5); ++ } ++ ++ int var8 = var6[0]; ++ float var9 = (float)((var8 & 16711680) >> 16) / 255.0F; ++ float var10 = (float)((var8 & 65280) >> 8) / 255.0F; ++ float var11 = (float)((var8 & 255) >> 0) / 255.0F; ++ EntityFireworkOverlayFX var12 = new EntityFireworkOverlayFX(this.worldObj, this.posX, this.posY, this.posZ); ++ var12.setRBGColorF(var9, var10, var11); ++ this.theEffectRenderer.addEffect(var12); ++ } ++ ++ ++this.fireworkAge; ++ ++ if (this.fireworkAge > this.particleMaxAge) ++ { ++ if (this.twinkle) ++ { ++ var1 = this.func_92037_i(); ++ String var16 = "fireworks." + (var1 ? "twinkle_far" : "twinkle"); ++ this.worldObj.playSound(this.posX, this.posY, this.posZ, var16, 20.0F, 0.9F + this.rand.nextFloat() * 0.15F, true); ++ } ++ ++ this.setDead(); ++ } ++ } ++ ++ private boolean func_92037_i() ++ { ++ Minecraft var1 = Minecraft.getMinecraft(); ++ return var1 == null || var1.renderViewEntity == null || var1.renderViewEntity.getDistanceSq(this.posX, this.posY, this.posZ) >= 256.0D; ++ } ++ ++ /** ++ * Creates a single particle. Args: x, y, z, x velocity, y velocity, z velocity, colours, fade colours, whether to ++ * trail, whether to twinkle ++ */ ++ private void createParticle(double par1, double par3, double par5, double par7, double par9, double par11, int[] par13ArrayOfInteger, int[] par14ArrayOfInteger, boolean par15, boolean par16) ++ { ++ EntityFireworkSparkFX var17 = new EntityFireworkSparkFX(this.worldObj, par1, par3, par5, par7, par9, par11, this.theEffectRenderer); ++ var17.setTrail(par15); ++ var17.setTwinkle(par16); ++ int var18 = this.rand.nextInt(par13ArrayOfInteger.length); ++ var17.setColour(par13ArrayOfInteger[var18]); ++ ++ if (par14ArrayOfInteger != null && par14ArrayOfInteger.length > 0) ++ { ++ var17.setFadeColour(par14ArrayOfInteger[this.rand.nextInt(par14ArrayOfInteger.length)]); ++ } ++ ++ this.theEffectRenderer.addEffect(var17); ++ } ++ ++ /** ++ * Creates a small ball or large ball type explosion. Args: particle speed, size, colours, fade colours, whether to ++ * trail, whether to flicker ++ */ ++ private void createBall(double par1, int par3, int[] par4ArrayOfInteger, int[] par5ArrayOfInteger, boolean par6, boolean par7) ++ { ++ double var8 = this.posX; ++ double var10 = this.posY; ++ double var12 = this.posZ; ++ ++ for (int var14 = -par3; var14 <= par3; ++var14) ++ { ++ for (int var15 = -par3; var15 <= par3; ++var15) ++ { ++ for (int var16 = -par3; var16 <= par3; ++var16) ++ { ++ double var17 = (double)var15 + (this.rand.nextDouble() - this.rand.nextDouble()) * 0.5D; ++ double var19 = (double)var14 + (this.rand.nextDouble() - this.rand.nextDouble()) * 0.5D; ++ double var21 = (double)var16 + (this.rand.nextDouble() - this.rand.nextDouble()) * 0.5D; ++ double var23 = (double)MathHelper.sqrt_double(var17 * var17 + var19 * var19 + var21 * var21) / par1 + this.rand.nextGaussian() * 0.05D; ++ this.createParticle(var8, var10, var12, var17 / var23, var19 / var23, var21 / var23, par4ArrayOfInteger, par5ArrayOfInteger, par6, par7); ++ ++ if (var14 != -par3 && var14 != par3 && var15 != -par3 && var15 != par3) ++ { ++ var16 += par3 * 2 - 1; ++ } ++ } ++ } ++ } ++ } ++ ++ /** ++ * Creates a creeper-shaped or star-shaped explosion. Args: particle speed, shape, colours, fade colours, whether to ++ * trail, whether to flicker, unknown ++ */ ++ private void createShaped(double par1, double[][] par3ArrayOfDouble, int[] par4ArrayOfInteger, int[] par5ArrayOfInteger, boolean par6, boolean par7, boolean par8) ++ { ++ double var9 = par3ArrayOfDouble[0][0]; ++ double var11 = par3ArrayOfDouble[0][1]; ++ this.createParticle(this.posX, this.posY, this.posZ, var9 * par1, var11 * par1, 0.0D, par4ArrayOfInteger, par5ArrayOfInteger, par6, par7); ++ float var13 = this.rand.nextFloat() * (float)Math.PI; ++ double var14 = par8 ? 0.034D : 0.34D; ++ ++ for (int var16 = 0; var16 < 3; ++var16) ++ { ++ double var17 = (double)var13 + (double)((float)var16 * (float)Math.PI) * var14; ++ double var19 = var9; ++ double var21 = var11; ++ ++ for (int var23 = 1; var23 < par3ArrayOfDouble.length; ++var23) ++ { ++ double var24 = par3ArrayOfDouble[var23][0]; ++ double var26 = par3ArrayOfDouble[var23][1]; ++ ++ for (double var28 = 0.25D; var28 <= 1.0D; var28 += 0.25D) ++ { ++ double var30 = (var19 + (var24 - var19) * var28) * par1; ++ double var32 = (var21 + (var26 - var21) * var28) * par1; ++ double var34 = var30 * Math.sin(var17); ++ var30 *= Math.cos(var17); ++ ++ for (double var36 = -1.0D; var36 <= 1.0D; var36 += 2.0D) ++ { ++ this.createParticle(this.posX, this.posY, this.posZ, var30 * var36, var32, var34 * var36, par4ArrayOfInteger, par5ArrayOfInteger, par6, par7); ++ } ++ } ++ ++ var19 = var24; ++ var21 = var26; ++ } ++ } ++ } ++ ++ /** ++ * Creates a burst type explosion. Args: colours, fade colours, whether to trail, whether to flicker ++ */ ++ private void createBurst(int[] par1ArrayOfInteger, int[] par2ArrayOfInteger, boolean par3, boolean par4) ++ { ++ double var5 = this.rand.nextGaussian() * 0.05D; ++ double var7 = this.rand.nextGaussian() * 0.05D; ++ ++ for (int var9 = 0; var9 < 70; ++var9) ++ { ++ double var10 = this.motionX * 0.5D + this.rand.nextGaussian() * 0.15D + var5; ++ double var12 = this.motionZ * 0.5D + this.rand.nextGaussian() * 0.15D + var7; ++ double var14 = this.motionY * 0.5D + this.rand.nextDouble() * 0.5D; ++ this.createParticle(this.posX, this.posY, this.posZ, var10, var14, var12, par1ArrayOfInteger, par2ArrayOfInteger, par3, par4); ++ } ++ } ++ ++ public int getFXLayer() ++ { ++ return 0; ++ } ++ } +*** EntityFishHook.java Sat Feb 5 04:13:13 2022 +--- EntityFishHook.java Sat Feb 5 04:12:34 2022 +*************** +*** 3,48 **** + import java.util.List; + + public class EntityFishHook extends Entity + { + /** The tile this entity is on, X position */ +! private int xTile = -1; + + /** The tile this entity is on, Y position */ +! private int yTile = -1; + + /** The tile this entity is on, Z position */ +! private int zTile = -1; + private int inTile; + private boolean inGround; + public int shake; + public EntityPlayer angler; + private int ticksInGround; + private int ticksInAir; + + /** the number of ticks remaining until this fish can no longer be caught */ + private int ticksCatchable; + +! /** the bobber that the fish hit */ + public Entity bobber; + private int fishPosRotationIncrements; + private double fishX; + private double fishY; + private double fishZ; + private double fishYaw; + private double fishPitch; + + public EntityFishHook(World par1World) + { + super(par1World); + this.setSize(0.25F, 0.25F); + this.ignoreFrustumCheck = true; + } + + public EntityFishHook(World par1World, EntityPlayer par2EntityPlayer) + { + super(par1World); + this.ignoreFrustumCheck = true; + this.angler = par2EntityPlayer; + this.angler.fishEntity = this; + this.setSize(0.25F, 0.25F); + this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + 1.62D - (double)par2EntityPlayer.yOffset, par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch); +--- 3,69 ---- + import java.util.List; + + public class EntityFishHook extends Entity + { + /** The tile this entity is on, X position */ +! private int xTile; + + /** The tile this entity is on, Y position */ +! private int yTile; + + /** The tile this entity is on, Z position */ +! private int zTile; + private int inTile; + private boolean inGround; + public int shake; + public EntityPlayer angler; + private int ticksInGround; + private int ticksInAir; + + /** the number of ticks remaining until this fish can no longer be caught */ + private int ticksCatchable; + +! /** +! * The entity that the fishing rod is connected to, if any. When you right click on the fishing rod and the hook +! * falls on to an entity, this it that entity. +! */ + public Entity bobber; + private int fishPosRotationIncrements; + private double fishX; + private double fishY; + private double fishZ; + private double fishYaw; + private double fishPitch; ++ private double velocityX; ++ private double velocityY; ++ private double velocityZ; + + public EntityFishHook(World par1World) + { + super(par1World); ++ this.xTile = -1; ++ this.yTile = -1; ++ this.zTile = -1; + this.setSize(0.25F, 0.25F); + this.ignoreFrustumCheck = true; + } + ++ public EntityFishHook(World par1World, double par2, double par4, double par6, EntityPlayer par8EntityPlayer) ++ { ++ this(par1World); ++ this.setPosition(par2, par4, par6); ++ this.ignoreFrustumCheck = true; ++ this.angler = par8EntityPlayer; ++ par8EntityPlayer.fishEntity = this; ++ } ++ + public EntityFishHook(World par1World, EntityPlayer par2EntityPlayer) + { + super(par1World); ++ this.xTile = -1; ++ this.yTile = -1; ++ this.zTile = -1; + this.ignoreFrustumCheck = true; + this.angler = par2EntityPlayer; + this.angler.fishEntity = this; + this.setSize(0.25F, 0.25F); + this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + 1.62D - (double)par2EntityPlayer.yOffset, par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch); +*************** +*** 58,67 **** +--- 79,99 ---- + this.calculateVelocity(this.motionX, this.motionY, this.motionZ, 1.5F, 1.0F); + } + + protected void entityInit() {} + ++ /** ++ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge ++ * length * 64 * renderDistanceWeight Args: distance ++ */ ++ public boolean isInRangeToRenderDist(double par1) ++ { ++ double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; ++ var3 *= 64.0D; ++ return par1 < var3 * var3; ++ } ++ + public void calculateVelocity(double par1, double par3, double par5, float par7, float par8) + { + float var9 = MathHelper.sqrt_double(par1 * par1 + par3 * par3 + par5 * par5); + par1 /= (double)var9; + par3 /= (double)var9; +*************** +*** 80,89 **** +--- 112,148 ---- + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var10) * 180.0D / Math.PI); + this.ticksInGround = 0; + } + + /** ++ * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, ++ * posY, posZ, yaw, pitch ++ */ ++ public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) ++ { ++ this.fishX = par1; ++ this.fishY = par3; ++ this.fishZ = par5; ++ this.fishYaw = (double)par7; ++ this.fishPitch = (double)par8; ++ this.fishPosRotationIncrements = par9; ++ this.motionX = this.velocityX; ++ this.motionY = this.velocityY; ++ this.motionZ = this.velocityZ; ++ } ++ ++ /** ++ * Sets the velocity to the args. Args: x, y, z ++ */ ++ public void setVelocity(double par1, double par3, double par5) ++ { ++ this.velocityX = this.motionX = par1; ++ this.velocityY = this.motionY = par3; ++ this.velocityZ = this.motionZ = par5; ++ } ++ ++ /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); +*************** +*** 160,170 **** + ++this.ticksInAir; + } + + Vec3 var20 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); +! MovingObjectPosition var3 = this.worldObj.rayTraceBlocks(var20, var2); + var20 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (var3 != null) + { +--- 219,229 ---- + ++this.ticksInAir; + } + + Vec3 var20 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); +! MovingObjectPosition var3 = this.worldObj.clip(var20, var2); + var20 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (var3 != null) + { +*************** +*** 355,364 **** +--- 414,428 ---- + this.yTile = par1NBTTagCompound.getShort("yTile"); + this.zTile = par1NBTTagCompound.getShort("zTile"); + this.inTile = par1NBTTagCompound.getByte("inTile") & 255; + this.shake = par1NBTTagCompound.getByte("shake") & 255; + this.inGround = par1NBTTagCompound.getByte("inGround") == 1; ++ } ++ ++ public float getShadowSize() ++ { ++ return 0.0F; + } + + public int catchFish() + { + if (this.worldObj.isRemote) +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityFlameFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,104 ---- ++ package net.minecraft.src; ++ ++ public class EntityFlameFX extends EntityFX ++ { ++ /** the scale of the flame FX */ ++ private float flameScale; ++ ++ public EntityFlameFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) ++ { ++ super(par1World, par2, par4, par6, par8, par10, par12); ++ this.motionX = this.motionX * 0.009999999776482582D + par8; ++ this.motionY = this.motionY * 0.009999999776482582D + par10; ++ this.motionZ = this.motionZ * 0.009999999776482582D + par12; ++ double var10000 = par2 + (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.05F); ++ var10000 = par4 + (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.05F); ++ var10000 = par6 + (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.05F); ++ this.flameScale = this.particleScale; ++ this.particleRed = this.particleGreen = this.particleBlue = 1.0F; ++ this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)) + 4; ++ this.noClip = true; ++ this.setParticleTextureIndex(48); ++ } ++ ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge; ++ this.particleScale = this.flameScale * (1.0F - var8 * var8 * 0.5F); ++ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); ++ } ++ ++ public int getBrightnessForRender(float par1) ++ { ++ float var2 = ((float)this.particleAge + par1) / (float)this.particleMaxAge; ++ ++ if (var2 < 0.0F) ++ { ++ var2 = 0.0F; ++ } ++ ++ if (var2 > 1.0F) ++ { ++ var2 = 1.0F; ++ } ++ ++ int var3 = super.getBrightnessForRender(par1); ++ int var4 = var3 & 255; ++ int var5 = var3 >> 16 & 255; ++ var4 += (int)(var2 * 15.0F * 16.0F); ++ ++ if (var4 > 240) ++ { ++ var4 = 240; ++ } ++ ++ return var4 | var5 << 16; ++ } ++ ++ /** ++ * Gets how bright this entity is. ++ */ ++ public float getBrightness(float par1) ++ { ++ float var2 = ((float)this.particleAge + par1) / (float)this.particleMaxAge; ++ ++ if (var2 < 0.0F) ++ { ++ var2 = 0.0F; ++ } ++ ++ if (var2 > 1.0F) ++ { ++ var2 = 1.0F; ++ } ++ ++ float var3 = super.getBrightness(par1); ++ return var3 * var2 + (1.0F - var2); ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ this.prevPosX = this.posX; ++ this.prevPosY = this.posY; ++ this.prevPosZ = this.posZ; ++ ++ if (this.particleAge++ >= this.particleMaxAge) ++ { ++ this.setDead(); ++ } ++ ++ this.moveEntity(this.motionX, this.motionY, this.motionZ); ++ this.motionX *= 0.9599999785423279D; ++ this.motionY *= 0.9599999785423279D; ++ this.motionZ *= 0.9599999785423279D; ++ ++ if (this.onGround) ++ { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ } ++ } ++ } +*** EntityFlying.java Sat Feb 5 04:13:13 2022 +--- EntityFlying.java Sat Feb 5 04:12:34 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityFootStepFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,69 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class EntityFootStepFX extends EntityFX ++ { ++ private static final ResourceLocation field_110126_a = new ResourceLocation("textures/particle/footprint.png"); ++ private int footstepAge; ++ private int footstepMaxAge; ++ private TextureManager currentFootSteps; ++ ++ public EntityFootStepFX(TextureManager par1TextureManager, World par2World, double par3, double par5, double par7) ++ { ++ super(par2World, par3, par5, par7, 0.0D, 0.0D, 0.0D); ++ this.currentFootSteps = par1TextureManager; ++ this.motionX = this.motionY = this.motionZ = 0.0D; ++ this.footstepMaxAge = 200; ++ } ++ ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ float var8 = ((float)this.footstepAge + par2) / (float)this.footstepMaxAge; ++ var8 *= var8; ++ float var9 = 2.0F - var8 * 2.0F; ++ ++ if (var9 > 1.0F) ++ { ++ var9 = 1.0F; ++ } ++ ++ var9 *= 0.2F; ++ GL11.glDisable(GL11.GL_LIGHTING); ++ float var10 = 0.125F; ++ float var11 = (float)(this.posX - interpPosX); ++ float var12 = (float)(this.posY - interpPosY); ++ float var13 = (float)(this.posZ - interpPosZ); ++ float var14 = this.worldObj.getLightBrightness(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); ++ this.currentFootSteps.bindTexture(field_110126_a); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ par1Tessellator.startDrawingQuads(); ++ par1Tessellator.setColorRGBA_F(var14, var14, var14, var9); ++ par1Tessellator.addVertexWithUV((double)(var11 - var10), (double)var12, (double)(var13 + var10), 0.0D, 1.0D); ++ par1Tessellator.addVertexWithUV((double)(var11 + var10), (double)var12, (double)(var13 + var10), 1.0D, 1.0D); ++ par1Tessellator.addVertexWithUV((double)(var11 + var10), (double)var12, (double)(var13 - var10), 1.0D, 0.0D); ++ par1Tessellator.addVertexWithUV((double)(var11 - var10), (double)var12, (double)(var13 - var10), 0.0D, 0.0D); ++ par1Tessellator.draw(); ++ GL11.glDisable(GL11.GL_BLEND); ++ GL11.glEnable(GL11.GL_LIGHTING); ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ ++this.footstepAge; ++ ++ if (this.footstepAge == this.footstepMaxAge) ++ { ++ this.setDead(); ++ } ++ } ++ ++ public int getFXLayer() ++ { ++ return 3; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,242 ---- ++ package net.minecraft.src; ++ ++ public class EntityFX extends Entity ++ { ++ protected int particleTextureIndexX; ++ protected int particleTextureIndexY; ++ protected float particleTextureJitterX; ++ protected float particleTextureJitterY; ++ protected int particleAge; ++ protected int particleMaxAge; ++ protected float particleScale; ++ protected float particleGravity; ++ ++ /** The red amount of color. Used as a percentage, 1.0 = 255 and 0.0 = 0. */ ++ protected float particleRed; ++ ++ /** ++ * The green amount of color. Used as a percentage, 1.0 = 255 and 0.0 = 0. ++ */ ++ protected float particleGreen; ++ ++ /** ++ * The blue amount of color. Used as a percentage, 1.0 = 255 and 0.0 = 0. ++ */ ++ protected float particleBlue; ++ ++ /** Particle alpha */ ++ protected float particleAlpha; ++ ++ /** The icon field from which the given particle pulls its texture. */ ++ protected Icon particleIcon; ++ public static double interpPosX; ++ public static double interpPosY; ++ public static double interpPosZ; ++ ++ protected EntityFX(World par1World, double par2, double par4, double par6) ++ { ++ super(par1World); ++ this.particleAlpha = 1.0F; ++ this.setSize(0.2F, 0.2F); ++ this.yOffset = this.height / 2.0F; ++ this.setPosition(par2, par4, par6); ++ this.lastTickPosX = par2; ++ this.lastTickPosY = par4; ++ this.lastTickPosZ = par6; ++ this.particleRed = this.particleGreen = this.particleBlue = 1.0F; ++ this.particleTextureJitterX = this.rand.nextFloat() * 3.0F; ++ this.particleTextureJitterY = this.rand.nextFloat() * 3.0F; ++ this.particleScale = (this.rand.nextFloat() * 0.5F + 0.5F) * 2.0F; ++ this.particleMaxAge = (int)(4.0F / (this.rand.nextFloat() * 0.9F + 0.1F)); ++ this.particleAge = 0; ++ } ++ ++ public EntityFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) ++ { ++ this(par1World, par2, par4, par6); ++ this.motionX = par8 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.4F); ++ this.motionY = par10 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.4F); ++ this.motionZ = par12 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.4F); ++ float var14 = (float)(Math.random() + Math.random() + 1.0D) * 0.15F; ++ float var15 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); ++ this.motionX = this.motionX / (double)var15 * (double)var14 * 0.4000000059604645D; ++ this.motionY = this.motionY / (double)var15 * (double)var14 * 0.4000000059604645D + 0.10000000149011612D; ++ this.motionZ = this.motionZ / (double)var15 * (double)var14 * 0.4000000059604645D; ++ } ++ ++ public EntityFX multiplyVelocity(float par1) ++ { ++ this.motionX *= (double)par1; ++ this.motionY = (this.motionY - 0.10000000149011612D) * (double)par1 + 0.10000000149011612D; ++ this.motionZ *= (double)par1; ++ return this; ++ } ++ ++ public EntityFX multipleParticleScaleBy(float par1) ++ { ++ this.setSize(0.2F * par1, 0.2F * par1); ++ this.particleScale *= par1; ++ return this; ++ } ++ ++ public void setRBGColorF(float par1, float par2, float par3) ++ { ++ this.particleRed = par1; ++ this.particleGreen = par2; ++ this.particleBlue = par3; ++ } ++ ++ /** ++ * Sets the particle alpha (float) ++ */ ++ public void setAlphaF(float par1) ++ { ++ this.particleAlpha = par1; ++ } ++ ++ public float getRedColorF() ++ { ++ return this.particleRed; ++ } ++ ++ public float getGreenColorF() ++ { ++ return this.particleGreen; ++ } ++ ++ public float getBlueColorF() ++ { ++ return this.particleBlue; ++ } ++ ++ /** ++ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to ++ * prevent them from trampling crops ++ */ ++ protected boolean canTriggerWalking() ++ { ++ return false; ++ } ++ ++ protected void entityInit() {} ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ this.prevPosX = this.posX; ++ this.prevPosY = this.posY; ++ this.prevPosZ = this.posZ; ++ ++ if (this.particleAge++ >= this.particleMaxAge) ++ { ++ this.setDead(); ++ } ++ ++ this.motionY -= 0.04D * (double)this.particleGravity; ++ this.moveEntity(this.motionX, this.motionY, this.motionZ); ++ this.motionX *= 0.9800000190734863D; ++ this.motionY *= 0.9800000190734863D; ++ this.motionZ *= 0.9800000190734863D; ++ ++ if (this.onGround) ++ { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ } ++ } ++ ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ float var8 = (float)this.particleTextureIndexX / 16.0F; ++ float var9 = var8 + 0.0624375F; ++ float var10 = (float)this.particleTextureIndexY / 16.0F; ++ float var11 = var10 + 0.0624375F; ++ float var12 = 0.1F * this.particleScale; ++ ++ if (this.particleIcon != null) ++ { ++ var8 = this.particleIcon.getMinU(); ++ var9 = this.particleIcon.getMaxU(); ++ var10 = this.particleIcon.getMinV(); ++ var11 = this.particleIcon.getMaxV(); ++ } ++ ++ float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX); ++ float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY); ++ float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ); ++ float var16 = 1.0F; ++ par1Tessellator.setColorRGBA_F(this.particleRed * var16, this.particleGreen * var16, this.particleBlue * var16, this.particleAlpha); ++ par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 - par5 * var12 - par7 * var12), (double)var9, (double)var11); ++ par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 - par5 * var12 + par7 * var12), (double)var9, (double)var10); ++ par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 + par5 * var12 + par7 * var12), (double)var8, (double)var10); ++ par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 + par5 * var12 - par7 * var12), (double)var8, (double)var11); ++ } ++ ++ public int getFXLayer() ++ { ++ return 0; ++ } ++ ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {} ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {} ++ ++ public void setParticleIcon(Icon par1Icon) ++ { ++ if (this.getFXLayer() == 1) ++ { ++ this.particleIcon = par1Icon; ++ } ++ else ++ { ++ if (this.getFXLayer() != 2) ++ { ++ throw new RuntimeException("Invalid call to Particle.setTex, use coordinate methods"); ++ } ++ ++ this.particleIcon = par1Icon; ++ } ++ } ++ ++ /** ++ * Public method to set private field particleTextureIndex. ++ */ ++ public void setParticleTextureIndex(int par1) ++ { ++ if (this.getFXLayer() != 0) ++ { ++ throw new RuntimeException("Invalid call to Particle.setMiscTex"); ++ } ++ else ++ { ++ this.particleTextureIndexX = par1 % 16; ++ this.particleTextureIndexY = par1 / 16; ++ } ++ } ++ ++ public void nextTextureIndexX() ++ { ++ ++this.particleTextureIndexX; ++ } ++ ++ /** ++ * If returns false, the item will not inflict any damage against entities. ++ */ ++ public boolean canAttackWithItem() ++ { ++ return false; ++ } ++ ++ public String toString() ++ { ++ return this.getClass().getSimpleName() + ", Pos (" + this.posX + "," + this.posY + "," + this.posZ + "), RGBA (" + this.particleRed + "," + this.particleGreen + "," + this.particleBlue + "," + this.particleAlpha + "), Age " + this.particleAge; ++ } ++ } +*** EntityGhast.java Sat Feb 5 04:13:13 2022 +--- EntityGhast.java Sat Feb 5 04:12:34 2022 +*************** +*** 22,31 **** +--- 22,36 ---- + this.setSize(4.0F, 4.0F); + this.isImmuneToFire = true; + this.experienceValue = 5; + } + ++ public boolean func_110182_bF() ++ { ++ return this.dataWatcher.getWatchableObjectByte(16) != 0; ++ } ++ + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) + { +*************** +*** 225,235 **** + { + return Item.gunpowder.itemID; + } + + /** +! * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.rand.nextInt(2) + this.rand.nextInt(1 + par2); + int var4; +--- 230,241 ---- + { + return Item.gunpowder.itemID; + } + + /** +! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param +! * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.rand.nextInt(2) + this.rand.nextInt(1 + par2); + int var4; +*** EntityGiantZombie.java Sat Feb 5 04:13:13 2022 +--- EntityGiantZombie.java Sat Feb 5 04:12:34 2022 +*** EntityGolem.java Sat Feb 5 04:13:13 2022 +--- EntityGolem.java Sat Feb 5 04:12:34 2022 +*** EntityHanging.java Sat Feb 5 04:13:13 2022 +--- EntityHanging.java Sat Feb 5 04:12:34 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityHeartFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,77 ---- ++ package net.minecraft.src; ++ ++ public class EntityHeartFX extends EntityFX ++ { ++ float particleScaleOverTime; ++ ++ public EntityHeartFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) ++ { ++ this(par1World, par2, par4, par6, par8, par10, par12, 2.0F); ++ } ++ ++ public EntityHeartFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, float par14) ++ { ++ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); ++ this.motionX *= 0.009999999776482582D; ++ this.motionY *= 0.009999999776482582D; ++ this.motionZ *= 0.009999999776482582D; ++ this.motionY += 0.1D; ++ this.particleScale *= 0.75F; ++ this.particleScale *= par14; ++ this.particleScaleOverTime = this.particleScale; ++ this.particleMaxAge = 16; ++ this.noClip = false; ++ this.setParticleTextureIndex(80); ++ } ++ ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F; ++ ++ if (var8 < 0.0F) ++ { ++ var8 = 0.0F; ++ } ++ ++ if (var8 > 1.0F) ++ { ++ var8 = 1.0F; ++ } ++ ++ this.particleScale = this.particleScaleOverTime * var8; ++ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ this.prevPosX = this.posX; ++ this.prevPosY = this.posY; ++ this.prevPosZ = this.posZ; ++ ++ if (this.particleAge++ >= this.particleMaxAge) ++ { ++ this.setDead(); ++ } ++ ++ this.moveEntity(this.motionX, this.motionY, this.motionZ); ++ ++ if (this.posY == this.prevPosY) ++ { ++ this.motionX *= 1.1D; ++ this.motionZ *= 1.1D; ++ } ++ ++ this.motionX *= 0.8600000143051147D; ++ this.motionY *= 0.8600000143051147D; ++ this.motionZ *= 0.8600000143051147D; ++ ++ if (this.onGround) ++ { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ } ++ } ++ } +*** EntityHorse.java Sat Feb 5 04:13:13 2022 +--- EntityHorse.java Sat Feb 5 04:12:34 2022 +*************** +*** 630,644 **** +--- 630,699 ---- + public int getTalkInterval() + { + return 400; + } + ++ public boolean func_110239_cn() ++ { ++ return this.getHorseType() == 0 || this.func_110241_cb() > 0; ++ } ++ + private void func_110230_cF() + { + this.field_110286_bQ = null; + } + ++ private void setHorseTexturePaths() ++ { ++ this.field_110286_bQ = "horse/"; ++ this.field_110280_bR[0] = null; ++ this.field_110280_bR[1] = null; ++ this.field_110280_bR[2] = null; ++ int var1 = this.getHorseType(); ++ int var2 = this.getHorseVariant(); ++ int var3; ++ ++ if (var1 == 0) ++ { ++ var3 = var2 & 255; ++ int var4 = (var2 & 65280) >> 8; ++ this.field_110280_bR[0] = horseTextures[var3]; ++ this.field_110286_bQ = this.field_110286_bQ + field_110269_bA[var3]; ++ this.field_110280_bR[1] = horseMarkingTextures[var4]; ++ this.field_110286_bQ = this.field_110286_bQ + field_110292_bC[var4]; ++ } ++ else ++ { ++ this.field_110280_bR[0] = ""; ++ this.field_110286_bQ = this.field_110286_bQ + "_" + var1 + "_"; ++ } ++ ++ var3 = this.func_110241_cb(); ++ this.field_110280_bR[2] = horseArmorTextures[var3]; ++ this.field_110286_bQ = this.field_110286_bQ + field_110273_bx[var3]; ++ } ++ ++ public String getHorseTexture() ++ { ++ if (this.field_110286_bQ == null) ++ { ++ this.setHorseTexturePaths(); ++ } ++ ++ return this.field_110286_bQ; ++ } ++ ++ public String[] getVariantTexturePaths() ++ { ++ if (this.field_110286_bQ == null) ++ { ++ this.setHorseTexturePaths(); ++ } ++ ++ return this.field_110280_bR; ++ } ++ + public void openGUI(EntityPlayer par1EntityPlayer) + { + if (!this.worldObj.isRemote && (this.riddenByEntity == null || this.riddenByEntity == par1EntityPlayer) && this.isTame()) + { + this.horseChest.func_110133_a(this.getEntityName()); +*************** +*** 964,974 **** + */ + public void onUpdate() + { + super.onUpdate(); + +! if (this.worldObj.isRemote && this.dataWatcher.hasObjectChanged()) + { + this.dataWatcher.func_111144_e(); + this.func_110230_cF(); + } + +--- 1019,1029 ---- + */ + public void onUpdate() + { + super.onUpdate(); + +! if (this.worldObj.isRemote && this.dataWatcher.hasChanges()) + { + this.dataWatcher.func_111144_e(); + this.func_110230_cF(); + } + +*************** +*** 1514,1523 **** +--- 1569,1593 ---- + + this.setHealth(this.getMaxHealth()); + return (EntityLivingData)par1EntityLivingData1; + } + ++ public float getGrassEatingAmount(float par1) ++ { ++ return this.prevHeadLean + (this.headLean - this.prevHeadLean) * par1; ++ } ++ ++ public float getRearingAmount(float par1) ++ { ++ return this.prevRearingAmount + (this.rearingAmount - this.prevRearingAmount) * par1; ++ } ++ ++ public float func_110201_q(float par1) ++ { ++ return this.prevMouthOpenness + (this.mouthOpenness - this.prevMouthOpenness) * par1; ++ } ++ + /** + * Returns true if the newer Entity AI code should be run + */ + protected boolean isAIEnabled() + { +*************** +*** 1544,1553 **** +--- 1614,1655 ---- + } + else + { + this.jumpPower = 0.4F + 0.4F * (float)par1 / 90.0F; + } ++ } ++ } ++ ++ /** ++ * "Spawns particles for the horse entity. par1 tells whether to spawn hearts. If it is false, it spawns smoke." ++ */ ++ protected void spawnHorseParticles(boolean par1) ++ { ++ String var2 = par1 ? "heart" : "smoke"; ++ ++ for (int var3 = 0; var3 < 7; ++var3) ++ { ++ double var4 = this.rand.nextGaussian() * 0.02D; ++ double var6 = this.rand.nextGaussian() * 0.02D; ++ double var8 = this.rand.nextGaussian() * 0.02D; ++ this.worldObj.spawnParticle(var2, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var4, var6, var8); ++ } ++ } ++ ++ public void handleHealthUpdate(byte par1) ++ { ++ if (par1 == 7) ++ { ++ this.spawnHorseParticles(true); ++ } ++ else if (par1 == 6) ++ { ++ this.spawnHorseParticles(false); ++ } ++ else ++ { ++ super.handleHealthUpdate(par1); + } + } + + public void updateRiderPosition() + { +*** EntityHorseBredSelector.java Sat Feb 5 04:13:13 2022 +--- EntityHorseBredSelector.java Sat Feb 5 04:12:34 2022 +*** EntityHorseGroupData.java Sat Feb 5 04:13:13 2022 +--- EntityHorseGroupData.java Sat Feb 5 04:12:34 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityHugeExplodeFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,42 ---- ++ package net.minecraft.src; ++ ++ public class EntityHugeExplodeFX extends EntityFX ++ { ++ private int timeSinceStart; ++ ++ /** the maximum time for the explosion */ ++ private int maximumTime = 8; ++ ++ public EntityHugeExplodeFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) ++ { ++ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); ++ } ++ ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {} ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ for (int var1 = 0; var1 < 6; ++var1) ++ { ++ double var2 = this.posX + (this.rand.nextDouble() - this.rand.nextDouble()) * 4.0D; ++ double var4 = this.posY + (this.rand.nextDouble() - this.rand.nextDouble()) * 4.0D; ++ double var6 = this.posZ + (this.rand.nextDouble() - this.rand.nextDouble()) * 4.0D; ++ this.worldObj.spawnParticle("largeexplode", var2, var4, var6, (double)((float)this.timeSinceStart / (float)this.maximumTime), 0.0D, 0.0D); ++ } ++ ++ ++this.timeSinceStart; ++ ++ if (this.timeSinceStart == this.maximumTime) ++ { ++ this.setDead(); ++ } ++ } ++ ++ public int getFXLayer() ++ { ++ return 1; ++ } ++ } +*** EntityIronGolem.java Sat Feb 5 04:13:13 2022 +--- EntityIronGolem.java Sat Feb 5 04:12:34 2022 +*************** +*** 160,174 **** +--- 160,196 ---- + + this.playSound("mob.irongolem.throw", 1.0F, 1.0F); + return var2; + } + ++ public void handleHealthUpdate(byte par1) ++ { ++ if (par1 == 4) ++ { ++ this.attackTimer = 10; ++ this.playSound("mob.irongolem.throw", 1.0F, 1.0F); ++ } ++ else if (par1 == 11) ++ { ++ this.holdRoseTick = 400; ++ } ++ else ++ { ++ super.handleHealthUpdate(par1); ++ } ++ } ++ + public Village getVillage() + { + return this.villageObj; + } + ++ public int getAttackTimer() ++ { ++ return this.attackTimer; ++ } ++ + public void setHoldingRose(boolean par1) + { + this.holdRoseTick = par1 ? 400 : 0; + this.worldObj.setEntityState(this, (byte)11); + } +*************** +*** 204,214 **** + { + this.playSound("mob.irongolem.walk", 1.0F, 1.0F); + } + + /** +! * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.rand.nextInt(3); + int var4; +--- 226,237 ---- + { + this.playSound("mob.irongolem.walk", 1.0F, 1.0F); + } + + /** +! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param +! * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.rand.nextInt(3); + int var4; +*** EntityItem.java Sat Feb 5 04:13:13 2022 +--- EntityItem.java Sat Feb 5 04:12:34 2022 +*** EntityItemFrame.java Sat Feb 5 04:13:13 2022 +--- EntityItemFrame.java Sat Feb 5 04:12:34 2022 +*************** +*** 31,40 **** +--- 31,51 ---- + { + return 9; + } + + /** ++ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge ++ * length * 64 * renderDistanceWeight Args: distance ++ */ ++ public boolean isInRangeToRenderDist(double par1) ++ { ++ double var3 = 16.0D; ++ var3 *= 64.0D * this.renderDistanceWeight; ++ return par1 < var3 * var3; ++ } ++ ++ /** + * Called when this entity is broken. Entity parameter may be null. + */ + public void onBroken(Entity par1Entity) + { + ItemStack var2 = this.getDisplayedItem(); +*** EntityJumpHelper.java Sat Feb 5 04:13:13 2022 +--- EntityJumpHelper.java Sat Feb 5 04:12:34 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityLargeExplodeFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,81 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class EntityLargeExplodeFX extends EntityFX ++ { ++ private static final ResourceLocation field_110127_a = new ResourceLocation("textures/entity/explosion.png"); ++ private int field_70581_a; ++ private int field_70584_aq; ++ ++ /** The Rendering Engine. */ ++ private TextureManager theRenderEngine; ++ private float field_70582_as; ++ ++ public EntityLargeExplodeFX(TextureManager par1TextureManager, World par2World, double par3, double par5, double par7, double par9, double par11, double par13) ++ { ++ super(par2World, par3, par5, par7, 0.0D, 0.0D, 0.0D); ++ this.theRenderEngine = par1TextureManager; ++ this.field_70584_aq = 6 + this.rand.nextInt(4); ++ this.particleRed = this.particleGreen = this.particleBlue = this.rand.nextFloat() * 0.6F + 0.4F; ++ this.field_70582_as = 1.0F - (float)par9 * 0.5F; ++ } ++ ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ int var8 = (int)(((float)this.field_70581_a + par2) * 15.0F / (float)this.field_70584_aq); ++ ++ if (var8 <= 15) ++ { ++ this.theRenderEngine.bindTexture(field_110127_a); ++ float var9 = (float)(var8 % 4) / 4.0F; ++ float var10 = var9 + 0.24975F; ++ float var11 = (float)(var8 / 4) / 4.0F; ++ float var12 = var11 + 0.24975F; ++ float var13 = 2.0F * this.field_70582_as; ++ float var14 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX); ++ float var15 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY); ++ float var16 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ RenderHelper.disableStandardItemLighting(); ++ par1Tessellator.startDrawingQuads(); ++ par1Tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, 1.0F); ++ par1Tessellator.setNormal(0.0F, 1.0F, 0.0F); ++ par1Tessellator.setBrightness(240); ++ par1Tessellator.addVertexWithUV((double)(var14 - par3 * var13 - par6 * var13), (double)(var15 - par4 * var13), (double)(var16 - par5 * var13 - par7 * var13), (double)var10, (double)var12); ++ par1Tessellator.addVertexWithUV((double)(var14 - par3 * var13 + par6 * var13), (double)(var15 + par4 * var13), (double)(var16 - par5 * var13 + par7 * var13), (double)var10, (double)var11); ++ par1Tessellator.addVertexWithUV((double)(var14 + par3 * var13 + par6 * var13), (double)(var15 + par4 * var13), (double)(var16 + par5 * var13 + par7 * var13), (double)var9, (double)var11); ++ par1Tessellator.addVertexWithUV((double)(var14 + par3 * var13 - par6 * var13), (double)(var15 - par4 * var13), (double)(var16 + par5 * var13 - par7 * var13), (double)var9, (double)var12); ++ par1Tessellator.draw(); ++ GL11.glPolygonOffset(0.0F, 0.0F); ++ GL11.glEnable(GL11.GL_LIGHTING); ++ } ++ } ++ ++ public int getBrightnessForRender(float par1) ++ { ++ return 61680; ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ this.prevPosX = this.posX; ++ this.prevPosY = this.posY; ++ this.prevPosZ = this.posZ; ++ ++this.field_70581_a; ++ ++ if (this.field_70581_a == this.field_70584_aq) ++ { ++ this.setDead(); ++ } ++ } ++ ++ public int getFXLayer() ++ { ++ return 3; ++ } ++ } +*** EntityLargeFireball.java Sat Feb 5 04:13:13 2022 +--- EntityLargeFireball.java Sat Feb 5 04:12:34 2022 +*************** +*** 7,16 **** +--- 7,21 ---- + public EntityLargeFireball(World par1World) + { + super(par1World); + } + ++ public EntityLargeFireball(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) ++ { ++ super(par1World, par2, par4, par6, par8, par10, par12); ++ } ++ + public EntityLargeFireball(World par1World, EntityLivingBase par2EntityLivingBase, double par3, double par5, double par7) + { + super(par1World, par2EntityLivingBase, par3, par5, par7); + } + +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityLavaFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,90 ---- ++ package net.minecraft.src; ++ ++ public class EntityLavaFX extends EntityFX ++ { ++ private float lavaParticleScale; ++ ++ public EntityLavaFX(World par1World, double par2, double par4, double par6) ++ { ++ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); ++ this.motionX *= 0.800000011920929D; ++ this.motionY *= 0.800000011920929D; ++ this.motionZ *= 0.800000011920929D; ++ this.motionY = (double)(this.rand.nextFloat() * 0.4F + 0.05F); ++ this.particleRed = this.particleGreen = this.particleBlue = 1.0F; ++ this.particleScale *= this.rand.nextFloat() * 2.0F + 0.2F; ++ this.lavaParticleScale = this.particleScale; ++ this.particleMaxAge = (int)(16.0D / (Math.random() * 0.8D + 0.2D)); ++ this.noClip = false; ++ this.setParticleTextureIndex(49); ++ } ++ ++ public int getBrightnessForRender(float par1) ++ { ++ float var2 = ((float)this.particleAge + par1) / (float)this.particleMaxAge; ++ ++ if (var2 < 0.0F) ++ { ++ var2 = 0.0F; ++ } ++ ++ if (var2 > 1.0F) ++ { ++ var2 = 1.0F; ++ } ++ ++ int var3 = super.getBrightnessForRender(par1); ++ short var4 = 240; ++ int var5 = var3 >> 16 & 255; ++ return var4 | var5 << 16; ++ } ++ ++ /** ++ * Gets how bright this entity is. ++ */ ++ public float getBrightness(float par1) ++ { ++ return 1.0F; ++ } ++ ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge; ++ this.particleScale = this.lavaParticleScale * (1.0F - var8 * var8); ++ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ this.prevPosX = this.posX; ++ this.prevPosY = this.posY; ++ this.prevPosZ = this.posZ; ++ ++ if (this.particleAge++ >= this.particleMaxAge) ++ { ++ this.setDead(); ++ } ++ ++ float var1 = (float)this.particleAge / (float)this.particleMaxAge; ++ ++ if (this.rand.nextFloat() > var1) ++ { ++ this.worldObj.spawnParticle("smoke", this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ); ++ } ++ ++ this.motionY -= 0.03D; ++ this.moveEntity(this.motionX, this.motionY, this.motionZ); ++ this.motionX *= 0.9990000128746033D; ++ this.motionY *= 0.9990000128746033D; ++ this.motionZ *= 0.9990000128746033D; ++ ++ if (this.onGround) ++ { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ } ++ } ++ } +*** EntityLeashKnot.java Sat Feb 5 04:13:13 2022 +--- EntityLeashKnot.java Sat Feb 5 04:12:34 2022 +*************** +*** 32,41 **** +--- 32,50 ---- + { + return 9; + } + + /** ++ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge ++ * length * 64 * renderDistanceWeight Args: distance ++ */ ++ public boolean isInRangeToRenderDist(double par1) ++ { ++ return par1 < 1024.0D; ++ } ++ ++ /** + * Called when this entity is broken. Entity parameter may be null. + */ + public void onBroken(Entity par1Entity) {} + + /** +*** EntityLightningBolt.java Sat Feb 5 04:13:13 2022 +--- EntityLightningBolt.java Sat Feb 5 04:12:34 2022 +*************** +*** 122,127 **** +--- 122,135 ---- + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {} ++ ++ /** ++ * Checks using a Vec3d to determine if this entity is within range of that vector to be rendered. Args: vec3D ++ */ ++ public boolean isInRangeToRenderVec3D(Vec3 par1Vec3) ++ { ++ return this.lightningState >= 0; ++ } + } +*** EntityList.java Sat Feb 5 04:13:13 2022 +--- EntityList.java Sat Feb 5 04:12:34 2022 +*** EntityLiving.java Sat Feb 5 04:13:13 2022 +--- EntityLiving.java Sat Feb 5 04:12:34 2022 +*************** +*** 180,190 **** + protected int getExperiencePoints(EntityPlayer par1EntityPlayer) + { + if (this.experienceValue > 0) + { + int var2 = this.experienceValue; +! ItemStack[] var3 = this.getInventory(); + + for (int var4 = 0; var4 < var3.length; ++var4) + { + if (var3[var4] != null && this.equipmentDropChances[var4] <= 1.0F) + { +--- 180,190 ---- + protected int getExperiencePoints(EntityPlayer par1EntityPlayer) + { + if (this.experienceValue > 0) + { + int var2 = this.experienceValue; +! ItemStack[] var3 = this.getLastActiveItems(); + + for (int var4 = 0; var4 < var3.length; ++var4) + { + if (var3[var4] != null && this.equipmentDropChances[var4] <= 1.0F) + { +*************** +*** 256,266 **** + { + return 0; + } + + /** +! * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.getDropItemId(); + +--- 256,267 ---- + { + return 0; + } + + /** +! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param +! * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.getDropItemId(); + +*************** +*** 421,431 **** + int var5 = getArmorPosition(var4); + + if (var5 > -1) + { + boolean var6 = true; +! ItemStack var7 = this.getEquipmentInSlot(var5); + + if (var7 != null) + { + if (var5 == 0) + { +--- 422,432 ---- + int var5 = getArmorPosition(var4); + + if (var5 > -1) + { + boolean var6 = true; +! ItemStack var7 = this.getCurrentItemOrArmor(var5); + + if (var7 != null) + { + if (var5 == 0) + { +*************** +*** 696,705 **** +--- 697,714 ---- + { + return this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox); + } + + /** ++ * Returns render size modifier ++ */ ++ public float getRenderSizeModifier() ++ { ++ return 1.0F; ++ } ++ ++ /** + * Will return how many at most can spawn in a chunk at once. + */ + public int getMaxSpawnedInChunk() + { + return 4; +*************** +*** 735,747 **** + { + return this.equipment[0]; + } + + /** +! * 0: Tool in Hand; 1-4: Armor + */ +! public ItemStack getEquipmentInSlot(int par1) + { + return this.equipment[par1]; + } + + public ItemStack func_130225_q(int par1) +--- 744,756 ---- + { + return this.equipment[0]; + } + + /** +! * 0 = item, 1-n is armor + */ +! public ItemStack getCurrentItemOrArmor(int par1) + { + return this.equipment[par1]; + } + + public ItemStack func_130225_q(int par1) +*************** +*** 755,780 **** + public void setCurrentItemOrArmor(int par1, ItemStack par2ItemStack) + { + this.equipment[par1] = par2ItemStack; + } + +! /** +! * returns the inventory of this entity (only used in EntityPlayerMP it seems) +! */ +! public ItemStack[] getInventory() + { + return this.equipment; + } + + /** + * Drop the equipment for this entity. + */ + protected void dropEquipment(boolean par1, int par2) + { +! for (int var3 = 0; var3 < this.getInventory().length; ++var3) + { +! ItemStack var4 = this.getEquipmentInSlot(var3); + boolean var5 = this.equipmentDropChances[var3] > 1.0F; + + if (var4 != null && (par1 || var5) && this.rand.nextFloat() - (float)par2 * 0.01F < this.equipmentDropChances[var3]) + { + if (!var5 && var4.isItemStackDamageable()) +--- 764,786 ---- + public void setCurrentItemOrArmor(int par1, ItemStack par2ItemStack) + { + this.equipment[par1] = par2ItemStack; + } + +! public ItemStack[] getLastActiveItems() + { + return this.equipment; + } + + /** + * Drop the equipment for this entity. + */ + protected void dropEquipment(boolean par1, int par2) + { +! for (int var3 = 0; var3 < this.getLastActiveItems().length; ++var3) + { +! ItemStack var4 = this.getCurrentItemOrArmor(var3); + boolean var5 = this.equipmentDropChances[var3] > 1.0F; + + if (var4 != null && (par1 || var5) && this.rand.nextFloat() - (float)par2 * 0.01F < this.equipmentDropChances[var3]) + { + if (!var5 && var4.isItemStackDamageable()) +*************** +*** 1051,1060 **** +--- 1057,1071 ---- + public boolean getAlwaysRenderNameTag() + { + return this.dataWatcher.getWatchableObjectByte(11) == 1; + } + ++ public boolean getAlwaysRenderNameTagForRender() ++ { ++ return this.getAlwaysRenderNameTag(); ++ } ++ + public void setEquipmentDropChance(int par1, float par2) + { + this.equipmentDropChances[par1] = par2; + } + +*************** +*** 1147,1157 **** + this.dropItem(Item.leash.itemID, 1); + } + + if (!this.worldObj.isRemote && par1 && this.worldObj instanceof WorldServer) + { +! ((WorldServer)this.worldObj).getEntityTracker().sendPacketToTrackedPlayers(this, new Packet39AttachEntity(1, this, (Entity)null)); + } + } + } + + public boolean allowLeashing() +--- 1158,1168 ---- + this.dropItem(Item.leash.itemID, 1); + } + + if (!this.worldObj.isRemote && par1 && this.worldObj instanceof WorldServer) + { +! ((WorldServer)this.worldObj).getEntityTracker().sendPacketToAllPlayersTrackingEntity(this, new Packet39AttachEntity(1, this, (Entity)null)); + } + } + } + + public boolean allowLeashing() +*************** +*** 1178,1188 **** + this.isLeashed = true; + this.leashedToEntity = par1Entity; + + if (!this.worldObj.isRemote && par2 && this.worldObj instanceof WorldServer) + { +! ((WorldServer)this.worldObj).getEntityTracker().sendPacketToTrackedPlayers(this, new Packet39AttachEntity(1, this, this.leashedToEntity)); + } + } + + private void recreateLeash() + { +--- 1189,1199 ---- + this.isLeashed = true; + this.leashedToEntity = par1Entity; + + if (!this.worldObj.isRemote && par2 && this.worldObj instanceof WorldServer) + { +! ((WorldServer)this.worldObj).getEntityTracker().sendPacketToAllPlayersTrackingEntity(this, new Packet39AttachEntity(1, this, this.leashedToEntity)); + } + } + + private void recreateLeash() + { +*** EntityLivingBase.java Sat Feb 5 04:13:13 2022 +--- EntityLivingBase.java Sat Feb 5 04:12:34 2022 +*************** +*** 81,91 **** + /** + * This gets set on entity death, but never used. Looks like a duplicate of isDead + */ + protected boolean dead; + +! /** The age of this EntityLiving (used to determine when it dies) */ + protected int entityAge; + protected float field_70768_au; + protected float field_110154_aX; + protected float field_70764_aw; + protected float field_70763_ax; +--- 81,91 ---- + /** + * This gets set on entity death, but never used. Looks like a duplicate of isDead + */ + protected boolean dead; + +! /** Holds the living entity age, used to control the despawn. */ + protected int entityAge; + protected float field_70768_au; + protected float field_110154_aX; + protected float field_70764_aw; + protected float field_70763_ax; +*************** +*** 452,462 **** + par1NBTTagCompound.setShort("Health", (short)((int)Math.ceil((double)this.getHealth()))); + par1NBTTagCompound.setShort("HurtTime", (short)this.hurtTime); + par1NBTTagCompound.setShort("DeathTime", (short)this.deathTime); + par1NBTTagCompound.setShort("AttackTime", (short)this.attackTime); + par1NBTTagCompound.setFloat("AbsorptionAmount", this.getAbsorptionAmount()); +! ItemStack[] var2 = this.getInventory(); + int var3 = var2.length; + int var4; + ItemStack var5; + + for (var4 = 0; var4 < var3; ++var4) +--- 452,462 ---- + par1NBTTagCompound.setShort("Health", (short)((int)Math.ceil((double)this.getHealth()))); + par1NBTTagCompound.setShort("HurtTime", (short)this.hurtTime); + par1NBTTagCompound.setShort("DeathTime", (short)this.deathTime); + par1NBTTagCompound.setShort("AttackTime", (short)this.attackTime); + par1NBTTagCompound.setFloat("AbsorptionAmount", this.getAbsorptionAmount()); +! ItemStack[] var2 = this.getLastActiveItems(); + int var3 = var2.length; + int var4; + ItemStack var5; + + for (var4 = 0; var4 < var3; ++var4) +*************** +*** 468,478 **** + this.attributeMap.removeAttributeModifiers(var5.getAttributeModifiers()); + } + } + + par1NBTTagCompound.setTag("Attributes", SharedMonsterAttributes.func_111257_a(this.getAttributeMap())); +! var2 = this.getInventory(); + var3 = var2.length; + + for (var4 = 0; var4 < var3; ++var4) + { + var5 = var2[var4]; +--- 468,478 ---- + this.attributeMap.removeAttributeModifiers(var5.getAttributeModifiers()); + } + } + + par1NBTTagCompound.setTag("Attributes", SharedMonsterAttributes.func_111257_a(this.getAttributeMap())); +! var2 = this.getLastActiveItems(); + var3 = var2.length; + + for (var4 = 0; var4 < var3; ++var4) + { + var5 = var2[var4]; +*************** +*** 709,718 **** +--- 709,726 ---- + { + return this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD; + } + + /** ++ * Remove the speified potion effect from this entity. ++ */ ++ public void removePotionEffectClient(int par1) ++ { ++ this.activePotionsMap.remove(Integer.valueOf(par1)); ++ } ++ ++ /** + * Remove the specified potion effect from this entity. + */ + public void removePotionEffect(int par1) + { + PotionEffect var2 = (PotionEffect)this.activePotionsMap.remove(Integer.valueOf(par1)); +*************** +*** 802,814 **** + { + return false; + } + else + { +! if ((par1DamageSource == DamageSource.anvil || par1DamageSource == DamageSource.fallingBlock) && this.getEquipmentInSlot(4) != null) + { +! this.getEquipmentInSlot(4).damageItem((int)(par2 * 4.0F + this.rand.nextFloat() * par2 * 2.0F), this); + par2 *= 0.75F; + } + + this.limbSwingAmount = 1.5F; + boolean var3 = true; +--- 810,822 ---- + { + return false; + } + else + { +! if ((par1DamageSource == DamageSource.anvil || par1DamageSource == DamageSource.fallingBlock) && this.getCurrentItemOrArmor(4) != null) + { +! this.getCurrentItemOrArmor(4).damageItem((int)(par2 * 4.0F + this.rand.nextFloat() * par2 * 2.0F), this); + par2 *= 0.75F; + } + + this.limbSwingAmount = 1.5F; + boolean var3 = true; +*************** +*** 1022,1032 **** + } + + protected void dropRareDrop(int par1) {} + + /** +! * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean par1, int par2) {} + + /** + * returns true if this entity is by a ladder, false otherwise +--- 1030,1041 ---- + } + + protected void dropRareDrop(int par1) {} + + /** +! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param +! * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean par1, int par2) {} + + /** + * returns true if this entity is by a ladder, false otherwise +*************** +*** 1079,1094 **** + } + } + } + + /** + * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue + */ + public int getTotalArmorValue() + { + int var1 = 0; +! ItemStack[] var2 = this.getInventory(); + int var3 = var2.length; + + for (int var4 = 0; var4 < var3; ++var4) + { + ItemStack var5 = var2[var4]; +--- 1088,1112 ---- + } + } + } + + /** ++ * Setups the entity to do the hurt animation. Only used by packets in multiplayer. ++ */ ++ public void performHurtAnimation() ++ { ++ this.hurtTime = this.maxHurtTime = 10; ++ this.attackedAtYaw = 0.0F; ++ } ++ ++ /** + * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue + */ + public int getTotalArmorValue() + { + int var1 = 0; +! ItemStack[] var2 = this.getLastActiveItems(); + int var3 = var2.length; + + for (int var4 = 0; var4 < var3; ++var4) + { + ItemStack var5 = var2[var4]; +*************** +*** 1147,1157 **** + { + return 0.0F; + } + else + { +! var3 = EnchantmentHelper.getEnchantmentModifierDamage(this.getInventory(), par1DamageSource); + + if (var3 > 20) + { + var3 = 20; + } +--- 1165,1175 ---- + { + return 0.0F; + } + else + { +! var3 = EnchantmentHelper.getEnchantmentModifierDamage(this.getLastActiveItems(), par1DamageSource); + + if (var3 > 20) + { + var3 = 20; + } +*************** +*** 1241,1255 **** + this.swingProgressInt = -1; + this.isSwingInProgress = true; + + if (this.worldObj instanceof WorldServer) + { +! ((WorldServer)this.worldObj).getEntityTracker().sendPacketToTrackedPlayers(this, new Packet18Animation(this, 1)); + } + } + } + + /** + * sets the dead flag. Used when you fall off the bottom of the world. + */ + protected void kill() + { +--- 1259,1296 ---- + this.swingProgressInt = -1; + this.isSwingInProgress = true; + + if (this.worldObj instanceof WorldServer) + { +! ((WorldServer)this.worldObj).getEntityTracker().sendPacketToAllPlayersTrackingEntity(this, new Packet18Animation(this, 1)); + } + } + } + ++ public void handleHealthUpdate(byte par1) ++ { ++ if (par1 == 2) ++ { ++ this.limbSwingAmount = 1.5F; ++ this.hurtResistantTime = this.maxHurtResistantTime; ++ this.hurtTime = this.maxHurtTime = 10; ++ this.attackedAtYaw = 0.0F; ++ this.playSound(this.getHurtSound(), this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); ++ this.attackEntityFrom(DamageSource.generic, 0.0F); ++ } ++ else if (par1 == 3) ++ { ++ this.playSound(this.getDeathSound(), this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); ++ this.setHealth(0.0F); ++ this.onDeath(DamageSource.generic); ++ } ++ else ++ { ++ super.handleHealthUpdate(par1); ++ } ++ } ++ + /** + * sets the dead flag. Used when you fall off the bottom of the world. + */ + protected void kill() + { +*************** +*** 1308,1320 **** + * Returns the item that this EntityLiving is holding, if any. + */ + public abstract ItemStack getHeldItem(); + + /** +! * 0: Tool in Hand; 1-4: Armor + */ +! public abstract ItemStack getEquipmentInSlot(int var1); + + /** + * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot + */ + public abstract void setCurrentItemOrArmor(int var1, ItemStack var2); +--- 1349,1361 ---- + * Returns the item that this EntityLiving is holding, if any. + */ + public abstract ItemStack getHeldItem(); + + /** +! * 0 = item, 1-n is armor + */ +! public abstract ItemStack getCurrentItemOrArmor(int var1); + + /** + * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot + */ + public abstract void setCurrentItemOrArmor(int var1, ItemStack var2); +*************** +*** 1336,1349 **** + { + var2.applyModifier(sprintingSpeedBoostModifier); + } + } + +! /** +! * returns the inventory of this entity (only used in EntityPlayerMP it seems) +! */ +! public abstract ItemStack[] getInventory(); + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() +--- 1377,1387 ---- + { + var2.applyModifier(sprintingSpeedBoostModifier); + } + } + +! public abstract ItemStack[] getLastActiveItems(); + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() +*************** +*** 1366,1376 **** + { + return this.getHealth() <= 0.0F; + } + + /** +! * Sets the position of the entity and updates the 'last' variables + */ + public void setPositionAndUpdate(double par1, double par3, double par5) + { + this.setLocationAndAngles(par1, par3, par5, this.rotationYaw, this.rotationPitch); + } +--- 1404,1414 ---- + { + return this.getHealth() <= 0.0F; + } + + /** +! * Move the entity to the coordinates informed, but keep yaw/pitch values. + */ + public void setPositionAndUpdate(double par1, double par3, double par5) + { + this.setLocationAndAngles(par1, par3, par5, this.rotationYaw, this.rotationPitch); + } +*************** +*** 1414,1423 **** +--- 1452,1474 ---- + } + + this.setPositionAndUpdate(var3, var5, var7); + } + ++ public boolean getAlwaysRenderNameTagForRender() ++ { ++ return false; ++ } ++ ++ /** ++ * Gets the Icon Index of the item currently held ++ */ ++ public Icon getItemIcon(ItemStack par1ItemStack, int par2) ++ { ++ return par1ItemStack.getIconIndex(); ++ } ++ + /** + * Causes this entity to do an upwards motion (jumping). + */ + protected void jump() + { +*************** +*** 1662,1676 **** + } + + for (int var2 = 0; var2 < 5; ++var2) + { + ItemStack var3 = this.previousEquipment[var2]; +! ItemStack var4 = this.getEquipmentInSlot(var2); + + if (!ItemStack.areItemStacksEqual(var4, var3)) + { +! ((WorldServer)this.worldObj).getEntityTracker().sendPacketToTrackedPlayers(this, new Packet5PlayerInventory(this.entityId, var2, var4)); + + if (var3 != null) + { + this.attributeMap.removeAttributeModifiers(var3.getAttributeModifiers()); + } +--- 1713,1727 ---- + } + + for (int var2 = 0; var2 < 5; ++var2) + { + ItemStack var3 = this.previousEquipment[var2]; +! ItemStack var4 = this.getCurrentItemOrArmor(var2); + + if (!ItemStack.areItemStacksEqual(var4, var3)) + { +! ((WorldServer)this.worldObj).getEntityTracker().sendPacketToAllPlayersTrackingEntity(this, new Packet5PlayerInventory(this.entityId, var2, var4)); + + if (var3 != null) + { + this.attributeMap.removeAttributeModifiers(var3.getAttributeModifiers()); + } +*************** +*** 1939,1948 **** +--- 1990,2014 ---- + this.field_110154_aX = 0.0F; + this.fallDistance = 0.0F; + } + + /** ++ * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, ++ * posY, posZ, yaw, pitch ++ */ ++ public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) ++ { ++ this.yOffset = 0.0F; ++ this.newPosX = par1; ++ this.newPosY = par3; ++ this.newPosZ = par5; ++ this.newRotationYaw = (double)par7; ++ this.newRotationPitch = (double)par8; ++ this.newPosRotationIncrements = par9; ++ } ++ ++ /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() {} + + protected void updateEntityActionState() +*************** +*** 1964,1994 **** + { + EntityTracker var3 = ((WorldServer)this.worldObj).getEntityTracker(); + + if (par1Entity instanceof EntityItem) + { +! var3.sendPacketToTrackedPlayers(par1Entity, new Packet22Collect(par1Entity.entityId, this.entityId)); + } + + if (par1Entity instanceof EntityArrow) + { +! var3.sendPacketToTrackedPlayers(par1Entity, new Packet22Collect(par1Entity.entityId, this.entityId)); + } + + if (par1Entity instanceof EntityXPOrb) + { +! var3.sendPacketToTrackedPlayers(par1Entity, new Packet22Collect(par1Entity.entityId, this.entityId)); + } + } + } + + /** + * returns true if the entity provided in the argument can be seen. (Raytrace) + */ + public boolean canEntityBeSeen(Entity par1Entity) + { +! return this.worldObj.rayTraceBlocks(this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ), this.worldObj.getWorldVec3Pool().getVecFromPool(par1Entity.posX, par1Entity.posY + (double)par1Entity.getEyeHeight(), par1Entity.posZ)) == null; + } + + /** + * returns a (normalized) vector of where this entity is looking + */ +--- 2030,2060 ---- + { + EntityTracker var3 = ((WorldServer)this.worldObj).getEntityTracker(); + + if (par1Entity instanceof EntityItem) + { +! var3.sendPacketToAllPlayersTrackingEntity(par1Entity, new Packet22Collect(par1Entity.entityId, this.entityId)); + } + + if (par1Entity instanceof EntityArrow) + { +! var3.sendPacketToAllPlayersTrackingEntity(par1Entity, new Packet22Collect(par1Entity.entityId, this.entityId)); + } + + if (par1Entity instanceof EntityXPOrb) + { +! var3.sendPacketToAllPlayersTrackingEntity(par1Entity, new Packet22Collect(par1Entity.entityId, this.entityId)); + } + } + } + + /** + * returns true if the entity provided in the argument can be seen. (Raytrace) + */ + public boolean canEntityBeSeen(Entity par1Entity) + { +! return this.worldObj.clip(this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ), this.worldObj.getWorldVec3Pool().getVecFromPool(par1Entity.posX, par1Entity.posY + (double)par1Entity.getEyeHeight(), par1Entity.posZ)) == null; + } + + /** + * returns a (normalized) vector of where this entity is looking + */ +*************** +*** 2026,2035 **** +--- 2092,2145 ---- + return this.worldObj.getWorldVec3Pool().getVecFromPool((double)(var5 * var6), (double)var7, (double)(var4 * var6)); + } + } + + /** ++ * Returns where in the swing animation the living entity is (from 0 to 1). Args: partialTickTime ++ */ ++ public float getSwingProgress(float par1) ++ { ++ float var2 = this.swingProgress - this.prevSwingProgress; ++ ++ if (var2 < 0.0F) ++ { ++ ++var2; ++ } ++ ++ return this.prevSwingProgress + var2 * par1; ++ } ++ ++ /** ++ * interpolated position vector ++ */ ++ public Vec3 getPosition(float par1) ++ { ++ if (par1 == 1.0F) ++ { ++ return this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); ++ } ++ else ++ { ++ double var2 = this.prevPosX + (this.posX - this.prevPosX) * (double)par1; ++ double var4 = this.prevPosY + (this.posY - this.prevPosY) * (double)par1; ++ double var6 = this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par1; ++ return this.worldObj.getWorldVec3Pool().getVecFromPool(var2, var4, var6); ++ } ++ } ++ ++ /** ++ * Performs a ray trace for the distance specified and using the partial tick time. Args: distance, partialTickTime ++ */ ++ public MovingObjectPosition rayTrace(double par1, float par3) ++ { ++ Vec3 var4 = this.getPosition(par3); ++ Vec3 var5 = this.getLook(par3); ++ Vec3 var6 = var4.addVector(var5.xCoord * par1, var5.yCoord * par1, var5.zCoord * par1); ++ return this.worldObj.clip(var4, var6); ++ } ++ ++ /** + * Returns whether the entity is in a local (client) world + */ + public boolean isClientWorld() + { + return !this.worldObj.isRemote; +*************** +*** 2065,2074 **** +--- 2175,2192 ---- + } + + public float getRotationYawHead() + { + return this.rotationYawHead; ++ } ++ ++ /** ++ * Sets the head's yaw rotation of the entity. ++ */ ++ public void setRotationYawHead(float par1) ++ { ++ this.rotationYawHead = par1; + } + + public float getAbsorptionAmount() + { + return this.field_110151_bq; +*** EntityLivingData.java Sat Feb 5 04:13:13 2022 +--- EntityLivingData.java Sat Feb 5 04:12:34 2022 +*** EntityLookHelper.java Sat Feb 5 04:13:13 2022 +--- EntityLookHelper.java Sat Feb 5 04:12:34 2022 +*** EntityMagmaCube.java Sat Feb 5 04:13:13 2022 +--- EntityMagmaCube.java Sat Feb 5 04:12:34 2022 +*************** +*** 28,37 **** +--- 28,42 ---- + public int getTotalArmorValue() + { + return this.getSlimeSize() * 3; + } + ++ public int getBrightnessForRender(float par1) ++ { ++ return 15728880; ++ } ++ + /** + * Gets how bright this entity is. + */ + public float getBrightness(float par1) + { +*************** +*** 58,68 **** + { + return Item.magmaCream.itemID; + } + + /** +! * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.getDropItemId(); + +--- 63,74 ---- + { + return Item.magmaCream.itemID; + } + + /** +! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param +! * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.getDropItemId(); + +*** EntityMinecart.java Sat Feb 5 04:13:13 2022 +--- EntityMinecart.java Sat Feb 5 04:12:34 2022 +*************** +*** 17,26 **** +--- 17,29 ---- + private double minecartX; + private double minecartY; + private double minecartZ; + private double minecartYaw; + private double minecartPitch; ++ private double velocityX; ++ private double velocityY; ++ private double velocityZ; + + public EntityMinecart(World par1World) + { + super(par1World); + this.preventEntitySpawning = true; +*************** +*** 180,189 **** +--- 183,202 ---- + + this.entityDropItem(var2, 0.0F); + } + + /** ++ * Setups the entity to do the hurt animation. Only used by packets in multiplayer. ++ */ ++ public void performHurtAnimation() ++ { ++ this.setRollingDirection(-this.getRollingDirection()); ++ this.setRollingAmplitude(10); ++ this.setDamage(this.getDamage() + this.getDamage() * 10.0F); ++ } ++ ++ /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() + { + return !this.isDead; +*************** +*** 385,395 **** + } + } + } + + /** +! * Called every tick the minecart is on an activator rail. Args: x, y, z, is the rail receiving power + */ + public void onActivatorRailPass(int par1, int par2, int par3, boolean par4) {} + + protected void func_94088_b(double par1) + { +--- 398,408 ---- + } + } + } + + /** +! * Called every tick the minecart is on an activator rail. + */ + public void onActivatorRailPass(int par1, int par2, int par3, boolean par4) {} + + protected void func_94088_b(double par1) + { +*************** +*** 683,692 **** +--- 696,760 ---- + this.motionY *= 0.0D; + this.motionZ *= 0.9599999785423279D; + } + } + ++ public Vec3 func_70495_a(double par1, double par3, double par5, double par7) ++ { ++ int var9 = MathHelper.floor_double(par1); ++ int var10 = MathHelper.floor_double(par3); ++ int var11 = MathHelper.floor_double(par5); ++ ++ if (BlockRailBase.isRailBlockAt(this.worldObj, var9, var10 - 1, var11)) ++ { ++ --var10; ++ } ++ ++ int var12 = this.worldObj.getBlockId(var9, var10, var11); ++ ++ if (!BlockRailBase.isRailBlock(var12)) ++ { ++ return null; ++ } ++ else ++ { ++ int var13 = this.worldObj.getBlockMetadata(var9, var10, var11); ++ ++ if (((BlockRailBase)Block.blocksList[var12]).isPowered()) ++ { ++ var13 &= 7; ++ } ++ ++ par3 = (double)var10; ++ ++ if (var13 >= 2 && var13 <= 5) ++ { ++ par3 = (double)(var10 + 1); ++ } ++ ++ int[][] var14 = matrix[var13]; ++ double var15 = (double)(var14[1][0] - var14[0][0]); ++ double var17 = (double)(var14[1][2] - var14[0][2]); ++ double var19 = Math.sqrt(var15 * var15 + var17 * var17); ++ var15 /= var19; ++ var17 /= var19; ++ par1 += var15 * par7; ++ par5 += var17 * par7; ++ ++ if (var14[0][1] != 0 && MathHelper.floor_double(par1) - var9 == var14[0][0] && MathHelper.floor_double(par5) - var11 == var14[0][2]) ++ { ++ par3 += (double)var14[0][1]; ++ } ++ else if (var14[1][1] != 0 && MathHelper.floor_double(par1) - var9 == var14[1][0] && MathHelper.floor_double(par5) - var11 == var14[1][2]) ++ { ++ par3 += (double)var14[1][1]; ++ } ++ ++ return this.func_70489_a(par1, par3, par5); ++ } ++ } ++ + public Vec3 func_70489_a(double par1, double par3, double par5) + { + int var7 = MathHelper.floor_double(par1); + int var8 = MathHelper.floor_double(par3); + int var9 = MathHelper.floor_double(par5); +*************** +*** 799,808 **** +--- 867,881 ---- + { + par1NBTTagCompound.setString("CustomName", this.entityName); + } + } + ++ public float getShadowSize() ++ { ++ return 0.0F; ++ } ++ + /** + * Applies a velocity to each of the entities pushing them away from each other. Args: entity + */ + public void applyEntityCollision(Entity par1Entity) + { +*************** +*** 890,899 **** +--- 963,999 ---- + par1Entity.addVelocity(var2 / 4.0D, 0.0D, var4 / 4.0D); + } + } + } + } ++ } ++ ++ /** ++ * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, ++ * posY, posZ, yaw, pitch ++ */ ++ public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) ++ { ++ this.minecartX = par1; ++ this.minecartY = par3; ++ this.minecartZ = par5; ++ this.minecartYaw = (double)par7; ++ this.minecartPitch = (double)par8; ++ this.turnProgress = par9 + 2; ++ this.motionX = this.velocityX; ++ this.motionY = this.velocityY; ++ this.motionZ = this.velocityZ; ++ } ++ ++ /** ++ * Sets the velocity to the args. Args: x, y, z ++ */ ++ public void setVelocity(double par1, double par3, double par5) ++ { ++ this.velocityX = this.motionX = par1; ++ this.velocityY = this.motionY = par3; ++ this.velocityZ = this.motionZ = par5; + } + + /** + * Sets the current amount of damage the minecart has taken. Decreases over time. The cart breaks when this is over + * 40. +*** EntityMinecartChest.java Sat Feb 5 04:13:13 2022 +--- EntityMinecartChest.java Sat Feb 5 04:12:34 2022 +*** EntityMinecartContainer.java Sat Feb 5 04:13:13 2022 +--- EntityMinecartContainer.java Sat Feb 5 04:12:34 2022 +*** EntityMinecartEmpty.java Sat Feb 5 04:13:13 2022 +--- EntityMinecartEmpty.java Sat Feb 5 04:12:34 2022 +*** EntityMinecartFurnace.java Sat Feb 5 04:13:13 2022 +--- EntityMinecartFurnace.java Sat Feb 5 04:12:34 2022 +*** EntityMinecartHopper.java Sat Feb 5 04:13:13 2022 +--- EntityMinecartHopper.java Sat Feb 5 04:12:34 2022 +*************** +*** 53,63 **** + + return true; + } + + /** +! * Called every tick the minecart is on an activator rail. Args: x, y, z, is the rail receiving power + */ + public void onActivatorRailPass(int par1, int par2, int par3, boolean par4) + { + boolean var5 = !par4; + +--- 53,63 ---- + + return true; + } + + /** +! * Called every tick the minecart is on an activator rail. + */ + public void onActivatorRailPass(int par1, int par2, int par3, boolean par4) + { + boolean var5 = !par4; + +*************** +*** 149,159 **** + { + List var1 = this.worldObj.selectEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(0.25D, 0.0D, 0.25D), IEntitySelector.selectAnything); + + if (var1.size() > 0) + { +! TileEntityHopper.func_96114_a(this, (EntityItem)var1.get(0)); + } + + return false; + } + } +--- 149,159 ---- + { + List var1 = this.worldObj.selectEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(0.25D, 0.0D, 0.25D), IEntitySelector.selectAnything); + + if (var1.size() > 0) + { +! TileEntityHopper.insertStackFromEntity(this, (EntityItem)var1.get(0)); + } + + return false; + } + } +*** EntityMinecartMobSpawner.java Sat Feb 5 04:13:13 2022 +--- EntityMinecartMobSpawner.java Sat Feb 5 04:12:34 2022 +*************** +*** 41,54 **** +--- 41,64 ---- + { + super.writeEntityToNBT(par1NBTTagCompound); + this.mobSpawnerLogic.writeToNBT(par1NBTTagCompound); + } + ++ public void handleHealthUpdate(byte par1) ++ { ++ this.mobSpawnerLogic.setDelayToMin(par1); ++ } ++ + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + this.mobSpawnerLogic.updateSpawner(); ++ } ++ ++ public MobSpawnerBaseLogic func_98039_d() ++ { ++ return this.mobSpawnerLogic; + } + } +*** EntityMinecartMobSpawnerLogic.java Sat Feb 5 04:13:13 2022 +--- EntityMinecartMobSpawnerLogic.java Sat Feb 5 04:12:34 2022 +*** EntityMinecartTNT.java Sat Feb 5 04:13:13 2022 +--- EntityMinecartTNT.java Sat Feb 5 04:12:34 2022 +*************** +*** 100,119 **** + + super.fall(par1); + } + + /** +! * Called every tick the minecart is on an activator rail. Args: x, y, z, is the rail receiving power + */ + public void onActivatorRailPass(int par1, int par2, int par3, boolean par4) + { + if (par4 && this.minecartTNTFuse < 0) + { + this.ignite(); + } + } + + /** + * Ignites this TNT cart. + */ + public void ignite() + { +--- 100,131 ---- + + super.fall(par1); + } + + /** +! * Called every tick the minecart is on an activator rail. + */ + public void onActivatorRailPass(int par1, int par2, int par3, boolean par4) + { + if (par4 && this.minecartTNTFuse < 0) + { + this.ignite(); + } + } + ++ public void handleHealthUpdate(byte par1) ++ { ++ if (par1 == 10) ++ { ++ this.ignite(); ++ } ++ else ++ { ++ super.handleHealthUpdate(par1); ++ } ++ } ++ + /** + * Ignites this TNT cart. + */ + public void ignite() + { +*************** +*** 122,131 **** +--- 134,148 ---- + if (!this.worldObj.isRemote) + { + this.worldObj.setEntityState(this, (byte)10); + this.worldObj.playSoundAtEntity(this, "random.fuse", 1.0F, 1.0F); + } ++ } ++ ++ public int func_94104_d() ++ { ++ return this.minecartTNTFuse; + } + + /** + * Returns true if the TNT minecart is ignited. + */ +*** EntityMob.java Sat Feb 5 04:13:13 2022 +--- EntityMob.java Sat Feb 5 04:12:34 2022 +*** EntityMooshroom.java Sat Feb 5 04:13:13 2022 +--- EntityMooshroom.java Sat Feb 5 04:12:34 2022 +*** EntityMoveHelper.java Sat Feb 5 04:13:13 2022 +--- EntityMoveHelper.java Sat Feb 5 04:12:34 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityNoteFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,80 ---- ++ package net.minecraft.src; ++ ++ public class EntityNoteFX extends EntityFX ++ { ++ float noteParticleScale; ++ ++ public EntityNoteFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) ++ { ++ this(par1World, par2, par4, par6, par8, par10, par12, 2.0F); ++ } ++ ++ public EntityNoteFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, float par14) ++ { ++ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); ++ this.motionX *= 0.009999999776482582D; ++ this.motionY *= 0.009999999776482582D; ++ this.motionZ *= 0.009999999776482582D; ++ this.motionY += 0.2D; ++ this.particleRed = MathHelper.sin(((float)par8 + 0.0F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F; ++ this.particleGreen = MathHelper.sin(((float)par8 + 0.33333334F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F; ++ this.particleBlue = MathHelper.sin(((float)par8 + 0.6666667F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F; ++ this.particleScale *= 0.75F; ++ this.particleScale *= par14; ++ this.noteParticleScale = this.particleScale; ++ this.particleMaxAge = 6; ++ this.noClip = false; ++ this.setParticleTextureIndex(64); ++ } ++ ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F; ++ ++ if (var8 < 0.0F) ++ { ++ var8 = 0.0F; ++ } ++ ++ if (var8 > 1.0F) ++ { ++ var8 = 1.0F; ++ } ++ ++ this.particleScale = this.noteParticleScale * var8; ++ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ this.prevPosX = this.posX; ++ this.prevPosY = this.posY; ++ this.prevPosZ = this.posZ; ++ ++ if (this.particleAge++ >= this.particleMaxAge) ++ { ++ this.setDead(); ++ } ++ ++ this.moveEntity(this.motionX, this.motionY, this.motionZ); ++ ++ if (this.posY == this.prevPosY) ++ { ++ this.motionX *= 1.1D; ++ this.motionZ *= 1.1D; ++ } ++ ++ this.motionX *= 0.6600000262260437D; ++ this.motionY *= 0.6600000262260437D; ++ this.motionZ *= 0.6600000262260437D; ++ ++ if (this.onGround) ++ { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ } ++ } ++ } +*** EntityOcelot.java Sat Feb 5 04:13:13 2022 +--- EntityOcelot.java Sat Feb 5 04:12:34 2022 +*************** +*** 170,180 **** + return super.attackEntityFrom(par1DamageSource, par2); + } + } + + /** +! * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean par1, int par2) {} + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. +--- 170,181 ---- + return super.attackEntityFrom(par1DamageSource, par2); + } + } + + /** +! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param +! * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean par1, int par2) {} + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityOtherPlayerMP.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,186 ---- ++ package net.minecraft.src; ++ ++ public class EntityOtherPlayerMP extends AbstractClientPlayer ++ { ++ private boolean isItemInUse; ++ private int otherPlayerMPPosRotationIncrements; ++ private double otherPlayerMPX; ++ private double otherPlayerMPY; ++ private double otherPlayerMPZ; ++ private double otherPlayerMPYaw; ++ private double otherPlayerMPPitch; ++ ++ public EntityOtherPlayerMP(World par1World, String par2Str) ++ { ++ super(par1World, par2Str); ++ this.yOffset = 0.0F; ++ this.stepHeight = 0.0F; ++ this.noClip = true; ++ this.field_71082_cx = 0.25F; ++ this.renderDistanceWeight = 10.0D; ++ } ++ ++ /** ++ * sets the players height back to normal after doing things like sleeping and dieing ++ */ ++ protected void resetHeight() ++ { ++ this.yOffset = 0.0F; ++ } ++ ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) ++ { ++ return true; ++ } ++ ++ /** ++ * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, ++ * posY, posZ, yaw, pitch ++ */ ++ public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) ++ { ++ this.otherPlayerMPX = par1; ++ this.otherPlayerMPY = par3; ++ this.otherPlayerMPZ = par5; ++ this.otherPlayerMPYaw = (double)par7; ++ this.otherPlayerMPPitch = (double)par8; ++ this.otherPlayerMPPosRotationIncrements = par9; ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ this.field_71082_cx = 0.0F; ++ super.onUpdate(); ++ this.prevLimbSwingAmount = this.limbSwingAmount; ++ double var1 = this.posX - this.prevPosX; ++ double var3 = this.posZ - this.prevPosZ; ++ float var5 = MathHelper.sqrt_double(var1 * var1 + var3 * var3) * 4.0F; ++ ++ if (var5 > 1.0F) ++ { ++ var5 = 1.0F; ++ } ++ ++ this.limbSwingAmount += (var5 - this.limbSwingAmount) * 0.4F; ++ this.limbSwing += this.limbSwingAmount; ++ ++ if (!this.isItemInUse && this.isEating() && this.inventory.mainInventory[this.inventory.currentItem] != null) ++ { ++ ItemStack var6 = this.inventory.mainInventory[this.inventory.currentItem]; ++ this.setItemInUse(this.inventory.mainInventory[this.inventory.currentItem], Item.itemsList[var6.itemID].getMaxItemUseDuration(var6)); ++ this.isItemInUse = true; ++ } ++ else if (this.isItemInUse && !this.isEating()) ++ { ++ this.clearItemInUse(); ++ this.isItemInUse = false; ++ } ++ } ++ ++ public float getShadowSize() ++ { ++ return 0.0F; ++ } ++ ++ /** ++ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons ++ * use this to react to sunlight and start to burn. ++ */ ++ public void onLivingUpdate() ++ { ++ super.updateEntityActionState(); ++ ++ if (this.otherPlayerMPPosRotationIncrements > 0) ++ { ++ double var1 = this.posX + (this.otherPlayerMPX - this.posX) / (double)this.otherPlayerMPPosRotationIncrements; ++ double var3 = this.posY + (this.otherPlayerMPY - this.posY) / (double)this.otherPlayerMPPosRotationIncrements; ++ double var5 = this.posZ + (this.otherPlayerMPZ - this.posZ) / (double)this.otherPlayerMPPosRotationIncrements; ++ double var7; ++ ++ for (var7 = this.otherPlayerMPYaw - (double)this.rotationYaw; var7 < -180.0D; var7 += 360.0D) ++ { ++ ; ++ } ++ ++ while (var7 >= 180.0D) ++ { ++ var7 -= 360.0D; ++ } ++ ++ this.rotationYaw = (float)((double)this.rotationYaw + var7 / (double)this.otherPlayerMPPosRotationIncrements); ++ this.rotationPitch = (float)((double)this.rotationPitch + (this.otherPlayerMPPitch - (double)this.rotationPitch) / (double)this.otherPlayerMPPosRotationIncrements); ++ --this.otherPlayerMPPosRotationIncrements; ++ this.setPosition(var1, var3, var5); ++ this.setRotation(this.rotationYaw, this.rotationPitch); ++ } ++ ++ this.prevCameraYaw = this.cameraYaw; ++ float var9 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); ++ float var2 = (float)Math.atan(-this.motionY * 0.20000000298023224D) * 15.0F; ++ ++ if (var9 > 0.1F) ++ { ++ var9 = 0.1F; ++ } ++ ++ if (!this.onGround || this.getHealth() <= 0.0F) ++ { ++ var9 = 0.0F; ++ } ++ ++ if (this.onGround || this.getHealth() <= 0.0F) ++ { ++ var2 = 0.0F; ++ } ++ ++ this.cameraYaw += (var9 - this.cameraYaw) * 0.4F; ++ this.cameraPitch += (var2 - this.cameraPitch) * 0.8F; ++ } ++ ++ /** ++ * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot ++ */ ++ public void setCurrentItemOrArmor(int par1, ItemStack par2ItemStack) ++ { ++ if (par1 == 0) ++ { ++ this.inventory.mainInventory[this.inventory.currentItem] = par2ItemStack; ++ } ++ else ++ { ++ this.inventory.armorInventory[par1 - 1] = par2ItemStack; ++ } ++ } ++ ++ public float getEyeHeight() ++ { ++ return 1.82F; ++ } ++ ++ public void sendChatToPlayer(ChatMessageComponent par1ChatMessageComponent) ++ { ++ Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(par1ChatMessageComponent.toStringWithFormatting(true)); ++ } ++ ++ /** ++ * Returns true if the command sender is allowed to use the given command. ++ */ ++ public boolean canCommandSenderUseCommand(int par1, String par2Str) ++ { ++ return false; ++ } ++ ++ /** ++ * Return the position for this command sender. ++ */ ++ public ChunkCoordinates getPlayerCoordinates() ++ { ++ return new ChunkCoordinates(MathHelper.floor_double(this.posX + 0.5D), MathHelper.floor_double(this.posY + 0.5D), MathHelper.floor_double(this.posZ + 0.5D)); ++ } ++ } +*** EntityOwnable.java Sat Feb 5 04:13:13 2022 +--- EntityOwnable.java Sat Feb 5 04:12:34 2022 +*** EntityPainting.java Sat Feb 5 04:13:13 2022 +--- EntityPainting.java Sat Feb 5 04:12:34 2022 +*************** +*** 36,45 **** +--- 36,65 ---- + } + + this.setDirection(par5); + } + ++ public EntityPainting(World par1World, int par2, int par3, int par4, int par5, String par6Str) ++ { ++ this(par1World, par2, par3, par4, par5); ++ EnumArt[] var7 = EnumArt.values(); ++ int var8 = var7.length; ++ ++ for (int var9 = 0; var9 < var8; ++var9) ++ { ++ EnumArt var10 = var7[var9]; ++ ++ if (var10.title.equals(par6Str)) ++ { ++ this.art = var10; ++ break; ++ } ++ } ++ ++ this.setDirection(par5); ++ } ++ + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityPickupFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,68 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class EntityPickupFX extends EntityFX ++ { ++ private Entity entityToPickUp; ++ private Entity entityPickingUp; ++ private int age; ++ private int maxAge; ++ ++ /** renamed from yOffset to fix shadowing Entity.yOffset */ ++ private float yOffs; ++ ++ public EntityPickupFX(World par1World, Entity par2Entity, Entity par3Entity, float par4) ++ { ++ super(par1World, par2Entity.posX, par2Entity.posY, par2Entity.posZ, par2Entity.motionX, par2Entity.motionY, par2Entity.motionZ); ++ this.entityToPickUp = par2Entity; ++ this.entityPickingUp = par3Entity; ++ this.maxAge = 3; ++ this.yOffs = par4; ++ } ++ ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ float var8 = ((float)this.age + par2) / (float)this.maxAge; ++ var8 *= var8; ++ double var9 = this.entityToPickUp.posX; ++ double var11 = this.entityToPickUp.posY; ++ double var13 = this.entityToPickUp.posZ; ++ double var15 = this.entityPickingUp.lastTickPosX + (this.entityPickingUp.posX - this.entityPickingUp.lastTickPosX) * (double)par2; ++ double var17 = this.entityPickingUp.lastTickPosY + (this.entityPickingUp.posY - this.entityPickingUp.lastTickPosY) * (double)par2 + (double)this.yOffs; ++ double var19 = this.entityPickingUp.lastTickPosZ + (this.entityPickingUp.posZ - this.entityPickingUp.lastTickPosZ) * (double)par2; ++ double var21 = var9 + (var15 - var9) * (double)var8; ++ double var23 = var11 + (var17 - var11) * (double)var8; ++ double var25 = var13 + (var19 - var13) * (double)var8; ++ int var27 = MathHelper.floor_double(var21); ++ int var28 = MathHelper.floor_double(var23 + (double)(this.yOffset / 2.0F)); ++ int var29 = MathHelper.floor_double(var25); ++ int var30 = this.getBrightnessForRender(par2); ++ int var31 = var30 % 65536; ++ int var32 = var30 / 65536; ++ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var31 / 1.0F, (float)var32 / 1.0F); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ var21 -= interpPosX; ++ var23 -= interpPosY; ++ var25 -= interpPosZ; ++ RenderManager.instance.renderEntityWithPosYaw(this.entityToPickUp, (double)((float)var21), (double)((float)var23), (double)((float)var25), this.entityToPickUp.rotationYaw, par2); ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ ++this.age; ++ ++ if (this.age == this.maxAge) ++ { ++ this.setDead(); ++ } ++ } ++ ++ public int getFXLayer() ++ { ++ return 3; ++ } ++ } +*** EntityPig.java Sat Feb 5 04:13:13 2022 +--- EntityPig.java Sat Feb 5 04:12:34 2022 +*************** +*** 135,145 **** + { + return this.isBurning() ? Item.porkCooked.itemID : Item.porkRaw.itemID; + } + + /** +! * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + par2); + +--- 135,146 ---- + { + return this.isBurning() ? Item.porkCooked.itemID : Item.porkRaw.itemID; + } + + /** +! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param +! * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + par2); + +*** EntityPigZombie.java Sat Feb 5 04:13:13 2022 +--- EntityPigZombie.java Sat Feb 5 04:12:34 2022 +*************** +*** 166,176 **** + { + return "mob.zombiepig.zpigdeath"; + } + + /** +! * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.rand.nextInt(2 + par2); + int var4; +--- 166,177 ---- + { + return "mob.zombiepig.zpigdeath"; + } + + /** +! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param +! * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.rand.nextInt(2 + par2); + int var4; +*** EntityPlayer.java Sat Feb 5 04:13:13 2022 +--- EntityPlayer.java Sat Feb 5 04:12:34 2022 +*************** +*** 16,26 **** + public Container inventoryContainer; + + /** The Container the player has open. */ + public Container openContainer; + +! /** The food object of the player, the general hunger logic. */ + protected FoodStats foodStats = new FoodStats(); + + /** + * Used to tell if the player pressed jump twice. If this is at 0 and it's pressed (And they are allowed to fly, as + * defined in the player's movementInput) it sets this to 7. If it's pressed and it's greater than 0 enable fly. +--- 16,26 ---- + public Container inventoryContainer; + + /** The Container the player has open. */ + public Container openContainer; + +! /** The player's food stats. (See class FoodStats) */ + protected FoodStats foodStats = new FoodStats(); + + /** + * Used to tell if the player pressed jump twice. If this is at 0 and it's pressed (And they are allowed to fly, as + * defined in the player's movementInput) it sets this to 7. If it's pressed and it's greater than 0 enable fly. +*************** +*** 42,58 **** + public double field_71085_bR; + + /** Boolean value indicating weather a player is sleeping or not */ + protected boolean sleeping; + +! /** the current location of the player */ + public ChunkCoordinates playerLocation; + private int sleepTimer; + public float field_71079_bU; + public float field_71089_bV; + +! /** holds the spawn chunk of the player */ + private ChunkCoordinates spawnChunk; + + /** + * Whether this player's spawn point is forced, preventing execution of bed checks. + */ +--- 42,63 ---- + public double field_71085_bR; + + /** Boolean value indicating weather a player is sleeping or not */ + protected boolean sleeping; + +! /** +! * The chunk coordinates of the bed the player is in (null if player isn't in a bed). +! */ + public ChunkCoordinates playerLocation; + private int sleepTimer; + public float field_71079_bU; ++ public float field_71082_cx; + public float field_71089_bV; + +! /** +! * Holds the last coordinate to spawn based on last bed that the player sleep. +! */ + private ChunkCoordinates spawnChunk; + + /** + * Whether this player's spawn point is forced, preventing execution of bed checks. + */ +*************** +*** 122,138 **** +--- 127,167 ---- + this.dataWatcher.addObject(17, Float.valueOf(0.0F)); + this.dataWatcher.addObject(18, Integer.valueOf(0)); + } + + /** ++ * returns the ItemStack containing the itemInUse ++ */ ++ public ItemStack getItemInUse() ++ { ++ return this.itemInUse; ++ } ++ ++ /** ++ * Returns the item in use count ++ */ ++ public int getItemInUseCount() ++ { ++ return this.itemInUseCount; ++ } ++ ++ /** + * Checks if the entity is currently using an item (e.g., bow, food, sword) by holding down the useItemButton + */ + public boolean isUsingItem() + { + return this.itemInUse != null; + } + ++ /** ++ * gets the duration for how long the current itemInUse has been in use ++ */ ++ public int getItemInUseDuration() ++ { ++ return this.isUsingItem() ? this.itemInUse.getMaxItemUseDuration() - this.itemInUseCount : 0; ++ } ++ + public void stopUsingItem() + { + if (this.itemInUse != null) + { + this.itemInUse.onPlayerStoppedUsing(this.worldObj, this, this.itemInUseCount); +*************** +*** 359,378 **** + + this.clearItemInUse(); + } + } + + /** + * Dead and sleeping entities cannot move + */ + protected boolean isMovementBlocked() + { + return this.getHealth() <= 0.0F || this.isPlayerSleeping(); + } + + /** +! * set current crafting inventory back to the 2x2 square + */ + protected void closeScreen() + { + this.openContainer = this.inventoryContainer; + } +--- 388,419 ---- + + this.clearItemInUse(); + } + } + ++ public void handleHealthUpdate(byte par1) ++ { ++ if (par1 == 9) ++ { ++ this.onItemUseFinish(); ++ } ++ else ++ { ++ super.handleHealthUpdate(par1); ++ } ++ } ++ + /** + * Dead and sleeping entities cannot move + */ + protected boolean isMovementBlocked() + { + return this.getHealth() <= 0.0F || this.isPlayerSleeping(); + } + + /** +! * sets current screen to null (used on escape buttons of GUIs) + */ + protected void closeScreen() + { + this.openContainer = this.inventoryContainer; + } +*************** +*** 431,440 **** +--- 472,494 ---- + this.renderYawOffset = ((EntityPig)this.ridingEntity).renderYawOffset; + } + } + } + ++ /** ++ * Keeps moving the entity up so it isn't colliding with blocks and other requirements for this entity to be spawned ++ * (only actually used on players though its also on Entity) ++ */ ++ public void preparePlayerToSpawn() ++ { ++ this.yOffset = 1.62F; ++ this.setSize(0.6F, 1.8F); ++ super.preparePlayerToSpawn(); ++ this.setHealth(this.getMaxHealth()); ++ this.deathTime = 0; ++ } ++ + protected void updateEntityActionState() + { + super.updateEntityActionState(); + this.updateArmSwingProgress(); + } +*************** +*** 1213,1222 **** +--- 1267,1278 ---- + */ + public void onCriticalHit(Entity par1Entity) {} + + public void onEnchantmentCritical(Entity par1Entity) {} + ++ public void respawnPlayer() {} ++ + /** + * Will get destroyed next tick. + */ + public void setDead() + { +*************** +*** 1236,1246 **** + { + return !this.sleeping && super.isEntityInsideOpaqueBlock(); + } + + /** +! * puts player to sleep on specified bed if possible + */ + public EnumStatus sleepInBedAt(int par1, int par2, int par3) + { + if (!this.worldObj.isRemote) + { +--- 1292,1302 ---- + { + return !this.sleeping && super.isEntityInsideOpaqueBlock(); + } + + /** +! * Attempts to have the player sleep in a bed at the specified location. + */ + public EnumStatus sleepInBedAt(int par1, int par2, int par3) + { + if (!this.worldObj.isRemote) + { +*************** +*** 1431,1440 **** +--- 1487,1525 ---- + return par2 && var6 && var7 ? par1ChunkCoordinates : null; + } + } + + /** ++ * Returns the orientation of the bed in degrees. ++ */ ++ public float getBedOrientationInDegrees() ++ { ++ if (this.playerLocation != null) ++ { ++ int var1 = this.worldObj.getBlockMetadata(this.playerLocation.posX, this.playerLocation.posY, this.playerLocation.posZ); ++ int var2 = BlockBed.getDirection(var1); ++ ++ switch (var2) ++ { ++ case 0: ++ return 90.0F; ++ ++ case 1: ++ return 0.0F; ++ ++ case 2: ++ return 270.0F; ++ ++ case 3: ++ return 180.0F; ++ } ++ } ++ ++ return 0.0F; ++ } ++ ++ /** + * Returns whether player is sleeping or not + */ + public boolean isPlayerSleeping() + { + return this.sleeping; +*************** +*** 1446,1455 **** +--- 1531,1550 ---- + public boolean isPlayerFullyAsleep() + { + return this.sleeping && this.sleepTimer >= 100; + } + ++ public int getSleepTimer() ++ { ++ return this.sleepTimer; ++ } ++ ++ protected boolean getHideCape(int par1) ++ { ++ return (this.dataWatcher.getWatchableObjectByte(16) & 1 << par1) != 0; ++ } ++ + protected void setHideCape(int par1, boolean par2) + { + byte var3 = this.dataWatcher.getWatchableObjectByte(16); + + if (par2) +*************** +*** 1700,1716 **** + { + super.setInWeb(); + } + } + + public ItemStack getCurrentArmor(int par1) + { + return this.inventory.armorItemInSlot(par1); + } + + /** +! * Add experience points to player. + */ + public void addExperience(int par1) + { + this.addScore(par1); + int var2 = Integer.MAX_VALUE - this.experienceTotal; +--- 1795,1853 ---- + { + super.setInWeb(); + } + } + ++ /** ++ * Gets the Icon Index of the item currently held ++ */ ++ public Icon getItemIcon(ItemStack par1ItemStack, int par2) ++ { ++ Icon var3 = super.getItemIcon(par1ItemStack, par2); ++ ++ if (par1ItemStack.itemID == Item.fishingRod.itemID && this.fishEntity != null) ++ { ++ var3 = Item.fishingRod.func_94597_g(); ++ } ++ else ++ { ++ if (par1ItemStack.getItem().requiresMultipleRenderPasses()) ++ { ++ return par1ItemStack.getItem().getIconFromDamageForRenderPass(par1ItemStack.getItemDamage(), par2); ++ } ++ ++ if (this.itemInUse != null && par1ItemStack.itemID == Item.bow.itemID) ++ { ++ int var4 = par1ItemStack.getMaxItemUseDuration() - this.itemInUseCount; ++ ++ if (var4 >= 18) ++ { ++ return Item.bow.getItemIconForUseDuration(2); ++ } ++ ++ if (var4 > 13) ++ { ++ return Item.bow.getItemIconForUseDuration(1); ++ } ++ ++ if (var4 > 0) ++ { ++ return Item.bow.getItemIconForUseDuration(0); ++ } ++ } ++ } ++ ++ return var3; ++ } ++ + public ItemStack getCurrentArmor(int par1) + { + return this.inventory.armorItemInSlot(par1); + } + + /** +! * This method increases the player's current amount of experience. + */ + public void addExperience(int par1) + { + this.addScore(par1); + int var2 = Integer.MAX_VALUE - this.experienceTotal; +*************** +*** 1884,1893 **** +--- 2021,2035 ---- + public String getEntityName() + { + return this.username; + } + ++ public boolean getAlwaysRenderNameTagForRender() ++ { ++ return true; ++ } ++ + /** + * Copies the values from the given player into this player if boolean par2 is true. Always clones Ender Chest + * Inventory. + */ + public void clonePlayer(EntityPlayer par1EntityPlayer, boolean par2) +*************** +*** 1954,1966 **** + { + return this.theInventoryEnderChest; + } + + /** +! * 0: Tool in Hand; 1-4: Armor + */ +! public ItemStack getEquipmentInSlot(int par1) + { + return par1 == 0 ? this.inventory.getCurrentItem() : this.inventory.armorInventory[par1 - 1]; + } + + /** +--- 2096,2108 ---- + { + return this.theInventoryEnderChest; + } + + /** +! * 0 = item, 1-n is armor + */ +! public ItemStack getCurrentItemOrArmor(int par1) + { + return par1 == 0 ? this.inventory.getCurrentItem() : this.inventory.armorInventory[par1 - 1]; + } + + /** +*************** +*** 1978,1992 **** + { + this.inventory.armorInventory[par1] = par2ItemStack; + } + + /** +! * returns the inventory of this entity (only used in EntityPlayerMP it seems) + */ +! public ItemStack[] getInventory() + { + return this.inventory.armorInventory; + } + + public boolean isPushedByWater() + { + return !this.capabilities.isFlying; +--- 2120,2154 ---- + { + this.inventory.armorInventory[par1] = par2ItemStack; + } + + /** +! * Only used by renderer in EntityLivingBase subclasses.\nDetermines if an entity is visible or not to a specfic +! * player, if the entity is normally invisible.\nFor EntityLivingBase subclasses, returning false when invisible +! * will render the entity semitransparent. + */ +! public boolean isInvisibleToPlayer(EntityPlayer par1EntityPlayer) +! { +! if (!this.isInvisible()) +! { +! return false; +! } +! else +! { +! Team var2 = this.getTeam(); +! return var2 == null || par1EntityPlayer == null || par1EntityPlayer.getTeam() != var2 || !var2.func_98297_h(); +! } +! } +! +! public ItemStack[] getLastActiveItems() + { + return this.inventory.armorInventory; ++ } ++ ++ public boolean getHideCape() ++ { ++ return this.getHideCape(1); + } + + public boolean isPushedByWater() + { + return !this.capabilities.isFlying; +*** EntityPlayerMP.java Sat Feb 5 04:13:13 2022 +--- EntityPlayerMP.java Sat Feb 5 04:12:34 2022 +*************** +*** 37,47 **** + + /** entities added to this list will be packet29'd to the player */ + public final List destroyedItemsNetCache = new LinkedList(); + private float field_130068_bO = Float.MIN_VALUE; + +! /** amount of health the client was last set to */ + private float lastHealth = -1.0E8F; + + /** set to foodStats.GetFoodLevel */ + private int lastFoodLevel = -99999999; + +--- 37,47 ---- + + /** entities added to this list will be packet29'd to the player */ + public final List destroyedItemsNetCache = new LinkedList(); + private float field_130068_bO = Float.MIN_VALUE; + +! /** set to getHealth */ + private float lastHealth = -1.0E8F; + + /** set to foodStats.GetFoodLevel */ + private int lastFoodLevel = -99999999; + +*************** +*** 49,60 **** + private boolean wasHungry = true; + + /** Amount of experience the client was last set to */ + private int lastExperience = -99999999; + +! /** how many ticks of invulnerability(spawn protection) this player has */ +! private int ticksOfInvuln = 60; + + /** must be between 3>x>15 (strictly between) */ + private int renderDistance; + private int chatVisibility; + private boolean chatColours = true; +--- 49,60 ---- + private boolean wasHungry = true; + + /** Amount of experience the client was last set to */ + private int lastExperience = -99999999; + +! /** de-increments onUpdate, attackEntityFrom is ignored if this >0 */ +! private int initialInvulnerability = 60; + + /** must be between 3>x>15 (strictly between) */ + private int renderDistance; + private int chatVisibility; + private boolean chatColours = true; +*************** +*** 64,77 **** + * The currently in use window ID. Incremented every time a window is opened. + */ + private int currentWindowId; + + /** +! * set to true when player is moving quantity of items from one inventory to another(crafting) but item in either +! * slot is not changed + */ +! public boolean isChangingQuantityOnly; + public int ping; + + /** + * Set when a player beats the ender dragon, used to respawn the player at the spawn point while retaining inventory + * and XP +--- 64,77 ---- + * The currently in use window ID. Incremented every time a window is opened. + */ + private int currentWindowId; + + /** +! * poor mans concurency flag, lets hope the jvm doesn't re-order the setting of this flag wrt the inventory change +! * on the next line + */ +! public boolean playerInventoryBeingManipulated; + public int ping; + + /** + * Set when a player beats the ender dragon, used to respawn the player at the spawn point while retaining inventory + * and XP +*************** +*** 146,156 **** + this.lastExperience = -1; + } + + public void addSelfToInternalCraftingInventory() + { +! this.openContainer.onCraftGuiOpened(this); + } + + /** + * sets the players height back to normal after doing things like sleeping and dieing + */ +--- 146,156 ---- + this.lastExperience = -1; + } + + public void addSelfToInternalCraftingInventory() + { +! this.openContainer.addCraftingToCrafters(this); + } + + /** + * sets the players height back to normal after doing things like sleeping and dieing + */ +*************** +*** 168,178 **** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.theItemInWorldManager.updateBlockRemoving(); +! --this.ticksOfInvuln; + this.openContainer.detectAndSendChanges(); + + if (!this.worldObj.isRemote && !this.openContainer.canInteractWith(this)) + { + this.closeScreen(); +--- 168,178 ---- + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.theItemInWorldManager.updateBlockRemoving(); +! --this.initialInvulnerability; + this.openContainer.detectAndSendChanges(); + + if (!this.worldObj.isRemote && !this.openContainer.canInteractWith(this)) + { + this.closeScreen(); +*************** +*** 190,200 **** + { + var2[var4++] = ((Integer)var3.next()).intValue(); + var3.remove(); + } + +! this.playerNetServerHandler.sendPacket(new Packet29DestroyEntity(var2)); + } + + if (!this.loadedChunks.isEmpty()) + { + ArrayList var6 = new ArrayList(); +--- 190,200 ---- + { + var2[var4++] = ((Integer)var3.next()).intValue(); + var3.remove(); + } + +! this.playerNetServerHandler.sendPacketToPlayer(new Packet29DestroyEntity(var2)); + } + + if (!this.loadedChunks.isEmpty()) + { + ArrayList var6 = new ArrayList(); +*************** +*** 207,229 **** + var7.remove(); + + if (var9 != null && this.worldObj.blockExists(var9.chunkXPos << 4, 0, var9.chunkZPos << 4)) + { + var6.add(this.worldObj.getChunkFromChunkCoords(var9.chunkXPos, var9.chunkZPos)); +! var8.addAll(((WorldServer)this.worldObj).getTileEntityList(var9.chunkXPos * 16, 0, var9.chunkZPos * 16, var9.chunkXPos * 16 + 16, 256, var9.chunkZPos * 16 + 16)); + } + } + + if (!var6.isEmpty()) + { +! this.playerNetServerHandler.sendPacket(new Packet56MapChunks(var6)); + Iterator var10 = var8.iterator(); + + while (var10.hasNext()) + { + TileEntity var5 = (TileEntity)var10.next(); +! this.getTileEntityInfo(var5); + } + + var10 = var6.iterator(); + + while (var10.hasNext()) +--- 207,229 ---- + var7.remove(); + + if (var9 != null && this.worldObj.blockExists(var9.chunkXPos << 4, 0, var9.chunkZPos << 4)) + { + var6.add(this.worldObj.getChunkFromChunkCoords(var9.chunkXPos, var9.chunkZPos)); +! var8.addAll(((WorldServer)this.worldObj).getAllTileEntityInBox(var9.chunkXPos * 16, 0, var9.chunkZPos * 16, var9.chunkXPos * 16 + 16, 256, var9.chunkZPos * 16 + 16)); + } + } + + if (!var6.isEmpty()) + { +! this.playerNetServerHandler.sendPacketToPlayer(new Packet56MapChunks(var6)); + Iterator var10 = var8.iterator(); + + while (var10.hasNext()) + { + TileEntity var5 = (TileEntity)var10.next(); +! this.sendTileEntityToPlayer(var5); + } + + var10 = var6.iterator(); + + while (var10.hasNext()) +*************** +*** 232,244 **** + this.getServerForPlayer().getEntityTracker().func_85172_a(this, var11); + } + } + } + +! if (this.field_143005_bX > 0L && this.mcServer.func_143007_ar() > 0 && MinecraftServer.getCurrentTimeMillis() - this.field_143005_bX > (long)(this.mcServer.func_143007_ar() * 1000 * 60)) + { +! this.playerNetServerHandler.kickPlayer("You have been idle for too long!"); + } + } + + public void onUpdateEntity() + { +--- 232,244 ---- + this.getServerForPlayer().getEntityTracker().func_85172_a(this, var11); + } + } + } + +! if (this.field_143005_bX > 0L && this.mcServer.func_143007_ar() > 0 && MinecraftServer.getSystemTimeMillis() - this.field_143005_bX > (long)(this.mcServer.func_143007_ar() * 1000 * 60)) + { +! this.playerNetServerHandler.kickPlayerFromServer("You have been idle for too long!"); + } + } + + public void onUpdateEntity() + { +*************** +*** 248,271 **** + + for (int var1 = 0; var1 < this.inventory.getSizeInventory(); ++var1) + { + ItemStack var6 = this.inventory.getStackInSlot(var1); + +! if (var6 != null && Item.itemsList[var6.itemID].isMap() && this.playerNetServerHandler.getNumChunkDataPackets() <= 5) + { +! Packet var8 = ((ItemMapBase)Item.itemsList[var6.itemID]).getUpdatePacket(var6, this.worldObj, this); + + if (var8 != null) + { +! this.playerNetServerHandler.sendPacket(var8); + } + } + } + + if (this.getHealth() != this.lastHealth || this.lastFoodLevel != this.foodStats.getFoodLevel() || this.foodStats.getSaturationLevel() == 0.0F != this.wasHungry) + { +! this.playerNetServerHandler.sendPacket(new Packet8UpdateHealth(this.getHealth(), this.foodStats.getFoodLevel(), this.foodStats.getSaturationLevel())); + this.lastHealth = this.getHealth(); + this.lastFoodLevel = this.foodStats.getFoodLevel(); + this.wasHungry = this.foodStats.getSaturationLevel() == 0.0F; + } + +--- 248,271 ---- + + for (int var1 = 0; var1 < this.inventory.getSizeInventory(); ++var1) + { + ItemStack var6 = this.inventory.getStackInSlot(var1); + +! if (var6 != null && Item.itemsList[var6.itemID].isMap() && this.playerNetServerHandler.packetSize() <= 5) + { +! Packet var8 = ((ItemMapBase)Item.itemsList[var6.itemID]).createMapDataPacket(var6, this.worldObj, this); + + if (var8 != null) + { +! this.playerNetServerHandler.sendPacketToPlayer(var8); + } + } + } + + if (this.getHealth() != this.lastHealth || this.lastFoodLevel != this.foodStats.getFoodLevel() || this.foodStats.getSaturationLevel() == 0.0F != this.wasHungry) + { +! this.playerNetServerHandler.sendPacketToPlayer(new Packet8UpdateHealth(this.getHealth(), this.foodStats.getFoodLevel(), this.foodStats.getSaturationLevel())); + this.lastHealth = this.getHealth(); + this.lastFoodLevel = this.foodStats.getFoodLevel(); + this.wasHungry = this.foodStats.getSaturationLevel() == 0.0F; + } + +*************** +*** 283,293 **** + } + + if (this.experienceTotal != this.lastExperience) + { + this.lastExperience = this.experienceTotal; +! this.playerNetServerHandler.sendPacket(new Packet43Experience(this.experience, this.experienceTotal, this.experienceLevel)); + } + } + catch (Throwable var4) + { + CrashReport var2 = CrashReport.makeCrashReport(var4, "Ticking player"); +--- 283,293 ---- + } + + if (this.experienceTotal != this.lastExperience) + { + this.lastExperience = this.experienceTotal; +! this.playerNetServerHandler.sendPacketToPlayer(new Packet43Experience(this.experience, this.experienceTotal, this.experienceLevel)); + } + } + catch (Throwable var4) + { + CrashReport var2 = CrashReport.makeCrashReport(var4, "Ticking player"); +*************** +*** 340,350 **** + } + else + { + boolean var3 = this.mcServer.isDedicatedServer() && this.mcServer.isPVPEnabled() && "fall".equals(par1DamageSource.damageType); + +! if (!var3 && this.ticksOfInvuln > 0 && par1DamageSource != DamageSource.outOfWorld) + { + return false; + } + else + { +--- 340,350 ---- + } + else + { + boolean var3 = this.mcServer.isDedicatedServer() && this.mcServer.isPVPEnabled() && "fall".equals(par1DamageSource.damageType); + +! if (!var3 && this.initialInvulnerability > 0 && par1DamageSource != DamageSource.outOfWorld) + { + return false; + } + else + { +*************** +*** 386,396 **** + if (this.dimension == 1 && par1 == 1) + { + this.triggerAchievement(AchievementList.theEnd2); + this.worldObj.removeEntity(this); + this.playerConqueredTheEnd = true; +! this.playerNetServerHandler.sendPacket(new Packet70GameEvent(4, 0)); + } + else + { + if (this.dimension == 0 && par1 == 1) + { +--- 386,396 ---- + if (this.dimension == 1 && par1 == 1) + { + this.triggerAchievement(AchievementList.theEnd2); + this.worldObj.removeEntity(this); + this.playerConqueredTheEnd = true; +! this.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(4, 0)); + } + else + { + if (this.dimension == 0 && par1 == 1) + { +*************** +*** 415,435 **** + this.lastFoodLevel = -1; + } + } + + /** +! * gets description packets from all TileEntity's that override func_20070 + */ +! private void getTileEntityInfo(TileEntity par1TileEntity) + { + if (par1TileEntity != null) + { + Packet var2 = par1TileEntity.getDescriptionPacket(); + + if (var2 != null) + { +! this.playerNetServerHandler.sendPacket(var2); + } + } + } + + /** +--- 415,435 ---- + this.lastFoodLevel = -1; + } + } + + /** +! * called from onUpdate for all tileEntity in specific chunks + */ +! private void sendTileEntityToPlayer(TileEntity par1TileEntity) + { + if (par1TileEntity != null) + { + Packet var2 = par1TileEntity.getDescriptionPacket(); + + if (var2 != null) + { +! this.playerNetServerHandler.sendPacketToPlayer(var2); + } + } + } + + /** +*************** +*** 440,461 **** + super.onItemPickup(par1Entity, par2); + this.openContainer.detectAndSendChanges(); + } + + /** +! * puts player to sleep on specified bed if possible + */ + public EnumStatus sleepInBedAt(int par1, int par2, int par3) + { + EnumStatus var4 = super.sleepInBedAt(par1, par2, par3); + + if (var4 == EnumStatus.OK) + { + Packet17Sleep var5 = new Packet17Sleep(this, 0, par1, par2, par3); +! this.getServerForPlayer().getEntityTracker().sendPacketToTrackedPlayers(this, var5); + this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); +! this.playerNetServerHandler.sendPacket(var5); + } + + return var4; + } + +--- 440,461 ---- + super.onItemPickup(par1Entity, par2); + this.openContainer.detectAndSendChanges(); + } + + /** +! * Attempts to have the player sleep in a bed at the specified location. + */ + public EnumStatus sleepInBedAt(int par1, int par2, int par3) + { + EnumStatus var4 = super.sleepInBedAt(par1, par2, par3); + + if (var4 == EnumStatus.OK) + { + Packet17Sleep var5 = new Packet17Sleep(this, 0, par1, par2, par3); +! this.getServerForPlayer().getEntityTracker().sendPacketToAllPlayersTrackingEntity(this, var5); + this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); +! this.playerNetServerHandler.sendPacketToPlayer(var5); + } + + return var4; + } + +*************** +*** 464,474 **** + */ + public void wakeUpPlayer(boolean par1, boolean par2, boolean par3) + { + if (this.isPlayerSleeping()) + { +! this.getServerForPlayer().getEntityTracker().sendPacketToTrackedPlayersAndTrackedEntity(this, new Packet18Animation(this, 3)); + } + + super.wakeUpPlayer(par1, par2, par3); + + if (this.playerNetServerHandler != null) +--- 464,474 ---- + */ + public void wakeUpPlayer(boolean par1, boolean par2, boolean par3) + { + if (this.isPlayerSleeping()) + { +! this.getServerForPlayer().getEntityTracker().sendPacketToAllAssociatedPlayers(this, new Packet18Animation(this, 3)); + } + + super.wakeUpPlayer(par1, par2, par3); + + if (this.playerNetServerHandler != null) +*************** +*** 481,504 **** + * Called when a player mounts an entity. e.g. mounts a pig, mounts a boat. + */ + public void mountEntity(Entity par1Entity) + { + super.mountEntity(par1Entity); +! this.playerNetServerHandler.sendPacket(new Packet39AttachEntity(0, this, this.ridingEntity)); + this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + } + + /** + * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance + * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround + */ + protected void updateFallState(double par1, boolean par3) {} + + /** +! * process player falling based on movement packet + */ +! public void handleFalling(double par1, boolean par3) + { + super.updateFallState(par1, par3); + } + + /** +--- 481,504 ---- + * Called when a player mounts an entity. e.g. mounts a pig, mounts a boat. + */ + public void mountEntity(Entity par1Entity) + { + super.mountEntity(par1Entity); +! this.playerNetServerHandler.sendPacketToPlayer(new Packet39AttachEntity(0, this, this.ridingEntity)); + this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + } + + /** + * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance + * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround + */ + protected void updateFallState(double par1, boolean par3) {} + + /** +! * likeUpdateFallState, but called from updateFlyingState, rather than moveEntity + */ +! public void updateFlyingState(double par1, boolean par3) + { + super.updateFallState(par1, par3); + } + + /** +*************** +*** 507,559 **** + public void displayGUIEditSign(TileEntity par1TileEntity) + { + if (par1TileEntity instanceof TileEntitySign) + { + ((TileEntitySign)par1TileEntity).func_142010_a(this); +! this.playerNetServerHandler.sendPacket(new Packet133TileEditorOpen(0, par1TileEntity.xCoord, par1TileEntity.yCoord, par1TileEntity.zCoord)); + } + } + +! /** +! * get the next window id to use +! */ +! private void getNextWindowId() + { + this.currentWindowId = this.currentWindowId % 100 + 1; + } + + /** + * Displays the crafting GUI for a workbench. + */ + public void displayGUIWorkbench(int par1, int par2, int par3) + { +! this.getNextWindowId(); +! this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 1, "Crafting", 9, true)); + this.openContainer = new ContainerWorkbench(this.inventory, this.worldObj, par1, par2, par3); + this.openContainer.windowId = this.currentWindowId; +! this.openContainer.onCraftGuiOpened(this); + } + + public void displayGUIEnchantment(int par1, int par2, int par3, String par4Str) + { +! this.getNextWindowId(); +! this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 4, par4Str == null ? "" : par4Str, 9, par4Str != null)); + this.openContainer = new ContainerEnchantment(this.inventory, this.worldObj, par1, par2, par3); + this.openContainer.windowId = this.currentWindowId; +! this.openContainer.onCraftGuiOpened(this); + } + + /** + * Displays the GUI for interacting with an anvil. + */ + public void displayGUIAnvil(int par1, int par2, int par3) + { +! this.getNextWindowId(); +! this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 8, "Repairing", 9, true)); + this.openContainer = new ContainerRepair(this.inventory, this.worldObj, par1, par2, par3, this); + this.openContainer.windowId = this.currentWindowId; +! this.openContainer.onCraftGuiOpened(this); + } + + /** + * Displays the GUI for interacting with a chest inventory. Args: chestInventory + */ +--- 507,556 ---- + public void displayGUIEditSign(TileEntity par1TileEntity) + { + if (par1TileEntity instanceof TileEntitySign) + { + ((TileEntitySign)par1TileEntity).func_142010_a(this); +! this.playerNetServerHandler.sendPacketToPlayer(new Packet133TileEditorOpen(0, par1TileEntity.xCoord, par1TileEntity.yCoord, par1TileEntity.zCoord)); + } + } + +! private void incrementWindowID() + { + this.currentWindowId = this.currentWindowId % 100 + 1; + } + + /** + * Displays the crafting GUI for a workbench. + */ + public void displayGUIWorkbench(int par1, int par2, int par3) + { +! this.incrementWindowID(); +! this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 1, "Crafting", 9, true)); + this.openContainer = new ContainerWorkbench(this.inventory, this.worldObj, par1, par2, par3); + this.openContainer.windowId = this.currentWindowId; +! this.openContainer.addCraftingToCrafters(this); + } + + public void displayGUIEnchantment(int par1, int par2, int par3, String par4Str) + { +! this.incrementWindowID(); +! this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 4, par4Str == null ? "" : par4Str, 9, par4Str != null)); + this.openContainer = new ContainerEnchantment(this.inventory, this.worldObj, par1, par2, par3); + this.openContainer.windowId = this.currentWindowId; +! this.openContainer.addCraftingToCrafters(this); + } + + /** + * Displays the GUI for interacting with an anvil. + */ + public void displayGUIAnvil(int par1, int par2, int par3) + { +! this.incrementWindowID(); +! this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 8, "Repairing", 9, true)); + this.openContainer = new ContainerRepair(this.inventory, this.worldObj, par1, par2, par3, this); + this.openContainer.windowId = this.currentWindowId; +! this.openContainer.addCraftingToCrafters(this); + } + + /** + * Displays the GUI for interacting with a chest inventory. Args: chestInventory + */ +*************** +*** 562,663 **** + if (this.openContainer != this.inventoryContainer) + { + this.closeScreen(); + } + +! this.getNextWindowId(); +! this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 0, par1IInventory.getInvName(), par1IInventory.getSizeInventory(), par1IInventory.isInvNameLocalized())); + this.openContainer = new ContainerChest(this.inventory, par1IInventory); + this.openContainer.windowId = this.currentWindowId; +! this.openContainer.onCraftGuiOpened(this); + } + + public void displayGUIHopper(TileEntityHopper par1TileEntityHopper) + { +! this.getNextWindowId(); +! this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 9, par1TileEntityHopper.getInvName(), par1TileEntityHopper.getSizeInventory(), par1TileEntityHopper.isInvNameLocalized())); + this.openContainer = new ContainerHopper(this.inventory, par1TileEntityHopper); + this.openContainer.windowId = this.currentWindowId; +! this.openContainer.onCraftGuiOpened(this); + } + + public void displayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper) + { +! this.getNextWindowId(); +! this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 9, par1EntityMinecartHopper.getInvName(), par1EntityMinecartHopper.getSizeInventory(), par1EntityMinecartHopper.isInvNameLocalized())); + this.openContainer = new ContainerHopper(this.inventory, par1EntityMinecartHopper); + this.openContainer.windowId = this.currentWindowId; +! this.openContainer.onCraftGuiOpened(this); + } + + /** + * Displays the furnace GUI for the passed in furnace entity. Args: tileEntityFurnace + */ + public void displayGUIFurnace(TileEntityFurnace par1TileEntityFurnace) + { +! this.getNextWindowId(); +! this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 2, par1TileEntityFurnace.getInvName(), par1TileEntityFurnace.getSizeInventory(), par1TileEntityFurnace.isInvNameLocalized())); + this.openContainer = new ContainerFurnace(this.inventory, par1TileEntityFurnace); + this.openContainer.windowId = this.currentWindowId; +! this.openContainer.onCraftGuiOpened(this); + } + + /** + * Displays the dipsenser GUI for the passed in dispenser entity. Args: TileEntityDispenser + */ + public void displayGUIDispenser(TileEntityDispenser par1TileEntityDispenser) + { +! this.getNextWindowId(); +! this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, par1TileEntityDispenser instanceof TileEntityDropper ? 10 : 3, par1TileEntityDispenser.getInvName(), par1TileEntityDispenser.getSizeInventory(), par1TileEntityDispenser.isInvNameLocalized())); + this.openContainer = new ContainerDispenser(this.inventory, par1TileEntityDispenser); + this.openContainer.windowId = this.currentWindowId; +! this.openContainer.onCraftGuiOpened(this); + } + + /** + * Displays the GUI for interacting with a brewing stand. + */ + public void displayGUIBrewingStand(TileEntityBrewingStand par1TileEntityBrewingStand) + { +! this.getNextWindowId(); +! this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 5, par1TileEntityBrewingStand.getInvName(), par1TileEntityBrewingStand.getSizeInventory(), par1TileEntityBrewingStand.isInvNameLocalized())); + this.openContainer = new ContainerBrewingStand(this.inventory, par1TileEntityBrewingStand); + this.openContainer.windowId = this.currentWindowId; +! this.openContainer.onCraftGuiOpened(this); + } + + /** + * Displays the GUI for interacting with a beacon. + */ + public void displayGUIBeacon(TileEntityBeacon par1TileEntityBeacon) + { +! this.getNextWindowId(); +! this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 7, par1TileEntityBeacon.getInvName(), par1TileEntityBeacon.getSizeInventory(), par1TileEntityBeacon.isInvNameLocalized())); + this.openContainer = new ContainerBeacon(this.inventory, par1TileEntityBeacon); + this.openContainer.windowId = this.currentWindowId; +! this.openContainer.onCraftGuiOpened(this); + } + + public void displayGUIMerchant(IMerchant par1IMerchant, String par2Str) + { +! this.getNextWindowId(); + this.openContainer = new ContainerMerchant(this.inventory, par1IMerchant, this.worldObj); + this.openContainer.windowId = this.currentWindowId; +! this.openContainer.onCraftGuiOpened(this); + InventoryMerchant var3 = ((ContainerMerchant)this.openContainer).getMerchantInventory(); +! this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 6, par2Str == null ? "" : par2Str, var3.getSizeInventory(), par2Str != null)); + MerchantRecipeList var4 = par1IMerchant.getRecipes(this); + + if (var4 != null) + { + try + { + ByteArrayOutputStream var5 = new ByteArrayOutputStream(); + DataOutputStream var6 = new DataOutputStream(var5); + var6.writeInt(this.currentWindowId); + var4.writeRecipiesToStream(var6); +! this.playerNetServerHandler.sendPacket(new Packet250CustomPayload("MC|TrList", var5.toByteArray())); + } + catch (IOException var7) + { + var7.printStackTrace(); + } +--- 559,660 ---- + if (this.openContainer != this.inventoryContainer) + { + this.closeScreen(); + } + +! this.incrementWindowID(); +! this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 0, par1IInventory.getInvName(), par1IInventory.getSizeInventory(), par1IInventory.isInvNameLocalized())); + this.openContainer = new ContainerChest(this.inventory, par1IInventory); + this.openContainer.windowId = this.currentWindowId; +! this.openContainer.addCraftingToCrafters(this); + } + + public void displayGUIHopper(TileEntityHopper par1TileEntityHopper) + { +! this.incrementWindowID(); +! this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 9, par1TileEntityHopper.getInvName(), par1TileEntityHopper.getSizeInventory(), par1TileEntityHopper.isInvNameLocalized())); + this.openContainer = new ContainerHopper(this.inventory, par1TileEntityHopper); + this.openContainer.windowId = this.currentWindowId; +! this.openContainer.addCraftingToCrafters(this); + } + + public void displayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper) + { +! this.incrementWindowID(); +! this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 9, par1EntityMinecartHopper.getInvName(), par1EntityMinecartHopper.getSizeInventory(), par1EntityMinecartHopper.isInvNameLocalized())); + this.openContainer = new ContainerHopper(this.inventory, par1EntityMinecartHopper); + this.openContainer.windowId = this.currentWindowId; +! this.openContainer.addCraftingToCrafters(this); + } + + /** + * Displays the furnace GUI for the passed in furnace entity. Args: tileEntityFurnace + */ + public void displayGUIFurnace(TileEntityFurnace par1TileEntityFurnace) + { +! this.incrementWindowID(); +! this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 2, par1TileEntityFurnace.getInvName(), par1TileEntityFurnace.getSizeInventory(), par1TileEntityFurnace.isInvNameLocalized())); + this.openContainer = new ContainerFurnace(this.inventory, par1TileEntityFurnace); + this.openContainer.windowId = this.currentWindowId; +! this.openContainer.addCraftingToCrafters(this); + } + + /** + * Displays the dipsenser GUI for the passed in dispenser entity. Args: TileEntityDispenser + */ + public void displayGUIDispenser(TileEntityDispenser par1TileEntityDispenser) + { +! this.incrementWindowID(); +! this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, par1TileEntityDispenser instanceof TileEntityDropper ? 10 : 3, par1TileEntityDispenser.getInvName(), par1TileEntityDispenser.getSizeInventory(), par1TileEntityDispenser.isInvNameLocalized())); + this.openContainer = new ContainerDispenser(this.inventory, par1TileEntityDispenser); + this.openContainer.windowId = this.currentWindowId; +! this.openContainer.addCraftingToCrafters(this); + } + + /** + * Displays the GUI for interacting with a brewing stand. + */ + public void displayGUIBrewingStand(TileEntityBrewingStand par1TileEntityBrewingStand) + { +! this.incrementWindowID(); +! this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 5, par1TileEntityBrewingStand.getInvName(), par1TileEntityBrewingStand.getSizeInventory(), par1TileEntityBrewingStand.isInvNameLocalized())); + this.openContainer = new ContainerBrewingStand(this.inventory, par1TileEntityBrewingStand); + this.openContainer.windowId = this.currentWindowId; +! this.openContainer.addCraftingToCrafters(this); + } + + /** + * Displays the GUI for interacting with a beacon. + */ + public void displayGUIBeacon(TileEntityBeacon par1TileEntityBeacon) + { +! this.incrementWindowID(); +! this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 7, par1TileEntityBeacon.getInvName(), par1TileEntityBeacon.getSizeInventory(), par1TileEntityBeacon.isInvNameLocalized())); + this.openContainer = new ContainerBeacon(this.inventory, par1TileEntityBeacon); + this.openContainer.windowId = this.currentWindowId; +! this.openContainer.addCraftingToCrafters(this); + } + + public void displayGUIMerchant(IMerchant par1IMerchant, String par2Str) + { +! this.incrementWindowID(); + this.openContainer = new ContainerMerchant(this.inventory, par1IMerchant, this.worldObj); + this.openContainer.windowId = this.currentWindowId; +! this.openContainer.addCraftingToCrafters(this); + InventoryMerchant var3 = ((ContainerMerchant)this.openContainer).getMerchantInventory(); +! this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 6, par2Str == null ? "" : par2Str, var3.getSizeInventory(), par2Str != null)); + MerchantRecipeList var4 = par1IMerchant.getRecipes(this); + + if (var4 != null) + { + try + { + ByteArrayOutputStream var5 = new ByteArrayOutputStream(); + DataOutputStream var6 = new DataOutputStream(var5); + var6.writeInt(this.currentWindowId); + var4.writeRecipiesToStream(var6); +! this.playerNetServerHandler.sendPacketToPlayer(new Packet250CustomPayload("MC|TrList", var5.toByteArray())); + } + catch (IOException var7) + { + var7.printStackTrace(); + } +*************** +*** 669,741 **** + if (this.openContainer != this.inventoryContainer) + { + this.closeScreen(); + } + +! this.getNextWindowId(); +! this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 11, par2IInventory.getInvName(), par2IInventory.getSizeInventory(), par2IInventory.isInvNameLocalized(), par1EntityHorse.entityId)); + this.openContainer = new ContainerHorseInventory(this.inventory, par2IInventory, par1EntityHorse); + this.openContainer.windowId = this.currentWindowId; +! this.openContainer.onCraftGuiOpened(this); + } + + /** + * Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual + * contents of that slot. Args: Container, slot number, slot contents + */ + public void sendSlotContents(Container par1Container, int par2, ItemStack par3ItemStack) + { + if (!(par1Container.getSlot(par2) instanceof SlotCrafting)) + { +! if (!this.isChangingQuantityOnly) + { +! this.playerNetServerHandler.sendPacket(new Packet103SetSlot(par1Container.windowId, par2, par3ItemStack)); + } + } + } + + public void sendContainerToPlayer(Container par1Container) + { +! this.updateCraftingInventory(par1Container, par1Container.getInventory()); + } + +! /** +! * update the crafting window inventory with the items in the list +! */ +! public void updateCraftingInventory(Container par1Container, List par2List) + { +! this.playerNetServerHandler.sendPacket(new Packet104WindowItems(par1Container.windowId, par2List)); +! this.playerNetServerHandler.sendPacket(new Packet103SetSlot(-1, -1, this.inventory.getItemStack())); + } + + /** + * Sends two ints to the client-side Container. Used for furnace burning time, smelting progress, brewing progress, + * and enchanting level. Normally the first int identifies which variable to update, and the second contains the new + * value. Both are truncated to shorts in non-local SMP. + */ + public void sendProgressBarUpdate(Container par1Container, int par2, int par3) + { +! this.playerNetServerHandler.sendPacket(new Packet105UpdateProgressbar(par1Container.windowId, par2, par3)); + } + + /** +! * set current crafting inventory back to the 2x2 square + */ + public void closeScreen() + { +! this.playerNetServerHandler.sendPacket(new Packet101CloseWindow(this.openContainer.windowId)); + this.closeContainer(); + } + + /** + * updates item held by mouse + */ + public void updateHeldItem() + { +! if (!this.isChangingQuantityOnly) + { +! this.playerNetServerHandler.sendPacket(new Packet103SetSlot(-1, -1, this.inventory.getItemStack())); + } + } + + /** + * Closes the container the player currently has open. +--- 666,735 ---- + if (this.openContainer != this.inventoryContainer) + { + this.closeScreen(); + } + +! this.incrementWindowID(); +! this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 11, par2IInventory.getInvName(), par2IInventory.getSizeInventory(), par2IInventory.isInvNameLocalized(), par1EntityHorse.entityId)); + this.openContainer = new ContainerHorseInventory(this.inventory, par2IInventory, par1EntityHorse); + this.openContainer.windowId = this.currentWindowId; +! this.openContainer.addCraftingToCrafters(this); + } + + /** + * Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual + * contents of that slot. Args: Container, slot number, slot contents + */ + public void sendSlotContents(Container par1Container, int par2, ItemStack par3ItemStack) + { + if (!(par1Container.getSlot(par2) instanceof SlotCrafting)) + { +! if (!this.playerInventoryBeingManipulated) + { +! this.playerNetServerHandler.sendPacketToPlayer(new Packet103SetSlot(par1Container.windowId, par2, par3ItemStack)); + } + } + } + + public void sendContainerToPlayer(Container par1Container) + { +! this.sendContainerAndContentsToPlayer(par1Container, par1Container.getInventory()); + } + +! public void sendContainerAndContentsToPlayer(Container par1Container, List par2List) + { +! this.playerNetServerHandler.sendPacketToPlayer(new Packet104WindowItems(par1Container.windowId, par2List)); +! this.playerNetServerHandler.sendPacketToPlayer(new Packet103SetSlot(-1, -1, this.inventory.getItemStack())); + } + + /** + * Sends two ints to the client-side Container. Used for furnace burning time, smelting progress, brewing progress, + * and enchanting level. Normally the first int identifies which variable to update, and the second contains the new + * value. Both are truncated to shorts in non-local SMP. + */ + public void sendProgressBarUpdate(Container par1Container, int par2, int par3) + { +! this.playerNetServerHandler.sendPacketToPlayer(new Packet105UpdateProgressbar(par1Container.windowId, par2, par3)); + } + + /** +! * sets current screen to null (used on escape buttons of GUIs) + */ + public void closeScreen() + { +! this.playerNetServerHandler.sendPacketToPlayer(new Packet101CloseWindow(this.openContainer.windowId)); + this.closeContainer(); + } + + /** + * updates item held by mouse + */ + public void updateHeldItem() + { +! if (!this.playerInventoryBeingManipulated) + { +! this.playerNetServerHandler.sendPacketToPlayer(new Packet103SetSlot(-1, -1, this.inventory.getItemStack())); + } + } + + /** + * Closes the container the player currently has open. +*************** +*** 772,782 **** + { + if (par1StatBase != null) + { + if (!par1StatBase.isIndependent) + { +! this.playerNetServerHandler.sendPacket(new Packet200Statistic(par1StatBase.statId, par2)); + } + } + } + + public void mountEntityAndWakeUp() +--- 766,776 ---- + { + if (par1StatBase != null) + { + if (!par1StatBase.isIndependent) + { +! this.playerNetServerHandler.sendPacketToPlayer(new Packet200Statistic(par1StatBase.statId, par2)); + } + } + } + + public void mountEntityAndWakeUp() +*************** +*** 804,822 **** + /** + * Add a chat message to the player + */ + public void addChatMessage(String par1Str) + { +! this.playerNetServerHandler.sendPacket(new Packet3Chat(ChatMessageComponent.createFromTranslationKey(par1Str))); + } + + /** + * Used for when item use count runs out, ie: eating completed + */ + protected void onItemUseFinish() + { +! this.playerNetServerHandler.sendPacket(new Packet38EntityStatus(this.entityId, (byte)9)); + super.onItemUseFinish(); + } + + /** + * sets the itemInUse when the use item button is clicked. Args: itemstack, int maxItemUseDuration +--- 798,816 ---- + /** + * Add a chat message to the player + */ + public void addChatMessage(String par1Str) + { +! this.playerNetServerHandler.sendPacketToPlayer(new Packet3Chat(ChatMessageComponent.createFromTranslationKey(par1Str))); + } + + /** + * Used for when item use count runs out, ie: eating completed + */ + protected void onItemUseFinish() + { +! this.playerNetServerHandler.sendPacketToPlayer(new Packet38EntityStatus(this.entityId, (byte)9)); + super.onItemUseFinish(); + } + + /** + * sets the itemInUse when the use item button is clicked. Args: itemstack, int maxItemUseDuration +*************** +*** 825,835 **** + { + super.setItemInUse(par1ItemStack, par2); + + if (par1ItemStack != null && par1ItemStack.getItem() != null && par1ItemStack.getItem().getItemUseAction(par1ItemStack) == EnumAction.eat) + { +! this.getServerForPlayer().getEntityTracker().sendPacketToTrackedPlayersAndTrackedEntity(this, new Packet18Animation(this, 5)); + } + } + + /** + * Copies the values from the given player into this player if boolean par2 is true. Always clones Ender Chest +--- 819,829 ---- + { + super.setItemInUse(par1ItemStack, par2); + + if (par1ItemStack != null && par1ItemStack.getItem() != null && par1ItemStack.getItem().getItemUseAction(par1ItemStack) == EnumAction.eat) + { +! this.getServerForPlayer().getEntityTracker().sendPacketToAllAssociatedPlayers(this, new Packet18Animation(this, 5)); + } + } + + /** + * Copies the values from the given player into this player if boolean par2 is true. Always clones Ender Chest +*************** +*** 845,871 **** + } + + protected void onNewPotionEffect(PotionEffect par1PotionEffect) + { + super.onNewPotionEffect(par1PotionEffect); +! this.playerNetServerHandler.sendPacket(new Packet41EntityEffect(this.entityId, par1PotionEffect)); + } + + protected void onChangedPotionEffect(PotionEffect par1PotionEffect, boolean par2) + { + super.onChangedPotionEffect(par1PotionEffect, par2); +! this.playerNetServerHandler.sendPacket(new Packet41EntityEffect(this.entityId, par1PotionEffect)); + } + + protected void onFinishedPotionEffect(PotionEffect par1PotionEffect) + { + super.onFinishedPotionEffect(par1PotionEffect); +! this.playerNetServerHandler.sendPacket(new Packet42RemoveEntityEffect(this.entityId, par1PotionEffect)); + } + + /** +! * Sets the position of the entity and updates the 'last' variables + */ + public void setPositionAndUpdate(double par1, double par3, double par5) + { + this.playerNetServerHandler.setPlayerLocation(par1, par3, par5, this.rotationYaw, this.rotationPitch); + } +--- 839,865 ---- + } + + protected void onNewPotionEffect(PotionEffect par1PotionEffect) + { + super.onNewPotionEffect(par1PotionEffect); +! this.playerNetServerHandler.sendPacketToPlayer(new Packet41EntityEffect(this.entityId, par1PotionEffect)); + } + + protected void onChangedPotionEffect(PotionEffect par1PotionEffect, boolean par2) + { + super.onChangedPotionEffect(par1PotionEffect, par2); +! this.playerNetServerHandler.sendPacketToPlayer(new Packet41EntityEffect(this.entityId, par1PotionEffect)); + } + + protected void onFinishedPotionEffect(PotionEffect par1PotionEffect) + { + super.onFinishedPotionEffect(par1PotionEffect); +! this.playerNetServerHandler.sendPacketToPlayer(new Packet42RemoveEntityEffect(this.entityId, par1PotionEffect)); + } + + /** +! * Move the entity to the coordinates informed, but keep yaw/pitch values. + */ + public void setPositionAndUpdate(double par1, double par3, double par5) + { + this.playerNetServerHandler.setPlayerLocation(par1, par3, par5, this.rotationYaw, this.rotationPitch); + } +*************** +*** 873,898 **** + /** + * Called when the player performs a critical hit on the Entity. Args: entity that was hit critically + */ + public void onCriticalHit(Entity par1Entity) + { +! this.getServerForPlayer().getEntityTracker().sendPacketToTrackedPlayersAndTrackedEntity(this, new Packet18Animation(par1Entity, 6)); + } + + public void onEnchantmentCritical(Entity par1Entity) + { +! this.getServerForPlayer().getEntityTracker().sendPacketToTrackedPlayersAndTrackedEntity(this, new Packet18Animation(par1Entity, 7)); + } + + /** + * Sends the player's abilities to the server (if there is one). + */ + public void sendPlayerAbilities() + { + if (this.playerNetServerHandler != null) + { +! this.playerNetServerHandler.sendPacket(new Packet202PlayerAbilities(this.capabilities)); + } + } + + public WorldServer getServerForPlayer() + { +--- 867,892 ---- + /** + * Called when the player performs a critical hit on the Entity. Args: entity that was hit critically + */ + public void onCriticalHit(Entity par1Entity) + { +! this.getServerForPlayer().getEntityTracker().sendPacketToAllAssociatedPlayers(this, new Packet18Animation(par1Entity, 6)); + } + + public void onEnchantmentCritical(Entity par1Entity) + { +! this.getServerForPlayer().getEntityTracker().sendPacketToAllAssociatedPlayers(this, new Packet18Animation(par1Entity, 7)); + } + + /** + * Sends the player's abilities to the server (if there is one). + */ + public void sendPlayerAbilities() + { + if (this.playerNetServerHandler != null) + { +! this.playerNetServerHandler.sendPacketToPlayer(new Packet202PlayerAbilities(this.capabilities)); + } + } + + public WorldServer getServerForPlayer() + { +*************** +*** 903,918 **** + * Sets the player's game mode and sends it to them. + */ + public void setGameType(EnumGameType par1EnumGameType) + { + this.theItemInWorldManager.setGameType(par1EnumGameType); +! this.playerNetServerHandler.sendPacket(new Packet70GameEvent(3, par1EnumGameType.getID())); + } + + public void sendChatToPlayer(ChatMessageComponent par1ChatMessageComponent) + { +! this.playerNetServerHandler.sendPacket(new Packet3Chat(par1ChatMessageComponent)); + } + + /** + * Returns true if the command sender is allowed to use the given command. + */ +--- 897,912 ---- + * Sets the player's game mode and sends it to them. + */ + public void setGameType(EnumGameType par1EnumGameType) + { + this.theItemInWorldManager.setGameType(par1EnumGameType); +! this.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(3, par1EnumGameType.getID())); + } + + public void sendChatToPlayer(ChatMessageComponent par1ChatMessageComponent) + { +! this.playerNetServerHandler.sendPacketToPlayer(new Packet3Chat(par1ChatMessageComponent)); + } + + /** + * Returns true if the command sender is allowed to use the given command. + */ +*************** +*** 924,934 **** + /** + * Gets the player's IP address. Used in /banip. + */ + public String getPlayerIP() + { +! String var1 = this.playerNetServerHandler.netManager.getRemoteAddress().toString(); + var1 = var1.substring(var1.indexOf("/") + 1); + var1 = var1.substring(0, var1.indexOf(":")); + return var1; + } + +--- 918,928 ---- + /** + * Gets the player's IP address. Used in /banip. + */ + public String getPlayerIP() + { +! String var1 = this.playerNetServerHandler.netManager.getSocketAddress().toString(); + var1 = var1.substring(var1.indexOf("/") + 1); + var1 = var1.substring(0, var1.indexOf(":")); + return var1; + } + +*************** +*** 962,982 **** + * on recieving this message the client (if permission is given) will download the requested textures + */ + public void requestTexturePackLoad(String par1Str, int par2) + { + String var3 = par1Str + "\u0000" + par2; +! this.playerNetServerHandler.sendPacket(new Packet250CustomPayload("MC|TPack", var3.getBytes())); + } + + /** + * Return the position for this command sender. + */ +! public ChunkCoordinates getCommandSenderPosition() + { + return new ChunkCoordinates(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY + 0.5D), MathHelper.floor_double(this.posZ)); + } + + public void func_143004_u() + { +! this.field_143005_bX = MinecraftServer.getCurrentTimeMillis(); + } + } +--- 956,976 ---- + * on recieving this message the client (if permission is given) will download the requested textures + */ + public void requestTexturePackLoad(String par1Str, int par2) + { + String var3 = par1Str + "\u0000" + par2; +! this.playerNetServerHandler.sendPacketToPlayer(new Packet250CustomPayload("MC|TPack", var3.getBytes())); + } + + /** + * Return the position for this command sender. + */ +! public ChunkCoordinates getPlayerCoordinates() + { + return new ChunkCoordinates(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY + 0.5D), MathHelper.floor_double(this.posZ)); + } + + public void func_143004_u() + { +! this.field_143005_bX = MinecraftServer.getSystemTimeMillis(); + } + } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityPlayerSP.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,659 ---- ++ package net.minecraft.src; ++ ++ public class EntityPlayerSP extends AbstractClientPlayer ++ { ++ public MovementInput movementInput; ++ protected Minecraft mc; ++ ++ /** ++ * Used to tell if the player pressed forward twice. If this is at 0 and it's pressed (And they are allowed to ++ * sprint, aka enough food on the ground etc) it sets this to 7. If it's pressed and it's greater than 0 enable ++ * sprinting. ++ */ ++ protected int sprintToggleTimer; ++ ++ /** Ticks left before sprinting is disabled. */ ++ public int sprintingTicksLeft; ++ public float renderArmYaw; ++ public float renderArmPitch; ++ public float prevRenderArmYaw; ++ public float prevRenderArmPitch; ++ private int horseJumpPowerCounter; ++ private float horseJumpPower; ++ private MouseFilter field_71162_ch = new MouseFilter(); ++ private MouseFilter field_71160_ci = new MouseFilter(); ++ private MouseFilter field_71161_cj = new MouseFilter(); ++ ++ /** The amount of time an entity has been in a Portal */ ++ public float timeInPortal; ++ ++ /** The amount of time an entity has been in a Portal the previous tick */ ++ public float prevTimeInPortal; ++ ++ public EntityPlayerSP(Minecraft par1Minecraft, World par2World, Session par3Session, int par4) ++ { ++ super(par2World, par3Session.getUsername()); ++ this.mc = par1Minecraft; ++ this.dimension = par4; ++ } ++ ++ public void updateEntityActionState() ++ { ++ super.updateEntityActionState(); ++ this.moveStrafing = this.movementInput.moveStrafe; ++ this.moveForward = this.movementInput.moveForward; ++ this.isJumping = this.movementInput.jump; ++ this.prevRenderArmYaw = this.renderArmYaw; ++ this.prevRenderArmPitch = this.renderArmPitch; ++ this.renderArmPitch = (float)((double)this.renderArmPitch + (double)(this.rotationPitch - this.renderArmPitch) * 0.5D); ++ this.renderArmYaw = (float)((double)this.renderArmYaw + (double)(this.rotationYaw - this.renderArmYaw) * 0.5D); ++ } ++ ++ /** ++ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons ++ * use this to react to sunlight and start to burn. ++ */ ++ public void onLivingUpdate() ++ { ++ if (this.sprintingTicksLeft > 0) ++ { ++ --this.sprintingTicksLeft; ++ ++ if (this.sprintingTicksLeft == 0) ++ { ++ this.setSprinting(false); ++ } ++ } ++ ++ if (this.sprintToggleTimer > 0) ++ { ++ --this.sprintToggleTimer; ++ } ++ ++ if (this.mc.playerController.enableEverythingIsScrewedUpMode()) ++ { ++ this.posX = this.posZ = 0.5D; ++ this.posX = 0.0D; ++ this.posZ = 0.0D; ++ this.rotationYaw = (float)this.ticksExisted / 12.0F; ++ this.rotationPitch = 10.0F; ++ this.posY = 68.5D; ++ } ++ else ++ { ++ if (!this.mc.statFileWriter.hasAchievementUnlocked(AchievementList.openInventory)) ++ { ++ this.mc.guiAchievement.queueAchievementInformation(AchievementList.openInventory); ++ } ++ ++ this.prevTimeInPortal = this.timeInPortal; ++ ++ if (this.inPortal) ++ { ++ if (this.mc.currentScreen != null) ++ { ++ this.mc.displayGuiScreen((GuiScreen)null); ++ } ++ ++ if (this.timeInPortal == 0.0F) ++ { ++ this.mc.sndManager.playSoundFX("portal.trigger", 1.0F, this.rand.nextFloat() * 0.4F + 0.8F); ++ } ++ ++ this.timeInPortal += 0.0125F; ++ ++ if (this.timeInPortal >= 1.0F) ++ { ++ this.timeInPortal = 1.0F; ++ } ++ ++ this.inPortal = false; ++ } ++ else if (this.isPotionActive(Potion.confusion) && this.getActivePotionEffect(Potion.confusion).getDuration() > 60) ++ { ++ this.timeInPortal += 0.006666667F; ++ ++ if (this.timeInPortal > 1.0F) ++ { ++ this.timeInPortal = 1.0F; ++ } ++ } ++ else ++ { ++ if (this.timeInPortal > 0.0F) ++ { ++ this.timeInPortal -= 0.05F; ++ } ++ ++ if (this.timeInPortal < 0.0F) ++ { ++ this.timeInPortal = 0.0F; ++ } ++ } ++ ++ if (this.timeUntilPortal > 0) ++ { ++ --this.timeUntilPortal; ++ } ++ ++ boolean var1 = this.movementInput.jump; ++ float var2 = 0.8F; ++ boolean var3 = this.movementInput.moveForward >= var2; ++ this.movementInput.updatePlayerMoveState(); ++ ++ if (this.isUsingItem() && !this.isRiding()) ++ { ++ this.movementInput.moveStrafe *= 0.2F; ++ this.movementInput.moveForward *= 0.2F; ++ this.sprintToggleTimer = 0; ++ } ++ ++ if (this.movementInput.sneak && this.ySize < 0.2F) ++ { ++ this.ySize = 0.2F; ++ } ++ ++ this.pushOutOfBlocks(this.posX - (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ + (double)this.width * 0.35D); ++ this.pushOutOfBlocks(this.posX - (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ - (double)this.width * 0.35D); ++ this.pushOutOfBlocks(this.posX + (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ - (double)this.width * 0.35D); ++ this.pushOutOfBlocks(this.posX + (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ + (double)this.width * 0.35D); ++ boolean var4 = (float)this.getFoodStats().getFoodLevel() > 6.0F || this.capabilities.allowFlying; ++ ++ if (this.onGround && !var3 && this.movementInput.moveForward >= var2 && !this.isSprinting() && var4 && !this.isUsingItem() && !this.isPotionActive(Potion.blindness)) ++ { ++ if (this.sprintToggleTimer == 0) ++ { ++ this.sprintToggleTimer = 7; ++ } ++ else ++ { ++ this.setSprinting(true); ++ this.sprintToggleTimer = 0; ++ } ++ } ++ ++ if (this.isSneaking()) ++ { ++ this.sprintToggleTimer = 0; ++ } ++ ++ if (this.isSprinting() && (this.movementInput.moveForward < var2 || this.isCollidedHorizontally || !var4)) ++ { ++ this.setSprinting(false); ++ } ++ ++ if (this.capabilities.allowFlying && !var1 && this.movementInput.jump) ++ { ++ if (this.flyToggleTimer == 0) ++ { ++ this.flyToggleTimer = 7; ++ } ++ else ++ { ++ this.capabilities.isFlying = !this.capabilities.isFlying; ++ this.sendPlayerAbilities(); ++ this.flyToggleTimer = 0; ++ } ++ } ++ ++ if (this.capabilities.isFlying) ++ { ++ if (this.movementInput.sneak) ++ { ++ this.motionY -= 0.15D; ++ } ++ ++ if (this.movementInput.jump) ++ { ++ this.motionY += 0.15D; ++ } ++ } ++ ++ if (this.isRidingHorse()) ++ { ++ if (this.horseJumpPowerCounter < 0) ++ { ++ ++this.horseJumpPowerCounter; ++ ++ if (this.horseJumpPowerCounter == 0) ++ { ++ this.horseJumpPower = 0.0F; ++ } ++ } ++ ++ if (var1 && !this.movementInput.jump) ++ { ++ this.horseJumpPowerCounter = -10; ++ this.func_110318_g(); ++ } ++ else if (!var1 && this.movementInput.jump) ++ { ++ this.horseJumpPowerCounter = 0; ++ this.horseJumpPower = 0.0F; ++ } ++ else if (var1) ++ { ++ ++this.horseJumpPowerCounter; ++ ++ if (this.horseJumpPowerCounter < 10) ++ { ++ this.horseJumpPower = (float)this.horseJumpPowerCounter * 0.1F; ++ } ++ else ++ { ++ this.horseJumpPower = 0.8F + 2.0F / (float)(this.horseJumpPowerCounter - 9) * 0.1F; ++ } ++ } ++ } ++ else ++ { ++ this.horseJumpPower = 0.0F; ++ } ++ ++ super.onLivingUpdate(); ++ ++ if (this.onGround && this.capabilities.isFlying) ++ { ++ this.capabilities.isFlying = false; ++ this.sendPlayerAbilities(); ++ } ++ } ++ } ++ ++ /** ++ * Gets the player's field of view multiplier. (ex. when flying) ++ */ ++ public float getFOVMultiplier() ++ { ++ float var1 = 1.0F; ++ ++ if (this.capabilities.isFlying) ++ { ++ var1 *= 1.1F; ++ } ++ ++ AttributeInstance var2 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); ++ var1 = (float)((double)var1 * ((var2.getAttributeValue() / (double)this.capabilities.getWalkSpeed() + 1.0D) / 2.0D)); ++ ++ if (this.isUsingItem() && this.getItemInUse().itemID == Item.bow.itemID) ++ { ++ int var3 = this.getItemInUseDuration(); ++ float var4 = (float)var3 / 20.0F; ++ ++ if (var4 > 1.0F) ++ { ++ var4 = 1.0F; ++ } ++ else ++ { ++ var4 *= var4; ++ } ++ ++ var1 *= 1.0F - var4 * 0.15F; ++ } ++ ++ return var1; ++ } ++ ++ /** ++ * sets current screen to null (used on escape buttons of GUIs) ++ */ ++ public void closeScreen() ++ { ++ super.closeScreen(); ++ this.mc.displayGuiScreen((GuiScreen)null); ++ } ++ ++ /** ++ * Displays the GUI for editing a sign. Args: tileEntitySign ++ */ ++ public void displayGUIEditSign(TileEntity par1TileEntity) ++ { ++ if (par1TileEntity instanceof TileEntitySign) ++ { ++ this.mc.displayGuiScreen(new GuiEditSign((TileEntitySign)par1TileEntity)); ++ } ++ else if (par1TileEntity instanceof TileEntityCommandBlock) ++ { ++ this.mc.displayGuiScreen(new GuiCommandBlock((TileEntityCommandBlock)par1TileEntity)); ++ } ++ } ++ ++ /** ++ * Displays the GUI for interacting with a book. ++ */ ++ public void displayGUIBook(ItemStack par1ItemStack) ++ { ++ Item var2 = par1ItemStack.getItem(); ++ ++ if (var2 == Item.writtenBook) ++ { ++ this.mc.displayGuiScreen(new GuiScreenBook(this, par1ItemStack, false)); ++ } ++ else if (var2 == Item.writableBook) ++ { ++ this.mc.displayGuiScreen(new GuiScreenBook(this, par1ItemStack, true)); ++ } ++ } ++ ++ /** ++ * Displays the GUI for interacting with a chest inventory. Args: chestInventory ++ */ ++ public void displayGUIChest(IInventory par1IInventory) ++ { ++ this.mc.displayGuiScreen(new GuiChest(this.inventory, par1IInventory)); ++ } ++ ++ public void displayGUIHopper(TileEntityHopper par1TileEntityHopper) ++ { ++ this.mc.displayGuiScreen(new GuiHopper(this.inventory, par1TileEntityHopper)); ++ } ++ ++ public void displayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper) ++ { ++ this.mc.displayGuiScreen(new GuiHopper(this.inventory, par1EntityMinecartHopper)); ++ } ++ ++ public void displayGUIHorse(EntityHorse par1EntityHorse, IInventory par2IInventory) ++ { ++ this.mc.displayGuiScreen(new GuiScreenHorseInventory(this.inventory, par2IInventory, par1EntityHorse)); ++ } ++ ++ /** ++ * Displays the crafting GUI for a workbench. ++ */ ++ public void displayGUIWorkbench(int par1, int par2, int par3) ++ { ++ this.mc.displayGuiScreen(new GuiCrafting(this.inventory, this.worldObj, par1, par2, par3)); ++ } ++ ++ public void displayGUIEnchantment(int par1, int par2, int par3, String par4Str) ++ { ++ this.mc.displayGuiScreen(new GuiEnchantment(this.inventory, this.worldObj, par1, par2, par3, par4Str)); ++ } ++ ++ /** ++ * Displays the GUI for interacting with an anvil. ++ */ ++ public void displayGUIAnvil(int par1, int par2, int par3) ++ { ++ this.mc.displayGuiScreen(new GuiRepair(this.inventory, this.worldObj, par1, par2, par3)); ++ } ++ ++ /** ++ * Displays the furnace GUI for the passed in furnace entity. Args: tileEntityFurnace ++ */ ++ public void displayGUIFurnace(TileEntityFurnace par1TileEntityFurnace) ++ { ++ this.mc.displayGuiScreen(new GuiFurnace(this.inventory, par1TileEntityFurnace)); ++ } ++ ++ /** ++ * Displays the GUI for interacting with a brewing stand. ++ */ ++ public void displayGUIBrewingStand(TileEntityBrewingStand par1TileEntityBrewingStand) ++ { ++ this.mc.displayGuiScreen(new GuiBrewingStand(this.inventory, par1TileEntityBrewingStand)); ++ } ++ ++ /** ++ * Displays the GUI for interacting with a beacon. ++ */ ++ public void displayGUIBeacon(TileEntityBeacon par1TileEntityBeacon) ++ { ++ this.mc.displayGuiScreen(new GuiBeacon(this.inventory, par1TileEntityBeacon)); ++ } ++ ++ /** ++ * Displays the dipsenser GUI for the passed in dispenser entity. Args: TileEntityDispenser ++ */ ++ public void displayGUIDispenser(TileEntityDispenser par1TileEntityDispenser) ++ { ++ this.mc.displayGuiScreen(new GuiDispenser(this.inventory, par1TileEntityDispenser)); ++ } ++ ++ public void displayGUIMerchant(IMerchant par1IMerchant, String par2Str) ++ { ++ this.mc.displayGuiScreen(new GuiMerchant(this.inventory, par1IMerchant, this.worldObj, par2Str)); ++ } ++ ++ /** ++ * Called when the player performs a critical hit on the Entity. Args: entity that was hit critically ++ */ ++ public void onCriticalHit(Entity par1Entity) ++ { ++ this.mc.effectRenderer.addEffect(new EntityCrit2FX(this.mc.theWorld, par1Entity)); ++ } ++ ++ public void onEnchantmentCritical(Entity par1Entity) ++ { ++ EntityCrit2FX var2 = new EntityCrit2FX(this.mc.theWorld, par1Entity, "magicCrit"); ++ this.mc.effectRenderer.addEffect(var2); ++ } ++ ++ /** ++ * Called whenever an item is picked up from walking over it. Args: pickedUpEntity, stackSize ++ */ ++ public void onItemPickup(Entity par1Entity, int par2) ++ { ++ this.mc.effectRenderer.addEffect(new EntityPickupFX(this.mc.theWorld, par1Entity, this, -0.5F)); ++ } ++ ++ /** ++ * Returns if this entity is sneaking. ++ */ ++ public boolean isSneaking() ++ { ++ return this.movementInput.sneak && !this.sleeping; ++ } ++ ++ /** ++ * Updates health locally. ++ */ ++ public void setPlayerSPHealth(float par1) ++ { ++ float var2 = this.getHealth() - par1; ++ ++ if (var2 <= 0.0F) ++ { ++ this.setHealth(par1); ++ ++ if (var2 < 0.0F) ++ { ++ this.hurtResistantTime = this.maxHurtResistantTime / 2; ++ } ++ } ++ else ++ { ++ this.lastDamage = var2; ++ this.setHealth(this.getHealth()); ++ this.hurtResistantTime = this.maxHurtResistantTime; ++ this.damageEntity(DamageSource.generic, var2); ++ this.hurtTime = this.maxHurtTime = 10; ++ } ++ } ++ ++ /** ++ * Add a chat message to the player ++ */ ++ public void addChatMessage(String par1Str) ++ { ++ this.mc.ingameGUI.getChatGUI().addTranslatedMessage(par1Str, new Object[0]); ++ } ++ ++ /** ++ * Adds a value to a statistic field. ++ */ ++ public void addStat(StatBase par1StatBase, int par2) ++ { ++ if (par1StatBase != null) ++ { ++ if (par1StatBase.isAchievement()) ++ { ++ Achievement var3 = (Achievement)par1StatBase; ++ ++ if (var3.parentAchievement == null || this.mc.statFileWriter.hasAchievementUnlocked(var3.parentAchievement)) ++ { ++ if (!this.mc.statFileWriter.hasAchievementUnlocked(var3)) ++ { ++ this.mc.guiAchievement.queueTakenAchievement(var3); ++ } ++ ++ this.mc.statFileWriter.readStat(par1StatBase, par2); ++ } ++ } ++ else ++ { ++ this.mc.statFileWriter.readStat(par1StatBase, par2); ++ } ++ } ++ } ++ ++ private boolean isBlockTranslucent(int par1, int par2, int par3) ++ { ++ return this.worldObj.isBlockNormalCube(par1, par2, par3); ++ } ++ ++ /** ++ * Adds velocity to push the entity out of blocks at the specified x, y, z position Args: x, y, z ++ */ ++ protected boolean pushOutOfBlocks(double par1, double par3, double par5) ++ { ++ int var7 = MathHelper.floor_double(par1); ++ int var8 = MathHelper.floor_double(par3); ++ int var9 = MathHelper.floor_double(par5); ++ double var10 = par1 - (double)var7; ++ double var12 = par5 - (double)var9; ++ ++ if (this.isBlockTranslucent(var7, var8, var9) || this.isBlockTranslucent(var7, var8 + 1, var9)) ++ { ++ boolean var14 = !this.isBlockTranslucent(var7 - 1, var8, var9) && !this.isBlockTranslucent(var7 - 1, var8 + 1, var9); ++ boolean var15 = !this.isBlockTranslucent(var7 + 1, var8, var9) && !this.isBlockTranslucent(var7 + 1, var8 + 1, var9); ++ boolean var16 = !this.isBlockTranslucent(var7, var8, var9 - 1) && !this.isBlockTranslucent(var7, var8 + 1, var9 - 1); ++ boolean var17 = !this.isBlockTranslucent(var7, var8, var9 + 1) && !this.isBlockTranslucent(var7, var8 + 1, var9 + 1); ++ byte var18 = -1; ++ double var19 = 9999.0D; ++ ++ if (var14 && var10 < var19) ++ { ++ var19 = var10; ++ var18 = 0; ++ } ++ ++ if (var15 && 1.0D - var10 < var19) ++ { ++ var19 = 1.0D - var10; ++ var18 = 1; ++ } ++ ++ if (var16 && var12 < var19) ++ { ++ var19 = var12; ++ var18 = 4; ++ } ++ ++ if (var17 && 1.0D - var12 < var19) ++ { ++ var19 = 1.0D - var12; ++ var18 = 5; ++ } ++ ++ float var21 = 0.1F; ++ ++ if (var18 == 0) ++ { ++ this.motionX = (double)(-var21); ++ } ++ ++ if (var18 == 1) ++ { ++ this.motionX = (double)var21; ++ } ++ ++ if (var18 == 4) ++ { ++ this.motionZ = (double)(-var21); ++ } ++ ++ if (var18 == 5) ++ { ++ this.motionZ = (double)var21; ++ } ++ } ++ ++ return false; ++ } ++ ++ /** ++ * Set sprinting switch for Entity. ++ */ ++ public void setSprinting(boolean par1) ++ { ++ super.setSprinting(par1); ++ this.sprintingTicksLeft = par1 ? 600 : 0; ++ } ++ ++ /** ++ * Sets the current XP, total XP, and level number. ++ */ ++ public void setXPStats(float par1, int par2, int par3) ++ { ++ this.experience = par1; ++ this.experienceTotal = par2; ++ this.experienceLevel = par3; ++ } ++ ++ public void sendChatToPlayer(ChatMessageComponent par1ChatMessageComponent) ++ { ++ this.mc.ingameGUI.getChatGUI().printChatMessage(par1ChatMessageComponent.toStringWithFormatting(true)); ++ } ++ ++ /** ++ * Returns true if the command sender is allowed to use the given command. ++ */ ++ public boolean canCommandSenderUseCommand(int par1, String par2Str) ++ { ++ return par1 <= 0; ++ } ++ ++ /** ++ * Return the position for this command sender. ++ */ ++ public ChunkCoordinates getPlayerCoordinates() ++ { ++ return new ChunkCoordinates(MathHelper.floor_double(this.posX + 0.5D), MathHelper.floor_double(this.posY + 0.5D), MathHelper.floor_double(this.posZ + 0.5D)); ++ } ++ ++ /** ++ * Returns the item that this EntityLiving is holding, if any. ++ */ ++ public ItemStack getHeldItem() ++ { ++ return this.inventory.getCurrentItem(); ++ } ++ ++ public void playSound(String par1Str, float par2, float par3) ++ { ++ this.worldObj.playSound(this.posX, this.posY - (double)this.yOffset, this.posZ, par1Str, par2, par3, false); ++ } ++ ++ /** ++ * Returns whether the entity is in a local (client) world ++ */ ++ public boolean isClientWorld() ++ { ++ return true; ++ } ++ ++ public boolean isRidingHorse() ++ { ++ return this.ridingEntity != null && this.ridingEntity instanceof EntityHorse; ++ } ++ ++ public float getHorseJumpPower() ++ { ++ return this.horseJumpPower; ++ } ++ ++ protected void func_110318_g() {} ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityPortalFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,89 ---- ++ package net.minecraft.src; ++ ++ public class EntityPortalFX extends EntityFX ++ { ++ private float portalParticleScale; ++ private double portalPosX; ++ private double portalPosY; ++ private double portalPosZ; ++ ++ public EntityPortalFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) ++ { ++ super(par1World, par2, par4, par6, par8, par10, par12); ++ this.motionX = par8; ++ this.motionY = par10; ++ this.motionZ = par12; ++ this.portalPosX = this.posX = par2; ++ this.portalPosY = this.posY = par4; ++ this.portalPosZ = this.posZ = par6; ++ float var14 = this.rand.nextFloat() * 0.6F + 0.4F; ++ this.portalParticleScale = this.particleScale = this.rand.nextFloat() * 0.2F + 0.5F; ++ this.particleRed = this.particleGreen = this.particleBlue = 1.0F * var14; ++ this.particleGreen *= 0.3F; ++ this.particleRed *= 0.9F; ++ this.particleMaxAge = (int)(Math.random() * 10.0D) + 40; ++ this.noClip = true; ++ this.setParticleTextureIndex((int)(Math.random() * 8.0D)); ++ } ++ ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge; ++ var8 = 1.0F - var8; ++ var8 *= var8; ++ var8 = 1.0F - var8; ++ this.particleScale = this.portalParticleScale * var8; ++ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); ++ } ++ ++ public int getBrightnessForRender(float par1) ++ { ++ int var2 = super.getBrightnessForRender(par1); ++ float var3 = (float)this.particleAge / (float)this.particleMaxAge; ++ var3 *= var3; ++ var3 *= var3; ++ int var4 = var2 & 255; ++ int var5 = var2 >> 16 & 255; ++ var5 += (int)(var3 * 15.0F * 16.0F); ++ ++ if (var5 > 240) ++ { ++ var5 = 240; ++ } ++ ++ return var4 | var5 << 16; ++ } ++ ++ /** ++ * Gets how bright this entity is. ++ */ ++ public float getBrightness(float par1) ++ { ++ float var2 = super.getBrightness(par1); ++ float var3 = (float)this.particleAge / (float)this.particleMaxAge; ++ var3 = var3 * var3 * var3 * var3; ++ return var2 * (1.0F - var3) + var3; ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ this.prevPosX = this.posX; ++ this.prevPosY = this.posY; ++ this.prevPosZ = this.posZ; ++ float var1 = (float)this.particleAge / (float)this.particleMaxAge; ++ float var2 = var1; ++ var1 = -var1 + var1 * var1 * 2.0F; ++ var1 = 1.0F - var1; ++ this.posX = this.portalPosX + this.motionX * (double)var1; ++ this.posY = this.portalPosY + this.motionY * (double)var1 + (double)(1.0F - var2); ++ this.posZ = this.portalPosZ + this.motionZ * (double)var1; ++ ++ if (this.particleAge++ >= this.particleMaxAge) ++ { ++ this.setDead(); ++ } ++ } ++ } +*** EntityPotion.java Sat Feb 5 04:13:13 2022 +--- EntityPotion.java Sat Feb 5 04:12:34 2022 +*************** +*** 24,33 **** +--- 24,38 ---- + { + super(par1World, par2EntityLivingBase); + this.potionDamage = par3ItemStack; + } + ++ public EntityPotion(World par1World, double par2, double par4, double par6, int par8) ++ { ++ this(par1World, par2, par4, par6, new ItemStack(Item.potion, 1, par8)); ++ } ++ + public EntityPotion(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack) + { + super(par1World, par2, par4, par6); + this.potionDamage = par8ItemStack; + } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityRainFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,62 ---- ++ package net.minecraft.src; ++ ++ public class EntityRainFX extends EntityFX ++ { ++ public EntityRainFX(World par1World, double par2, double par4, double par6) ++ { ++ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); ++ this.motionX *= 0.30000001192092896D; ++ this.motionY = (double)((float)Math.random() * 0.2F + 0.1F); ++ this.motionZ *= 0.30000001192092896D; ++ this.particleRed = 1.0F; ++ this.particleGreen = 1.0F; ++ this.particleBlue = 1.0F; ++ this.setParticleTextureIndex(19 + this.rand.nextInt(4)); ++ this.setSize(0.01F, 0.01F); ++ this.particleGravity = 0.06F; ++ this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ this.prevPosX = this.posX; ++ this.prevPosY = this.posY; ++ this.prevPosZ = this.posZ; ++ this.motionY -= (double)this.particleGravity; ++ this.moveEntity(this.motionX, this.motionY, this.motionZ); ++ this.motionX *= 0.9800000190734863D; ++ this.motionY *= 0.9800000190734863D; ++ this.motionZ *= 0.9800000190734863D; ++ ++ if (this.particleMaxAge-- <= 0) ++ { ++ this.setDead(); ++ } ++ ++ if (this.onGround) ++ { ++ if (Math.random() < 0.5D) ++ { ++ this.setDead(); ++ } ++ ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ } ++ ++ Material var1 = this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); ++ ++ if (var1.isLiquid() || var1.isSolid()) ++ { ++ double var2 = (double)((float)(MathHelper.floor_double(this.posY) + 1) - BlockFluid.getFluidHeightPercent(this.worldObj.getBlockMetadata(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)))); ++ ++ if (this.posY < var2) ++ { ++ this.setDead(); ++ } ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityReddustFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,87 ---- ++ package net.minecraft.src; ++ ++ public class EntityReddustFX extends EntityFX ++ { ++ float reddustParticleScale; ++ ++ public EntityReddustFX(World par1World, double par2, double par4, double par6, float par8, float par9, float par10) ++ { ++ this(par1World, par2, par4, par6, 1.0F, par8, par9, par10); ++ } ++ ++ public EntityReddustFX(World par1World, double par2, double par4, double par6, float par8, float par9, float par10, float par11) ++ { ++ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); ++ this.motionX *= 0.10000000149011612D; ++ this.motionY *= 0.10000000149011612D; ++ this.motionZ *= 0.10000000149011612D; ++ ++ if (par9 == 0.0F) ++ { ++ par9 = 1.0F; ++ } ++ ++ float var12 = (float)Math.random() * 0.4F + 0.6F; ++ this.particleRed = ((float)(Math.random() * 0.20000000298023224D) + 0.8F) * par9 * var12; ++ this.particleGreen = ((float)(Math.random() * 0.20000000298023224D) + 0.8F) * par10 * var12; ++ this.particleBlue = ((float)(Math.random() * 0.20000000298023224D) + 0.8F) * par11 * var12; ++ this.particleScale *= 0.75F; ++ this.particleScale *= par8; ++ this.reddustParticleScale = this.particleScale; ++ this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); ++ this.particleMaxAge = (int)((float)this.particleMaxAge * par8); ++ this.noClip = false; ++ } ++ ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F; ++ ++ if (var8 < 0.0F) ++ { ++ var8 = 0.0F; ++ } ++ ++ if (var8 > 1.0F) ++ { ++ var8 = 1.0F; ++ } ++ ++ this.particleScale = this.reddustParticleScale * var8; ++ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ this.prevPosX = this.posX; ++ this.prevPosY = this.posY; ++ this.prevPosZ = this.posZ; ++ ++ if (this.particleAge++ >= this.particleMaxAge) ++ { ++ this.setDead(); ++ } ++ ++ this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); ++ this.moveEntity(this.motionX, this.motionY, this.motionZ); ++ ++ if (this.posY == this.prevPosY) ++ { ++ this.motionX *= 1.1D; ++ this.motionZ *= 1.1D; ++ } ++ ++ this.motionX *= 0.9599999785423279D; ++ this.motionY *= 0.9599999785423279D; ++ this.motionZ *= 0.9599999785423279D; ++ ++ if (this.onGround) ++ { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntityRenderer.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,1891 ---- ++ package net.minecraft.src; ++ ++ import java.nio.FloatBuffer; ++ import java.util.List; ++ import java.util.Random; ++ import org.lwjgl.input.Mouse; ++ import org.lwjgl.opengl.Display; ++ import org.lwjgl.opengl.GL11; ++ import org.lwjgl.opengl.GLContext; ++ import org.lwjgl.util.glu.Project; ++ ++ public class EntityRenderer ++ { ++ private static final ResourceLocation locationRainPng = new ResourceLocation("textures/environment/rain.png"); ++ private static final ResourceLocation locationSnowPng = new ResourceLocation("textures/environment/snow.png"); ++ public static boolean anaglyphEnable; ++ ++ /** Anaglyph field (0=R, 1=GB) */ ++ public static int anaglyphField; ++ ++ /** A reference to the Minecraft object. */ ++ private Minecraft mc; ++ private float farPlaneDistance; ++ public ItemRenderer itemRenderer; ++ ++ /** Entity renderer update count */ ++ private int rendererUpdateCount; ++ ++ /** Pointed entity */ ++ private Entity pointedEntity; ++ private MouseFilter mouseFilterXAxis = new MouseFilter(); ++ private MouseFilter mouseFilterYAxis = new MouseFilter(); ++ ++ /** Mouse filter dummy 1 */ ++ private MouseFilter mouseFilterDummy1 = new MouseFilter(); ++ ++ /** Mouse filter dummy 2 */ ++ private MouseFilter mouseFilterDummy2 = new MouseFilter(); ++ ++ /** Mouse filter dummy 3 */ ++ private MouseFilter mouseFilterDummy3 = new MouseFilter(); ++ ++ /** Mouse filter dummy 4 */ ++ private MouseFilter mouseFilterDummy4 = new MouseFilter(); ++ private float thirdPersonDistance = 4.0F; ++ ++ /** Third person distance temp */ ++ private float thirdPersonDistanceTemp = 4.0F; ++ private float debugCamYaw; ++ private float prevDebugCamYaw; ++ private float debugCamPitch; ++ private float prevDebugCamPitch; ++ ++ /** Smooth cam yaw */ ++ private float smoothCamYaw; ++ ++ /** Smooth cam pitch */ ++ private float smoothCamPitch; ++ ++ /** Smooth cam filter X */ ++ private float smoothCamFilterX; ++ ++ /** Smooth cam filter Y */ ++ private float smoothCamFilterY; ++ ++ /** Smooth cam partial ticks */ ++ private float smoothCamPartialTicks; ++ private float debugCamFOV; ++ private float prevDebugCamFOV; ++ private float camRoll; ++ private float prevCamRoll; ++ ++ /** ++ * The texture id of the blocklight/skylight texture used for lighting effects ++ */ ++ private final DynamicTexture lightmapTexture; ++ ++ /** ++ * Colors computed in updateLightmap() and loaded into the lightmap emptyTexture ++ */ ++ private final int[] lightmapColors; ++ private final ResourceLocation locationLightMap; ++ ++ /** FOV modifier hand */ ++ private float fovModifierHand; ++ ++ /** FOV modifier hand prev */ ++ private float fovModifierHandPrev; ++ ++ /** FOV multiplier temp */ ++ private float fovMultiplierTemp; ++ private float field_82831_U; ++ private float field_82832_V; ++ ++ /** Cloud fog mode */ ++ private boolean cloudFog; ++ private double cameraZoom = 1.0D; ++ private double cameraYaw; ++ private double cameraPitch; ++ ++ /** Previous frame time in milliseconds */ ++ private long prevFrameTime = Minecraft.getSystemTime(); ++ ++ /** End time of last render (ns) */ ++ private long renderEndNanoTime; ++ ++ /** ++ * Is set, updateCameraAndRender() calls updateLightmap(); set by updateTorchFlicker() ++ */ ++ private boolean lightmapUpdateNeeded; ++ ++ /** Torch flicker X */ ++ float torchFlickerX; ++ ++ /** Torch flicker DX */ ++ float torchFlickerDX; ++ ++ /** Torch flicker Y */ ++ float torchFlickerY; ++ ++ /** Torch flicker DY */ ++ float torchFlickerDY; ++ private Random random = new Random(); ++ ++ /** Rain sound counter */ ++ private int rainSoundCounter; ++ ++ /** Rain X coords */ ++ float[] rainXCoords; ++ ++ /** Rain Y coords */ ++ float[] rainYCoords; ++ ++ /** Fog color buffer */ ++ FloatBuffer fogColorBuffer = GLAllocation.createDirectFloatBuffer(16); ++ ++ /** red component of the fog color */ ++ float fogColorRed; ++ ++ /** green component of the fog color */ ++ float fogColorGreen; ++ ++ /** blue component of the fog color */ ++ float fogColorBlue; ++ ++ /** Fog color 2 */ ++ private float fogColor2; ++ ++ /** Fog color 1 */ ++ private float fogColor1; ++ ++ /** ++ * Debug view direction (0=OFF, 1=Front, 2=Right, 3=Back, 4=Left, 5=TiltLeft, 6=TiltRight) ++ */ ++ public int debugViewDirection; ++ ++ public EntityRenderer(Minecraft par1Minecraft) ++ { ++ this.mc = par1Minecraft; ++ this.itemRenderer = new ItemRenderer(par1Minecraft); ++ this.lightmapTexture = new DynamicTexture(16, 16); ++ this.locationLightMap = par1Minecraft.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture); ++ this.lightmapColors = this.lightmapTexture.getTextureData(); ++ } ++ ++ /** ++ * Updates the entity renderer ++ */ ++ public void updateRenderer() ++ { ++ this.updateFovModifierHand(); ++ this.updateTorchFlicker(); ++ this.fogColor2 = this.fogColor1; ++ this.thirdPersonDistanceTemp = this.thirdPersonDistance; ++ this.prevDebugCamYaw = this.debugCamYaw; ++ this.prevDebugCamPitch = this.debugCamPitch; ++ this.prevDebugCamFOV = this.debugCamFOV; ++ this.prevCamRoll = this.camRoll; ++ float var1; ++ float var2; ++ ++ if (this.mc.gameSettings.smoothCamera) ++ { ++ var1 = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; ++ var2 = var1 * var1 * var1 * 8.0F; ++ this.smoothCamFilterX = this.mouseFilterXAxis.smooth(this.smoothCamYaw, 0.05F * var2); ++ this.smoothCamFilterY = this.mouseFilterYAxis.smooth(this.smoothCamPitch, 0.05F * var2); ++ this.smoothCamPartialTicks = 0.0F; ++ this.smoothCamYaw = 0.0F; ++ this.smoothCamPitch = 0.0F; ++ } ++ ++ if (this.mc.renderViewEntity == null) ++ { ++ this.mc.renderViewEntity = this.mc.thePlayer; ++ } ++ ++ var1 = this.mc.theWorld.getLightBrightness(MathHelper.floor_double(this.mc.renderViewEntity.posX), MathHelper.floor_double(this.mc.renderViewEntity.posY), MathHelper.floor_double(this.mc.renderViewEntity.posZ)); ++ var2 = (float)(3 - this.mc.gameSettings.renderDistance) / 3.0F; ++ float var3 = var1 * (1.0F - var2) + var2; ++ this.fogColor1 += (var3 - this.fogColor1) * 0.1F; ++ ++this.rendererUpdateCount; ++ this.itemRenderer.updateEquippedItem(); ++ this.addRainParticles(); ++ this.field_82832_V = this.field_82831_U; ++ ++ if (BossStatus.field_82825_d) ++ { ++ this.field_82831_U += 0.05F; ++ ++ if (this.field_82831_U > 1.0F) ++ { ++ this.field_82831_U = 1.0F; ++ } ++ ++ BossStatus.field_82825_d = false; ++ } ++ else if (this.field_82831_U > 0.0F) ++ { ++ this.field_82831_U -= 0.0125F; ++ } ++ } ++ ++ /** ++ * Finds what block or object the mouse is over at the specified partial tick time. Args: partialTickTime ++ */ ++ public void getMouseOver(float par1) ++ { ++ if (this.mc.renderViewEntity != null) ++ { ++ if (this.mc.theWorld != null) ++ { ++ this.mc.pointedEntityLiving = null; ++ double var2 = (double)this.mc.playerController.getBlockReachDistance(); ++ this.mc.objectMouseOver = this.mc.renderViewEntity.rayTrace(var2, par1); ++ double var4 = var2; ++ Vec3 var6 = this.mc.renderViewEntity.getPosition(par1); ++ ++ if (this.mc.playerController.extendedReach()) ++ { ++ var2 = 6.0D; ++ var4 = 6.0D; ++ } ++ else ++ { ++ if (var2 > 3.0D) ++ { ++ var4 = 3.0D; ++ } ++ ++ var2 = var4; ++ } ++ ++ if (this.mc.objectMouseOver != null) ++ { ++ var4 = this.mc.objectMouseOver.hitVec.distanceTo(var6); ++ } ++ ++ Vec3 var7 = this.mc.renderViewEntity.getLook(par1); ++ Vec3 var8 = var6.addVector(var7.xCoord * var2, var7.yCoord * var2, var7.zCoord * var2); ++ this.pointedEntity = null; ++ float var9 = 1.0F; ++ List var10 = this.mc.theWorld.getEntitiesWithinAABBExcludingEntity(this.mc.renderViewEntity, this.mc.renderViewEntity.boundingBox.addCoord(var7.xCoord * var2, var7.yCoord * var2, var7.zCoord * var2).expand((double)var9, (double)var9, (double)var9)); ++ double var11 = var4; ++ ++ for (int var13 = 0; var13 < var10.size(); ++var13) ++ { ++ Entity var14 = (Entity)var10.get(var13); ++ ++ if (var14.canBeCollidedWith()) ++ { ++ float var15 = var14.getCollisionBorderSize(); ++ AxisAlignedBB var16 = var14.boundingBox.expand((double)var15, (double)var15, (double)var15); ++ MovingObjectPosition var17 = var16.calculateIntercept(var6, var8); ++ ++ if (var16.isVecInside(var6)) ++ { ++ if (0.0D < var11 || var11 == 0.0D) ++ { ++ this.pointedEntity = var14; ++ var11 = 0.0D; ++ } ++ } ++ else if (var17 != null) ++ { ++ double var18 = var6.distanceTo(var17.hitVec); ++ ++ if (var18 < var11 || var11 == 0.0D) ++ { ++ if (var14 == this.mc.renderViewEntity.ridingEntity) ++ { ++ if (var11 == 0.0D) ++ { ++ this.pointedEntity = var14; ++ } ++ } ++ else ++ { ++ this.pointedEntity = var14; ++ var11 = var18; ++ } ++ } ++ } ++ } ++ } ++ ++ if (this.pointedEntity != null && (var11 < var4 || this.mc.objectMouseOver == null)) ++ { ++ this.mc.objectMouseOver = new MovingObjectPosition(this.pointedEntity); ++ ++ if (this.pointedEntity instanceof EntityLivingBase) ++ { ++ this.mc.pointedEntityLiving = (EntityLivingBase)this.pointedEntity; ++ } ++ } ++ } ++ } ++ } ++ ++ /** ++ * Update FOV modifier hand ++ */ ++ private void updateFovModifierHand() ++ { ++ EntityPlayerSP var1 = (EntityPlayerSP)this.mc.renderViewEntity; ++ this.fovMultiplierTemp = var1.getFOVMultiplier(); ++ this.fovModifierHandPrev = this.fovModifierHand; ++ this.fovModifierHand += (this.fovMultiplierTemp - this.fovModifierHand) * 0.5F; ++ ++ if (this.fovModifierHand > 1.5F) ++ { ++ this.fovModifierHand = 1.5F; ++ } ++ ++ if (this.fovModifierHand < 0.1F) ++ { ++ this.fovModifierHand = 0.1F; ++ } ++ } ++ ++ /** ++ * Changes the field of view of the player depending on if they are underwater or not ++ */ ++ private float getFOVModifier(float par1, boolean par2) ++ { ++ if (this.debugViewDirection > 0) ++ { ++ return 90.0F; ++ } ++ else ++ { ++ EntityPlayer var3 = (EntityPlayer)this.mc.renderViewEntity; ++ float var4 = 70.0F; ++ ++ if (par2) ++ { ++ var4 += this.mc.gameSettings.fovSetting * 40.0F; ++ var4 *= this.fovModifierHandPrev + (this.fovModifierHand - this.fovModifierHandPrev) * par1; ++ } ++ ++ if (var3.getHealth() <= 0.0F) ++ { ++ float var5 = (float)var3.deathTime + par1; ++ var4 /= (1.0F - 500.0F / (var5 + 500.0F)) * 2.0F + 1.0F; ++ } ++ ++ int var6 = ActiveRenderInfo.getBlockIdAtEntityViewpoint(this.mc.theWorld, var3, par1); ++ ++ if (var6 != 0 && Block.blocksList[var6].blockMaterial == Material.water) ++ { ++ var4 = var4 * 60.0F / 70.0F; ++ } ++ ++ return var4 + this.prevDebugCamFOV + (this.debugCamFOV - this.prevDebugCamFOV) * par1; ++ } ++ } ++ ++ private void hurtCameraEffect(float par1) ++ { ++ EntityLivingBase var2 = this.mc.renderViewEntity; ++ float var3 = (float)var2.hurtTime - par1; ++ float var4; ++ ++ if (var2.getHealth() <= 0.0F) ++ { ++ var4 = (float)var2.deathTime + par1; ++ GL11.glRotatef(40.0F - 8000.0F / (var4 + 200.0F), 0.0F, 0.0F, 1.0F); ++ } ++ ++ if (var3 >= 0.0F) ++ { ++ var3 /= (float)var2.maxHurtTime; ++ var3 = MathHelper.sin(var3 * var3 * var3 * var3 * (float)Math.PI); ++ var4 = var2.attackedAtYaw; ++ GL11.glRotatef(-var4, 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(-var3 * 14.0F, 0.0F, 0.0F, 1.0F); ++ GL11.glRotatef(var4, 0.0F, 1.0F, 0.0F); ++ } ++ } ++ ++ /** ++ * Setups all the GL settings for view bobbing. Args: partialTickTime ++ */ ++ private void setupViewBobbing(float par1) ++ { ++ if (this.mc.renderViewEntity instanceof EntityPlayer) ++ { ++ EntityPlayer var2 = (EntityPlayer)this.mc.renderViewEntity; ++ float var3 = var2.distanceWalkedModified - var2.prevDistanceWalkedModified; ++ float var4 = -(var2.distanceWalkedModified + var3 * par1); ++ float var5 = var2.prevCameraYaw + (var2.cameraYaw - var2.prevCameraYaw) * par1; ++ float var6 = var2.prevCameraPitch + (var2.cameraPitch - var2.prevCameraPitch) * par1; ++ GL11.glTranslatef(MathHelper.sin(var4 * (float)Math.PI) * var5 * 0.5F, -Math.abs(MathHelper.cos(var4 * (float)Math.PI) * var5), 0.0F); ++ GL11.glRotatef(MathHelper.sin(var4 * (float)Math.PI) * var5 * 3.0F, 0.0F, 0.0F, 1.0F); ++ GL11.glRotatef(Math.abs(MathHelper.cos(var4 * (float)Math.PI - 0.2F) * var5) * 5.0F, 1.0F, 0.0F, 0.0F); ++ GL11.glRotatef(var6, 1.0F, 0.0F, 0.0F); ++ } ++ } ++ ++ /** ++ * sets up player's eye (or camera in third person mode) ++ */ ++ private void orientCamera(float par1) ++ { ++ EntityLivingBase var2 = this.mc.renderViewEntity; ++ float var3 = var2.yOffset - 1.62F; ++ double var4 = var2.prevPosX + (var2.posX - var2.prevPosX) * (double)par1; ++ double var6 = var2.prevPosY + (var2.posY - var2.prevPosY) * (double)par1 - (double)var3; ++ double var8 = var2.prevPosZ + (var2.posZ - var2.prevPosZ) * (double)par1; ++ GL11.glRotatef(this.prevCamRoll + (this.camRoll - this.prevCamRoll) * par1, 0.0F, 0.0F, 1.0F); ++ ++ if (var2.isPlayerSleeping()) ++ { ++ var3 = (float)((double)var3 + 1.0D); ++ GL11.glTranslatef(0.0F, 0.3F, 0.0F); ++ ++ if (!this.mc.gameSettings.debugCamEnable) ++ { ++ int var10 = this.mc.theWorld.getBlockId(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ)); ++ ++ if (var10 == Block.bed.blockID) ++ { ++ int var11 = this.mc.theWorld.getBlockMetadata(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ)); ++ int var12 = var11 & 3; ++ GL11.glRotatef((float)(var12 * 90), 0.0F, 1.0F, 0.0F); ++ } ++ ++ GL11.glRotatef(var2.prevRotationYaw + (var2.rotationYaw - var2.prevRotationYaw) * par1 + 180.0F, 0.0F, -1.0F, 0.0F); ++ GL11.glRotatef(var2.prevRotationPitch + (var2.rotationPitch - var2.prevRotationPitch) * par1, -1.0F, 0.0F, 0.0F); ++ } ++ } ++ else if (this.mc.gameSettings.thirdPersonView > 0) ++ { ++ double var27 = (double)(this.thirdPersonDistanceTemp + (this.thirdPersonDistance - this.thirdPersonDistanceTemp) * par1); ++ float var13; ++ float var28; ++ ++ if (this.mc.gameSettings.debugCamEnable) ++ { ++ var28 = this.prevDebugCamYaw + (this.debugCamYaw - this.prevDebugCamYaw) * par1; ++ var13 = this.prevDebugCamPitch + (this.debugCamPitch - this.prevDebugCamPitch) * par1; ++ GL11.glTranslatef(0.0F, 0.0F, (float)(-var27)); ++ GL11.glRotatef(var13, 1.0F, 0.0F, 0.0F); ++ GL11.glRotatef(var28, 0.0F, 1.0F, 0.0F); ++ } ++ else ++ { ++ var28 = var2.rotationYaw; ++ var13 = var2.rotationPitch; ++ ++ if (this.mc.gameSettings.thirdPersonView == 2) ++ { ++ var13 += 180.0F; ++ } ++ ++ double var14 = (double)(-MathHelper.sin(var28 / 180.0F * (float)Math.PI) * MathHelper.cos(var13 / 180.0F * (float)Math.PI)) * var27; ++ double var16 = (double)(MathHelper.cos(var28 / 180.0F * (float)Math.PI) * MathHelper.cos(var13 / 180.0F * (float)Math.PI)) * var27; ++ double var18 = (double)(-MathHelper.sin(var13 / 180.0F * (float)Math.PI)) * var27; ++ ++ for (int var20 = 0; var20 < 8; ++var20) ++ { ++ float var21 = (float)((var20 & 1) * 2 - 1); ++ float var22 = (float)((var20 >> 1 & 1) * 2 - 1); ++ float var23 = (float)((var20 >> 2 & 1) * 2 - 1); ++ var21 *= 0.1F; ++ var22 *= 0.1F; ++ var23 *= 0.1F; ++ MovingObjectPosition var24 = this.mc.theWorld.clip(this.mc.theWorld.getWorldVec3Pool().getVecFromPool(var4 + (double)var21, var6 + (double)var22, var8 + (double)var23), this.mc.theWorld.getWorldVec3Pool().getVecFromPool(var4 - var14 + (double)var21 + (double)var23, var6 - var18 + (double)var22, var8 - var16 + (double)var23)); ++ ++ if (var24 != null) ++ { ++ double var25 = var24.hitVec.distanceTo(this.mc.theWorld.getWorldVec3Pool().getVecFromPool(var4, var6, var8)); ++ ++ if (var25 < var27) ++ { ++ var27 = var25; ++ } ++ } ++ } ++ ++ if (this.mc.gameSettings.thirdPersonView == 2) ++ { ++ GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); ++ } ++ ++ GL11.glRotatef(var2.rotationPitch - var13, 1.0F, 0.0F, 0.0F); ++ GL11.glRotatef(var2.rotationYaw - var28, 0.0F, 1.0F, 0.0F); ++ GL11.glTranslatef(0.0F, 0.0F, (float)(-var27)); ++ GL11.glRotatef(var28 - var2.rotationYaw, 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(var13 - var2.rotationPitch, 1.0F, 0.0F, 0.0F); ++ } ++ } ++ else ++ { ++ GL11.glTranslatef(0.0F, 0.0F, -0.1F); ++ } ++ ++ if (!this.mc.gameSettings.debugCamEnable) ++ { ++ GL11.glRotatef(var2.prevRotationPitch + (var2.rotationPitch - var2.prevRotationPitch) * par1, 1.0F, 0.0F, 0.0F); ++ GL11.glRotatef(var2.prevRotationYaw + (var2.rotationYaw - var2.prevRotationYaw) * par1 + 180.0F, 0.0F, 1.0F, 0.0F); ++ } ++ ++ GL11.glTranslatef(0.0F, var3, 0.0F); ++ var4 = var2.prevPosX + (var2.posX - var2.prevPosX) * (double)par1; ++ var6 = var2.prevPosY + (var2.posY - var2.prevPosY) * (double)par1 - (double)var3; ++ var8 = var2.prevPosZ + (var2.posZ - var2.prevPosZ) * (double)par1; ++ this.cloudFog = this.mc.renderGlobal.hasCloudFog(var4, var6, var8, par1); ++ } ++ ++ /** ++ * sets up projection, view effects, camera position/rotation ++ */ ++ private void setupCameraTransform(float par1, int par2) ++ { ++ this.farPlaneDistance = (float)(256 >> this.mc.gameSettings.renderDistance); ++ GL11.glMatrixMode(GL11.GL_PROJECTION); ++ GL11.glLoadIdentity(); ++ float var3 = 0.07F; ++ ++ if (this.mc.gameSettings.anaglyph) ++ { ++ GL11.glTranslatef((float)(-(par2 * 2 - 1)) * var3, 0.0F, 0.0F); ++ } ++ ++ if (this.cameraZoom != 1.0D) ++ { ++ GL11.glTranslatef((float)this.cameraYaw, (float)(-this.cameraPitch), 0.0F); ++ GL11.glScaled(this.cameraZoom, this.cameraZoom, 1.0D); ++ } ++ ++ Project.gluPerspective(this.getFOVModifier(par1, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F); ++ float var4; ++ ++ if (this.mc.playerController.enableEverythingIsScrewedUpMode()) ++ { ++ var4 = 0.6666667F; ++ GL11.glScalef(1.0F, var4, 1.0F); ++ } ++ ++ GL11.glMatrixMode(GL11.GL_MODELVIEW); ++ GL11.glLoadIdentity(); ++ ++ if (this.mc.gameSettings.anaglyph) ++ { ++ GL11.glTranslatef((float)(par2 * 2 - 1) * 0.1F, 0.0F, 0.0F); ++ } ++ ++ this.hurtCameraEffect(par1); ++ ++ if (this.mc.gameSettings.viewBobbing) ++ { ++ this.setupViewBobbing(par1); ++ } ++ ++ var4 = this.mc.thePlayer.prevTimeInPortal + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * par1; ++ ++ if (var4 > 0.0F) ++ { ++ byte var5 = 20; ++ ++ if (this.mc.thePlayer.isPotionActive(Potion.confusion)) ++ { ++ var5 = 7; ++ } ++ ++ float var6 = 5.0F / (var4 * var4 + 5.0F) - var4 * 0.04F; ++ var6 *= var6; ++ GL11.glRotatef(((float)this.rendererUpdateCount + par1) * (float)var5, 0.0F, 1.0F, 1.0F); ++ GL11.glScalef(1.0F / var6, 1.0F, 1.0F); ++ GL11.glRotatef(-((float)this.rendererUpdateCount + par1) * (float)var5, 0.0F, 1.0F, 1.0F); ++ } ++ ++ this.orientCamera(par1); ++ ++ if (this.debugViewDirection > 0) ++ { ++ int var7 = this.debugViewDirection - 1; ++ ++ if (var7 == 1) ++ { ++ GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); ++ } ++ ++ if (var7 == 2) ++ { ++ GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); ++ } ++ ++ if (var7 == 3) ++ { ++ GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); ++ } ++ ++ if (var7 == 4) ++ { ++ GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); ++ } ++ ++ if (var7 == 5) ++ { ++ GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); ++ } ++ } ++ } ++ ++ /** ++ * Render player hand ++ */ ++ private void renderHand(float par1, int par2) ++ { ++ if (this.debugViewDirection <= 0) ++ { ++ GL11.glMatrixMode(GL11.GL_PROJECTION); ++ GL11.glLoadIdentity(); ++ float var3 = 0.07F; ++ ++ if (this.mc.gameSettings.anaglyph) ++ { ++ GL11.glTranslatef((float)(-(par2 * 2 - 1)) * var3, 0.0F, 0.0F); ++ } ++ ++ if (this.cameraZoom != 1.0D) ++ { ++ GL11.glTranslatef((float)this.cameraYaw, (float)(-this.cameraPitch), 0.0F); ++ GL11.glScaled(this.cameraZoom, this.cameraZoom, 1.0D); ++ } ++ ++ Project.gluPerspective(this.getFOVModifier(par1, false), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F); ++ ++ if (this.mc.playerController.enableEverythingIsScrewedUpMode()) ++ { ++ float var4 = 0.6666667F; ++ GL11.glScalef(1.0F, var4, 1.0F); ++ } ++ ++ GL11.glMatrixMode(GL11.GL_MODELVIEW); ++ GL11.glLoadIdentity(); ++ ++ if (this.mc.gameSettings.anaglyph) ++ { ++ GL11.glTranslatef((float)(par2 * 2 - 1) * 0.1F, 0.0F, 0.0F); ++ } ++ ++ GL11.glPushMatrix(); ++ this.hurtCameraEffect(par1); ++ ++ if (this.mc.gameSettings.viewBobbing) ++ { ++ this.setupViewBobbing(par1); ++ } ++ ++ if (this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping() && !this.mc.gameSettings.hideGUI && !this.mc.playerController.enableEverythingIsScrewedUpMode()) ++ { ++ this.enableLightmap((double)par1); ++ this.itemRenderer.renderItemInFirstPerson(par1); ++ this.disableLightmap((double)par1); ++ } ++ ++ GL11.glPopMatrix(); ++ ++ if (this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping()) ++ { ++ this.itemRenderer.renderOverlays(par1); ++ this.hurtCameraEffect(par1); ++ } ++ ++ if (this.mc.gameSettings.viewBobbing) ++ { ++ this.setupViewBobbing(par1); ++ } ++ } ++ } ++ ++ /** ++ * Disable secondary texture unit used by lightmap ++ */ ++ public void disableLightmap(double par1) ++ { ++ OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); ++ } ++ ++ /** ++ * Enable lightmap in secondary texture unit ++ */ ++ 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.mc.getTextureManager().bindTexture(this.locationLightMap); ++ 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); ++ OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); ++ } ++ ++ /** ++ * Recompute a random value that is applied to block color in updateLightmap() ++ */ ++ private void updateTorchFlicker() ++ { ++ this.torchFlickerDX = (float)((double)this.torchFlickerDX + (Math.random() - Math.random()) * Math.random() * Math.random()); ++ this.torchFlickerDY = (float)((double)this.torchFlickerDY + (Math.random() - Math.random()) * Math.random() * Math.random()); ++ this.torchFlickerDX = (float)((double)this.torchFlickerDX * 0.9D); ++ this.torchFlickerDY = (float)((double)this.torchFlickerDY * 0.9D); ++ this.torchFlickerX += (this.torchFlickerDX - this.torchFlickerX) * 1.0F; ++ this.torchFlickerY += (this.torchFlickerDY - this.torchFlickerY) * 1.0F; ++ this.lightmapUpdateNeeded = true; ++ } ++ ++ private void updateLightmap(float par1) ++ { ++ WorldClient var2 = this.mc.theWorld; ++ ++ if (var2 != null) ++ { ++ for (int var3 = 0; var3 < 256; ++var3) ++ { ++ float var4 = var2.getSunBrightness(1.0F) * 0.95F + 0.05F; ++ float var5 = var2.provider.lightBrightnessTable[var3 / 16] * var4; ++ float var6 = var2.provider.lightBrightnessTable[var3 % 16] * (this.torchFlickerX * 0.1F + 1.5F); ++ ++ if (var2.lastLightningBolt > 0) ++ { ++ var5 = var2.provider.lightBrightnessTable[var3 / 16]; ++ } ++ ++ float var7 = var5 * (var2.getSunBrightness(1.0F) * 0.65F + 0.35F); ++ float var8 = var5 * (var2.getSunBrightness(1.0F) * 0.65F + 0.35F); ++ float var11 = var6 * ((var6 * 0.6F + 0.4F) * 0.6F + 0.4F); ++ float var12 = var6 * (var6 * var6 * 0.6F + 0.4F); ++ float var13 = var7 + var6; ++ float var14 = var8 + var11; ++ float var15 = var5 + var12; ++ var13 = var13 * 0.96F + 0.03F; ++ var14 = var14 * 0.96F + 0.03F; ++ var15 = var15 * 0.96F + 0.03F; ++ float var16; ++ ++ if (this.field_82831_U > 0.0F) ++ { ++ var16 = this.field_82832_V + (this.field_82831_U - this.field_82832_V) * par1; ++ var13 = var13 * (1.0F - var16) + var13 * 0.7F * var16; ++ var14 = var14 * (1.0F - var16) + var14 * 0.6F * var16; ++ var15 = var15 * (1.0F - var16) + var15 * 0.6F * var16; ++ } ++ ++ if (var2.provider.dimensionId == 1) ++ { ++ var13 = 0.22F + var6 * 0.75F; ++ var14 = 0.28F + var11 * 0.75F; ++ var15 = 0.25F + var12 * 0.75F; ++ } ++ ++ float var17; ++ ++ if (this.mc.thePlayer.isPotionActive(Potion.nightVision)) ++ { ++ var16 = this.getNightVisionBrightness(this.mc.thePlayer, par1); ++ var17 = 1.0F / var13; ++ ++ if (var17 > 1.0F / var14) ++ { ++ var17 = 1.0F / var14; ++ } ++ ++ if (var17 > 1.0F / var15) ++ { ++ var17 = 1.0F / var15; ++ } ++ ++ var13 = var13 * (1.0F - var16) + var13 * var17 * var16; ++ var14 = var14 * (1.0F - var16) + var14 * var17 * var16; ++ var15 = var15 * (1.0F - var16) + var15 * var17 * var16; ++ } ++ ++ if (var13 > 1.0F) ++ { ++ var13 = 1.0F; ++ } ++ ++ if (var14 > 1.0F) ++ { ++ var14 = 1.0F; ++ } ++ ++ if (var15 > 1.0F) ++ { ++ var15 = 1.0F; ++ } ++ ++ var16 = this.mc.gameSettings.gammaSetting; ++ var17 = 1.0F - var13; ++ float var18 = 1.0F - var14; ++ float var19 = 1.0F - var15; ++ var17 = 1.0F - var17 * var17 * var17 * var17; ++ var18 = 1.0F - var18 * var18 * var18 * var18; ++ var19 = 1.0F - var19 * var19 * var19 * var19; ++ var13 = var13 * (1.0F - var16) + var17 * var16; ++ var14 = var14 * (1.0F - var16) + var18 * var16; ++ var15 = var15 * (1.0F - var16) + var19 * var16; ++ var13 = var13 * 0.96F + 0.03F; ++ var14 = var14 * 0.96F + 0.03F; ++ var15 = var15 * 0.96F + 0.03F; ++ ++ if (var13 > 1.0F) ++ { ++ var13 = 1.0F; ++ } ++ ++ if (var14 > 1.0F) ++ { ++ var14 = 1.0F; ++ } ++ ++ if (var15 > 1.0F) ++ { ++ var15 = 1.0F; ++ } ++ ++ if (var13 < 0.0F) ++ { ++ var13 = 0.0F; ++ } ++ ++ if (var14 < 0.0F) ++ { ++ var14 = 0.0F; ++ } ++ ++ if (var15 < 0.0F) ++ { ++ var15 = 0.0F; ++ } ++ ++ short var20 = 255; ++ int var21 = (int)(var13 * 255.0F); ++ int var22 = (int)(var14 * 255.0F); ++ int var23 = (int)(var15 * 255.0F); ++ this.lightmapColors[var3] = var20 << 24 | var21 << 16 | var22 << 8 | var23; ++ } ++ ++ this.lightmapTexture.updateDynamicTexture(); ++ this.lightmapUpdateNeeded = false; ++ } ++ } ++ ++ /** ++ * Gets the night vision brightness ++ */ ++ private float getNightVisionBrightness(EntityPlayer par1EntityPlayer, float par2) ++ { ++ int var3 = par1EntityPlayer.getActivePotionEffect(Potion.nightVision).getDuration(); ++ return var3 > 200 ? 1.0F : 0.7F + MathHelper.sin(((float)var3 - par2) * (float)Math.PI * 0.2F) * 0.3F; ++ } ++ ++ /** ++ * Will update any inputs that effect the camera angle (mouse) and then render the world and GUI ++ */ ++ public void updateCameraAndRender(float par1) ++ { ++ this.mc.mcProfiler.startSection("lightTex"); ++ ++ if (this.lightmapUpdateNeeded) ++ { ++ this.updateLightmap(par1); ++ } ++ ++ this.mc.mcProfiler.endSection(); ++ boolean var2 = Display.isActive(); ++ ++ if (!var2 && this.mc.gameSettings.pauseOnLostFocus && (!this.mc.gameSettings.touchscreen || !Mouse.isButtonDown(1))) ++ { ++ if (Minecraft.getSystemTime() - this.prevFrameTime > 500L) ++ { ++ this.mc.displayInGameMenu(); ++ } ++ } ++ else ++ { ++ this.prevFrameTime = Minecraft.getSystemTime(); ++ } ++ ++ this.mc.mcProfiler.startSection("mouse"); ++ ++ if (this.mc.inGameHasFocus && var2) ++ { ++ this.mc.mouseHelper.mouseXYChange(); ++ float var3 = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; ++ float var4 = var3 * var3 * var3 * 8.0F; ++ float var5 = (float)this.mc.mouseHelper.deltaX * var4; ++ float var6 = (float)this.mc.mouseHelper.deltaY * var4; ++ byte var7 = 1; ++ ++ if (this.mc.gameSettings.invertMouse) ++ { ++ var7 = -1; ++ } ++ ++ if (this.mc.gameSettings.smoothCamera) ++ { ++ this.smoothCamYaw += var5; ++ this.smoothCamPitch += var6; ++ float var8 = par1 - this.smoothCamPartialTicks; ++ this.smoothCamPartialTicks = par1; ++ var5 = this.smoothCamFilterX * var8; ++ var6 = this.smoothCamFilterY * var8; ++ this.mc.thePlayer.setAngles(var5, var6 * (float)var7); ++ } ++ else ++ { ++ this.mc.thePlayer.setAngles(var5, var6 * (float)var7); ++ } ++ } ++ ++ this.mc.mcProfiler.endSection(); ++ ++ if (!this.mc.skipRenderWorld) ++ { ++ anaglyphEnable = this.mc.gameSettings.anaglyph; ++ ScaledResolution var13 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); ++ int var14 = var13.getScaledWidth(); ++ int var15 = var13.getScaledHeight(); ++ int var16 = Mouse.getX() * var14 / this.mc.displayWidth; ++ int var17 = var15 - Mouse.getY() * var15 / this.mc.displayHeight - 1; ++ int var18 = performanceToFps(this.mc.gameSettings.limitFramerate); ++ ++ if (this.mc.theWorld != null) ++ { ++ this.mc.mcProfiler.startSection("level"); ++ ++ if (this.mc.gameSettings.limitFramerate == 0) ++ { ++ this.renderWorld(par1, 0L); ++ } ++ else ++ { ++ this.renderWorld(par1, this.renderEndNanoTime + (long)(1000000000 / var18)); ++ } ++ ++ this.renderEndNanoTime = System.nanoTime(); ++ this.mc.mcProfiler.endStartSection("gui"); ++ ++ if (!this.mc.gameSettings.hideGUI || this.mc.currentScreen != null) ++ { ++ this.mc.ingameGUI.renderGameOverlay(par1, this.mc.currentScreen != null, var16, var17); ++ } ++ ++ this.mc.mcProfiler.endSection(); ++ } ++ else ++ { ++ GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); ++ GL11.glMatrixMode(GL11.GL_PROJECTION); ++ GL11.glLoadIdentity(); ++ GL11.glMatrixMode(GL11.GL_MODELVIEW); ++ GL11.glLoadIdentity(); ++ this.setupOverlayRendering(); ++ this.renderEndNanoTime = System.nanoTime(); ++ } ++ ++ if (this.mc.currentScreen != null) ++ { ++ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); ++ ++ try ++ { ++ this.mc.currentScreen.drawScreen(var16, var17, par1); ++ } ++ catch (Throwable var12) ++ { ++ CrashReport var10 = CrashReport.makeCrashReport(var12, "Rendering screen"); ++ CrashReportCategory var11 = var10.makeCategory("Screen render details"); ++ var11.addCrashSectionCallable("Screen name", new CallableScreenName(this)); ++ var11.addCrashSectionCallable("Mouse location", new CallableMouseLocation(this, var16, var17)); ++ var11.addCrashSectionCallable("Screen size", new CallableScreenSize(this, var13)); ++ throw new ReportedException(var10); ++ } ++ } ++ } ++ } ++ ++ public void renderWorld(float par1, long par2) ++ { ++ this.mc.mcProfiler.startSection("lightTex"); ++ ++ if (this.lightmapUpdateNeeded) ++ { ++ this.updateLightmap(par1); ++ } ++ ++ GL11.glEnable(GL11.GL_CULL_FACE); ++ GL11.glEnable(GL11.GL_DEPTH_TEST); ++ ++ if (this.mc.renderViewEntity == null) ++ { ++ this.mc.renderViewEntity = this.mc.thePlayer; ++ } ++ ++ this.mc.mcProfiler.endStartSection("pick"); ++ this.getMouseOver(par1); ++ EntityLivingBase var4 = this.mc.renderViewEntity; ++ RenderGlobal var5 = this.mc.renderGlobal; ++ EffectRenderer var6 = this.mc.effectRenderer; ++ double var7 = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)par1; ++ double var9 = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)par1; ++ double var11 = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)par1; ++ this.mc.mcProfiler.endStartSection("center"); ++ ++ for (int var13 = 0; var13 < 2; ++var13) ++ { ++ if (this.mc.gameSettings.anaglyph) ++ { ++ anaglyphField = var13; ++ ++ if (anaglyphField == 0) ++ { ++ GL11.glColorMask(false, true, true, false); ++ } ++ else ++ { ++ GL11.glColorMask(true, false, false, false); ++ } ++ } ++ ++ this.mc.mcProfiler.endStartSection("clear"); ++ GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); ++ this.updateFogColor(par1); ++ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); ++ GL11.glEnable(GL11.GL_CULL_FACE); ++ this.mc.mcProfiler.endStartSection("camera"); ++ this.setupCameraTransform(par1, var13); ++ ActiveRenderInfo.updateRenderInfo(this.mc.thePlayer, this.mc.gameSettings.thirdPersonView == 2); ++ this.mc.mcProfiler.endStartSection("frustrum"); ++ ClippingHelperImpl.getInstance(); ++ ++ if (this.mc.gameSettings.renderDistance < 2) ++ { ++ this.setupFog(-1, par1); ++ this.mc.mcProfiler.endStartSection("sky"); ++ var5.renderSky(par1); ++ } ++ ++ GL11.glEnable(GL11.GL_FOG); ++ this.setupFog(1, par1); ++ ++ if (this.mc.gameSettings.ambientOcclusion != 0) ++ { ++ GL11.glShadeModel(GL11.GL_SMOOTH); ++ } ++ ++ this.mc.mcProfiler.endStartSection("culling"); ++ Frustrum var14 = new Frustrum(); ++ var14.setPosition(var7, var9, var11); ++ this.mc.renderGlobal.clipRenderersByFrustum(var14, par1); ++ ++ if (var13 == 0) ++ { ++ this.mc.mcProfiler.endStartSection("updatechunks"); ++ ++ while (!this.mc.renderGlobal.updateRenderers(var4, false) && par2 != 0L) ++ { ++ long var15 = par2 - System.nanoTime(); ++ ++ if (var15 < 0L || var15 > 1000000000L) ++ { ++ break; ++ } ++ } ++ } ++ ++ if (var4.posY < 128.0D) ++ { ++ this.renderCloudsCheck(var5, par1); ++ } ++ ++ this.mc.mcProfiler.endStartSection("prepareterrain"); ++ this.setupFog(0, par1); ++ GL11.glEnable(GL11.GL_FOG); ++ this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); ++ RenderHelper.disableStandardItemLighting(); ++ this.mc.mcProfiler.endStartSection("terrain"); ++ var5.sortAndRender(var4, 0, (double)par1); ++ GL11.glShadeModel(GL11.GL_FLAT); ++ EntityPlayer var17; ++ ++ if (this.debugViewDirection == 0) ++ { ++ RenderHelper.enableStandardItemLighting(); ++ this.mc.mcProfiler.endStartSection("entities"); ++ var5.renderEntities(var4.getPosition(par1), var14, par1); ++ this.enableLightmap((double)par1); ++ this.mc.mcProfiler.endStartSection("litParticles"); ++ var6.renderLitParticles(var4, par1); ++ RenderHelper.disableStandardItemLighting(); ++ this.setupFog(0, par1); ++ this.mc.mcProfiler.endStartSection("particles"); ++ var6.renderParticles(var4, par1); ++ this.disableLightmap((double)par1); ++ ++ if (this.mc.objectMouseOver != null && var4.isInsideOfMaterial(Material.water) && var4 instanceof EntityPlayer && !this.mc.gameSettings.hideGUI) ++ { ++ var17 = (EntityPlayer)var4; ++ GL11.glDisable(GL11.GL_ALPHA_TEST); ++ this.mc.mcProfiler.endStartSection("outline"); ++ var5.drawSelectionBox(var17, this.mc.objectMouseOver, 0, par1); ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ } ++ } ++ ++ GL11.glDisable(GL11.GL_BLEND); ++ GL11.glEnable(GL11.GL_CULL_FACE); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ GL11.glDepthMask(true); ++ this.setupFog(0, par1); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glDisable(GL11.GL_CULL_FACE); ++ this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); ++ ++ if (this.mc.gameSettings.fancyGraphics) ++ { ++ this.mc.mcProfiler.endStartSection("water"); ++ ++ if (this.mc.gameSettings.ambientOcclusion != 0) ++ { ++ GL11.glShadeModel(GL11.GL_SMOOTH); ++ } ++ ++ GL11.glColorMask(false, false, false, false); ++ int var18 = var5.sortAndRender(var4, 1, (double)par1); ++ ++ if (this.mc.gameSettings.anaglyph) ++ { ++ if (anaglyphField == 0) ++ { ++ GL11.glColorMask(false, true, true, true); ++ } ++ else ++ { ++ GL11.glColorMask(true, false, false, true); ++ } ++ } ++ else ++ { ++ GL11.glColorMask(true, true, true, true); ++ } ++ ++ if (var18 > 0) ++ { ++ var5.renderAllRenderLists(1, (double)par1); ++ } ++ ++ GL11.glShadeModel(GL11.GL_FLAT); ++ } ++ else ++ { ++ this.mc.mcProfiler.endStartSection("water"); ++ var5.sortAndRender(var4, 1, (double)par1); ++ } ++ ++ GL11.glDepthMask(true); ++ GL11.glEnable(GL11.GL_CULL_FACE); ++ GL11.glDisable(GL11.GL_BLEND); ++ ++ if (this.cameraZoom == 1.0D && var4 instanceof EntityPlayer && !this.mc.gameSettings.hideGUI && this.mc.objectMouseOver != null && !var4.isInsideOfMaterial(Material.water)) ++ { ++ var17 = (EntityPlayer)var4; ++ GL11.glDisable(GL11.GL_ALPHA_TEST); ++ this.mc.mcProfiler.endStartSection("outline"); ++ var5.drawSelectionBox(var17, this.mc.objectMouseOver, 0, par1); ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ } ++ ++ this.mc.mcProfiler.endStartSection("destroyProgress"); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); ++ var5.drawBlockDamageTexture(Tessellator.instance, (EntityPlayer)var4, par1); ++ GL11.glDisable(GL11.GL_BLEND); ++ this.mc.mcProfiler.endStartSection("weather"); ++ this.renderRainSnow(par1); ++ GL11.glDisable(GL11.GL_FOG); ++ ++ if (var4.posY >= 128.0D) ++ { ++ this.renderCloudsCheck(var5, par1); ++ } ++ ++ this.mc.mcProfiler.endStartSection("hand"); ++ ++ if (this.cameraZoom == 1.0D) ++ { ++ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); ++ this.renderHand(par1, var13); ++ } ++ ++ if (!this.mc.gameSettings.anaglyph) ++ { ++ this.mc.mcProfiler.endSection(); ++ return; ++ } ++ } ++ ++ GL11.glColorMask(true, true, true, false); ++ this.mc.mcProfiler.endSection(); ++ } ++ ++ /** ++ * Render clouds if enabled ++ */ ++ private void renderCloudsCheck(RenderGlobal par1RenderGlobal, float par2) ++ { ++ if (this.mc.gameSettings.shouldRenderClouds()) ++ { ++ this.mc.mcProfiler.endStartSection("clouds"); ++ GL11.glPushMatrix(); ++ this.setupFog(0, par2); ++ GL11.glEnable(GL11.GL_FOG); ++ par1RenderGlobal.renderClouds(par2); ++ GL11.glDisable(GL11.GL_FOG); ++ this.setupFog(1, par2); ++ GL11.glPopMatrix(); ++ } ++ } ++ ++ private void addRainParticles() ++ { ++ float var1 = this.mc.theWorld.getRainStrength(1.0F); ++ ++ if (!this.mc.gameSettings.fancyGraphics) ++ { ++ var1 /= 2.0F; ++ } ++ ++ if (var1 != 0.0F) ++ { ++ this.random.setSeed((long)this.rendererUpdateCount * 312987231L); ++ EntityLivingBase var2 = this.mc.renderViewEntity; ++ WorldClient var3 = this.mc.theWorld; ++ int var4 = MathHelper.floor_double(var2.posX); ++ int var5 = MathHelper.floor_double(var2.posY); ++ int var6 = MathHelper.floor_double(var2.posZ); ++ byte var7 = 10; ++ double var8 = 0.0D; ++ double var10 = 0.0D; ++ double var12 = 0.0D; ++ int var14 = 0; ++ int var15 = (int)(100.0F * var1 * var1); ++ ++ if (this.mc.gameSettings.particleSetting == 1) ++ { ++ var15 >>= 1; ++ } ++ else if (this.mc.gameSettings.particleSetting == 2) ++ { ++ var15 = 0; ++ } ++ ++ for (int var16 = 0; var16 < var15; ++var16) ++ { ++ int var17 = var4 + this.random.nextInt(var7) - this.random.nextInt(var7); ++ int var18 = var6 + this.random.nextInt(var7) - this.random.nextInt(var7); ++ int var19 = var3.getPrecipitationHeight(var17, var18); ++ int var20 = var3.getBlockId(var17, var19 - 1, var18); ++ BiomeGenBase var21 = var3.getBiomeGenForCoords(var17, var18); ++ ++ if (var19 <= var5 + var7 && var19 >= var5 - var7 && var21.canSpawnLightningBolt() && var21.getFloatTemperature() >= 0.2F) ++ { ++ float var22 = this.random.nextFloat(); ++ float var23 = this.random.nextFloat(); ++ ++ if (var20 > 0) ++ { ++ if (Block.blocksList[var20].blockMaterial == Material.lava) ++ { ++ this.mc.effectRenderer.addEffect(new EntitySmokeFX(var3, (double)((float)var17 + var22), (double)((float)var19 + 0.1F) - Block.blocksList[var20].getBlockBoundsMinY(), (double)((float)var18 + var23), 0.0D, 0.0D, 0.0D)); ++ } ++ else ++ { ++ ++var14; ++ ++ if (this.random.nextInt(var14) == 0) ++ { ++ var8 = (double)((float)var17 + var22); ++ var10 = (double)((float)var19 + 0.1F) - Block.blocksList[var20].getBlockBoundsMinY(); ++ var12 = (double)((float)var18 + var23); ++ } ++ ++ this.mc.effectRenderer.addEffect(new EntityRainFX(var3, (double)((float)var17 + var22), (double)((float)var19 + 0.1F) - Block.blocksList[var20].getBlockBoundsMinY(), (double)((float)var18 + var23))); ++ } ++ } ++ } ++ } ++ ++ if (var14 > 0 && this.random.nextInt(3) < this.rainSoundCounter++) ++ { ++ this.rainSoundCounter = 0; ++ ++ if (var10 > var2.posY + 1.0D && var3.getPrecipitationHeight(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posZ)) > MathHelper.floor_double(var2.posY)) ++ { ++ this.mc.theWorld.playSound(var8, var10, var12, "ambient.weather.rain", 0.1F, 0.5F, false); ++ } ++ else ++ { ++ this.mc.theWorld.playSound(var8, var10, var12, "ambient.weather.rain", 0.2F, 1.0F, false); ++ } ++ } ++ } ++ } ++ ++ /** ++ * Render rain and snow ++ */ ++ protected void renderRainSnow(float par1) ++ { ++ float var2 = this.mc.theWorld.getRainStrength(par1); ++ ++ if (var2 > 0.0F) ++ { ++ this.enableLightmap((double)par1); ++ ++ if (this.rainXCoords == null) ++ { ++ this.rainXCoords = new float[1024]; ++ this.rainYCoords = new float[1024]; ++ ++ for (int var3 = 0; var3 < 32; ++var3) ++ { ++ for (int var4 = 0; var4 < 32; ++var4) ++ { ++ float var5 = (float)(var4 - 16); ++ float var6 = (float)(var3 - 16); ++ float var7 = MathHelper.sqrt_float(var5 * var5 + var6 * var6); ++ this.rainXCoords[var3 << 5 | var4] = -var6 / var7; ++ this.rainYCoords[var3 << 5 | var4] = var5 / var7; ++ } ++ } ++ } ++ ++ EntityLivingBase var41 = this.mc.renderViewEntity; ++ WorldClient var42 = this.mc.theWorld; ++ int var43 = MathHelper.floor_double(var41.posX); ++ int var44 = MathHelper.floor_double(var41.posY); ++ int var45 = MathHelper.floor_double(var41.posZ); ++ Tessellator var8 = Tessellator.instance; ++ GL11.glDisable(GL11.GL_CULL_FACE); ++ GL11.glNormal3f(0.0F, 1.0F, 0.0F); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ GL11.glAlphaFunc(GL11.GL_GREATER, 0.01F); ++ this.mc.getTextureManager().bindTexture(locationSnowPng); ++ double var9 = var41.lastTickPosX + (var41.posX - var41.lastTickPosX) * (double)par1; ++ double var11 = var41.lastTickPosY + (var41.posY - var41.lastTickPosY) * (double)par1; ++ double var13 = var41.lastTickPosZ + (var41.posZ - var41.lastTickPosZ) * (double)par1; ++ int var15 = MathHelper.floor_double(var11); ++ byte var16 = 5; ++ ++ if (this.mc.gameSettings.fancyGraphics) ++ { ++ var16 = 10; ++ } ++ ++ boolean var17 = false; ++ byte var18 = -1; ++ float var19 = (float)this.rendererUpdateCount + par1; ++ ++ if (this.mc.gameSettings.fancyGraphics) ++ { ++ var16 = 10; ++ } ++ ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ var17 = false; ++ ++ for (int var20 = var45 - var16; var20 <= var45 + var16; ++var20) ++ { ++ for (int var21 = var43 - var16; var21 <= var43 + var16; ++var21) ++ { ++ int var22 = (var20 - var45 + 16) * 32 + var21 - var43 + 16; ++ float var23 = this.rainXCoords[var22] * 0.5F; ++ float var24 = this.rainYCoords[var22] * 0.5F; ++ BiomeGenBase var25 = var42.getBiomeGenForCoords(var21, var20); ++ ++ if (var25.canSpawnLightningBolt() || var25.getEnableSnow()) ++ { ++ int var26 = var42.getPrecipitationHeight(var21, var20); ++ int var27 = var44 - var16; ++ int var28 = var44 + var16; ++ ++ if (var27 < var26) ++ { ++ var27 = var26; ++ } ++ ++ if (var28 < var26) ++ { ++ var28 = var26; ++ } ++ ++ float var29 = 1.0F; ++ int var30 = var26; ++ ++ if (var26 < var15) ++ { ++ var30 = var15; ++ } ++ ++ if (var27 != var28) ++ { ++ this.random.setSeed((long)(var21 * var21 * 3121 + var21 * 45238971 ^ var20 * var20 * 418711 + var20 * 13761)); ++ float var31 = var25.getFloatTemperature(); ++ float var32; ++ double var35; ++ ++ if (var42.getWorldChunkManager().getTemperatureAtHeight(var31, var26) >= 0.15F) ++ { ++ if (var18 != 0) ++ { ++ if (var18 >= 0) ++ { ++ var8.draw(); ++ } ++ ++ var18 = 0; ++ this.mc.getTextureManager().bindTexture(locationRainPng); ++ var8.startDrawingQuads(); ++ } ++ ++ var32 = ((float)(this.rendererUpdateCount + var21 * var21 * 3121 + var21 * 45238971 + var20 * var20 * 418711 + var20 * 13761 & 31) + par1) / 32.0F * (3.0F + this.random.nextFloat()); ++ double var33 = (double)((float)var21 + 0.5F) - var41.posX; ++ var35 = (double)((float)var20 + 0.5F) - var41.posZ; ++ float var37 = MathHelper.sqrt_double(var33 * var33 + var35 * var35) / (float)var16; ++ float var38 = 1.0F; ++ var8.setBrightness(var42.getLightBrightnessForSkyBlocks(var21, var30, var20, 0)); ++ var8.setColorRGBA_F(var38, var38, var38, ((1.0F - var37 * var37) * 0.5F + 0.5F) * var2); ++ var8.setTranslation(-var9 * 1.0D, -var11 * 1.0D, -var13 * 1.0D); ++ var8.addVertexWithUV((double)((float)var21 - var23) + 0.5D, (double)var27, (double)((float)var20 - var24) + 0.5D, (double)(0.0F * var29), (double)((float)var27 * var29 / 4.0F + var32 * var29)); ++ var8.addVertexWithUV((double)((float)var21 + var23) + 0.5D, (double)var27, (double)((float)var20 + var24) + 0.5D, (double)(1.0F * var29), (double)((float)var27 * var29 / 4.0F + var32 * var29)); ++ var8.addVertexWithUV((double)((float)var21 + var23) + 0.5D, (double)var28, (double)((float)var20 + var24) + 0.5D, (double)(1.0F * var29), (double)((float)var28 * var29 / 4.0F + var32 * var29)); ++ var8.addVertexWithUV((double)((float)var21 - var23) + 0.5D, (double)var28, (double)((float)var20 - var24) + 0.5D, (double)(0.0F * var29), (double)((float)var28 * var29 / 4.0F + var32 * var29)); ++ var8.setTranslation(0.0D, 0.0D, 0.0D); ++ } ++ else ++ { ++ if (var18 != 1) ++ { ++ if (var18 >= 0) ++ { ++ var8.draw(); ++ } ++ ++ var18 = 1; ++ this.mc.getTextureManager().bindTexture(new ResourceLocation("textures/environment/snow.png")); ++ var8.startDrawingQuads(); ++ } ++ ++ var32 = ((float)(this.rendererUpdateCount & 511) + par1) / 512.0F; ++ float var46 = this.random.nextFloat() + var19 * 0.01F * (float)this.random.nextGaussian(); ++ float var34 = this.random.nextFloat() + var19 * (float)this.random.nextGaussian() * 0.001F; ++ var35 = (double)((float)var21 + 0.5F) - var41.posX; ++ double var47 = (double)((float)var20 + 0.5F) - var41.posZ; ++ float var39 = MathHelper.sqrt_double(var35 * var35 + var47 * var47) / (float)var16; ++ float var40 = 1.0F; ++ var8.setBrightness((var42.getLightBrightnessForSkyBlocks(var21, var30, var20, 0) * 3 + 15728880) / 4); ++ var8.setColorRGBA_F(var40, var40, var40, ((1.0F - var39 * var39) * 0.3F + 0.5F) * var2); ++ var8.setTranslation(-var9 * 1.0D, -var11 * 1.0D, -var13 * 1.0D); ++ var8.addVertexWithUV((double)((float)var21 - var23) + 0.5D, (double)var27, (double)((float)var20 - var24) + 0.5D, (double)(0.0F * var29 + var46), (double)((float)var27 * var29 / 4.0F + var32 * var29 + var34)); ++ var8.addVertexWithUV((double)((float)var21 + var23) + 0.5D, (double)var27, (double)((float)var20 + var24) + 0.5D, (double)(1.0F * var29 + var46), (double)((float)var27 * var29 / 4.0F + var32 * var29 + var34)); ++ var8.addVertexWithUV((double)((float)var21 + var23) + 0.5D, (double)var28, (double)((float)var20 + var24) + 0.5D, (double)(1.0F * var29 + var46), (double)((float)var28 * var29 / 4.0F + var32 * var29 + var34)); ++ var8.addVertexWithUV((double)((float)var21 - var23) + 0.5D, (double)var28, (double)((float)var20 - var24) + 0.5D, (double)(0.0F * var29 + var46), (double)((float)var28 * var29 / 4.0F + var32 * var29 + var34)); ++ var8.setTranslation(0.0D, 0.0D, 0.0D); ++ } ++ } ++ } ++ } ++ } ++ ++ if (var18 >= 0) ++ { ++ var8.draw(); ++ } ++ ++ GL11.glEnable(GL11.GL_CULL_FACE); ++ GL11.glDisable(GL11.GL_BLEND); ++ GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); ++ this.disableLightmap((double)par1); ++ } ++ } ++ ++ /** ++ * Setup orthogonal projection for rendering GUI screen overlays ++ */ ++ public void setupOverlayRendering() ++ { ++ ScaledResolution var1 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); ++ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); ++ GL11.glMatrixMode(GL11.GL_PROJECTION); ++ GL11.glLoadIdentity(); ++ GL11.glOrtho(0.0D, var1.getScaledWidth_double(), var1.getScaledHeight_double(), 0.0D, 1000.0D, 3000.0D); ++ GL11.glMatrixMode(GL11.GL_MODELVIEW); ++ GL11.glLoadIdentity(); ++ GL11.glTranslatef(0.0F, 0.0F, -2000.0F); ++ } ++ ++ /** ++ * calculates fog and calls glClearColor ++ */ ++ private void updateFogColor(float par1) ++ { ++ WorldClient var2 = this.mc.theWorld; ++ EntityLivingBase var3 = this.mc.renderViewEntity; ++ float var4 = 1.0F / (float)(4 - this.mc.gameSettings.renderDistance); ++ var4 = 1.0F - (float)Math.pow((double)var4, 0.25D); ++ Vec3 var5 = var2.getSkyColor(this.mc.renderViewEntity, par1); ++ float var6 = (float)var5.xCoord; ++ float var7 = (float)var5.yCoord; ++ float var8 = (float)var5.zCoord; ++ Vec3 var9 = var2.getFogColor(par1); ++ this.fogColorRed = (float)var9.xCoord; ++ this.fogColorGreen = (float)var9.yCoord; ++ this.fogColorBlue = (float)var9.zCoord; ++ float var11; ++ ++ if (this.mc.gameSettings.renderDistance < 2) ++ { ++ Vec3 var10 = MathHelper.sin(var2.getCelestialAngleRadians(par1)) > 0.0F ? var2.getWorldVec3Pool().getVecFromPool(-1.0D, 0.0D, 0.0D) : var2.getWorldVec3Pool().getVecFromPool(1.0D, 0.0D, 0.0D); ++ var11 = (float)var3.getLook(par1).dotProduct(var10); ++ ++ if (var11 < 0.0F) ++ { ++ var11 = 0.0F; ++ } ++ ++ if (var11 > 0.0F) ++ { ++ float[] var12 = var2.provider.calcSunriseSunsetColors(var2.getCelestialAngle(par1), par1); ++ ++ if (var12 != null) ++ { ++ var11 *= var12[3]; ++ this.fogColorRed = this.fogColorRed * (1.0F - var11) + var12[0] * var11; ++ this.fogColorGreen = this.fogColorGreen * (1.0F - var11) + var12[1] * var11; ++ this.fogColorBlue = this.fogColorBlue * (1.0F - var11) + var12[2] * var11; ++ } ++ } ++ } ++ ++ this.fogColorRed += (var6 - this.fogColorRed) * var4; ++ this.fogColorGreen += (var7 - this.fogColorGreen) * var4; ++ this.fogColorBlue += (var8 - this.fogColorBlue) * var4; ++ float var19 = var2.getRainStrength(par1); ++ float var20; ++ ++ if (var19 > 0.0F) ++ { ++ var11 = 1.0F - var19 * 0.5F; ++ var20 = 1.0F - var19 * 0.4F; ++ this.fogColorRed *= var11; ++ this.fogColorGreen *= var11; ++ this.fogColorBlue *= var20; ++ } ++ ++ var11 = var2.getWeightedThunderStrength(par1); ++ ++ if (var11 > 0.0F) ++ { ++ var20 = 1.0F - var11 * 0.5F; ++ this.fogColorRed *= var20; ++ this.fogColorGreen *= var20; ++ this.fogColorBlue *= var20; ++ } ++ ++ int var21 = ActiveRenderInfo.getBlockIdAtEntityViewpoint(this.mc.theWorld, var3, par1); ++ float var22; ++ ++ if (this.cloudFog) ++ { ++ Vec3 var13 = var2.getCloudColour(par1); ++ this.fogColorRed = (float)var13.xCoord; ++ this.fogColorGreen = (float)var13.yCoord; ++ this.fogColorBlue = (float)var13.zCoord; ++ } ++ else if (var21 != 0 && Block.blocksList[var21].blockMaterial == Material.water) ++ { ++ var22 = (float)EnchantmentHelper.getRespiration(var3) * 0.2F; ++ this.fogColorRed = 0.02F + var22; ++ this.fogColorGreen = 0.02F + var22; ++ this.fogColorBlue = 0.2F + var22; ++ } ++ else if (var21 != 0 && Block.blocksList[var21].blockMaterial == Material.lava) ++ { ++ this.fogColorRed = 0.6F; ++ this.fogColorGreen = 0.1F; ++ this.fogColorBlue = 0.0F; ++ } ++ ++ var22 = this.fogColor2 + (this.fogColor1 - this.fogColor2) * par1; ++ this.fogColorRed *= var22; ++ this.fogColorGreen *= var22; ++ this.fogColorBlue *= var22; ++ double var14 = (var3.lastTickPosY + (var3.posY - var3.lastTickPosY) * (double)par1) * var2.provider.getVoidFogYFactor(); ++ ++ if (var3.isPotionActive(Potion.blindness)) ++ { ++ int var16 = var3.getActivePotionEffect(Potion.blindness).getDuration(); ++ ++ if (var16 < 20) ++ { ++ var14 *= (double)(1.0F - (float)var16 / 20.0F); ++ } ++ else ++ { ++ var14 = 0.0D; ++ } ++ } ++ ++ if (var14 < 1.0D) ++ { ++ if (var14 < 0.0D) ++ { ++ var14 = 0.0D; ++ } ++ ++ var14 *= var14; ++ this.fogColorRed = (float)((double)this.fogColorRed * var14); ++ this.fogColorGreen = (float)((double)this.fogColorGreen * var14); ++ this.fogColorBlue = (float)((double)this.fogColorBlue * var14); ++ } ++ ++ float var23; ++ ++ if (this.field_82831_U > 0.0F) ++ { ++ var23 = this.field_82832_V + (this.field_82831_U - this.field_82832_V) * par1; ++ this.fogColorRed = this.fogColorRed * (1.0F - var23) + this.fogColorRed * 0.7F * var23; ++ this.fogColorGreen = this.fogColorGreen * (1.0F - var23) + this.fogColorGreen * 0.6F * var23; ++ this.fogColorBlue = this.fogColorBlue * (1.0F - var23) + this.fogColorBlue * 0.6F * var23; ++ } ++ ++ float var17; ++ ++ if (var3.isPotionActive(Potion.nightVision)) ++ { ++ var23 = this.getNightVisionBrightness(this.mc.thePlayer, par1); ++ var17 = 1.0F / this.fogColorRed; ++ ++ if (var17 > 1.0F / this.fogColorGreen) ++ { ++ var17 = 1.0F / this.fogColorGreen; ++ } ++ ++ if (var17 > 1.0F / this.fogColorBlue) ++ { ++ var17 = 1.0F / this.fogColorBlue; ++ } ++ ++ this.fogColorRed = this.fogColorRed * (1.0F - var23) + this.fogColorRed * var17 * var23; ++ this.fogColorGreen = this.fogColorGreen * (1.0F - var23) + this.fogColorGreen * var17 * var23; ++ this.fogColorBlue = this.fogColorBlue * (1.0F - var23) + this.fogColorBlue * var17 * var23; ++ } ++ ++ if (this.mc.gameSettings.anaglyph) ++ { ++ var23 = (this.fogColorRed * 30.0F + this.fogColorGreen * 59.0F + this.fogColorBlue * 11.0F) / 100.0F; ++ var17 = (this.fogColorRed * 30.0F + this.fogColorGreen * 70.0F) / 100.0F; ++ float var18 = (this.fogColorRed * 30.0F + this.fogColorBlue * 70.0F) / 100.0F; ++ this.fogColorRed = var23; ++ this.fogColorGreen = var17; ++ this.fogColorBlue = var18; ++ } ++ ++ GL11.glClearColor(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 0.0F); ++ } ++ ++ /** ++ * Sets up the fog to be rendered. If the arg passed in is -1 the fog starts at 0 and goes to 80% of far plane ++ * distance and is used for sky rendering. ++ */ ++ private void setupFog(int par1, float par2) ++ { ++ EntityLivingBase var3 = this.mc.renderViewEntity; ++ boolean var4 = false; ++ ++ if (var3 instanceof EntityPlayer) ++ { ++ var4 = ((EntityPlayer)var3).capabilities.isCreativeMode; ++ } ++ ++ if (par1 == 999) ++ { ++ GL11.glFog(GL11.GL_FOG_COLOR, this.setFogColorBuffer(0.0F, 0.0F, 0.0F, 1.0F)); ++ GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR); ++ GL11.glFogf(GL11.GL_FOG_START, 0.0F); ++ GL11.glFogf(GL11.GL_FOG_END, 8.0F); ++ ++ if (GLContext.getCapabilities().GL_NV_fog_distance) ++ { ++ GL11.glFogi(34138, 34139); ++ } ++ ++ GL11.glFogf(GL11.GL_FOG_START, 0.0F); ++ } ++ else ++ { ++ GL11.glFog(GL11.GL_FOG_COLOR, this.setFogColorBuffer(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 1.0F)); ++ GL11.glNormal3f(0.0F, -1.0F, 0.0F); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ int var5 = ActiveRenderInfo.getBlockIdAtEntityViewpoint(this.mc.theWorld, var3, par2); ++ float var6; ++ ++ if (var3.isPotionActive(Potion.blindness)) ++ { ++ var6 = 5.0F; ++ int var7 = var3.getActivePotionEffect(Potion.blindness).getDuration(); ++ ++ if (var7 < 20) ++ { ++ var6 = 5.0F + (this.farPlaneDistance - 5.0F) * (1.0F - (float)var7 / 20.0F); ++ } ++ ++ GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR); ++ ++ if (par1 < 0) ++ { ++ GL11.glFogf(GL11.GL_FOG_START, 0.0F); ++ GL11.glFogf(GL11.GL_FOG_END, var6 * 0.8F); ++ } ++ else ++ { ++ GL11.glFogf(GL11.GL_FOG_START, var6 * 0.25F); ++ GL11.glFogf(GL11.GL_FOG_END, var6); ++ } ++ ++ if (GLContext.getCapabilities().GL_NV_fog_distance) ++ { ++ GL11.glFogi(34138, 34139); ++ } ++ } ++ else if (this.cloudFog) ++ { ++ GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); ++ GL11.glFogf(GL11.GL_FOG_DENSITY, 0.1F); ++ } ++ else if (var5 > 0 && Block.blocksList[var5].blockMaterial == Material.water) ++ { ++ GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); ++ ++ if (var3.isPotionActive(Potion.waterBreathing)) ++ { ++ GL11.glFogf(GL11.GL_FOG_DENSITY, 0.05F); ++ } ++ else ++ { ++ GL11.glFogf(GL11.GL_FOG_DENSITY, 0.1F - (float)EnchantmentHelper.getRespiration(var3) * 0.03F); ++ } ++ } ++ else if (var5 > 0 && Block.blocksList[var5].blockMaterial == Material.lava) ++ { ++ GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); ++ GL11.glFogf(GL11.GL_FOG_DENSITY, 2.0F); ++ } ++ else ++ { ++ var6 = this.farPlaneDistance; ++ ++ if (this.mc.theWorld.provider.getWorldHasVoidParticles() && !var4) ++ { ++ double var10 = (double)((var3.getBrightnessForRender(par2) & 15728640) >> 20) / 16.0D + (var3.lastTickPosY + (var3.posY - var3.lastTickPosY) * (double)par2 + 4.0D) / 32.0D; ++ ++ if (var10 < 1.0D) ++ { ++ if (var10 < 0.0D) ++ { ++ var10 = 0.0D; ++ } ++ ++ var10 *= var10; ++ float var9 = 100.0F * (float)var10; ++ ++ if (var9 < 5.0F) ++ { ++ var9 = 5.0F; ++ } ++ ++ if (var6 > var9) ++ { ++ var6 = var9; ++ } ++ } ++ } ++ ++ GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR); ++ ++ if (par1 < 0) ++ { ++ GL11.glFogf(GL11.GL_FOG_START, 0.0F); ++ GL11.glFogf(GL11.GL_FOG_END, var6 * 0.8F); ++ } ++ else ++ { ++ GL11.glFogf(GL11.GL_FOG_START, var6 * 0.25F); ++ GL11.glFogf(GL11.GL_FOG_END, var6); ++ } ++ ++ if (GLContext.getCapabilities().GL_NV_fog_distance) ++ { ++ GL11.glFogi(34138, 34139); ++ } ++ ++ if (this.mc.theWorld.provider.doesXZShowFog((int)var3.posX, (int)var3.posZ)) ++ { ++ GL11.glFogf(GL11.GL_FOG_START, var6 * 0.05F); ++ GL11.glFogf(GL11.GL_FOG_END, Math.min(var6, 192.0F) * 0.5F); ++ } ++ } ++ ++ GL11.glEnable(GL11.GL_COLOR_MATERIAL); ++ GL11.glColorMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT); ++ } ++ } ++ ++ /** ++ * Update and return fogColorBuffer with the RGBA values passed as arguments ++ */ ++ private FloatBuffer setFogColorBuffer(float par1, float par2, float par3, float par4) ++ { ++ this.fogColorBuffer.clear(); ++ this.fogColorBuffer.put(par1).put(par2).put(par3).put(par4); ++ this.fogColorBuffer.flip(); ++ return this.fogColorBuffer; ++ } ++ ++ /** ++ * Converts performance value (0-2) to FPS (35-200) ++ */ ++ public static int performanceToFps(int par0) ++ { ++ short var1 = 200; ++ ++ if (par0 == 1) ++ { ++ var1 = 120; ++ } ++ ++ if (par0 == 2) ++ { ++ var1 = 35; ++ } ++ ++ return var1; ++ } ++ ++ /** ++ * Get minecraft reference from the EntityRenderer ++ */ ++ static Minecraft getRendererMinecraft(EntityRenderer par0EntityRenderer) ++ { ++ return par0EntityRenderer.mc; ++ } ++ } +*** EntitySelectorAlive.java Sat Feb 5 04:13:13 2022 +--- EntitySelectorAlive.java Sat Feb 5 04:12:34 2022 +*** EntitySelectorArmoredMob.java Sat Feb 5 04:13:13 2022 +--- EntitySelectorArmoredMob.java Sat Feb 5 04:12:34 2022 +*************** +*** 23,31 **** + return false; + } + else + { + EntityLivingBase var2 = (EntityLivingBase)par1Entity; +! return var2.getEquipmentInSlot(EntityLiving.getArmorPosition(this.field_96567_c)) != null ? false : (var2 instanceof EntityLiving ? ((EntityLiving)var2).canPickUpLoot() : var2 instanceof EntityPlayer); + } + } + } +--- 23,31 ---- + return false; + } + else + { + EntityLivingBase var2 = (EntityLivingBase)par1Entity; +! return var2.getCurrentItemOrArmor(EntityLiving.getArmorPosition(this.field_96567_c)) != null ? false : (var2 instanceof EntityLiving ? ((EntityLiving)var2).canPickUpLoot() : var2 instanceof EntityPlayer); + } + } + } +*** EntitySelectorInventory.java Sat Feb 5 04:13:13 2022 +--- EntitySelectorInventory.java Sat Feb 5 04:12:34 2022 +*** EntitySenses.java Sat Feb 5 04:13:13 2022 +--- EntitySenses.java Sat Feb 5 04:12:34 2022 +*** EntitySheep.java Sat Feb 5 04:13:13 2022 +--- EntitySheep.java Sat Feb 5 04:12:34 2022 +*************** +*** 78,88 **** + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte)0)); + } + + /** +! * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean par1, int par2) + { + if (!this.getSheared()) + { +--- 78,89 ---- + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte)0)); + } + + /** +! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param +! * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean par1, int par2) + { + if (!this.getSheared()) + { +*************** +*** 94,103 **** +--- 95,134 ---- + * Returns the item ID for the item the mob drops on death. + */ + protected int getDropItemId() + { + return Block.cloth.blockID; ++ } ++ ++ public void handleHealthUpdate(byte par1) ++ { ++ if (par1 == 10) ++ { ++ this.sheepTimer = 40; ++ } ++ else ++ { ++ super.handleHealthUpdate(par1); ++ } ++ } ++ ++ public float func_70894_j(float par1) ++ { ++ return this.sheepTimer <= 0 ? 0.0F : (this.sheepTimer >= 4 && this.sheepTimer <= 36 ? 1.0F : (this.sheepTimer < 4 ? ((float)this.sheepTimer - par1) / 4.0F : -((float)(this.sheepTimer - 40) - par1) / 4.0F)); ++ } ++ ++ public float func_70890_k(float par1) ++ { ++ if (this.sheepTimer > 4 && this.sheepTimer <= 36) ++ { ++ float var2 = ((float)(this.sheepTimer - 4) - par1) / 32.0F; ++ return ((float)Math.PI / 5F) + ((float)Math.PI * 7F / 100F) * MathHelper.sin(var2 * 28.7F); ++ } ++ else ++ { ++ return this.sheepTimer > 0 ? ((float)Math.PI / 5F) : this.rotationPitch / (180F / (float)Math.PI); ++ } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ +*** EntitySilverfish.java Sat Feb 5 04:13:13 2022 +--- EntitySilverfish.java Sat Feb 5 04:12:34 2022 +*** EntitySkeleton.java Sat Feb 5 04:13:13 2022 +--- EntitySkeleton.java Sat Feb 5 04:12:34 2022 +*************** +*** 113,123 **** + float var1 = this.getBrightness(1.0F); + + if (var1 > 0.5F && this.rand.nextFloat() * 30.0F < (var1 - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))) + { + boolean var2 = true; +! ItemStack var3 = this.getEquipmentInSlot(4); + + if (var3 != null) + { + if (var3.isItemStackDamageable()) + { +--- 113,123 ---- + float var1 = this.getBrightness(1.0F); + + if (var1 > 0.5F && this.rand.nextFloat() * 30.0F < (var1 - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))) + { + boolean var2 = true; +! ItemStack var3 = this.getCurrentItemOrArmor(4); + + if (var3 != null) + { + if (var3.isItemStackDamageable()) + { +*************** +*** 189,199 **** + { + return Item.arrow.itemID; + } + + /** +! * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3; + int var4; +--- 189,200 ---- + { + return Item.arrow.itemID; + } + + /** +! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param +! * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3; + int var4; +*************** +*** 260,270 **** + this.enchantEquipment(); + } + + this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ)); + +! if (this.getEquipmentInSlot(4) == null) + { + Calendar var2 = this.worldObj.getCurrentDate(); + + if (var2.get(2) + 1 == 10 && var2.get(5) == 31 && this.rand.nextFloat() < 0.25F) + { +--- 261,271 ---- + this.enchantEquipment(); + } + + this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ)); + +! if (this.getCurrentItemOrArmor(4) == null) + { + Calendar var2 = this.worldObj.getCurrentDate(); + + if (var2.get(2) + 1 == 10 && var2.get(5) == 31 && this.rand.nextFloat() < 0.25F) + { +*** EntitySlime.java Sat Feb 5 04:13:13 2022 +--- EntitySlime.java Sat Feb 5 04:12:34 2022 +*************** +*** 4,14 **** + { + public float squishAmount; + public float squishFactor; + public float prevSquishFactor; + +! /** ticks until this slime jumps again */ + private int slimeJumpDelay; + + public EntitySlime(World par1World) + { + super(par1World); +--- 4,14 ---- + { + public float squishAmount; + public float squishFactor; + public float prevSquishFactor; + +! /** the time between each jump of the slime */ + private int slimeJumpDelay; + + public EntitySlime(World par1World) + { + super(par1World); +*** EntitySmallFireball.java Sat Feb 5 04:13:13 2022 +--- EntitySmallFireball.java Sat Feb 5 04:12:34 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntitySmokeFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,82 ---- ++ package net.minecraft.src; ++ ++ public class EntitySmokeFX extends EntityFX ++ { ++ float smokeParticleScale; ++ ++ public EntitySmokeFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) ++ { ++ this(par1World, par2, par4, par6, par8, par10, par12, 1.0F); ++ } ++ ++ public EntitySmokeFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, float par14) ++ { ++ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); ++ this.motionX *= 0.10000000149011612D; ++ this.motionY *= 0.10000000149011612D; ++ this.motionZ *= 0.10000000149011612D; ++ this.motionX += par8; ++ this.motionY += par10; ++ this.motionZ += par12; ++ this.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * 0.30000001192092896D); ++ this.particleScale *= 0.75F; ++ this.particleScale *= par14; ++ this.smokeParticleScale = this.particleScale; ++ this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); ++ this.particleMaxAge = (int)((float)this.particleMaxAge * par14); ++ this.noClip = false; ++ } ++ ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F; ++ ++ if (var8 < 0.0F) ++ { ++ var8 = 0.0F; ++ } ++ ++ if (var8 > 1.0F) ++ { ++ var8 = 1.0F; ++ } ++ ++ this.particleScale = this.smokeParticleScale * var8; ++ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ this.prevPosX = this.posX; ++ this.prevPosY = this.posY; ++ this.prevPosZ = this.posZ; ++ ++ if (this.particleAge++ >= this.particleMaxAge) ++ { ++ this.setDead(); ++ } ++ ++ this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); ++ this.motionY += 0.004D; ++ this.moveEntity(this.motionX, this.motionY, this.motionZ); ++ ++ if (this.posY == this.prevPosY) ++ { ++ this.motionX *= 1.1D; ++ this.motionZ *= 1.1D; ++ } ++ ++ this.motionX *= 0.9599999785423279D; ++ this.motionY *= 0.9599999785423279D; ++ this.motionZ *= 0.9599999785423279D; ++ ++ if (this.onGround) ++ { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ } ++ } ++ } +*** EntitySnowball.java Sat Feb 5 04:13:13 2022 +--- EntitySnowball.java Sat Feb 5 04:12:34 2022 +*** EntitySnowman.java Sat Feb 5 04:13:13 2022 +--- EntitySnowman.java Sat Feb 5 04:12:34 2022 +*************** +*** 70,80 **** + { + return Item.snowball.itemID; + } + + /** +! * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.rand.nextInt(16); + +--- 70,81 ---- + { + return Item.snowball.itemID; + } + + /** +! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param +! * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.rand.nextInt(16); + +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntitySnowShovelFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,75 ---- ++ package net.minecraft.src; ++ ++ public class EntitySnowShovelFX extends EntityFX ++ { ++ float snowDigParticleScale; ++ ++ public EntitySnowShovelFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) ++ { ++ this(par1World, par2, par4, par6, par8, par10, par12, 1.0F); ++ } ++ ++ public EntitySnowShovelFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, float par14) ++ { ++ super(par1World, par2, par4, par6, par8, par10, par12); ++ this.motionX *= 0.10000000149011612D; ++ this.motionY *= 0.10000000149011612D; ++ this.motionZ *= 0.10000000149011612D; ++ this.motionX += par8; ++ this.motionY += par10; ++ this.motionZ += par12; ++ this.particleRed = this.particleGreen = this.particleBlue = 1.0F - (float)(Math.random() * 0.30000001192092896D); ++ this.particleScale *= 0.75F; ++ this.particleScale *= par14; ++ this.snowDigParticleScale = this.particleScale; ++ this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); ++ this.particleMaxAge = (int)((float)this.particleMaxAge * par14); ++ this.noClip = false; ++ } ++ ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F; ++ ++ if (var8 < 0.0F) ++ { ++ var8 = 0.0F; ++ } ++ ++ if (var8 > 1.0F) ++ { ++ var8 = 1.0F; ++ } ++ ++ this.particleScale = this.snowDigParticleScale * var8; ++ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ this.prevPosX = this.posX; ++ this.prevPosY = this.posY; ++ this.prevPosZ = this.posZ; ++ ++ if (this.particleAge++ >= this.particleMaxAge) ++ { ++ this.setDead(); ++ } ++ ++ this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); ++ this.motionY -= 0.03D; ++ this.moveEntity(this.motionX, this.motionY, this.motionZ); ++ this.motionX *= 0.9900000095367432D; ++ this.motionY *= 0.9900000095367432D; ++ this.motionZ *= 0.9900000095367432D; ++ ++ if (this.onGround) ++ { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntitySorter.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,41 ---- ++ package net.minecraft.src; ++ ++ import java.util.Comparator; ++ ++ public class EntitySorter implements Comparator ++ { ++ /** Entity position X */ ++ private double entityPosX; ++ ++ /** Entity position Y */ ++ private double entityPosY; ++ ++ /** Entity position Z */ ++ private double entityPosZ; ++ ++ public EntitySorter(Entity par1Entity) ++ { ++ this.entityPosX = -par1Entity.posX; ++ this.entityPosY = -par1Entity.posY; ++ this.entityPosZ = -par1Entity.posZ; ++ } ++ ++ /** ++ * Sorts the two world renderers according to their distance to a given entity. ++ */ ++ public int sortByDistanceToEntity(WorldRenderer par1WorldRenderer, WorldRenderer par2WorldRenderer) ++ { ++ double var3 = (double)par1WorldRenderer.posXPlus + this.entityPosX; ++ double var5 = (double)par1WorldRenderer.posYPlus + this.entityPosY; ++ double var7 = (double)par1WorldRenderer.posZPlus + this.entityPosZ; ++ double var9 = (double)par2WorldRenderer.posXPlus + this.entityPosX; ++ double var11 = (double)par2WorldRenderer.posYPlus + this.entityPosY; ++ double var13 = (double)par2WorldRenderer.posZPlus + this.entityPosZ; ++ return (int)((var3 * var3 + var5 * var5 + var7 * var7 - (var9 * var9 + var11 * var11 + var13 * var13)) * 1024.0D); ++ } ++ ++ public int compare(Object par1Obj, Object par2Obj) ++ { ++ return this.sortByDistanceToEntity((WorldRenderer)par1Obj, (WorldRenderer)par2Obj); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntitySpellParticleFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,83 ---- ++ package net.minecraft.src; ++ ++ public class EntitySpellParticleFX extends EntityFX ++ { ++ /** Base spell texture index */ ++ private int baseSpellTextureIndex = 128; ++ ++ public EntitySpellParticleFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) ++ { ++ super(par1World, par2, par4, par6, par8, par10, par12); ++ this.motionY *= 0.20000000298023224D; ++ ++ if (par8 == 0.0D && par12 == 0.0D) ++ { ++ this.motionX *= 0.10000000149011612D; ++ this.motionZ *= 0.10000000149011612D; ++ } ++ ++ this.particleScale *= 0.75F; ++ this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); ++ this.noClip = false; ++ } ++ ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F; ++ ++ if (var8 < 0.0F) ++ { ++ var8 = 0.0F; ++ } ++ ++ if (var8 > 1.0F) ++ { ++ var8 = 1.0F; ++ } ++ ++ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ this.prevPosX = this.posX; ++ this.prevPosY = this.posY; ++ this.prevPosZ = this.posZ; ++ ++ if (this.particleAge++ >= this.particleMaxAge) ++ { ++ this.setDead(); ++ } ++ ++ this.setParticleTextureIndex(this.baseSpellTextureIndex + (7 - this.particleAge * 8 / this.particleMaxAge)); ++ this.motionY += 0.004D; ++ this.moveEntity(this.motionX, this.motionY, this.motionZ); ++ ++ if (this.posY == this.prevPosY) ++ { ++ this.motionX *= 1.1D; ++ this.motionZ *= 1.1D; ++ } ++ ++ this.motionX *= 0.9599999785423279D; ++ this.motionY *= 0.9599999785423279D; ++ this.motionZ *= 0.9599999785423279D; ++ ++ if (this.onGround) ++ { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ } ++ } ++ ++ /** ++ * Sets the base spell texture index ++ */ ++ public void setBaseSpellTextureIndex(int par1) ++ { ++ this.baseSpellTextureIndex = par1; ++ } ++ } +*** EntitySpider.java Sat Feb 5 04:13:13 2022 +--- EntitySpider.java Sat Feb 5 04:12:34 2022 +*************** +*** 124,134 **** + { + return Item.silk.itemID; + } + + /** +! * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean par1, int par2) + { + super.dropFewItems(par1, par2); + +--- 124,135 ---- + { + return Item.silk.itemID; + } + + /** +! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param +! * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean par1, int par2) + { + super.dropFewItems(par1, par2); + +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntitySplashFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,18 ---- ++ package net.minecraft.src; ++ ++ public class EntitySplashFX extends EntityRainFX ++ { ++ public EntitySplashFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) ++ { ++ super(par1World, par2, par4, par6); ++ this.particleGravity = 0.04F; ++ this.nextTextureIndexX(); ++ ++ if (par10 == 0.0D && (par8 != 0.0D || par12 != 0.0D)) ++ { ++ this.motionX = par8; ++ this.motionY = par10 + 0.1D; ++ this.motionZ = par12; ++ } ++ } ++ } +*** EntitySquid.java Sat Feb 5 04:13:13 2022 +--- EntitySquid.java Sat Feb 5 04:12:34 2022 +*************** +*** 10,27 **** + /** + * appears to be rotation in radians; we already have pitch & yaw, so this completes the triumvirate. + */ + public float squidRotation; + +! /** previous squidRotation in radians */ + public float prevSquidRotation; + + /** angle of the tentacles in radians */ + public float tentacleAngle; + + /** the last calculated angle of the tentacles in radians */ +! public float lastTentacleAngle; + private float randomMotionSpeed; + + /** change in squidRotation in radians. */ + private float rotationVelocity; + private float field_70871_bB; +--- 10,27 ---- + /** + * appears to be rotation in radians; we already have pitch & yaw, so this completes the triumvirate. + */ + public float squidRotation; + +! /** previous squidRotation in radians. */ + public float prevSquidRotation; + + /** angle of the tentacles in radians */ + public float tentacleAngle; + + /** the last calculated angle of the tentacles in radians */ +! public float prevTentacleAngle; + private float randomMotionSpeed; + + /** change in squidRotation in radians. */ + private float rotationVelocity; + private float field_70871_bB; +*************** +*** 90,100 **** + { + return false; + } + + /** +! * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.rand.nextInt(3 + par2) + 1; + +--- 90,101 ---- + { + return false; + } + + /** +! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param +! * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.rand.nextInt(3 + par2) + 1; + +*************** +*** 121,131 **** + { + super.onLivingUpdate(); + this.prevSquidPitch = this.squidPitch; + this.prevSquidYaw = this.squidYaw; + this.prevSquidRotation = this.squidRotation; +! this.lastTentacleAngle = this.tentacleAngle; + this.squidRotation += this.rotationVelocity; + + if (this.squidRotation > ((float)Math.PI * 2F)) + { + this.squidRotation -= ((float)Math.PI * 2F); +--- 122,132 ---- + { + super.onLivingUpdate(); + this.prevSquidPitch = this.squidPitch; + this.prevSquidYaw = this.squidYaw; + this.prevSquidRotation = this.squidRotation; +! this.prevTentacleAngle = this.tentacleAngle; + this.squidRotation += this.rotationVelocity; + + if (this.squidRotation > ((float)Math.PI * 2F)) + { + this.squidRotation -= ((float)Math.PI * 2F); +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EntitySuspendFX.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,40 ---- ++ package net.minecraft.src; ++ ++ public class EntitySuspendFX extends EntityFX ++ { ++ public EntitySuspendFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) ++ { ++ super(par1World, par2, par4 - 0.125D, par6, par8, par10, par12); ++ this.particleRed = 0.4F; ++ this.particleGreen = 0.4F; ++ this.particleBlue = 0.7F; ++ this.setParticleTextureIndex(0); ++ this.setSize(0.01F, 0.01F); ++ this.particleScale *= this.rand.nextFloat() * 0.6F + 0.2F; ++ this.motionX = par8 * 0.0D; ++ this.motionY = par10 * 0.0D; ++ this.motionZ = par12 * 0.0D; ++ this.particleMaxAge = (int)(16.0D / (Math.random() * 0.8D + 0.2D)); ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ public void onUpdate() ++ { ++ this.prevPosX = this.posX; ++ this.prevPosY = this.posY; ++ this.prevPosZ = this.posZ; ++ this.moveEntity(this.motionX, this.motionY, this.motionZ); ++ ++ if (this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) != Material.water) ++ { ++ this.setDead(); ++ } ++ ++ if (this.particleMaxAge-- <= 0) ++ { ++ this.setDead(); ++ } ++ } ++ } +*** EntityTameable.java Sat Feb 5 04:13:13 2022 +--- EntityTameable.java Sat Feb 5 04:12:34 2022 +*************** +*** 72,81 **** +--- 72,97 ---- + double var8 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle(var2, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var4, var6, var8); + } + } + ++ public void handleHealthUpdate(byte par1) ++ { ++ if (par1 == 7) ++ { ++ this.playTameEffect(true); ++ } ++ else if (par1 == 6) ++ { ++ this.playTameEffect(false); ++ } ++ else ++ { ++ super.handleHealthUpdate(par1); ++ } ++ } ++ + public boolean isTamed() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 4) != 0; + } + +*** EntityThrowable.java Sat Feb 5 04:13:13 2022 +--- EntityThrowable.java Sat Feb 5 04:12:34 2022 +*************** +*** 9,19 **** + private int zTile = -1; + private int inTile; + protected boolean inGround; + public int throwableShake; + +! /** The entity that threw this throwable item. */ + private EntityLivingBase thrower; + private String throwerName; + private int ticksInGround; + private int ticksInAir; + +--- 9,21 ---- + private int zTile = -1; + private int inTile; + protected boolean inGround; + public int throwableShake; + +! /** +! * Is the entity that throws this 'thing' (snowball, ender pearl, eye of ender or potion) +! */ + private EntityLivingBase thrower; + private String throwerName; + private int ticksInGround; + private int ticksInAir; + +*************** +*** 23,32 **** +--- 25,45 ---- + this.setSize(0.25F, 0.25F); + } + + protected void entityInit() {} + ++ /** ++ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge ++ * length * 64 * renderDistanceWeight Args: distance ++ */ ++ public boolean isInRangeToRenderDist(double par1) ++ { ++ double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; ++ var3 *= 64.0D; ++ return par1 < var3 * var3; ++ } ++ + public EntityThrowable(World par1World, EntityLivingBase par2EntityLivingBase) + { + super(par1World); + this.thrower = par2EntityLivingBase; + this.setSize(0.25F, 0.25F); +*************** +*** 85,94 **** +--- 98,124 ---- + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var10) * 180.0D / Math.PI); + this.ticksInGround = 0; + } + + /** ++ * Sets the velocity to the args. Args: x, y, z ++ */ ++ public void setVelocity(double par1, double par3, double par5) ++ { ++ this.motionX = par1; ++ this.motionY = par3; ++ this.motionZ = par5; ++ ++ if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) ++ { ++ float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); ++ this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI); ++ this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var7) * 180.0D / Math.PI); ++ } ++ } ++ ++ /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.lastTickPosX = this.posX; +*************** +*** 129,139 **** + ++this.ticksInAir; + } + + Vec3 var16 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); +! MovingObjectPosition var3 = this.worldObj.rayTraceBlocks(var16, var2); + var16 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (var3 != null) + { +--- 159,169 ---- + ++this.ticksInAir; + } + + Vec3 var16 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); +! MovingObjectPosition var3 = this.worldObj.clip(var16, var2); + var16 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (var3 != null) + { +*************** +*** 285,294 **** +--- 315,329 ---- + + if (this.throwerName != null && this.throwerName.length() == 0) + { + this.throwerName = null; + } ++ } ++ ++ public float getShadowSize() ++ { ++ return 0.0F; + } + + public EntityLivingBase getThrower() + { + if (this.thrower == null && this.throwerName != null && this.throwerName.length() > 0) +*** EntityTNTPrimed.java Sat Feb 5 04:13:13 2022 +--- EntityTNTPrimed.java Sat Feb 5 04:12:34 2022 +*************** +*** 104,113 **** +--- 104,118 ---- + protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + this.fuse = par1NBTTagCompound.getByte("Fuse"); + } + ++ public float getShadowSize() ++ { ++ return 0.0F; ++ } ++ + /** + * returns null or the entityliving it was placed or ignited by + */ + public EntityLivingBase getTntPlacedBy() + { +*** EntityTracker.java Sat Feb 5 04:13:13 2022 +--- EntityTracker.java Sat Feb 5 04:12:34 2022 +*************** +*** 11,180 **** + + /** + * List of tracked entities, used for iteration operations on tracked entities. + */ + private Set trackedEntities = new HashSet(); +! +! /** Used for identity lookup of tracked entities. */ +! private IntHashMap trackedEntityHashTable = new IntHashMap(); +! private int maxTrackingDistanceThreshold; + + public EntityTracker(WorldServer par1WorldServer) + { + this.theWorld = par1WorldServer; +! this.maxTrackingDistanceThreshold = par1WorldServer.getMinecraftServer().getConfigurationManager().getEntityViewDistance(); + } + +! public void trackEntity(Entity par1Entity) + { + if (par1Entity instanceof EntityPlayerMP) + { +! this.trackEntity(par1Entity, 512, 2); + EntityPlayerMP var2 = (EntityPlayerMP)par1Entity; + Iterator var3 = this.trackedEntities.iterator(); + + while (var3.hasNext()) + { + EntityTrackerEntry var4 = (EntityTrackerEntry)var3.next(); + +! if (var4.trackedEntity != var2) + { +! var4.updatePlayerEntity(var2); + } + } + } + else if (par1Entity instanceof EntityFishHook) + { +! this.trackEntity(par1Entity, 64, 5, true); + } + else if (par1Entity instanceof EntityArrow) + { +! this.trackEntity(par1Entity, 64, 20, false); + } + else if (par1Entity instanceof EntitySmallFireball) + { +! this.trackEntity(par1Entity, 64, 10, false); + } + else if (par1Entity instanceof EntityFireball) + { +! this.trackEntity(par1Entity, 64, 10, false); + } + else if (par1Entity instanceof EntitySnowball) + { +! this.trackEntity(par1Entity, 64, 10, true); + } + else if (par1Entity instanceof EntityEnderPearl) + { +! this.trackEntity(par1Entity, 64, 10, true); + } + else if (par1Entity instanceof EntityEnderEye) + { +! this.trackEntity(par1Entity, 64, 4, true); + } + else if (par1Entity instanceof EntityEgg) + { +! this.trackEntity(par1Entity, 64, 10, true); + } + else if (par1Entity instanceof EntityPotion) + { +! this.trackEntity(par1Entity, 64, 10, true); + } + else if (par1Entity instanceof EntityExpBottle) + { +! this.trackEntity(par1Entity, 64, 10, true); + } + else if (par1Entity instanceof EntityFireworkRocket) + { +! this.trackEntity(par1Entity, 64, 10, true); + } + else if (par1Entity instanceof EntityItem) + { +! this.trackEntity(par1Entity, 64, 20, true); + } + else if (par1Entity instanceof EntityMinecart) + { +! this.trackEntity(par1Entity, 80, 3, true); + } + else if (par1Entity instanceof EntityBoat) + { +! this.trackEntity(par1Entity, 80, 3, true); + } + else if (par1Entity instanceof EntitySquid) + { +! this.trackEntity(par1Entity, 64, 3, true); + } + else if (par1Entity instanceof EntityWither) + { +! this.trackEntity(par1Entity, 80, 3, false); + } + else if (par1Entity instanceof EntityBat) + { +! this.trackEntity(par1Entity, 80, 3, false); + } + else if (par1Entity instanceof IAnimals) + { +! this.trackEntity(par1Entity, 80, 3, true); + } + else if (par1Entity instanceof EntityDragon) + { +! this.trackEntity(par1Entity, 160, 3, true); + } + else if (par1Entity instanceof EntityTNTPrimed) + { +! this.trackEntity(par1Entity, 160, 10, true); + } + else if (par1Entity instanceof EntityFallingSand) + { +! this.trackEntity(par1Entity, 160, 20, true); + } + else if (par1Entity instanceof EntityHanging) + { +! this.trackEntity(par1Entity, 160, Integer.MAX_VALUE, false); + } + else if (par1Entity instanceof EntityXPOrb) + { +! this.trackEntity(par1Entity, 160, 20, true); + } + else if (par1Entity instanceof EntityEnderCrystal) + { +! this.trackEntity(par1Entity, 256, Integer.MAX_VALUE, false); + } + } + +! public void trackEntity(Entity par1Entity, int par2, int par3) + { +! this.trackEntity(par1Entity, par2, par3, false); + } + +! public void trackEntity(Entity par1Entity, int par2, int par3, boolean par4) + { +! if (par2 > this.maxTrackingDistanceThreshold) + { +! par2 = this.maxTrackingDistanceThreshold; + } + + try + { +! if (this.trackedEntityHashTable.containsItem(par1Entity.entityId)) + { + throw new IllegalStateException("Entity is already tracked!"); + } + + EntityTrackerEntry var5 = new EntityTrackerEntry(par1Entity, par2, par3, par4); + this.trackedEntities.add(var5); +! this.trackedEntityHashTable.addKey(par1Entity.entityId, var5); +! var5.updatePlayerEntities(this.theWorld.playerEntities); + } + catch (Throwable var11) + { + CrashReport var6 = CrashReport.makeCrashReport(var11, "Adding entity to track"); + CrashReportCategory var7 = var6.makeCategory("Entity To Track"); + var7.addCrashSection("Tracking range", par2 + " blocks"); + var7.addCrashSectionCallable("Update interval", new CallableEntityTracker(this, par3)); + par1Entity.addEntityCrashInfo(var7); + CrashReportCategory var8 = var6.makeCategory("Entity That Is Already Tracked"); +! ((EntityTrackerEntry)this.trackedEntityHashTable.lookup(par1Entity.entityId)).trackedEntity.addEntityCrashInfo(var8); + + try + { + throw new ReportedException(var6); + } +--- 11,182 ---- + + /** + * List of tracked entities, used for iteration operations on tracked entities. + */ + private Set trackedEntities = new HashSet(); +! private IntHashMap trackedEntityIDs = new IntHashMap(); +! private int entityViewDistance; + + public EntityTracker(WorldServer par1WorldServer) + { + this.theWorld = par1WorldServer; +! this.entityViewDistance = par1WorldServer.getMinecraftServer().getConfigurationManager().getEntityViewDistance(); + } + +! /** +! * if entity is a player sends all tracked events to the player, otherwise, adds with a visibility and update arate +! * based on the class type +! */ +! public void addEntityToTracker(Entity par1Entity) + { + if (par1Entity instanceof EntityPlayerMP) + { +! this.addEntityToTracker(par1Entity, 512, 2); + EntityPlayerMP var2 = (EntityPlayerMP)par1Entity; + Iterator var3 = this.trackedEntities.iterator(); + + while (var3.hasNext()) + { + EntityTrackerEntry var4 = (EntityTrackerEntry)var3.next(); + +! if (var4.myEntity != var2) + { +! var4.tryStartWachingThis(var2); + } + } + } + else if (par1Entity instanceof EntityFishHook) + { +! this.addEntityToTracker(par1Entity, 64, 5, true); + } + else if (par1Entity instanceof EntityArrow) + { +! this.addEntityToTracker(par1Entity, 64, 20, false); + } + else if (par1Entity instanceof EntitySmallFireball) + { +! this.addEntityToTracker(par1Entity, 64, 10, false); + } + else if (par1Entity instanceof EntityFireball) + { +! this.addEntityToTracker(par1Entity, 64, 10, false); + } + else if (par1Entity instanceof EntitySnowball) + { +! this.addEntityToTracker(par1Entity, 64, 10, true); + } + else if (par1Entity instanceof EntityEnderPearl) + { +! this.addEntityToTracker(par1Entity, 64, 10, true); + } + else if (par1Entity instanceof EntityEnderEye) + { +! this.addEntityToTracker(par1Entity, 64, 4, true); + } + else if (par1Entity instanceof EntityEgg) + { +! this.addEntityToTracker(par1Entity, 64, 10, true); + } + else if (par1Entity instanceof EntityPotion) + { +! this.addEntityToTracker(par1Entity, 64, 10, true); + } + else if (par1Entity instanceof EntityExpBottle) + { +! this.addEntityToTracker(par1Entity, 64, 10, true); + } + else if (par1Entity instanceof EntityFireworkRocket) + { +! this.addEntityToTracker(par1Entity, 64, 10, true); + } + else if (par1Entity instanceof EntityItem) + { +! this.addEntityToTracker(par1Entity, 64, 20, true); + } + else if (par1Entity instanceof EntityMinecart) + { +! this.addEntityToTracker(par1Entity, 80, 3, true); + } + else if (par1Entity instanceof EntityBoat) + { +! this.addEntityToTracker(par1Entity, 80, 3, true); + } + else if (par1Entity instanceof EntitySquid) + { +! this.addEntityToTracker(par1Entity, 64, 3, true); + } + else if (par1Entity instanceof EntityWither) + { +! this.addEntityToTracker(par1Entity, 80, 3, false); + } + else if (par1Entity instanceof EntityBat) + { +! this.addEntityToTracker(par1Entity, 80, 3, false); + } + else if (par1Entity instanceof IAnimals) + { +! this.addEntityToTracker(par1Entity, 80, 3, true); + } + else if (par1Entity instanceof EntityDragon) + { +! this.addEntityToTracker(par1Entity, 160, 3, true); + } + else if (par1Entity instanceof EntityTNTPrimed) + { +! this.addEntityToTracker(par1Entity, 160, 10, true); + } + else if (par1Entity instanceof EntityFallingSand) + { +! this.addEntityToTracker(par1Entity, 160, 20, true); + } + else if (par1Entity instanceof EntityHanging) + { +! this.addEntityToTracker(par1Entity, 160, Integer.MAX_VALUE, false); + } + else if (par1Entity instanceof EntityXPOrb) + { +! this.addEntityToTracker(par1Entity, 160, 20, true); + } + else if (par1Entity instanceof EntityEnderCrystal) + { +! this.addEntityToTracker(par1Entity, 256, Integer.MAX_VALUE, false); + } + } + +! public void addEntityToTracker(Entity par1Entity, int par2, int par3) + { +! this.addEntityToTracker(par1Entity, par2, par3, false); + } + +! public void addEntityToTracker(Entity par1Entity, int par2, int par3, boolean par4) + { +! if (par2 > this.entityViewDistance) + { +! par2 = this.entityViewDistance; + } + + try + { +! if (this.trackedEntityIDs.containsItem(par1Entity.entityId)) + { + throw new IllegalStateException("Entity is already tracked!"); + } + + EntityTrackerEntry var5 = new EntityTrackerEntry(par1Entity, par2, par3, par4); + this.trackedEntities.add(var5); +! this.trackedEntityIDs.addKey(par1Entity.entityId, var5); +! var5.sendEventsToPlayers(this.theWorld.playerEntities); + } + catch (Throwable var11) + { + CrashReport var6 = CrashReport.makeCrashReport(var11, "Adding entity to track"); + CrashReportCategory var7 = var6.makeCategory("Entity To Track"); + var7.addCrashSection("Tracking range", par2 + " blocks"); + var7.addCrashSectionCallable("Update interval", new CallableEntityTracker(this, par3)); + par1Entity.addEntityCrashInfo(var7); + CrashReportCategory var8 = var6.makeCategory("Entity That Is Already Tracked"); +! ((EntityTrackerEntry)this.trackedEntityIDs.lookup(par1Entity.entityId)).myEntity.addEntityCrashInfo(var8); + + try + { + throw new ReportedException(var6); + } +*************** +*** 184,213 **** + var10.printStackTrace(); + } + } + } + +! public void untrackEntity(Entity par1Entity) + { + if (par1Entity instanceof EntityPlayerMP) + { + EntityPlayerMP var2 = (EntityPlayerMP)par1Entity; + Iterator var3 = this.trackedEntities.iterator(); + + while (var3.hasNext()) + { + EntityTrackerEntry var4 = (EntityTrackerEntry)var3.next(); +! var4.removeFromTrackedPlayers(var2); + } + } + +! EntityTrackerEntry var5 = (EntityTrackerEntry)this.trackedEntityHashTable.removeObject(par1Entity.entityId); + + if (var5 != null) + { + this.trackedEntities.remove(var5); +! var5.sendDestroyEntityPacketToTrackedPlayers(); + } + } + + public void updateTrackedEntities() + { +--- 186,215 ---- + var10.printStackTrace(); + } + } + } + +! public void removeEntityFromAllTrackingPlayers(Entity par1Entity) + { + if (par1Entity instanceof EntityPlayerMP) + { + EntityPlayerMP var2 = (EntityPlayerMP)par1Entity; + Iterator var3 = this.trackedEntities.iterator(); + + while (var3.hasNext()) + { + EntityTrackerEntry var4 = (EntityTrackerEntry)var3.next(); +! var4.removeFromWatchingList(var2); + } + } + +! EntityTrackerEntry var5 = (EntityTrackerEntry)this.trackedEntityIDs.removeObject(par1Entity.entityId); + + if (var5 != null) + { + this.trackedEntities.remove(var5); +! var5.informAllAssociatedPlayersOfItemDestruction(); + } + } + + public void updateTrackedEntities() + { +*************** +*** 215,229 **** + Iterator var2 = this.trackedEntities.iterator(); + + while (var2.hasNext()) + { + EntityTrackerEntry var3 = (EntityTrackerEntry)var2.next(); +! var3.updatePlayerList(this.theWorld.playerEntities); + +! if (var3.playerEntitiesUpdated && var3.trackedEntity instanceof EntityPlayerMP) + { +! var1.add((EntityPlayerMP)var3.trackedEntity); + } + } + + for (int var6 = 0; var6 < var1.size(); ++var6) + { +--- 217,231 ---- + Iterator var2 = this.trackedEntities.iterator(); + + while (var2.hasNext()) + { + EntityTrackerEntry var3 = (EntityTrackerEntry)var2.next(); +! var3.sendLocationToAllClients(this.theWorld.playerEntities); + +! if (var3.playerEntitiesUpdated && var3.myEntity instanceof EntityPlayerMP) + { +! var1.add((EntityPlayerMP)var3.myEntity); + } + } + + for (int var6 = 0; var6 < var1.size(); ++var6) + { +*************** +*** 232,277 **** + + while (var4.hasNext()) + { + EntityTrackerEntry var5 = (EntityTrackerEntry)var4.next(); + +! if (var5.trackedEntity != var7) + { +! var5.updatePlayerEntity(var7); + } + } + } + } + +! public void sendPacketToTrackedPlayers(Entity par1Entity, Packet par2Packet) + { +! EntityTrackerEntry var3 = (EntityTrackerEntry)this.trackedEntityHashTable.lookup(par1Entity.entityId); + + if (var3 != null) + { +! var3.sendPacketToTrackedPlayers(par2Packet); + } + } + +! public void sendPacketToTrackedPlayersAndTrackedEntity(Entity par1Entity, Packet par2Packet) + { +! EntityTrackerEntry var3 = (EntityTrackerEntry)this.trackedEntityHashTable.lookup(par1Entity.entityId); + + if (var3 != null) + { +! var3.sendPacketToTrackedPlayersAndTrackedEntity(par2Packet); + } + } + + public void removePlayerFromTrackers(EntityPlayerMP par1EntityPlayerMP) + { + Iterator var2 = this.trackedEntities.iterator(); + + while (var2.hasNext()) + { + EntityTrackerEntry var3 = (EntityTrackerEntry)var2.next(); +! var3.removeTrackedPlayerSymmetric(par1EntityPlayerMP); + } + } + + public void func_85172_a(EntityPlayerMP par1EntityPlayerMP, Chunk par2Chunk) + { +--- 234,285 ---- + + while (var4.hasNext()) + { + EntityTrackerEntry var5 = (EntityTrackerEntry)var4.next(); + +! if (var5.myEntity != var7) + { +! var5.tryStartWachingThis(var7); + } + } + } + } + +! /** +! * does not send the packet to the entity if the entity is a player +! */ +! public void sendPacketToAllPlayersTrackingEntity(Entity par1Entity, Packet par2Packet) + { +! EntityTrackerEntry var3 = (EntityTrackerEntry)this.trackedEntityIDs.lookup(par1Entity.entityId); + + if (var3 != null) + { +! var3.sendPacketToAllTrackingPlayers(par2Packet); + } + } + +! /** +! * sends to the entity if the entity is a player +! */ +! public void sendPacketToAllAssociatedPlayers(Entity par1Entity, Packet par2Packet) + { +! EntityTrackerEntry var3 = (EntityTrackerEntry)this.trackedEntityIDs.lookup(par1Entity.entityId); + + if (var3 != null) + { +! var3.sendPacketToAllAssociatedPlayers(par2Packet); + } + } + + public void removePlayerFromTrackers(EntityPlayerMP par1EntityPlayerMP) + { + Iterator var2 = this.trackedEntities.iterator(); + + while (var2.hasNext()) + { + EntityTrackerEntry var3 = (EntityTrackerEntry)var2.next(); +! var3.removePlayerFromTracker(par1EntityPlayerMP); + } + } + + public void func_85172_a(EntityPlayerMP par1EntityPlayerMP, Chunk par2Chunk) + { +*************** +*** 279,290 **** + + while (var3.hasNext()) + { + EntityTrackerEntry var4 = (EntityTrackerEntry)var3.next(); + +! if (var4.trackedEntity != par1EntityPlayerMP && var4.trackedEntity.chunkCoordX == par2Chunk.xPosition && var4.trackedEntity.chunkCoordZ == par2Chunk.zPosition) + { +! var4.updatePlayerEntity(par1EntityPlayerMP); + } + } + } + } +--- 287,298 ---- + + while (var3.hasNext()) + { + EntityTrackerEntry var4 = (EntityTrackerEntry)var3.next(); + +! if (var4.myEntity != par1EntityPlayerMP && var4.myEntity.chunkCoordX == par2Chunk.xPosition && var4.myEntity.chunkCoordZ == par2Chunk.zPosition) + { +! var4.tryStartWachingThis(par1EntityPlayerMP); + } + } + } + } +*** EntityTrackerEntry.java Sat Feb 5 04:13:13 2022 +--- EntityTrackerEntry.java Sat Feb 5 04:12:34 2022 +*************** +*** 6,45 **** + import java.util.List; + import java.util.Set; + + public class EntityTrackerEntry + { +! /** The entity that this EntityTrackerEntry tracks. */ +! public Entity trackedEntity; +! public int trackingDistanceThreshold; + + /** check for sync when ticks % updateFrequency==0 */ + public int updateFrequency; +! +! /** The encoded entity X position. */ +! public int encodedPosX; +! +! /** The encoded entity Y position. */ +! public int encodedPosY; +! +! /** The encoded entity Z position. */ +! public int encodedPosZ; +! +! /** The encoded entity yaw rotation. */ +! public int encodedRotationYaw; +! +! /** The encoded entity pitch rotation. */ +! public int encodedRotationPitch; + public int lastHeadMotion; +! public double lastTrackedEntityMotionX; +! public double lastTrackedEntityMotionY; + public double motionZ; +! public int updateCounter; +! private double lastTrackedEntityPosX; +! private double lastTrackedEntityPosY; +! private double lastTrackedEntityPosZ; +! private boolean firstUpdateDone; + private boolean sendVelocityUpdates; + + /** + * every 400 ticks a full teleport packet is sent, rather than just a "move me +x" command, so that position + * remains fully synced. +--- 6,36 ---- + import java.util.List; + import java.util.Set; + + public class EntityTrackerEntry + { +! public Entity myEntity; +! public int blocksDistanceThreshold; + + /** check for sync when ticks % updateFrequency==0 */ + public int updateFrequency; +! public int lastScaledXPosition; +! public int lastScaledYPosition; +! public int lastScaledZPosition; +! public int lastYaw; +! public int lastPitch; + public int lastHeadMotion; +! public double motionX; +! public double motionY; + public double motionZ; +! public int ticks; +! private double posX; +! private double posY; +! private double posZ; +! +! /** set to true on first sendLocationToClients */ +! private boolean isDataInitialized; + private boolean sendVelocityUpdates; + + /** + * every 400 ticks a full teleport packet is sent, rather than just a "move me +x" command, so that position + * remains fully synced. +*************** +*** 54,585 **** + */ + public Set trackingPlayers = new HashSet(); + + public EntityTrackerEntry(Entity par1Entity, int par2, int par3, boolean par4) + { +! this.trackedEntity = par1Entity; +! this.trackingDistanceThreshold = par2; + this.updateFrequency = par3; + this.sendVelocityUpdates = par4; +! this.encodedPosX = MathHelper.floor_double(par1Entity.posX * 32.0D); +! this.encodedPosY = MathHelper.floor_double(par1Entity.posY * 32.0D); +! this.encodedPosZ = MathHelper.floor_double(par1Entity.posZ * 32.0D); +! this.encodedRotationYaw = MathHelper.floor_float(par1Entity.rotationYaw * 256.0F / 360.0F); +! this.encodedRotationPitch = MathHelper.floor_float(par1Entity.rotationPitch * 256.0F / 360.0F); + this.lastHeadMotion = MathHelper.floor_float(par1Entity.getRotationYawHead() * 256.0F / 360.0F); + } + + public boolean equals(Object par1Obj) + { +! return par1Obj instanceof EntityTrackerEntry ? ((EntityTrackerEntry)par1Obj).trackedEntity.entityId == this.trackedEntity.entityId : false; + } + + public int hashCode() + { +! return this.trackedEntity.entityId; + } + +! public void updatePlayerList(List par1List) + { + this.playerEntitiesUpdated = false; + +! if (!this.firstUpdateDone || this.trackedEntity.getDistanceSq(this.lastTrackedEntityPosX, this.lastTrackedEntityPosY, this.lastTrackedEntityPosZ) > 16.0D) + { +! this.lastTrackedEntityPosX = this.trackedEntity.posX; +! this.lastTrackedEntityPosY = this.trackedEntity.posY; +! this.lastTrackedEntityPosZ = this.trackedEntity.posZ; +! this.firstUpdateDone = true; + this.playerEntitiesUpdated = true; +! this.updatePlayerEntities(par1List); + } + +! if (this.field_85178_v != this.trackedEntity.ridingEntity || this.trackedEntity.ridingEntity != null && this.updateCounter % 60 == 0) + { +! this.field_85178_v = this.trackedEntity.ridingEntity; +! this.sendPacketToTrackedPlayers(new Packet39AttachEntity(0, this.trackedEntity, this.trackedEntity.ridingEntity)); + } + +! if (this.trackedEntity instanceof EntityItemFrame && this.updateCounter % 10 == 0) + { +! EntityItemFrame var23 = (EntityItemFrame)this.trackedEntity; + ItemStack var24 = var23.getDisplayedItem(); + + if (var24 != null && var24.getItem() instanceof ItemMap) + { +! MapData var26 = Item.map.getMapData(var24, this.trackedEntity.worldObj); + Iterator var27 = par1List.iterator(); + + while (var27.hasNext()) + { + EntityPlayer var28 = (EntityPlayer)var27.next(); + EntityPlayerMP var29 = (EntityPlayerMP)var28; + var26.updateVisiblePlayers(var29, var24); + +! if (var29.playerNetServerHandler.getNumChunkDataPackets() <= 5) + { +! Packet var30 = Item.map.getUpdatePacket(var24, this.trackedEntity.worldObj, var29); + + if (var30 != null) + { +! var29.playerNetServerHandler.sendPacket(var30); + } + } + } + } + + this.func_111190_b(); + } +! else if (this.updateCounter % this.updateFrequency == 0 || this.trackedEntity.isAirBorne || this.trackedEntity.getDataWatcher().hasObjectChanged()) + { + int var2; + int var3; + +! if (this.trackedEntity.ridingEntity == null) + { + ++this.ticksSinceLastForcedTeleport; +! var2 = this.trackedEntity.myEntitySize.multiplyBy32AndRound(this.trackedEntity.posX); +! var3 = MathHelper.floor_double(this.trackedEntity.posY * 32.0D); +! int var4 = this.trackedEntity.myEntitySize.multiplyBy32AndRound(this.trackedEntity.posZ); +! int var5 = MathHelper.floor_float(this.trackedEntity.rotationYaw * 256.0F / 360.0F); +! int var6 = MathHelper.floor_float(this.trackedEntity.rotationPitch * 256.0F / 360.0F); +! int var7 = var2 - this.encodedPosX; +! int var8 = var3 - this.encodedPosY; +! int var9 = var4 - this.encodedPosZ; + Object var10 = null; +! boolean var11 = Math.abs(var7) >= 4 || Math.abs(var8) >= 4 || Math.abs(var9) >= 4 || this.updateCounter % 60 == 0; +! boolean var12 = Math.abs(var5 - this.encodedRotationYaw) >= 4 || Math.abs(var6 - this.encodedRotationPitch) >= 4; + +! if (this.updateCounter > 0 || this.trackedEntity instanceof EntityArrow) + { + if (var7 >= -128 && var7 < 128 && var8 >= -128 && var8 < 128 && var9 >= -128 && var9 < 128 && this.ticksSinceLastForcedTeleport <= 400 && !this.ridingEntity) + { + if (var11 && var12) + { +! var10 = new Packet33RelEntityMoveLook(this.trackedEntity.entityId, (byte)var7, (byte)var8, (byte)var9, (byte)var5, (byte)var6); + } + else if (var11) + { +! var10 = new Packet31RelEntityMove(this.trackedEntity.entityId, (byte)var7, (byte)var8, (byte)var9); + } + else if (var12) + { +! var10 = new Packet32EntityLook(this.trackedEntity.entityId, (byte)var5, (byte)var6); + } + } + else + { + this.ticksSinceLastForcedTeleport = 0; +! var10 = new Packet34EntityTeleport(this.trackedEntity.entityId, var2, var3, var4, (byte)var5, (byte)var6); + } + } + + if (this.sendVelocityUpdates) + { +! double var13 = this.trackedEntity.motionX - this.lastTrackedEntityMotionX; +! double var15 = this.trackedEntity.motionY - this.lastTrackedEntityMotionY; +! double var17 = this.trackedEntity.motionZ - this.motionZ; + double var19 = 0.02D; + double var21 = var13 * var13 + var15 * var15 + var17 * var17; + +! if (var21 > var19 * var19 || var21 > 0.0D && this.trackedEntity.motionX == 0.0D && this.trackedEntity.motionY == 0.0D && this.trackedEntity.motionZ == 0.0D) + { +! this.lastTrackedEntityMotionX = this.trackedEntity.motionX; +! this.lastTrackedEntityMotionY = this.trackedEntity.motionY; +! this.motionZ = this.trackedEntity.motionZ; +! this.sendPacketToTrackedPlayers(new Packet28EntityVelocity(this.trackedEntity.entityId, this.lastTrackedEntityMotionX, this.lastTrackedEntityMotionY, this.motionZ)); + } + } + + if (var10 != null) + { +! this.sendPacketToTrackedPlayers((Packet)var10); + } + + this.func_111190_b(); + + if (var11) + { +! this.encodedPosX = var2; +! this.encodedPosY = var3; +! this.encodedPosZ = var4; + } + + if (var12) + { +! this.encodedRotationYaw = var5; +! this.encodedRotationPitch = var6; + } + + this.ridingEntity = false; + } + else + { +! var2 = MathHelper.floor_float(this.trackedEntity.rotationYaw * 256.0F / 360.0F); +! var3 = MathHelper.floor_float(this.trackedEntity.rotationPitch * 256.0F / 360.0F); +! boolean var25 = Math.abs(var2 - this.encodedRotationYaw) >= 4 || Math.abs(var3 - this.encodedRotationPitch) >= 4; + + if (var25) + { +! this.sendPacketToTrackedPlayers(new Packet32EntityLook(this.trackedEntity.entityId, (byte)var2, (byte)var3)); +! this.encodedRotationYaw = var2; +! this.encodedRotationPitch = var3; + } + +! this.encodedPosX = this.trackedEntity.myEntitySize.multiplyBy32AndRound(this.trackedEntity.posX); +! this.encodedPosY = MathHelper.floor_double(this.trackedEntity.posY * 32.0D); +! this.encodedPosZ = this.trackedEntity.myEntitySize.multiplyBy32AndRound(this.trackedEntity.posZ); + this.func_111190_b(); + this.ridingEntity = true; + } + +! var2 = MathHelper.floor_float(this.trackedEntity.getRotationYawHead() * 256.0F / 360.0F); + + if (Math.abs(var2 - this.lastHeadMotion) >= 4) + { +! this.sendPacketToTrackedPlayers(new Packet35EntityHeadRotation(this.trackedEntity.entityId, (byte)var2)); + this.lastHeadMotion = var2; + } + +! this.trackedEntity.isAirBorne = false; + } + +! ++this.updateCounter; + +! if (this.trackedEntity.velocityChanged) + { +! this.sendPacketToTrackedPlayersAndTrackedEntity(new Packet28EntityVelocity(this.trackedEntity)); +! this.trackedEntity.velocityChanged = false; + } + } + + private void func_111190_b() + { +! DataWatcher var1 = this.trackedEntity.getDataWatcher(); + +! if (var1.hasObjectChanged()) + { +! this.sendPacketToTrackedPlayersAndTrackedEntity(new Packet40EntityMetadata(this.trackedEntity.entityId, var1, false)); + } + +! if (this.trackedEntity instanceof EntityLivingBase) + { +! ServersideAttributeMap var2 = (ServersideAttributeMap)((EntityLivingBase)this.trackedEntity).getAttributeMap(); + Set var3 = var2.func_111161_b(); + + if (!var3.isEmpty()) + { +! this.sendPacketToTrackedPlayersAndTrackedEntity(new Packet44UpdateAttributes(this.trackedEntity.entityId, var3)); + } + + var3.clear(); + } + } + +! public void sendPacketToTrackedPlayers(Packet par1Packet) + { + Iterator var2 = this.trackingPlayers.iterator(); + + while (var2.hasNext()) + { + EntityPlayerMP var3 = (EntityPlayerMP)var2.next(); +! var3.playerNetServerHandler.sendPacket(par1Packet); + } + } + +! public void sendPacketToTrackedPlayersAndTrackedEntity(Packet par1Packet) + { +! this.sendPacketToTrackedPlayers(par1Packet); + +! if (this.trackedEntity instanceof EntityPlayerMP) + { +! ((EntityPlayerMP)this.trackedEntity).playerNetServerHandler.sendPacket(par1Packet); + } + } + +! public void sendDestroyEntityPacketToTrackedPlayers() + { + Iterator var1 = this.trackingPlayers.iterator(); + + while (var1.hasNext()) + { + EntityPlayerMP var2 = (EntityPlayerMP)var1.next(); +! var2.destroyedItemsNetCache.add(Integer.valueOf(this.trackedEntity.entityId)); + } + } + +! public void removeFromTrackedPlayers(EntityPlayerMP par1EntityPlayerMP) + { + if (this.trackingPlayers.contains(par1EntityPlayerMP)) + { +! par1EntityPlayerMP.destroyedItemsNetCache.add(Integer.valueOf(this.trackedEntity.entityId)); + this.trackingPlayers.remove(par1EntityPlayerMP); + } + } + +! public void updatePlayerEntity(EntityPlayerMP par1EntityPlayerMP) + { +! if (par1EntityPlayerMP != this.trackedEntity) + { +! double var2 = par1EntityPlayerMP.posX - (double)(this.encodedPosX / 32); +! double var4 = par1EntityPlayerMP.posZ - (double)(this.encodedPosZ / 32); + +! if (var2 >= (double)(-this.trackingDistanceThreshold) && var2 <= (double)this.trackingDistanceThreshold && var4 >= (double)(-this.trackingDistanceThreshold) && var4 <= (double)this.trackingDistanceThreshold) + { +! if (!this.trackingPlayers.contains(par1EntityPlayerMP) && (this.isPlayerWatchingThisChunk(par1EntityPlayerMP) || this.trackedEntity.forceSpawn)) + { + this.trackingPlayers.add(par1EntityPlayerMP); +! Packet var6 = this.getSpawnPacket(); +! par1EntityPlayerMP.playerNetServerHandler.sendPacket(var6); + +! if (!this.trackedEntity.getDataWatcher().getIsBlank()) + { +! par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet40EntityMetadata(this.trackedEntity.entityId, this.trackedEntity.getDataWatcher(), true)); + } + +! if (this.trackedEntity instanceof EntityLivingBase) + { +! ServersideAttributeMap var7 = (ServersideAttributeMap)((EntityLivingBase)this.trackedEntity).getAttributeMap(); + Collection var8 = var7.func_111160_c(); + + if (!var8.isEmpty()) + { +! par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet44UpdateAttributes(this.trackedEntity.entityId, var8)); + } + } + +! this.lastTrackedEntityMotionX = this.trackedEntity.motionX; +! this.lastTrackedEntityMotionY = this.trackedEntity.motionY; +! this.motionZ = this.trackedEntity.motionZ; + + if (this.sendVelocityUpdates && !(var6 instanceof Packet24MobSpawn)) + { +! par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet28EntityVelocity(this.trackedEntity.entityId, this.trackedEntity.motionX, this.trackedEntity.motionY, this.trackedEntity.motionZ)); + } + +! if (this.trackedEntity.ridingEntity != null) + { +! par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet39AttachEntity(0, this.trackedEntity, this.trackedEntity.ridingEntity)); + } + +! if (this.trackedEntity instanceof EntityLiving && ((EntityLiving)this.trackedEntity).getLeashedToEntity() != null) + { +! par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet39AttachEntity(1, this.trackedEntity, ((EntityLiving)this.trackedEntity).getLeashedToEntity())); + } + +! if (this.trackedEntity instanceof EntityLivingBase) + { + for (int var10 = 0; var10 < 5; ++var10) + { +! ItemStack var12 = ((EntityLivingBase)this.trackedEntity).getEquipmentInSlot(var10); + + if (var12 != null) + { +! par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet5PlayerInventory(this.trackedEntity.entityId, var10, var12)); + } + } + } + +! if (this.trackedEntity instanceof EntityPlayer) + { +! EntityPlayer var11 = (EntityPlayer)this.trackedEntity; + + if (var11.isPlayerSleeping()) + { +! par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet17Sleep(this.trackedEntity, 0, MathHelper.floor_double(this.trackedEntity.posX), MathHelper.floor_double(this.trackedEntity.posY), MathHelper.floor_double(this.trackedEntity.posZ))); + } + } + +! if (this.trackedEntity instanceof EntityLivingBase) + { +! EntityLivingBase var13 = (EntityLivingBase)this.trackedEntity; + Iterator var14 = var13.getActivePotionEffects().iterator(); + + while (var14.hasNext()) + { + PotionEffect var9 = (PotionEffect)var14.next(); +! par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet41EntityEffect(this.trackedEntity.entityId, var9)); + } + } + } + } + else if (this.trackingPlayers.contains(par1EntityPlayerMP)) + { + this.trackingPlayers.remove(par1EntityPlayerMP); +! par1EntityPlayerMP.destroyedItemsNetCache.add(Integer.valueOf(this.trackedEntity.entityId)); + } + } + } + + private boolean isPlayerWatchingThisChunk(EntityPlayerMP par1EntityPlayerMP) + { +! return par1EntityPlayerMP.getServerForPlayer().getPlayerManager().isPlayerWatchingChunk(par1EntityPlayerMP, this.trackedEntity.chunkCoordX, this.trackedEntity.chunkCoordZ); + } + +! public void updatePlayerEntities(List par1List) + { + for (int var2 = 0; var2 < par1List.size(); ++var2) + { +! this.updatePlayerEntity((EntityPlayerMP)par1List.get(var2)); + } + } + +! private Packet getSpawnPacket() + { +! if (this.trackedEntity.isDead) + { +! this.trackedEntity.worldObj.getWorldLogAgent().logWarning("Fetching addPacket for removed entity"); + } + +! if (this.trackedEntity instanceof EntityItem) + { +! return new Packet23VehicleSpawn(this.trackedEntity, 2, 1); + } +! else if (this.trackedEntity instanceof EntityPlayerMP) + { +! return new Packet20NamedEntitySpawn((EntityPlayer)this.trackedEntity); + } +! else if (this.trackedEntity instanceof EntityMinecart) + { +! EntityMinecart var9 = (EntityMinecart)this.trackedEntity; +! return new Packet23VehicleSpawn(this.trackedEntity, 10, var9.getMinecartType()); + } +! else if (this.trackedEntity instanceof EntityBoat) + { +! return new Packet23VehicleSpawn(this.trackedEntity, 1); + } +! else if (!(this.trackedEntity instanceof IAnimals) && !(this.trackedEntity instanceof EntityDragon)) + { +! if (this.trackedEntity instanceof EntityFishHook) + { +! EntityPlayer var8 = ((EntityFishHook)this.trackedEntity).angler; +! return new Packet23VehicleSpawn(this.trackedEntity, 90, var8 != null ? var8.entityId : this.trackedEntity.entityId); + } +! else if (this.trackedEntity instanceof EntityArrow) + { +! Entity var7 = ((EntityArrow)this.trackedEntity).shootingEntity; +! return new Packet23VehicleSpawn(this.trackedEntity, 60, var7 != null ? var7.entityId : this.trackedEntity.entityId); + } +! else if (this.trackedEntity instanceof EntitySnowball) + { +! return new Packet23VehicleSpawn(this.trackedEntity, 61); + } +! else if (this.trackedEntity instanceof EntityPotion) + { +! return new Packet23VehicleSpawn(this.trackedEntity, 73, ((EntityPotion)this.trackedEntity).getPotionDamage()); + } +! else if (this.trackedEntity instanceof EntityExpBottle) + { +! return new Packet23VehicleSpawn(this.trackedEntity, 75); + } +! else if (this.trackedEntity instanceof EntityEnderPearl) + { +! return new Packet23VehicleSpawn(this.trackedEntity, 65); + } +! else if (this.trackedEntity instanceof EntityEnderEye) + { +! return new Packet23VehicleSpawn(this.trackedEntity, 72); + } +! else if (this.trackedEntity instanceof EntityFireworkRocket) + { +! return new Packet23VehicleSpawn(this.trackedEntity, 76); + } + else + { + Packet23VehicleSpawn var2; + +! if (this.trackedEntity instanceof EntityFireball) + { +! EntityFireball var6 = (EntityFireball)this.trackedEntity; + var2 = null; + byte var3 = 63; + +! if (this.trackedEntity instanceof EntitySmallFireball) + { + var3 = 64; + } +! else if (this.trackedEntity instanceof EntityWitherSkull) + { + var3 = 66; + } + + if (var6.shootingEntity != null) + { +! var2 = new Packet23VehicleSpawn(this.trackedEntity, var3, ((EntityFireball)this.trackedEntity).shootingEntity.entityId); + } + else + { +! var2 = new Packet23VehicleSpawn(this.trackedEntity, var3, 0); + } + + var2.speedX = (int)(var6.accelerationX * 8000.0D); + var2.speedY = (int)(var6.accelerationY * 8000.0D); + var2.speedZ = (int)(var6.accelerationZ * 8000.0D); + return var2; + } +! else if (this.trackedEntity instanceof EntityEgg) + { +! return new Packet23VehicleSpawn(this.trackedEntity, 62); + } +! else if (this.trackedEntity instanceof EntityTNTPrimed) + { +! return new Packet23VehicleSpawn(this.trackedEntity, 50); + } +! else if (this.trackedEntity instanceof EntityEnderCrystal) + { +! return new Packet23VehicleSpawn(this.trackedEntity, 51); + } +! else if (this.trackedEntity instanceof EntityFallingSand) + { +! EntityFallingSand var5 = (EntityFallingSand)this.trackedEntity; +! return new Packet23VehicleSpawn(this.trackedEntity, 70, var5.blockID | var5.metadata << 16); + } +! else if (this.trackedEntity instanceof EntityPainting) + { +! return new Packet25EntityPainting((EntityPainting)this.trackedEntity); + } +! else if (this.trackedEntity instanceof EntityItemFrame) + { +! EntityItemFrame var4 = (EntityItemFrame)this.trackedEntity; +! var2 = new Packet23VehicleSpawn(this.trackedEntity, 71, var4.hangingDirection); + var2.xPosition = MathHelper.floor_float((float)(var4.xPosition * 32)); + var2.yPosition = MathHelper.floor_float((float)(var4.yPosition * 32)); + var2.zPosition = MathHelper.floor_float((float)(var4.zPosition * 32)); + return var2; + } +! else if (this.trackedEntity instanceof EntityLeashKnot) + { +! EntityLeashKnot var1 = (EntityLeashKnot)this.trackedEntity; +! var2 = new Packet23VehicleSpawn(this.trackedEntity, 77); + var2.xPosition = MathHelper.floor_float((float)(var1.xPosition * 32)); + var2.yPosition = MathHelper.floor_float((float)(var1.yPosition * 32)); + var2.zPosition = MathHelper.floor_float((float)(var1.zPosition * 32)); + return var2; + } +! else if (this.trackedEntity instanceof EntityXPOrb) + { +! return new Packet26EntityExpOrb((EntityXPOrb)this.trackedEntity); + } + else + { +! throw new IllegalArgumentException("Don\'t know how to add " + this.trackedEntity.getClass() + "!"); + } + } + } + else + { +! this.lastHeadMotion = MathHelper.floor_float(this.trackedEntity.getRotationYawHead() * 256.0F / 360.0F); +! return new Packet24MobSpawn((EntityLivingBase)this.trackedEntity); + } + } + +! /** +! * Remove a tracked player from our list and tell the tracked player to destroy us from their world. +! */ +! public void removeTrackedPlayerSymmetric(EntityPlayerMP par1EntityPlayerMP) + { + if (this.trackingPlayers.contains(par1EntityPlayerMP)) + { + this.trackingPlayers.remove(par1EntityPlayerMP); +! par1EntityPlayerMP.destroyedItemsNetCache.add(Integer.valueOf(this.trackedEntity.entityId)); + } + } + } +--- 45,585 ---- + */ + public Set trackingPlayers = new HashSet(); + + public EntityTrackerEntry(Entity par1Entity, int par2, int par3, boolean par4) + { +! this.myEntity = par1Entity; +! this.blocksDistanceThreshold = par2; + this.updateFrequency = par3; + this.sendVelocityUpdates = par4; +! this.lastScaledXPosition = MathHelper.floor_double(par1Entity.posX * 32.0D); +! this.lastScaledYPosition = MathHelper.floor_double(par1Entity.posY * 32.0D); +! this.lastScaledZPosition = MathHelper.floor_double(par1Entity.posZ * 32.0D); +! this.lastYaw = MathHelper.floor_float(par1Entity.rotationYaw * 256.0F / 360.0F); +! this.lastPitch = MathHelper.floor_float(par1Entity.rotationPitch * 256.0F / 360.0F); + this.lastHeadMotion = MathHelper.floor_float(par1Entity.getRotationYawHead() * 256.0F / 360.0F); + } + + public boolean equals(Object par1Obj) + { +! return par1Obj instanceof EntityTrackerEntry ? ((EntityTrackerEntry)par1Obj).myEntity.entityId == this.myEntity.entityId : false; + } + + public int hashCode() + { +! return this.myEntity.entityId; + } + +! /** +! * also sends velocity, rotation, and riding info. +! */ +! public void sendLocationToAllClients(List par1List) + { + this.playerEntitiesUpdated = false; + +! if (!this.isDataInitialized || this.myEntity.getDistanceSq(this.posX, this.posY, this.posZ) > 16.0D) + { +! this.posX = this.myEntity.posX; +! this.posY = this.myEntity.posY; +! this.posZ = this.myEntity.posZ; +! this.isDataInitialized = true; + this.playerEntitiesUpdated = true; +! this.sendEventsToPlayers(par1List); + } + +! if (this.field_85178_v != this.myEntity.ridingEntity || this.myEntity.ridingEntity != null && this.ticks % 60 == 0) + { +! this.field_85178_v = this.myEntity.ridingEntity; +! this.sendPacketToAllTrackingPlayers(new Packet39AttachEntity(0, this.myEntity, this.myEntity.ridingEntity)); + } + +! if (this.myEntity instanceof EntityItemFrame && this.ticks % 10 == 0) + { +! EntityItemFrame var23 = (EntityItemFrame)this.myEntity; + ItemStack var24 = var23.getDisplayedItem(); + + if (var24 != null && var24.getItem() instanceof ItemMap) + { +! MapData var26 = Item.map.getMapData(var24, this.myEntity.worldObj); + Iterator var27 = par1List.iterator(); + + while (var27.hasNext()) + { + EntityPlayer var28 = (EntityPlayer)var27.next(); + EntityPlayerMP var29 = (EntityPlayerMP)var28; + var26.updateVisiblePlayers(var29, var24); + +! if (var29.playerNetServerHandler.packetSize() <= 5) + { +! Packet var30 = Item.map.createMapDataPacket(var24, this.myEntity.worldObj, var29); + + if (var30 != null) + { +! var29.playerNetServerHandler.sendPacketToPlayer(var30); + } + } + } + } + + this.func_111190_b(); + } +! else if (this.ticks % this.updateFrequency == 0 || this.myEntity.isAirBorne || this.myEntity.getDataWatcher().hasChanges()) + { + int var2; + int var3; + +! if (this.myEntity.ridingEntity == null) + { + ++this.ticksSinceLastForcedTeleport; +! var2 = this.myEntity.myEntitySize.multiplyBy32AndRound(this.myEntity.posX); +! var3 = MathHelper.floor_double(this.myEntity.posY * 32.0D); +! int var4 = this.myEntity.myEntitySize.multiplyBy32AndRound(this.myEntity.posZ); +! int var5 = MathHelper.floor_float(this.myEntity.rotationYaw * 256.0F / 360.0F); +! int var6 = MathHelper.floor_float(this.myEntity.rotationPitch * 256.0F / 360.0F); +! int var7 = var2 - this.lastScaledXPosition; +! int var8 = var3 - this.lastScaledYPosition; +! int var9 = var4 - this.lastScaledZPosition; + Object var10 = null; +! boolean var11 = Math.abs(var7) >= 4 || Math.abs(var8) >= 4 || Math.abs(var9) >= 4 || this.ticks % 60 == 0; +! boolean var12 = Math.abs(var5 - this.lastYaw) >= 4 || Math.abs(var6 - this.lastPitch) >= 4; + +! if (this.ticks > 0 || this.myEntity instanceof EntityArrow) + { + if (var7 >= -128 && var7 < 128 && var8 >= -128 && var8 < 128 && var9 >= -128 && var9 < 128 && this.ticksSinceLastForcedTeleport <= 400 && !this.ridingEntity) + { + if (var11 && var12) + { +! var10 = new Packet33RelEntityMoveLook(this.myEntity.entityId, (byte)var7, (byte)var8, (byte)var9, (byte)var5, (byte)var6); + } + else if (var11) + { +! var10 = new Packet31RelEntityMove(this.myEntity.entityId, (byte)var7, (byte)var8, (byte)var9); + } + else if (var12) + { +! var10 = new Packet32EntityLook(this.myEntity.entityId, (byte)var5, (byte)var6); + } + } + else + { + this.ticksSinceLastForcedTeleport = 0; +! var10 = new Packet34EntityTeleport(this.myEntity.entityId, var2, var3, var4, (byte)var5, (byte)var6); + } + } + + if (this.sendVelocityUpdates) + { +! double var13 = this.myEntity.motionX - this.motionX; +! double var15 = this.myEntity.motionY - this.motionY; +! double var17 = this.myEntity.motionZ - this.motionZ; + double var19 = 0.02D; + double var21 = var13 * var13 + var15 * var15 + var17 * var17; + +! if (var21 > var19 * var19 || var21 > 0.0D && this.myEntity.motionX == 0.0D && this.myEntity.motionY == 0.0D && this.myEntity.motionZ == 0.0D) + { +! this.motionX = this.myEntity.motionX; +! this.motionY = this.myEntity.motionY; +! this.motionZ = this.myEntity.motionZ; +! this.sendPacketToAllTrackingPlayers(new Packet28EntityVelocity(this.myEntity.entityId, this.motionX, this.motionY, this.motionZ)); + } + } + + if (var10 != null) + { +! this.sendPacketToAllTrackingPlayers((Packet)var10); + } + + this.func_111190_b(); + + if (var11) + { +! this.lastScaledXPosition = var2; +! this.lastScaledYPosition = var3; +! this.lastScaledZPosition = var4; + } + + if (var12) + { +! this.lastYaw = var5; +! this.lastPitch = var6; + } + + this.ridingEntity = false; + } + else + { +! var2 = MathHelper.floor_float(this.myEntity.rotationYaw * 256.0F / 360.0F); +! var3 = MathHelper.floor_float(this.myEntity.rotationPitch * 256.0F / 360.0F); +! boolean var25 = Math.abs(var2 - this.lastYaw) >= 4 || Math.abs(var3 - this.lastPitch) >= 4; + + if (var25) + { +! this.sendPacketToAllTrackingPlayers(new Packet32EntityLook(this.myEntity.entityId, (byte)var2, (byte)var3)); +! this.lastYaw = var2; +! this.lastPitch = var3; + } + +! this.lastScaledXPosition = this.myEntity.myEntitySize.multiplyBy32AndRound(this.myEntity.posX); +! this.lastScaledYPosition = MathHelper.floor_double(this.myEntity.posY * 32.0D); +! this.lastScaledZPosition = this.myEntity.myEntitySize.multiplyBy32AndRound(this.myEntity.posZ); + this.func_111190_b(); + this.ridingEntity = true; + } + +! var2 = MathHelper.floor_float(this.myEntity.getRotationYawHead() * 256.0F / 360.0F); + + if (Math.abs(var2 - this.lastHeadMotion) >= 4) + { +! this.sendPacketToAllTrackingPlayers(new Packet35EntityHeadRotation(this.myEntity.entityId, (byte)var2)); + this.lastHeadMotion = var2; + } + +! this.myEntity.isAirBorne = false; + } + +! ++this.ticks; + +! if (this.myEntity.velocityChanged) + { +! this.sendPacketToAllAssociatedPlayers(new Packet28EntityVelocity(this.myEntity)); +! this.myEntity.velocityChanged = false; + } + } + + private void func_111190_b() + { +! DataWatcher var1 = this.myEntity.getDataWatcher(); + +! if (var1.hasChanges()) + { +! this.sendPacketToAllAssociatedPlayers(new Packet40EntityMetadata(this.myEntity.entityId, var1, false)); + } + +! if (this.myEntity instanceof EntityLivingBase) + { +! ServersideAttributeMap var2 = (ServersideAttributeMap)((EntityLivingBase)this.myEntity).getAttributeMap(); + Set var3 = var2.func_111161_b(); + + if (!var3.isEmpty()) + { +! this.sendPacketToAllAssociatedPlayers(new Packet44UpdateAttributes(this.myEntity.entityId, var3)); + } + + var3.clear(); + } + } + +! /** +! * if this is a player, then it is not informed +! */ +! public void sendPacketToAllTrackingPlayers(Packet par1Packet) + { + Iterator var2 = this.trackingPlayers.iterator(); + + while (var2.hasNext()) + { + EntityPlayerMP var3 = (EntityPlayerMP)var2.next(); +! var3.playerNetServerHandler.sendPacketToPlayer(par1Packet); + } + } + +! /** +! * if this is a player, then it recieves the message also +! */ +! public void sendPacketToAllAssociatedPlayers(Packet par1Packet) + { +! this.sendPacketToAllTrackingPlayers(par1Packet); + +! if (this.myEntity instanceof EntityPlayerMP) + { +! ((EntityPlayerMP)this.myEntity).playerNetServerHandler.sendPacketToPlayer(par1Packet); + } + } + +! public void informAllAssociatedPlayersOfItemDestruction() + { + Iterator var1 = this.trackingPlayers.iterator(); + + while (var1.hasNext()) + { + EntityPlayerMP var2 = (EntityPlayerMP)var1.next(); +! var2.destroyedItemsNetCache.add(Integer.valueOf(this.myEntity.entityId)); + } + } + +! public void removeFromWatchingList(EntityPlayerMP par1EntityPlayerMP) + { + if (this.trackingPlayers.contains(par1EntityPlayerMP)) + { +! par1EntityPlayerMP.destroyedItemsNetCache.add(Integer.valueOf(this.myEntity.entityId)); + this.trackingPlayers.remove(par1EntityPlayerMP); + } + } + +! /** +! * if the player is more than the distance threshold (typically 64) then the player is removed instead +! */ +! public void tryStartWachingThis(EntityPlayerMP par1EntityPlayerMP) + { +! if (par1EntityPlayerMP != this.myEntity) + { +! double var2 = par1EntityPlayerMP.posX - (double)(this.lastScaledXPosition / 32); +! double var4 = par1EntityPlayerMP.posZ - (double)(this.lastScaledZPosition / 32); + +! if (var2 >= (double)(-this.blocksDistanceThreshold) && var2 <= (double)this.blocksDistanceThreshold && var4 >= (double)(-this.blocksDistanceThreshold) && var4 <= (double)this.blocksDistanceThreshold) + { +! if (!this.trackingPlayers.contains(par1EntityPlayerMP) && (this.isPlayerWatchingThisChunk(par1EntityPlayerMP) || this.myEntity.forceSpawn)) + { + this.trackingPlayers.add(par1EntityPlayerMP); +! Packet var6 = this.getPacketForThisEntity(); +! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(var6); + +! if (!this.myEntity.getDataWatcher().getIsBlank()) + { +! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet40EntityMetadata(this.myEntity.entityId, this.myEntity.getDataWatcher(), true)); + } + +! if (this.myEntity instanceof EntityLivingBase) + { +! ServersideAttributeMap var7 = (ServersideAttributeMap)((EntityLivingBase)this.myEntity).getAttributeMap(); + Collection var8 = var7.func_111160_c(); + + if (!var8.isEmpty()) + { +! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet44UpdateAttributes(this.myEntity.entityId, var8)); + } + } + +! this.motionX = this.myEntity.motionX; +! this.motionY = this.myEntity.motionY; +! this.motionZ = this.myEntity.motionZ; + + if (this.sendVelocityUpdates && !(var6 instanceof Packet24MobSpawn)) + { +! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet28EntityVelocity(this.myEntity.entityId, this.myEntity.motionX, this.myEntity.motionY, this.myEntity.motionZ)); + } + +! if (this.myEntity.ridingEntity != null) + { +! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet39AttachEntity(0, this.myEntity, this.myEntity.ridingEntity)); + } + +! if (this.myEntity instanceof EntityLiving && ((EntityLiving)this.myEntity).getLeashedToEntity() != null) + { +! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet39AttachEntity(1, this.myEntity, ((EntityLiving)this.myEntity).getLeashedToEntity())); + } + +! if (this.myEntity instanceof EntityLivingBase) + { + for (int var10 = 0; var10 < 5; ++var10) + { +! ItemStack var12 = ((EntityLivingBase)this.myEntity).getCurrentItemOrArmor(var10); + + if (var12 != null) + { +! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet5PlayerInventory(this.myEntity.entityId, var10, var12)); + } + } + } + +! if (this.myEntity instanceof EntityPlayer) + { +! EntityPlayer var11 = (EntityPlayer)this.myEntity; + + if (var11.isPlayerSleeping()) + { +! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet17Sleep(this.myEntity, 0, MathHelper.floor_double(this.myEntity.posX), MathHelper.floor_double(this.myEntity.posY), MathHelper.floor_double(this.myEntity.posZ))); + } + } + +! if (this.myEntity instanceof EntityLivingBase) + { +! EntityLivingBase var13 = (EntityLivingBase)this.myEntity; + Iterator var14 = var13.getActivePotionEffects().iterator(); + + while (var14.hasNext()) + { + PotionEffect var9 = (PotionEffect)var14.next(); +! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet41EntityEffect(this.myEntity.entityId, var9)); + } + } + } + } + else if (this.trackingPlayers.contains(par1EntityPlayerMP)) + { + this.trackingPlayers.remove(par1EntityPlayerMP); +! par1EntityPlayerMP.destroyedItemsNetCache.add(Integer.valueOf(this.myEntity.entityId)); + } + } + } + + private boolean isPlayerWatchingThisChunk(EntityPlayerMP par1EntityPlayerMP) + { +! return par1EntityPlayerMP.getServerForPlayer().getPlayerManager().isPlayerWatchingChunk(par1EntityPlayerMP, this.myEntity.chunkCoordX, this.myEntity.chunkCoordZ); + } + +! public void sendEventsToPlayers(List par1List) + { + for (int var2 = 0; var2 < par1List.size(); ++var2) + { +! this.tryStartWachingThis((EntityPlayerMP)par1List.get(var2)); + } + } + +! private Packet getPacketForThisEntity() + { +! if (this.myEntity.isDead) + { +! this.myEntity.worldObj.getWorldLogAgent().logWarning("Fetching addPacket for removed entity"); + } + +! if (this.myEntity instanceof EntityItem) + { +! return new Packet23VehicleSpawn(this.myEntity, 2, 1); + } +! else if (this.myEntity instanceof EntityPlayerMP) + { +! return new Packet20NamedEntitySpawn((EntityPlayer)this.myEntity); + } +! else if (this.myEntity instanceof EntityMinecart) + { +! EntityMinecart var9 = (EntityMinecart)this.myEntity; +! return new Packet23VehicleSpawn(this.myEntity, 10, var9.getMinecartType()); + } +! else if (this.myEntity instanceof EntityBoat) + { +! return new Packet23VehicleSpawn(this.myEntity, 1); + } +! else if (!(this.myEntity instanceof IAnimals) && !(this.myEntity instanceof EntityDragon)) + { +! if (this.myEntity instanceof EntityFishHook) + { +! EntityPlayer var8 = ((EntityFishHook)this.myEntity).angler; +! return new Packet23VehicleSpawn(this.myEntity, 90, var8 != null ? var8.entityId : this.myEntity.entityId); + } +! else if (this.myEntity instanceof EntityArrow) + { +! Entity var7 = ((EntityArrow)this.myEntity).shootingEntity; +! return new Packet23VehicleSpawn(this.myEntity, 60, var7 != null ? var7.entityId : this.myEntity.entityId); + } +! else if (this.myEntity instanceof EntitySnowball) + { +! return new Packet23VehicleSpawn(this.myEntity, 61); + } +! else if (this.myEntity instanceof EntityPotion) + { +! return new Packet23VehicleSpawn(this.myEntity, 73, ((EntityPotion)this.myEntity).getPotionDamage()); + } +! else if (this.myEntity instanceof EntityExpBottle) + { +! return new Packet23VehicleSpawn(this.myEntity, 75); + } +! else if (this.myEntity instanceof EntityEnderPearl) + { +! return new Packet23VehicleSpawn(this.myEntity, 65); + } +! else if (this.myEntity instanceof EntityEnderEye) + { +! return new Packet23VehicleSpawn(this.myEntity, 72); + } +! else if (this.myEntity instanceof EntityFireworkRocket) + { +! return new Packet23VehicleSpawn(this.myEntity, 76); + } + else + { + Packet23VehicleSpawn var2; + +! if (this.myEntity instanceof EntityFireball) + { +! EntityFireball var6 = (EntityFireball)this.myEntity; + var2 = null; + byte var3 = 63; + +! if (this.myEntity instanceof EntitySmallFireball) + { + var3 = 64; + } +! else if (this.myEntity instanceof EntityWitherSkull) + { + var3 = 66; + } + + if (var6.shootingEntity != null) + { +! var2 = new Packet23VehicleSpawn(this.myEntity, var3, ((EntityFireball)this.myEntity).shootingEntity.entityId); + } + else + { +! var2 = new Packet23VehicleSpawn(this.myEntity, var3, 0); + } + + var2.speedX = (int)(var6.accelerationX * 8000.0D); + var2.speedY = (int)(var6.accelerationY * 8000.0D); + var2.speedZ = (int)(var6.accelerationZ * 8000.0D); + return var2; + } +! else if (this.myEntity instanceof EntityEgg) + { +! return new Packet23VehicleSpawn(this.myEntity, 62); + } +! else if (this.myEntity instanceof EntityTNTPrimed) + { +! return new Packet23VehicleSpawn(this.myEntity, 50); + } +! else if (this.myEntity instanceof EntityEnderCrystal) + { +! return new Packet23VehicleSpawn(this.myEntity, 51); + } +! else if (this.myEntity instanceof EntityFallingSand) + { +! EntityFallingSand var5 = (EntityFallingSand)this.myEntity; +! return new Packet23VehicleSpawn(this.myEntity, 70, var5.blockID | var5.metadata << 16); + } +! else if (this.myEntity instanceof EntityPainting) + { +! return new Packet25EntityPainting((EntityPainting)this.myEntity); + } +! else if (this.myEntity instanceof EntityItemFrame) + { +! EntityItemFrame var4 = (EntityItemFrame)this.myEntity; +! var2 = new Packet23VehicleSpawn(this.myEntity, 71, var4.hangingDirection); + var2.xPosition = MathHelper.floor_float((float)(var4.xPosition * 32)); + var2.yPosition = MathHelper.floor_float((float)(var4.yPosition * 32)); + var2.zPosition = MathHelper.floor_float((float)(var4.zPosition * 32)); + return var2; + } +! else if (this.myEntity instanceof EntityLeashKnot) + { +! EntityLeashKnot var1 = (EntityLeashKnot)this.myEntity; +! var2 = new Packet23VehicleSpawn(this.myEntity, 77); + var2.xPosition = MathHelper.floor_float((float)(var1.xPosition * 32)); + var2.yPosition = MathHelper.floor_float((float)(var1.yPosition * 32)); + var2.zPosition = MathHelper.floor_float((float)(var1.zPosition * 32)); + return var2; + } +! else if (this.myEntity instanceof EntityXPOrb) + { +! return new Packet26EntityExpOrb((EntityXPOrb)this.myEntity); + } + else + { +! throw new IllegalArgumentException("Don\'t know how to add " + this.myEntity.getClass() + "!"); + } + } + } + else + { +! this.lastHeadMotion = MathHelper.floor_float(this.myEntity.getRotationYawHead() * 256.0F / 360.0F); +! return new Packet24MobSpawn((EntityLivingBase)this.myEntity); + } + } + +! public void removePlayerFromTracker(EntityPlayerMP par1EntityPlayerMP) + { + if (this.trackingPlayers.contains(par1EntityPlayerMP)) + { + this.trackingPlayers.remove(par1EntityPlayerMP); +! par1EntityPlayerMP.destroyedItemsNetCache.add(Integer.valueOf(this.myEntity.entityId)); + } + } + } +*** EntityVillager.java Sat Feb 5 04:13:13 2022 +--- EntityVillager.java Sat Feb 5 04:12:34 2022 +*************** +*** 27,40 **** + /** Last player to trade with this villager, used for aggressivity. */ + private String lastBuyingPlayer; + private boolean field_82190_bM; + private float field_82191_bN; + +! /** Selling list of Villagers items. */ +! private static final Map villagersSellingList = new HashMap(); + +! /** Selling list of Blacksmith items. */ + private static final Map blacksmithSellingList = new HashMap(); + + public EntityVillager(World par1World) + { + this(par1World, 0); +--- 27,46 ---- + /** Last player to trade with this villager, used for aggressivity. */ + private String lastBuyingPlayer; + private boolean field_82190_bM; + private float field_82191_bN; + +! /** +! * a villagers recipe list is intialized off this list ; the 2 params are min/max amount they will trade for 1 +! * emerald +! */ +! private static final Map villagerStockList = new HashMap(); + +! /** +! * Selling list of Blacksmith items. negative numbers mean 1 emerald for n items, positive numbers are n emeralds +! * for 1 item +! */ + private static final Map blacksmithSellingList = new HashMap(); + + public EntityVillager(World par1World) + { + this(par1World, 0); +*************** +*** 556,565 **** +--- 562,573 ---- + { + this.buyingList.addToListWithCheck((MerchantRecipe)var2.get(var9)); + } + } + ++ public void setRecipes(MerchantRecipeList par1MerchantRecipeList) {} ++ + /** + * each recipie takes a random stack from villagerStockList and offers it for 1 emerald + */ + private static void addMerchantItem(MerchantRecipeList par0MerchantRecipeList, int par1, Random par2Random, float par3) + { +*************** +*** 577,587 **** + /** + * default to 1, and villagerStockList contains a min/max amount for each index + */ + private static int getRandomCountForItem(int par0, Random par1Random) + { +! Tuple var2 = (Tuple)villagersSellingList.get(Integer.valueOf(par0)); + return var2 == null ? 1 : (((Integer)var2.getFirst()).intValue() >= ((Integer)var2.getSecond()).intValue() ? ((Integer)var2.getFirst()).intValue() : ((Integer)var2.getFirst()).intValue() + par1Random.nextInt(((Integer)var2.getSecond()).intValue() - ((Integer)var2.getFirst()).intValue())); + } + + private static void addBlacksmithItem(MerchantRecipeList par0MerchantRecipeList, int par1, Random par2Random, float par3) + { +--- 585,595 ---- + /** + * default to 1, and villagerStockList contains a min/max amount for each index + */ + private static int getRandomCountForItem(int par0, Random par1Random) + { +! Tuple var2 = (Tuple)villagerStockList.get(Integer.valueOf(par0)); + return var2 == null ? 1 : (((Integer)var2.getFirst()).intValue() >= ((Integer)var2.getSecond()).intValue() ? ((Integer)var2.getFirst()).intValue() : ((Integer)var2.getFirst()).intValue() + par1Random.nextInt(((Integer)var2.getSecond()).intValue() - ((Integer)var2.getFirst()).intValue())); + } + + private static void addBlacksmithItem(MerchantRecipeList par0MerchantRecipeList, int par1, Random par2Random, float par3) + { +*************** +*** 610,619 **** +--- 618,661 ---- + { + Tuple var2 = (Tuple)blacksmithSellingList.get(Integer.valueOf(par0)); + return var2 == null ? 1 : (((Integer)var2.getFirst()).intValue() >= ((Integer)var2.getSecond()).intValue() ? ((Integer)var2.getFirst()).intValue() : ((Integer)var2.getFirst()).intValue() + par1Random.nextInt(((Integer)var2.getSecond()).intValue() - ((Integer)var2.getFirst()).intValue())); + } + ++ public void handleHealthUpdate(byte par1) ++ { ++ if (par1 == 12) ++ { ++ this.generateRandomParticles("heart"); ++ } ++ else if (par1 == 13) ++ { ++ this.generateRandomParticles("angryVillager"); ++ } ++ else if (par1 == 14) ++ { ++ this.generateRandomParticles("happyVillager"); ++ } ++ else ++ { ++ super.handleHealthUpdate(par1); ++ } ++ } ++ ++ /** ++ * par1 is the particleName ++ */ ++ private void generateRandomParticles(String par1Str) ++ { ++ for (int var2 = 0; var2 < 5; ++var2) ++ { ++ double var3 = this.rand.nextGaussian() * 0.02D; ++ double var5 = this.rand.nextGaussian() * 0.02D; ++ double var7 = this.rand.nextGaussian() * 0.02D; ++ this.worldObj.spawnParticle(par1Str, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 1.0D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var3, var5, var7); ++ } ++ } ++ + public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData) + { + par1EntityLivingData = super.onSpawnWithEgg(par1EntityLivingData); + this.setProfession(this.worldObj.rand.nextInt(5)); + return par1EntityLivingData; +*************** +*** 641,669 **** + return this.func_90012_b(par1EntityAgeable); + } + + static + { +! villagersSellingList.put(Integer.valueOf(Item.coal.itemID), new Tuple(Integer.valueOf(16), Integer.valueOf(24))); +! villagersSellingList.put(Integer.valueOf(Item.ingotIron.itemID), new Tuple(Integer.valueOf(8), Integer.valueOf(10))); +! villagersSellingList.put(Integer.valueOf(Item.ingotGold.itemID), new Tuple(Integer.valueOf(8), Integer.valueOf(10))); +! villagersSellingList.put(Integer.valueOf(Item.diamond.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(6))); +! villagersSellingList.put(Integer.valueOf(Item.paper.itemID), new Tuple(Integer.valueOf(24), Integer.valueOf(36))); +! villagersSellingList.put(Integer.valueOf(Item.book.itemID), new Tuple(Integer.valueOf(11), Integer.valueOf(13))); +! villagersSellingList.put(Integer.valueOf(Item.writtenBook.itemID), new Tuple(Integer.valueOf(1), Integer.valueOf(1))); +! villagersSellingList.put(Integer.valueOf(Item.enderPearl.itemID), new Tuple(Integer.valueOf(3), Integer.valueOf(4))); +! villagersSellingList.put(Integer.valueOf(Item.eyeOfEnder.itemID), new Tuple(Integer.valueOf(2), Integer.valueOf(3))); +! villagersSellingList.put(Integer.valueOf(Item.porkRaw.itemID), new Tuple(Integer.valueOf(14), Integer.valueOf(18))); +! villagersSellingList.put(Integer.valueOf(Item.beefRaw.itemID), new Tuple(Integer.valueOf(14), Integer.valueOf(18))); +! villagersSellingList.put(Integer.valueOf(Item.chickenRaw.itemID), new Tuple(Integer.valueOf(14), Integer.valueOf(18))); +! villagersSellingList.put(Integer.valueOf(Item.fishCooked.itemID), new Tuple(Integer.valueOf(9), Integer.valueOf(13))); +! villagersSellingList.put(Integer.valueOf(Item.seeds.itemID), new Tuple(Integer.valueOf(34), Integer.valueOf(48))); +! villagersSellingList.put(Integer.valueOf(Item.melonSeeds.itemID), new Tuple(Integer.valueOf(30), Integer.valueOf(38))); +! villagersSellingList.put(Integer.valueOf(Item.pumpkinSeeds.itemID), new Tuple(Integer.valueOf(30), Integer.valueOf(38))); +! villagersSellingList.put(Integer.valueOf(Item.wheat.itemID), new Tuple(Integer.valueOf(18), Integer.valueOf(22))); +! villagersSellingList.put(Integer.valueOf(Block.cloth.blockID), new Tuple(Integer.valueOf(14), Integer.valueOf(22))); +! villagersSellingList.put(Integer.valueOf(Item.rottenFlesh.itemID), new Tuple(Integer.valueOf(36), Integer.valueOf(64))); + blacksmithSellingList.put(Integer.valueOf(Item.flintAndSteel.itemID), new Tuple(Integer.valueOf(3), Integer.valueOf(4))); + blacksmithSellingList.put(Integer.valueOf(Item.shears.itemID), new Tuple(Integer.valueOf(3), Integer.valueOf(4))); + blacksmithSellingList.put(Integer.valueOf(Item.swordIron.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(11))); + blacksmithSellingList.put(Integer.valueOf(Item.swordDiamond.itemID), new Tuple(Integer.valueOf(12), Integer.valueOf(14))); + blacksmithSellingList.put(Integer.valueOf(Item.axeIron.itemID), new Tuple(Integer.valueOf(6), Integer.valueOf(8))); +--- 683,711 ---- + return this.func_90012_b(par1EntityAgeable); + } + + static + { +! villagerStockList.put(Integer.valueOf(Item.coal.itemID), new Tuple(Integer.valueOf(16), Integer.valueOf(24))); +! villagerStockList.put(Integer.valueOf(Item.ingotIron.itemID), new Tuple(Integer.valueOf(8), Integer.valueOf(10))); +! villagerStockList.put(Integer.valueOf(Item.ingotGold.itemID), new Tuple(Integer.valueOf(8), Integer.valueOf(10))); +! villagerStockList.put(Integer.valueOf(Item.diamond.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(6))); +! villagerStockList.put(Integer.valueOf(Item.paper.itemID), new Tuple(Integer.valueOf(24), Integer.valueOf(36))); +! villagerStockList.put(Integer.valueOf(Item.book.itemID), new Tuple(Integer.valueOf(11), Integer.valueOf(13))); +! villagerStockList.put(Integer.valueOf(Item.writtenBook.itemID), new Tuple(Integer.valueOf(1), Integer.valueOf(1))); +! villagerStockList.put(Integer.valueOf(Item.enderPearl.itemID), new Tuple(Integer.valueOf(3), Integer.valueOf(4))); +! villagerStockList.put(Integer.valueOf(Item.eyeOfEnder.itemID), new Tuple(Integer.valueOf(2), Integer.valueOf(3))); +! villagerStockList.put(Integer.valueOf(Item.porkRaw.itemID), new Tuple(Integer.valueOf(14), Integer.valueOf(18))); +! villagerStockList.put(Integer.valueOf(Item.beefRaw.itemID), new Tuple(Integer.valueOf(14), Integer.valueOf(18))); +! villagerStockList.put(Integer.valueOf(Item.chickenRaw.itemID), new Tuple(Integer.valueOf(14), Integer.valueOf(18))); +! villagerStockList.put(Integer.valueOf(Item.fishCooked.itemID), new Tuple(Integer.valueOf(9), Integer.valueOf(13))); +! villagerStockList.put(Integer.valueOf(Item.seeds.itemID), new Tuple(Integer.valueOf(34), Integer.valueOf(48))); +! villagerStockList.put(Integer.valueOf(Item.melonSeeds.itemID), new Tuple(Integer.valueOf(30), Integer.valueOf(38))); +! villagerStockList.put(Integer.valueOf(Item.pumpkinSeeds.itemID), new Tuple(Integer.valueOf(30), Integer.valueOf(38))); +! villagerStockList.put(Integer.valueOf(Item.wheat.itemID), new Tuple(Integer.valueOf(18), Integer.valueOf(22))); +! villagerStockList.put(Integer.valueOf(Block.cloth.blockID), new Tuple(Integer.valueOf(14), Integer.valueOf(22))); +! villagerStockList.put(Integer.valueOf(Item.rottenFlesh.itemID), new Tuple(Integer.valueOf(36), Integer.valueOf(64))); + blacksmithSellingList.put(Integer.valueOf(Item.flintAndSteel.itemID), new Tuple(Integer.valueOf(3), Integer.valueOf(4))); + blacksmithSellingList.put(Integer.valueOf(Item.shears.itemID), new Tuple(Integer.valueOf(3), Integer.valueOf(4))); + blacksmithSellingList.put(Integer.valueOf(Item.swordIron.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(11))); + blacksmithSellingList.put(Integer.valueOf(Item.swordDiamond.itemID), new Tuple(Integer.valueOf(12), Integer.valueOf(14))); + blacksmithSellingList.put(Integer.valueOf(Item.axeIron.itemID), new Tuple(Integer.valueOf(6), Integer.valueOf(8))); +*** EntityWaterMob.java Sat Feb 5 04:13:13 2022 +--- EntityWaterMob.java Sat Feb 5 04:12:34 2022 +*** EntityWeatherEffect.java Sat Feb 5 04:13:13 2022 +--- EntityWeatherEffect.java Sat Feb 5 04:12:34 2022 +*** EntityWitch.java Sat Feb 5 04:13:13 2022 +--- EntityWitch.java Sat Feb 5 04:12:34 2022 +*************** +*** 165,174 **** +--- 165,189 ---- + } + + super.onLivingUpdate(); + } + ++ public void handleHealthUpdate(byte par1) ++ { ++ if (par1 == 15) ++ { ++ for (int var2 = 0; var2 < this.rand.nextInt(35) + 10; ++var2) ++ { ++ this.worldObj.spawnParticle("witchMagic", this.posX + this.rand.nextGaussian() * 0.12999999523162842D, this.boundingBox.maxY + 0.5D + this.rand.nextGaussian() * 0.12999999523162842D, this.posZ + this.rand.nextGaussian() * 0.12999999523162842D, 0.0D, 0.0D, 0.0D); ++ } ++ } ++ else ++ { ++ super.handleHealthUpdate(par1); ++ } ++ } ++ + /** + * Reduces damage, depending on potions + */ + protected float applyPotionDamageCalculations(DamageSource par1DamageSource, float par2) + { +*************** +*** 186,196 **** + + return par2; + } + + /** +! * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.rand.nextInt(3) + 1; + +--- 201,212 ---- + + return par2; + } + + /** +! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param +! * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.rand.nextInt(3) + 1; + +*** EntityWither.java Sat Feb 5 04:13:13 2022 +--- EntityWither.java Sat Feb 5 04:12:34 2022 +*************** +*** 1,10 **** + package net.minecraft.src; + + import java.util.List; + +! public class EntityWither extends EntityMob implements IRangedAttackMob + { + private float[] field_82220_d = new float[2]; + private float[] field_82221_e = new float[2]; + private float[] field_82217_f = new float[2]; + private float[] field_82218_g = new float[2]; +--- 1,10 ---- + package net.minecraft.src; + + import java.util.List; + +! public class EntityWither extends EntityMob implements IBossDisplayData, IRangedAttackMob + { + private float[] field_82220_d = new float[2]; + private float[] field_82221_e = new float[2]; + private float[] field_82217_f = new float[2]; + private float[] field_82218_g = new float[2]; +*************** +*** 57,66 **** +--- 57,71 ---- + { + super.readEntityFromNBT(par1NBTTagCompound); + this.func_82215_s(par1NBTTagCompound.getInteger("Invul")); + } + ++ public float getShadowSize() ++ { ++ return this.height / 8.0F; ++ } ++ + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { +*************** +*** 501,511 **** + } + } + } + + /** +! * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean par1, int par2) + { + this.dropItem(Item.netherStar.itemID, 1); + } +--- 506,517 ---- + } + } + } + + /** +! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param +! * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean par1, int par2) + { + this.dropItem(Item.netherStar.itemID, 1); + } +*************** +*** 516,525 **** +--- 522,536 ---- + protected void despawnEntity() + { + this.entityAge = 0; + } + ++ public int getBrightnessForRender(float par1) ++ { ++ return 15728880; ++ } ++ + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() + { +*************** +*** 548,557 **** +--- 559,578 ---- + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(300.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.6000000238418579D); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setAttribute(40.0D); ++ } ++ ++ public float func_82207_a(int par1) ++ { ++ return this.field_82221_e[par1]; ++ } ++ ++ public float func_82210_r(int par1) ++ { ++ return this.field_82220_d[par1]; + } + + public int func_82212_n() + { + return this.dataWatcher.getWatchableObjectInt(20); +*** EntityWitherAttackFilter.java Sat Feb 5 04:13:13 2022 +--- EntityWitherAttackFilter.java Sat Feb 5 04:12:34 2022 +*** EntityWitherSkull.java Sat Feb 5 04:13:13 2022 +--- EntityWitherSkull.java Sat Feb 5 04:12:34 2022 +*************** +*** 20,29 **** +--- 20,35 ---- + protected float getMotionFactor() + { + return this.isInvulnerable() ? 0.73F : super.getMotionFactor(); + } + ++ public EntityWitherSkull(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) ++ { ++ super(par1World, par2, par4, par6, par8, par10, par12); ++ this.setSize(0.3125F, 0.3125F); ++ } ++ + /** + * Returns true if the entity is on fire. Used by render to add the fire effect on rendering. + */ + public boolean isBurning() + { +*** EntityWolf.java Sat Feb 5 04:13:13 2022 +--- EntityWolf.java Sat Feb 5 04:12:34 2022 +*************** +*** 242,251 **** +--- 242,285 ---- + } + } + } + } + ++ public boolean getWolfShaking() ++ { ++ return this.isShaking; ++ } ++ ++ /** ++ * Used when calculating the amount of shading to apply while the wolf is shaking. ++ */ ++ public float getShadingWhileShaking(float par1) ++ { ++ return 0.75F + (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * par1) / 2.0F * 0.25F; ++ } ++ ++ public float getShakeAngle(float par1, float par2) ++ { ++ float var3 = (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * par1 + par2) / 1.8F; ++ ++ if (var3 < 0.0F) ++ { ++ var3 = 0.0F; ++ } ++ else if (var3 > 1.0F) ++ { ++ var3 = 1.0F; ++ } ++ ++ return MathHelper.sin(var3 * (float)Math.PI) * MathHelper.sin(var3 * (float)Math.PI * 11.0F) * 0.15F * (float)Math.PI; ++ } ++ ++ public float getInterestedAngle(float par1) ++ { ++ return (this.field_70924_f + (this.field_70926_e - this.field_70924_f) * par1) * 0.15F * (float)Math.PI; ++ } ++ + public float getEyeHeight() + { + return this.height * 0.8F; + } + +*************** +*** 394,403 **** +--- 428,456 ---- + + return true; + } + + return super.interact(par1EntityPlayer); ++ } ++ ++ public void handleHealthUpdate(byte par1) ++ { ++ if (par1 == 8) ++ { ++ this.field_70928_h = true; ++ this.timeWolfIsShaking = 0.0F; ++ this.prevTimeWolfIsShaking = 0.0F; ++ } ++ else ++ { ++ super.handleHealthUpdate(par1); ++ } ++ } ++ ++ public float getTailRotation() ++ { ++ return this.isAngry() ? 1.5393804F : (this.isTamed() ? (0.55F - (20.0F - this.dataWatcher.getWatchableObjectFloat(18)) * 0.02F) * (float)Math.PI : ((float)Math.PI / 5F)); + } + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) +*** EntityXPOrb.java Sat Feb 5 04:13:13 2022 +--- EntityXPOrb.java Sat Feb 5 04:12:34 2022 +*************** +*** 52,61 **** +--- 52,88 ---- + this.yOffset = this.height / 2.0F; + } + + protected void entityInit() {} + ++ public int getBrightnessForRender(float par1) ++ { ++ float var2 = 0.5F; ++ ++ if (var2 < 0.0F) ++ { ++ var2 = 0.0F; ++ } ++ ++ if (var2 > 1.0F) ++ { ++ var2 = 1.0F; ++ } ++ ++ int var3 = super.getBrightnessForRender(par1); ++ int var4 = var3 & 255; ++ int var5 = var3 >> 16 & 255; ++ var4 += (int)(var2 * 15.0F * 16.0F); ++ ++ if (var4 > 240) ++ { ++ var4 = 240; ++ } ++ ++ return var4 | var5 << 16; ++ } ++ + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { +*************** +*** 226,236 **** + { + return this.xpValue; + } + + /** +! * Get a fragment of the maximum experience points value for the supplied value of experience points value. + */ + public static int getXPSplit(int par0) + { + return par0 >= 2477 ? 2477 : (par0 >= 1237 ? 1237 : (par0 >= 617 ? 617 : (par0 >= 307 ? 307 : (par0 >= 149 ? 149 : (par0 >= 73 ? 73 : (par0 >= 37 ? 37 : (par0 >= 17 ? 17 : (par0 >= 7 ? 7 : (par0 >= 3 ? 3 : 1))))))))); + } +--- 253,272 ---- + { + return this.xpValue; + } + + /** +! * Returns a number from 1 to 10 based on how much XP this orb is worth. This is used by RenderXPOrb to determine +! * what texture to use. +! */ +! public int getTextureByXP() +! { +! return this.xpValue >= 2477 ? 10 : (this.xpValue >= 1237 ? 9 : (this.xpValue >= 617 ? 8 : (this.xpValue >= 307 ? 7 : (this.xpValue >= 149 ? 6 : (this.xpValue >= 73 ? 5 : (this.xpValue >= 37 ? 4 : (this.xpValue >= 17 ? 3 : (this.xpValue >= 7 ? 2 : (this.xpValue >= 3 ? 1 : 0))))))))); +! } +! +! /** +! * Get xp split rate (Is called until the xp drop code in EntityLiving.onEntityUpdate is complete) + */ + public static int getXPSplit(int par0) + { + return par0 >= 2477 ? 2477 : (par0 >= 1237 ? 1237 : (par0 >= 617 ? 617 : (par0 >= 307 ? 307 : (par0 >= 149 ? 149 : (par0 >= 73 ? 73 : (par0 >= 37 ? 37 : (par0 >= 17 ? 17 : (par0 >= 7 ? 7 : (par0 >= 3 ? 3 : 1))))))))); + } +*** EntityZombie.java Sat Feb 5 04:13:13 2022 +--- EntityZombie.java Sat Feb 5 04:12:34 2022 +*************** +*** 126,136 **** + float var1 = this.getBrightness(1.0F); + + if (var1 > 0.5F && this.rand.nextFloat() * 30.0F < (var1 - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))) + { + boolean var2 = true; +! ItemStack var3 = this.getEquipmentInSlot(4); + + if (var3 != null) + { + if (var3.isItemStackDamageable()) + { +--- 126,136 ---- + float var1 = this.getBrightness(1.0F); + + if (var1 > 0.5F && this.rand.nextFloat() * 30.0F < (var1 - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))) + { + boolean var2 = true; +! ItemStack var3 = this.getCurrentItemOrArmor(4); + + if (var3 != null) + { + if (var3.isItemStackDamageable()) + { +*************** +*** 431,441 **** + } + + this.addRandomArmor(); + this.enchantEquipment(); + +! if (this.getEquipmentInSlot(4) == null) + { + Calendar var5 = this.worldObj.getCurrentDate(); + + if (var5.get(2) + 1 == 10 && var5.get(5) == 31 && this.rand.nextFloat() < 0.25F) + { +--- 431,441 ---- + } + + this.addRandomArmor(); + this.enchantEquipment(); + +! if (this.getCurrentItemOrArmor(4) == null) + { + Calendar var5 = this.worldObj.getCurrentDate(); + + if (var5.get(2) + 1 == 10 && var5.get(5) == 31 && this.rand.nextFloat() < 0.25F) + { +*************** +*** 497,506 **** +--- 497,518 ---- + this.conversionTime = par1; + this.getDataWatcher().updateObject(14, Byte.valueOf((byte)1)); + this.removePotionEffect(Potion.weakness.id); + this.addPotionEffect(new PotionEffect(Potion.damageBoost.id, par1, Math.min(this.worldObj.difficultySetting - 1, 0))); + this.worldObj.setEntityState(this, (byte)16); ++ } ++ ++ public void handleHealthUpdate(byte par1) ++ { ++ if (par1 == 16) ++ { ++ this.worldObj.playSound(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "mob.zombie.remedy", 1.0F + this.rand.nextFloat(), this.rand.nextFloat() * 0.7F + 0.3F, false); ++ } ++ else ++ { ++ super.handleHealthUpdate(par1); ++ } + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ +*** EntityZombieGroupData.java Sat Feb 5 04:13:13 2022 +--- EntityZombieGroupData.java Sat Feb 5 04:12:34 2022 +*** EntityZombieINNER1.java Sat Feb 5 04:13:13 2022 +--- EntityZombieINNER1.java Sat Feb 5 04:12:34 2022 +*** EnumAction.java Sat Feb 5 04:13:13 2022 +--- EnumAction.java Sat Feb 5 04:12:34 2022 +*** EnumArmorMaterial.java Sat Feb 5 04:13:13 2022 +--- EnumArmorMaterial.java Sat Feb 5 04:12:34 2022 +*** EnumArt.java Sat Feb 5 04:13:13 2022 +--- EnumArt.java Sat Feb 5 04:12:34 2022 +*** EnumChatFormatting.java Sat Feb 5 04:13:13 2022 +--- EnumChatFormatting.java Sat Feb 5 04:12:34 2022 +*************** +*** 58,70 **** + { + return this.field_96303_A; + } + + /** +! * if typo is a color. + */ +! public boolean Checks() + { + return !this.field_96303_A && this != RESET; + } + + public String func_96297_d() +--- 58,70 ---- + { + return this.field_96303_A; + } + + /** +! * Checks if typo is a color. + */ +! public boolean isColor() + { + return !this.field_96303_A && this != RESET; + } + + public String func_96297_d() +*************** +*** 75,84 **** +--- 75,89 ---- + public String toString() + { + return this.field_96304_B; + } + ++ public static String func_110646_a(String par0Str) ++ { ++ return par0Str == null ? null : field_96330_y.matcher(par0Str).replaceAll(""); ++ } ++ + public static EnumChatFormatting func_96300_b(String par0Str) + { + return par0Str == null ? null : (EnumChatFormatting)field_96331_x.get(par0Str.toLowerCase()); + } + +*************** +*** 90,100 **** + + for (int var5 = 0; var5 < var4; ++var5) + { + EnumChatFormatting var6 = var3[var5]; + +! if ((!var6.Checks() || par0) && (!var6.func_96301_b() || par1)) + { + var2.add(var6.func_96297_d()); + } + } + +--- 95,105 ---- + + for (int var5 = 0; var5 < var4; ++var5) + { + EnumChatFormatting var6 = var3[var5]; + +! if ((!var6.isColor() || par0) && (!var6.func_96301_b() || par1)) + { + var2.add(var6.func_96297_d()); + } + } + +*** EnumCreatureAttribute.java Sat Feb 5 04:13:13 2022 +--- EnumCreatureAttribute.java Sat Feb 5 04:12:34 2022 +*** EnumCreatureType.java Sat Feb 5 04:13:13 2022 +--- EnumCreatureType.java Sat Feb 5 04:12:34 2022 +*** EnumDoor.java Sat Feb 5 04:13:13 2022 +--- EnumDoor.java Sat Feb 5 04:12:34 2022 +*** EnumDoorHelper.java Sat Feb 5 04:13:13 2022 +--- EnumDoorHelper.java Sat Feb 5 04:12:34 2022 +*** EnumEnchantmentType.java Sat Feb 5 04:13:13 2022 +--- EnumEnchantmentType.java Sat Feb 5 04:12:34 2022 +*** EnumEntitySize.java Sat Feb 5 04:13:13 2022 +--- EnumEntitySize.java Sat Feb 5 04:12:34 2022 +*** EnumEntitySizeHelper.java Sat Feb 5 04:13:13 2022 +--- EnumEntitySizeHelper.java Sat Feb 5 04:12:34 2022 +*** EnumFacing.java Sat Feb 5 04:13:13 2022 +--- EnumFacing.java Sat Feb 5 04:12:34 2022 +*** EnumGameType.java Sat Feb 5 04:13:13 2022 +--- EnumGameType.java Sat Feb 5 04:12:34 2022 +*************** +*** 68,77 **** +--- 68,85 ---- + { + return this == CREATIVE; + } + + /** ++ * Returns true if this is the SURVIVAL or ADVENTURE game type ++ */ ++ public boolean isSurvivalOrAdventure() ++ { ++ return this == SURVIVAL || this == ADVENTURE; ++ } ++ ++ /** + * Returns the game type with the specified ID, or SURVIVAL if none found. Args: id + */ + public static EnumGameType getByID(int par0) + { + EnumGameType[] var1 = values(); +*************** +*** 80,89 **** +--- 88,118 ---- + for (int var3 = 0; var3 < var2; ++var3) + { + EnumGameType var4 = var1[var3]; + + if (var4.id == par0) ++ { ++ return var4; ++ } ++ } ++ ++ return SURVIVAL; ++ } ++ ++ /** ++ * Returns the game type with the specified name, or SURVIVAL if none found. This is case sensitive. Args: name ++ */ ++ public static EnumGameType getByName(String par0Str) ++ { ++ EnumGameType[] var1 = values(); ++ int var2 = var1.length; ++ ++ for (int var3 = 0; var3 < var2; ++var3) ++ { ++ EnumGameType var4 = var1[var3]; ++ ++ if (var4.name.equals(par0Str)) + { + return var4; + } + } + +*** EnumMobType.java Sat Feb 5 04:13:13 2022 +--- EnumMobType.java Sat Feb 5 04:12:34 2022 +*** EnumMovingObjectType.java Sat Feb 5 04:13:13 2022 +--- EnumMovingObjectType.java Sat Feb 5 04:12:34 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EnumOptions.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,85 ---- ++ package net.minecraft.src; ++ ++ public enum EnumOptions ++ { ++ MUSIC("options.music", true, false), ++ SOUND("options.sound", true, false), ++ INVERT_MOUSE("options.invertMouse", false, true), ++ SENSITIVITY("options.sensitivity", true, false), ++ FOV("options.fov", true, false), ++ GAMMA("options.gamma", true, false), ++ RENDER_DISTANCE("options.renderDistance", false, false), ++ VIEW_BOBBING("options.viewBobbing", false, true), ++ ANAGLYPH("options.anaglyph", false, true), ++ ADVANCED_OPENGL("options.advancedOpengl", false, true), ++ FRAMERATE_LIMIT("options.framerateLimit", false, false), ++ DIFFICULTY("options.difficulty", false, false), ++ GRAPHICS("options.graphics", false, false), ++ AMBIENT_OCCLUSION("options.ao", false, false), ++ GUI_SCALE("options.guiScale", false, false), ++ RENDER_CLOUDS("options.renderClouds", false, true), ++ PARTICLES("options.particles", false, false), ++ CHAT_VISIBILITY("options.chat.visibility", false, false), ++ CHAT_COLOR("options.chat.color", false, true), ++ CHAT_LINKS("options.chat.links", false, true), ++ CHAT_OPACITY("options.chat.opacity", true, false), ++ CHAT_LINKS_PROMPT("options.chat.links.prompt", false, true), ++ USE_SERVER_TEXTURES("options.serverTextures", false, true), ++ SNOOPER_ENABLED("options.snooper", false, true), ++ USE_FULLSCREEN("options.fullscreen", false, true), ++ ENABLE_VSYNC("options.vsync", false, true), ++ SHOW_CAPE("options.showCape", false, true), ++ TOUCHSCREEN("options.touchscreen", false, true), ++ CHAT_SCALE("options.chat.scale", true, false), ++ CHAT_WIDTH("options.chat.width", true, false), ++ CHAT_HEIGHT_FOCUSED("options.chat.height.focused", true, false), ++ CHAT_HEIGHT_UNFOCUSED("options.chat.height.unfocused", true, false); ++ private final boolean enumFloat; ++ private final boolean enumBoolean; ++ private final String enumString; ++ ++ public static EnumOptions getEnumOptions(int par0) ++ { ++ EnumOptions[] var1 = values(); ++ int var2 = var1.length; ++ ++ for (int var3 = 0; var3 < var2; ++var3) ++ { ++ EnumOptions var4 = var1[var3]; ++ ++ if (var4.returnEnumOrdinal() == par0) ++ { ++ return var4; ++ } ++ } ++ ++ return null; ++ } ++ ++ private EnumOptions(String par3Str, boolean par4, boolean par5) ++ { ++ this.enumString = par3Str; ++ this.enumFloat = par4; ++ this.enumBoolean = par5; ++ } ++ ++ public boolean getEnumFloat() ++ { ++ return this.enumFloat; ++ } ++ ++ public boolean getEnumBoolean() ++ { ++ return this.enumBoolean; ++ } ++ ++ public int returnEnumOrdinal() ++ { ++ return this.ordinal(); ++ } ++ ++ public String getEnumString() ++ { ++ return this.enumString; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EnumOptionsHelper.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,135 ---- ++ package net.minecraft.src; ++ ++ class EnumOptionsHelper ++ { ++ static final int[] enumOptionsMappingHelperArray = new int[EnumOptions.values().length]; ++ ++ static ++ { ++ try ++ { ++ enumOptionsMappingHelperArray[EnumOptions.INVERT_MOUSE.ordinal()] = 1; ++ } ++ catch (NoSuchFieldError var14) ++ { ++ ; ++ } ++ ++ try ++ { ++ enumOptionsMappingHelperArray[EnumOptions.VIEW_BOBBING.ordinal()] = 2; ++ } ++ catch (NoSuchFieldError var13) ++ { ++ ; ++ } ++ ++ try ++ { ++ enumOptionsMappingHelperArray[EnumOptions.ANAGLYPH.ordinal()] = 3; ++ } ++ catch (NoSuchFieldError var12) ++ { ++ ; ++ } ++ ++ try ++ { ++ enumOptionsMappingHelperArray[EnumOptions.ADVANCED_OPENGL.ordinal()] = 4; ++ } ++ catch (NoSuchFieldError var11) ++ { ++ ; ++ } ++ ++ try ++ { ++ enumOptionsMappingHelperArray[EnumOptions.RENDER_CLOUDS.ordinal()] = 5; ++ } ++ catch (NoSuchFieldError var10) ++ { ++ ; ++ } ++ ++ try ++ { ++ enumOptionsMappingHelperArray[EnumOptions.CHAT_COLOR.ordinal()] = 6; ++ } ++ catch (NoSuchFieldError var9) ++ { ++ ; ++ } ++ ++ try ++ { ++ enumOptionsMappingHelperArray[EnumOptions.CHAT_LINKS.ordinal()] = 7; ++ } ++ catch (NoSuchFieldError var8) ++ { ++ ; ++ } ++ ++ try ++ { ++ enumOptionsMappingHelperArray[EnumOptions.CHAT_LINKS_PROMPT.ordinal()] = 8; ++ } ++ catch (NoSuchFieldError var7) ++ { ++ ; ++ } ++ ++ try ++ { ++ enumOptionsMappingHelperArray[EnumOptions.USE_SERVER_TEXTURES.ordinal()] = 9; ++ } ++ catch (NoSuchFieldError var6) ++ { ++ ; ++ } ++ ++ try ++ { ++ enumOptionsMappingHelperArray[EnumOptions.SNOOPER_ENABLED.ordinal()] = 10; ++ } ++ catch (NoSuchFieldError var5) ++ { ++ ; ++ } ++ ++ try ++ { ++ enumOptionsMappingHelperArray[EnumOptions.USE_FULLSCREEN.ordinal()] = 11; ++ } ++ catch (NoSuchFieldError var4) ++ { ++ ; ++ } ++ ++ try ++ { ++ enumOptionsMappingHelperArray[EnumOptions.ENABLE_VSYNC.ordinal()] = 12; ++ } ++ catch (NoSuchFieldError var3) ++ { ++ ; ++ } ++ ++ try ++ { ++ enumOptionsMappingHelperArray[EnumOptions.SHOW_CAPE.ordinal()] = 13; ++ } ++ catch (NoSuchFieldError var2) ++ { ++ ; ++ } ++ ++ try ++ { ++ enumOptionsMappingHelperArray[EnumOptions.TOUCHSCREEN.ordinal()] = 14; ++ } ++ catch (NoSuchFieldError var1) ++ { ++ ; ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EnumOS.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,10 ---- ++ package net.minecraft.src; ++ ++ public enum EnumOS ++ { ++ LINUX, ++ SOLARIS, ++ WINDOWS, ++ MACOS, ++ UNKNOWN; ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- EnumRarity.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,24 ---- ++ package net.minecraft.src; ++ ++ public enum EnumRarity ++ { ++ common(15, "Common"), ++ uncommon(14, "Uncommon"), ++ rare(11, "Rare"), ++ epic(13, "Epic"); ++ ++ /** ++ * A decimal representation of the hex color codes of a the color assigned to this rarity type. (13 becomes d as in ++ * \247d which is light purple) ++ */ ++ public final int rarityColor; ++ ++ /** Rarity name. */ ++ public final String rarityName; ++ ++ private EnumRarity(int par3, String par4Str) ++ { ++ this.rarityColor = par3; ++ this.rarityName = par4Str; ++ } ++ } +*** EnumSkyBlock.java Sat Feb 5 04:13:13 2022 +--- EnumSkyBlock.java Sat Feb 5 04:12:34 2022 +*** EnumStatus.java Sat Feb 5 04:13:13 2022 +--- EnumStatus.java Sat Feb 5 04:12:34 2022 +*** EnumToolMaterial.java Sat Feb 5 04:13:13 2022 +--- EnumToolMaterial.java Sat Feb 5 04:12:34 2022 +*************** +*** 53,63 **** + { + return this.efficiencyOnProperMaterial; + } + + /** +! * Returns the damage against a given entity. + */ + public float getDamageVsEntity() + { + return this.damageVsEntity; + } +--- 53,63 ---- + { + return this.efficiencyOnProperMaterial; + } + + /** +! * Damage versus entities. + */ + public float getDamageVsEntity() + { + return this.damageVsEntity; + } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ExceptionMcoHttp.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,9 ---- ++ package net.minecraft.src; ++ ++ public class ExceptionMcoHttp extends RuntimeException ++ { ++ public ExceptionMcoHttp(String par1Str, Exception par2Exception) ++ { ++ super(par1Str, par2Exception); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ExceptionMcoService.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,21 ---- ++ package net.minecraft.src; ++ ++ public class ExceptionMcoService extends Exception ++ { ++ public final int field_96392_a; ++ public final String field_96391_b; ++ public final int field_130097_c; ++ ++ public ExceptionMcoService(int par1, String par2Str, int par3) ++ { ++ super(par2Str); ++ this.field_96392_a = par1; ++ this.field_96391_b = par2Str; ++ this.field_130097_c = par3; ++ } ++ ++ public String toString() ++ { ++ return this.field_130097_c != -1 ? "Realms ( ErrorCode: " + this.field_130097_c + " )" : "Realms: " + this.field_96391_b; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ExceptionRetryCall.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,12 ---- ++ package net.minecraft.src; ++ ++ public class ExceptionRetryCall extends ExceptionMcoService ++ { ++ public final int field_96393_c; ++ ++ public ExceptionRetryCall(int par1) ++ { ++ super(503, "Retry operation", -1); ++ this.field_96393_c = par1; ++ } ++ } +*** Explosion.java Sat Feb 5 04:13:13 2022 +--- Explosion.java Sat Feb 5 04:12:34 2022 +*** ExtendedBlockStorage.java Sat Feb 5 04:13:13 2022 +--- ExtendedBlockStorage.java Sat Feb 5 04:12:34 2022 +*************** +*** 235,244 **** +--- 235,249 ---- + public byte[] getBlockLSBArray() + { + return this.blockLSBArray; + } + ++ public void clearMSBArray() ++ { ++ this.blockMSBArray = null; ++ } ++ + /** + * Returns the block ID MSB (bits 11..8) array for this storage array's Chunk. + */ + public NibbleArray getBlockMSBArray() + { +*************** +*** 302,308 **** +--- 307,323 ---- + * Sets the NibbleArray instance used for Sky-light values in this particular storage block. + */ + public void setSkylightArray(NibbleArray par1NibbleArray) + { + this.skylightArray = par1NibbleArray; ++ } ++ ++ /** ++ * Called by a Chunk to initialize the MSB array if getBlockMSBArray returns null. Returns the newly-created ++ * NibbleArray instance. ++ */ ++ public NibbleArray createBlockMSBArray() ++ { ++ this.blockMSBArray = new NibbleArray(this.blockLSBArray.length, 4); ++ return this.blockMSBArray; + } + } +*** Facing.java Sat Feb 5 04:13:13 2022 +--- Facing.java Sat Feb 5 04:12:34 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- FallbackResourceManager.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,93 ---- ++ package net.minecraft.src; ++ ++ import com.google.common.collect.Lists; ++ import java.io.FileNotFoundException; ++ import java.io.IOException; ++ import java.io.InputStream; ++ import java.util.ArrayList; ++ import java.util.Iterator; ++ import java.util.List; ++ import java.util.Set; ++ ++ public class FallbackResourceManager implements ResourceManager ++ { ++ protected final List resourcePacks = new ArrayList(); ++ private final MetadataSerializer frmMetadataSerializer; ++ ++ public FallbackResourceManager(MetadataSerializer par1MetadataSerializer) ++ { ++ this.frmMetadataSerializer = par1MetadataSerializer; ++ } ++ ++ public void addResourcePack(ResourcePack par1ResourcePack) ++ { ++ this.resourcePacks.add(par1ResourcePack); ++ } ++ ++ public Set getResourceDomains() ++ { ++ return null; ++ } ++ ++ public Resource getResource(ResourceLocation par1ResourceLocation) throws IOException ++ { ++ ResourcePack var2 = null; ++ ResourceLocation var3 = getLocationMcmeta(par1ResourceLocation); ++ ++ for (int var4 = this.resourcePacks.size() - 1; var4 >= 0; --var4) ++ { ++ ResourcePack var5 = (ResourcePack)this.resourcePacks.get(var4); ++ ++ if (var2 == null && var5.resourceExists(var3)) ++ { ++ var2 = var5; ++ } ++ ++ if (var5.resourceExists(par1ResourceLocation)) ++ { ++ InputStream var6 = null; ++ ++ if (var2 != null) ++ { ++ var6 = var2.getInputStream(var3); ++ } ++ ++ return new SimpleResource(par1ResourceLocation, var5.getInputStream(par1ResourceLocation), var6, this.frmMetadataSerializer); ++ } ++ } ++ ++ throw new FileNotFoundException(par1ResourceLocation.toString()); ++ } ++ ++ public List getAllResources(ResourceLocation par1ResourceLocation) throws IOException ++ { ++ ArrayList var2 = Lists.newArrayList(); ++ ResourceLocation var3 = getLocationMcmeta(par1ResourceLocation); ++ Iterator var4 = this.resourcePacks.iterator(); ++ ++ while (var4.hasNext()) ++ { ++ ResourcePack var5 = (ResourcePack)var4.next(); ++ ++ if (var5.resourceExists(par1ResourceLocation)) ++ { ++ InputStream var6 = var5.resourceExists(var3) ? var5.getInputStream(var3) : null; ++ var2.add(new SimpleResource(par1ResourceLocation, var5.getInputStream(par1ResourceLocation), var6, this.frmMetadataSerializer)); ++ } ++ } ++ ++ if (var2.isEmpty()) ++ { ++ throw new FileNotFoundException(par1ResourceLocation.toString()); ++ } ++ else ++ { ++ return var2; ++ } ++ } ++ ++ static ResourceLocation getLocationMcmeta(ResourceLocation par0ResourceLocation) ++ { ++ return new ResourceLocation(par0ResourceLocation.getResourceDomain(), par0ResourceLocation.getResourcePath() + ".mcmeta"); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- FileResourcePack.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,137 ---- ++ package net.minecraft.src; ++ ++ import com.google.common.base.Splitter; ++ import com.google.common.collect.Lists; ++ import com.google.common.collect.Sets; ++ import java.io.Closeable; ++ import java.io.File; ++ import java.io.IOException; ++ import java.io.InputStream; ++ import java.util.ArrayList; ++ import java.util.Collections; ++ import java.util.Enumeration; ++ import java.util.HashSet; ++ import java.util.Set; ++ import java.util.zip.ZipEntry; ++ import java.util.zip.ZipFile; ++ ++ public class FileResourcePack extends AbstractResourcePack implements Closeable ++ { ++ public static final Splitter entryNameSplitter = Splitter.on('/').omitEmptyStrings().limit(3); ++ private ZipFile resourcePackZipFile; ++ ++ public FileResourcePack(File par1File) ++ { ++ super(par1File); ++ } ++ ++ private ZipFile getResourcePackZipFile() throws IOException ++ { ++ if (this.resourcePackZipFile == null) ++ { ++ this.resourcePackZipFile = new ZipFile(this.resourcePackFile); ++ } ++ ++ return this.resourcePackZipFile; ++ } ++ ++ protected InputStream getInputStreamByName(String par1Str) throws IOException ++ { ++ ZipFile var2 = this.getResourcePackZipFile(); ++ ZipEntry var3 = var2.getEntry(par1Str); ++ ++ if (var3 == null) ++ { ++ throw new ResourcePackFileNotFoundException(this.resourcePackFile, par1Str); ++ } ++ else ++ { ++ return var2.getInputStream(var3); ++ } ++ } ++ ++ public boolean hasResourceName(String par1Str) ++ { ++ try ++ { ++ return this.getResourcePackZipFile().getEntry(par1Str) != null; ++ } ++ catch (IOException var3) ++ { ++ return false; ++ } ++ } ++ ++ public Set getResourceDomains() ++ { ++ ZipFile var1; ++ ++ try ++ { ++ var1 = this.getResourcePackZipFile(); ++ } ++ catch (IOException var8) ++ { ++ return Collections.emptySet(); ++ } ++ ++ Enumeration var2 = var1.entries(); ++ HashSet var3 = Sets.newHashSet(); ++ ++ while (var2.hasMoreElements()) ++ { ++ ZipEntry var4 = (ZipEntry)var2.nextElement(); ++ String var5 = var4.getName(); ++ ++ if (var5.startsWith("assets/")) ++ { ++ ArrayList var6 = Lists.newArrayList(entryNameSplitter.split(var5)); ++ ++ if (var6.size() > 1) ++ { ++ String var7 = (String)var6.get(1); ++ ++ if (!var7.equals(var7.toLowerCase())) ++ { ++ this.logNameNotLowercase(var7); ++ } ++ else ++ { ++ var3.add(var7); ++ } ++ } ++ } ++ } ++ ++ return var3; ++ } ++ ++ protected void finalize() ++ { ++ this.close(); ++ ++ try ++ { ++ super.finalize(); ++ } ++ catch (Throwable t) ++ { ++ } ++ } ++ ++ public void close() ++ { ++ if (this.resourcePackZipFile != null) ++ { ++ try ++ { ++ this.resourcePackZipFile.close(); ++ } ++ catch (Exception ex) ++ { ++ } ++ ++ this.resourcePackZipFile = null; ++ } ++ } ++ } +*** FilterIMob.java Sat Feb 5 04:13:13 2022 +--- FilterIMob.java Sat Feb 5 04:12:34 2022 +*** FlatGeneratorInfo.java Sat Feb 5 04:13:13 2022 +--- FlatGeneratorInfo.java Sat Feb 5 04:12:34 2022 +*** FlatLayerInfo.java Sat Feb 5 04:13:13 2022 +--- FlatLayerInfo.java Sat Feb 5 04:12:34 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- FolderResourcePack.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,58 ---- ++ package net.minecraft.src; ++ ++ import com.google.common.collect.Sets; ++ import java.io.BufferedInputStream; ++ import java.io.File; ++ import java.io.FileInputStream; ++ import java.io.IOException; ++ import java.io.InputStream; ++ import java.util.HashSet; ++ import java.util.Set; ++ import org.apache.commons.io.filefilter.DirectoryFileFilter; ++ ++ public class FolderResourcePack extends AbstractResourcePack ++ { ++ public FolderResourcePack(File par1File) ++ { ++ super(par1File); ++ } ++ ++ protected InputStream getInputStreamByName(String par1Str) throws IOException ++ { ++ return new BufferedInputStream(new FileInputStream(new File(this.resourcePackFile, par1Str))); ++ } ++ ++ protected boolean hasResourceName(String par1Str) ++ { ++ return (new File(this.resourcePackFile, par1Str)).isFile(); ++ } ++ ++ public Set getResourceDomains() ++ { ++ HashSet var1 = Sets.newHashSet(); ++ File var2 = new File(this.resourcePackFile, "assets/"); ++ ++ if (var2.isDirectory()) ++ { ++ File[] var3 = var2.listFiles((java.io.FileFilter)DirectoryFileFilter.DIRECTORY); ++ int var4 = var3.length; ++ ++ for (int var5 = 0; var5 < var4; ++var5) ++ { ++ File var6 = var3[var5]; ++ String var7 = getRelativeName(var2, var6); ++ ++ if (!var7.equals(var7.toLowerCase())) ++ { ++ this.logNameNotLowercase(var7); ++ } ++ else ++ { ++ var1.add(var7.substring(0, var7.length() - 1)); ++ } ++ } ++ } ++ ++ return var1; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- FoliageColorReloadListener.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,20 ---- ++ package net.minecraft.src; ++ ++ import java.io.IOException; ++ ++ public class FoliageColorReloadListener implements ResourceManagerReloadListener ++ { ++ private static final ResourceLocation field_130079_a = new ResourceLocation("textures/colormap/foliage.png"); ++ ++ public void onResourceManagerReload(ResourceManager par1ResourceManager) ++ { ++ try ++ { ++ ColorizerFoliage.setFoliageBiomeColorizer(TextureUtil.readImageData(par1ResourceManager, field_130079_a)); ++ } ++ catch (IOException var3) ++ { ++ ; ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- FontMetadataSection.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,15 ---- ++ package net.minecraft.src; ++ ++ public class FontMetadataSection implements MetadataSection ++ { ++ private final float[] charWidths; ++ private final float[] charLefts; ++ private final float[] charSpacings; ++ ++ public FontMetadataSection(float[] par1ArrayOfFloat, float[] par2ArrayOfFloat, float[] par3ArrayOfFloat) ++ { ++ this.charWidths = par1ArrayOfFloat; ++ this.charLefts = par2ArrayOfFloat; ++ this.charSpacings = par3ArrayOfFloat; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- FontMetadataSectionSerializer.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,84 ---- ++ package net.minecraft.src; ++ ++ import com.google.gson.JsonDeserializationContext; ++ import com.google.gson.JsonElement; ++ import com.google.gson.JsonObject; ++ import com.google.gson.JsonParseException; ++ import java.lang.reflect.Type; ++ ++ public class FontMetadataSectionSerializer extends BaseMetadataSectionSerializer ++ { ++ public FontMetadataSection func_110490_a(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) ++ { ++ JsonObject var4 = par1JsonElement.getAsJsonObject(); ++ float[] var5 = new float[256]; ++ float[] var6 = new float[256]; ++ float[] var7 = new float[256]; ++ float var8 = 1.0F; ++ float var9 = 0.0F; ++ float var10 = 0.0F; ++ ++ if (var4.has("characters")) ++ { ++ if (!var4.get("characters").isJsonObject()) ++ { ++ throw new JsonParseException("Invalid font->characters: expected object, was " + var4.get("characters")); ++ } ++ ++ JsonObject var11 = var4.getAsJsonObject("characters"); ++ ++ if (var11.has("default")) ++ { ++ if (!var11.get("default").isJsonObject()) ++ { ++ throw new JsonParseException("Invalid font->characters->default: expected object, was " + var11.get("default")); ++ } ++ ++ JsonObject var12 = var11.getAsJsonObject("default"); ++ var8 = this.func_110487_a(var12.get("width"), "characters->default->width", Float.valueOf(var8), 0.0F, 2.14748365E9F); ++ var9 = this.func_110487_a(var12.get("spacing"), "characters->default->spacing", Float.valueOf(var9), 0.0F, 2.14748365E9F); ++ var10 = this.func_110487_a(var12.get("left"), "characters->default->left", Float.valueOf(var10), 0.0F, 2.14748365E9F); ++ } ++ ++ for (int var18 = 0; var18 < 256; ++var18) ++ { ++ JsonElement var13 = var11.get(Integer.toString(var18)); ++ float var14 = var8; ++ float var15 = var9; ++ float var16 = var10; ++ ++ if (var13 != null) ++ { ++ if (!var13.isJsonObject()) ++ { ++ throw new JsonParseException("Invalid font->characters->" + var18 + ": expected object, was " + var13); ++ } ++ ++ JsonObject var17 = var13.getAsJsonObject(); ++ var14 = this.func_110487_a(var17.get("width"), "characters->" + var18 + "->width", Float.valueOf(var8), 0.0F, 2.14748365E9F); ++ var15 = this.func_110487_a(var17.get("spacing"), "characters->" + var18 + "->spacing", Float.valueOf(var9), 0.0F, 2.14748365E9F); ++ var16 = this.func_110487_a(var17.get("left"), "characters->" + var18 + "->left", Float.valueOf(var10), 0.0F, 2.14748365E9F); ++ } ++ ++ var5[var18] = var14; ++ var6[var18] = var15; ++ var7[var18] = var16; ++ } ++ } ++ ++ return new FontMetadataSection(var5, var7, var6); ++ } ++ ++ /** ++ * The name of this section type as it appears in JSON. ++ */ ++ public String getSectionName() ++ { ++ return "font"; ++ } ++ ++ public Object deserialize(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) ++ { ++ return this.func_110490_a(par1JsonElement, par2Type, par3JsonDeserializationContext); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- FontRenderer.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,1031 ---- ++ package net.minecraft.src; ++ ++ import java.awt.image.BufferedImage; ++ import java.io.IOException; ++ import java.io.InputStream; ++ import java.text.Bidi; ++ import java.util.Arrays; ++ import java.util.Iterator; ++ import java.util.List; ++ import java.util.Random; ++ import javax.imageio.ImageIO; ++ import org.lwjgl.opengl.GL11; ++ ++ public class FontRenderer implements ResourceManagerReloadListener ++ { ++ private static final ResourceLocation[] unicodePageLocations = new ResourceLocation[256]; ++ ++ /** Array of width of all the characters in default.png */ ++ private int[] charWidth = new int[256]; ++ ++ /** the height in pixels of default text */ ++ public int FONT_HEIGHT = 9; ++ public Random fontRandom = new Random(); ++ ++ /** ++ * Array of the start/end column (in upper/lower nibble) for every glyph in the /font directory. ++ */ ++ private byte[] glyphWidth = new byte[65536]; ++ ++ /** ++ * Array of RGB triplets defining the 16 standard chat colors followed by 16 darker version of the same colors for ++ * drop shadows. ++ */ ++ private int[] colorCode = new int[32]; ++ private final ResourceLocation locationFontTexture; ++ ++ /** The RenderEngine used to load and setup glyph textures. */ ++ private final TextureManager renderEngine; ++ ++ /** Current X coordinate at which to draw the next character. */ ++ private float posX; ++ ++ /** Current Y coordinate at which to draw the next character. */ ++ private float posY; ++ ++ /** ++ * If true, strings should be rendered with Unicode fonts instead of the default.png font ++ */ ++ private boolean unicodeFlag; ++ ++ /** ++ * If true, the Unicode Bidirectional Algorithm should be run before rendering any string. ++ */ ++ private boolean bidiFlag; ++ ++ /** Used to specify new red value for the current color. */ ++ private float red; ++ ++ /** Used to specify new blue value for the current color. */ ++ private float blue; ++ ++ /** Used to specify new green value for the current color. */ ++ private float green; ++ ++ /** Used to speify new alpha value for the current color. */ ++ private float alpha; ++ ++ /** Text color of the currently rendering string. */ ++ private int textColor; ++ ++ /** Set if the "k" style (random) is active in currently rendering string */ ++ private boolean randomStyle; ++ ++ /** Set if the "l" style (bold) is active in currently rendering string */ ++ private boolean boldStyle; ++ ++ /** Set if the "o" style (italic) is active in currently rendering string */ ++ private boolean italicStyle; ++ ++ /** ++ * Set if the "n" style (underlined) is active in currently rendering string ++ */ ++ private boolean underlineStyle; ++ ++ /** ++ * Set if the "m" style (strikethrough) is active in currently rendering string ++ */ ++ private boolean strikethroughStyle; ++ ++ public FontRenderer(GameSettings par1GameSettings, ResourceLocation par2ResourceLocation, TextureManager par3TextureManager, boolean par4) ++ { ++ this.locationFontTexture = par2ResourceLocation; ++ this.renderEngine = par3TextureManager; ++ this.unicodeFlag = par4; ++ par3TextureManager.bindTexture(this.locationFontTexture); ++ ++ for (int var5 = 0; var5 < 32; ++var5) ++ { ++ int var6 = (var5 >> 3 & 1) * 85; ++ int var7 = (var5 >> 2 & 1) * 170 + var6; ++ int var8 = (var5 >> 1 & 1) * 170 + var6; ++ int var9 = (var5 >> 0 & 1) * 170 + var6; ++ ++ if (var5 == 6) ++ { ++ var7 += 85; ++ } ++ ++ if (par1GameSettings.anaglyph) ++ { ++ int var10 = (var7 * 30 + var8 * 59 + var9 * 11) / 100; ++ int var11 = (var7 * 30 + var8 * 70) / 100; ++ int var12 = (var7 * 30 + var9 * 70) / 100; ++ var7 = var10; ++ var8 = var11; ++ var9 = var12; ++ } ++ ++ if (var5 >= 16) ++ { ++ var7 /= 4; ++ var8 /= 4; ++ var9 /= 4; ++ } ++ ++ this.colorCode[var5] = (var7 & 255) << 16 | (var8 & 255) << 8 | var9 & 255; ++ } ++ ++ this.readGlyphSizes(); ++ } ++ ++ public void onResourceManagerReload(ResourceManager par1ResourceManager) ++ { ++ this.readFontTexture(); ++ } ++ ++ private void readFontTexture() ++ { ++ BufferedImage var1; ++ ++ try ++ { ++ var1 = ImageIO.read(Minecraft.getMinecraft().getResourceManager().getResource(this.locationFontTexture).getInputStream()); ++ } ++ catch (IOException var17) ++ { ++ throw new RuntimeException(var17); ++ } ++ ++ int var2 = var1.getWidth(); ++ int var3 = var1.getHeight(); ++ int[] var4 = new int[var2 * var3]; ++ var1.getRGB(0, 0, var2, var3, var4, 0, var2); ++ int var5 = var3 / 16; ++ int var6 = var2 / 16; ++ byte var7 = 1; ++ float var8 = 8.0F / (float)var6; ++ int var9 = 0; ++ ++ while (var9 < 256) ++ { ++ int var10 = var9 % 16; ++ int var11 = var9 / 16; ++ ++ if (var9 == 32) ++ { ++ this.charWidth[var9] = 3 + var7; ++ } ++ ++ int var12 = var6 - 1; ++ ++ while (true) ++ { ++ if (var12 >= 0) ++ { ++ int var13 = var10 * var6 + var12; ++ boolean var14 = true; ++ ++ for (int var15 = 0; var15 < var5 && var14; ++var15) ++ { ++ int var16 = (var11 * var6 + var15) * var2; ++ ++ if ((var4[var13 + var16] >> 24 & 255) != 0) ++ { ++ var14 = false; ++ } ++ } ++ ++ if (var14) ++ { ++ --var12; ++ continue; ++ } ++ } ++ ++ ++var12; ++ this.charWidth[var9] = (int)(0.5D + (double)((float)var12 * var8)) + var7; ++ ++var9; ++ break; ++ } ++ } ++ } ++ ++ private void readGlyphSizes() ++ { ++ try ++ { ++ InputStream var1 = Minecraft.getMinecraft().getResourceManager().getResource(new ResourceLocation("font/glyph_sizes.bin")).getInputStream(); ++ var1.read(this.glyphWidth); ++ } ++ catch (IOException var2) ++ { ++ throw new RuntimeException(var2); ++ } ++ } ++ ++ /** ++ * Pick how to render a single character and return the width used. ++ */ ++ private float renderCharAtPos(int par1, char par2, boolean par3) ++ { ++ return par2 == 32 ? 4.0F : (par1 > 0 && !this.unicodeFlag ? this.renderDefaultChar(par1 + 32, par3) : this.renderUnicodeChar(par2, par3)); ++ } ++ ++ /** ++ * Render a single character with the default.png font at current (posX,posY) location... ++ */ ++ private float renderDefaultChar(int par1, boolean par2) ++ { ++ float var3 = (float)(par1 % 16 * 8); ++ float var4 = (float)(par1 / 16 * 8); ++ float var5 = par2 ? 1.0F : 0.0F; ++ this.renderEngine.bindTexture(this.locationFontTexture); ++ float var6 = (float)this.charWidth[par1] - 0.01F; ++ GL11.glBegin(GL11.GL_TRIANGLE_STRIP); ++ GL11.glTexCoord2f(var3 / 128.0F, var4 / 128.0F); ++ GL11.glVertex3f(this.posX + var5, this.posY, 0.0F); ++ GL11.glTexCoord2f(var3 / 128.0F, (var4 + 7.99F) / 128.0F); ++ GL11.glVertex3f(this.posX - var5, this.posY + 7.99F, 0.0F); ++ GL11.glTexCoord2f((var3 + var6 - 1.0F) / 128.0F, var4 / 128.0F); ++ GL11.glVertex3f(this.posX + var6 - 1.0F + var5, this.posY, 0.0F); ++ GL11.glTexCoord2f((var3 + var6 - 1.0F) / 128.0F, (var4 + 7.99F) / 128.0F); ++ GL11.glVertex3f(this.posX + var6 - 1.0F - var5, this.posY + 7.99F, 0.0F); ++ GL11.glEnd(); ++ return (float)this.charWidth[par1]; ++ } ++ ++ private ResourceLocation getUnicodePageLocation(int par1) ++ { ++ if (unicodePageLocations[par1] == null) ++ { ++ unicodePageLocations[par1] = new ResourceLocation(String.format("textures/font/unicode_page_%02x.png", new Object[] {Integer.valueOf(par1)})); ++ } ++ ++ return unicodePageLocations[par1]; ++ } ++ ++ /** ++ * Load one of the /font/glyph_XX.png into a new GL texture and store the texture ID in glyphTextureName array. ++ */ ++ private void loadGlyphTexture(int par1) ++ { ++ this.renderEngine.bindTexture(this.getUnicodePageLocation(par1)); ++ } ++ ++ /** ++ * Render a single Unicode character at current (posX,posY) location using one of the /font/glyph_XX.png files... ++ */ ++ private float renderUnicodeChar(char par1, boolean par2) ++ { ++ if (this.glyphWidth[par1] == 0) ++ { ++ return 0.0F; ++ } ++ else ++ { ++ int var3 = par1 / 256; ++ this.loadGlyphTexture(var3); ++ int var4 = this.glyphWidth[par1] >>> 4; ++ int var5 = this.glyphWidth[par1] & 15; ++ float var6 = (float)var4; ++ float var7 = (float)(var5 + 1); ++ float var8 = (float)(par1 % 16 * 16) + var6; ++ float var9 = (float)((par1 & 255) / 16 * 16); ++ float var10 = var7 - var6 - 0.02F; ++ float var11 = par2 ? 1.0F : 0.0F; ++ GL11.glBegin(GL11.GL_TRIANGLE_STRIP); ++ GL11.glTexCoord2f(var8 / 256.0F, var9 / 256.0F); ++ GL11.glVertex3f(this.posX + var11, this.posY, 0.0F); ++ GL11.glTexCoord2f(var8 / 256.0F, (var9 + 15.98F) / 256.0F); ++ GL11.glVertex3f(this.posX - var11, this.posY + 7.99F, 0.0F); ++ GL11.glTexCoord2f((var8 + var10) / 256.0F, var9 / 256.0F); ++ GL11.glVertex3f(this.posX + var10 / 2.0F + var11, this.posY, 0.0F); ++ GL11.glTexCoord2f((var8 + var10) / 256.0F, (var9 + 15.98F) / 256.0F); ++ GL11.glVertex3f(this.posX + var10 / 2.0F - var11, this.posY + 7.99F, 0.0F); ++ GL11.glEnd(); ++ return (var7 - var6) / 2.0F + 1.0F; ++ } ++ } ++ ++ /** ++ * Draws the specified string with a shadow. ++ */ ++ public int drawStringWithShadow(String par1Str, int par2, int par3, int par4) ++ { ++ return this.drawString(par1Str, par2, par3, par4, true); ++ } ++ ++ /** ++ * Draws the specified string. ++ */ ++ public int drawString(String par1Str, int par2, int par3, int par4) ++ { ++ return this.drawString(par1Str, par2, par3, par4, false); ++ } ++ ++ /** ++ * Draws the specified string. Args: string, x, y, color, dropShadow ++ */ ++ public int drawString(String par1Str, int par2, int par3, int par4, boolean par5) ++ { ++ this.resetStyles(); ++ ++ if (this.bidiFlag) ++ { ++ par1Str = this.bidiReorder(par1Str); ++ } ++ ++ int var6; ++ ++ if (par5) ++ { ++ var6 = this.renderString(par1Str, par2 + 1, par3 + 1, par4, true); ++ var6 = Math.max(var6, this.renderString(par1Str, par2, par3, par4, false)); ++ } ++ else ++ { ++ var6 = this.renderString(par1Str, par2, par3, par4, false); ++ } ++ ++ return var6; ++ } ++ ++ /** ++ * Apply Unicode Bidirectional Algorithm to string and return a new possibly reordered string for visual rendering. ++ */ ++ private String bidiReorder(String par1Str) ++ { ++ if (par1Str != null && Bidi.requiresBidi(par1Str.toCharArray(), 0, par1Str.length())) ++ { ++ Bidi var2 = new Bidi(par1Str, -2); ++ byte[] var3 = new byte[var2.getRunCount()]; ++ String[] var4 = new String[var3.length]; ++ int var7; ++ ++ for (int var5 = 0; var5 < var3.length; ++var5) ++ { ++ int var6 = var2.getRunStart(var5); ++ var7 = var2.getRunLimit(var5); ++ int var8 = var2.getRunLevel(var5); ++ String var9 = par1Str.substring(var6, var7); ++ var3[var5] = (byte)var8; ++ var4[var5] = var9; ++ } ++ ++ String[] var11 = (String[])var4.clone(); ++ Bidi.reorderVisually(var3, 0, var4, 0, var3.length); ++ StringBuilder var12 = new StringBuilder(); ++ var7 = 0; ++ ++ while (var7 < var4.length) ++ { ++ byte var13 = var3[var7]; ++ int var14 = 0; ++ ++ while (true) ++ { ++ if (var14 < var11.length) ++ { ++ if (!var11[var14].equals(var4[var7])) ++ { ++ ++var14; ++ continue; ++ } ++ ++ var13 = var3[var14]; ++ } ++ ++ if ((var13 & 1) == 0) ++ { ++ var12.append(var4[var7]); ++ } ++ else ++ { ++ for (var14 = var4[var7].length() - 1; var14 >= 0; --var14) ++ { ++ char var10 = var4[var7].charAt(var14); ++ ++ if (var10 == 40) ++ { ++ var10 = 41; ++ } ++ else if (var10 == 41) ++ { ++ var10 = 40; ++ } ++ ++ var12.append(var10); ++ } ++ } ++ ++ ++var7; ++ break; ++ } ++ } ++ ++ return var12.toString(); ++ } ++ else ++ { ++ return par1Str; ++ } ++ } ++ ++ /** ++ * Reset all style flag fields in the class to false; called at the start of string rendering ++ */ ++ private void resetStyles() ++ { ++ this.randomStyle = false; ++ this.boldStyle = false; ++ this.italicStyle = false; ++ this.underlineStyle = false; ++ this.strikethroughStyle = false; ++ } ++ ++ /** ++ * Render a single line string at the current (posX,posY) and update posX ++ */ ++ private void renderStringAtPos(String par1Str, boolean par2) ++ { ++ for (int var3 = 0; var3 < par1Str.length(); ++var3) ++ { ++ char var4 = par1Str.charAt(var3); ++ int var5; ++ int var6; ++ ++ if (var4 == 167 && var3 + 1 < par1Str.length()) ++ { ++ var5 = "0123456789abcdefklmnor".indexOf(par1Str.toLowerCase().charAt(var3 + 1)); ++ ++ if (var5 < 16) ++ { ++ this.randomStyle = false; ++ this.boldStyle = false; ++ this.strikethroughStyle = false; ++ this.underlineStyle = false; ++ this.italicStyle = false; ++ ++ if (var5 < 0 || var5 > 15) ++ { ++ var5 = 15; ++ } ++ ++ if (par2) ++ { ++ var5 += 16; ++ } ++ ++ var6 = this.colorCode[var5]; ++ this.textColor = var6; ++ GL11.glColor4f((float)(var6 >> 16) / 255.0F, (float)(var6 >> 8 & 255) / 255.0F, (float)(var6 & 255) / 255.0F, this.alpha); ++ } ++ else if (var5 == 16) ++ { ++ this.randomStyle = true; ++ } ++ else if (var5 == 17) ++ { ++ this.boldStyle = true; ++ } ++ else if (var5 == 18) ++ { ++ this.strikethroughStyle = true; ++ } ++ else if (var5 == 19) ++ { ++ this.underlineStyle = true; ++ } ++ else if (var5 == 20) ++ { ++ this.italicStyle = true; ++ } ++ else if (var5 == 21) ++ { ++ this.randomStyle = false; ++ this.boldStyle = false; ++ this.strikethroughStyle = false; ++ this.underlineStyle = false; ++ this.italicStyle = false; ++ GL11.glColor4f(this.red, this.blue, this.green, this.alpha); ++ } ++ ++ ++var3; ++ } ++ else ++ { ++ var5 = ChatAllowedCharacters.allowedCharacters.indexOf(var4); ++ ++ if (this.randomStyle && var5 > 0) ++ { ++ do ++ { ++ var6 = this.fontRandom.nextInt(ChatAllowedCharacters.allowedCharacters.length()); ++ } ++ while (this.charWidth[var5 + 32] != this.charWidth[var6 + 32]); ++ ++ var5 = var6; ++ } ++ ++ float var11 = this.unicodeFlag ? 0.5F : 1.0F; ++ boolean var7 = (var5 <= 0 || this.unicodeFlag) && par2; ++ ++ if (var7) ++ { ++ this.posX -= var11; ++ this.posY -= var11; ++ } ++ ++ float var8 = this.renderCharAtPos(var5, var4, this.italicStyle); ++ ++ if (var7) ++ { ++ this.posX += var11; ++ this.posY += var11; ++ } ++ ++ if (this.boldStyle) ++ { ++ this.posX += var11; ++ ++ if (var7) ++ { ++ this.posX -= var11; ++ this.posY -= var11; ++ } ++ ++ this.renderCharAtPos(var5, var4, this.italicStyle); ++ this.posX -= var11; ++ ++ if (var7) ++ { ++ this.posX += var11; ++ this.posY += var11; ++ } ++ ++ ++var8; ++ } ++ ++ Tessellator var9; ++ ++ if (this.strikethroughStyle) ++ { ++ var9 = Tessellator.instance; ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ var9.startDrawingQuads(); ++ var9.addVertex((double)this.posX, (double)(this.posY + (float)(this.FONT_HEIGHT / 2)), 0.0D); ++ var9.addVertex((double)(this.posX + var8), (double)(this.posY + (float)(this.FONT_HEIGHT / 2)), 0.0D); ++ var9.addVertex((double)(this.posX + var8), (double)(this.posY + (float)(this.FONT_HEIGHT / 2) - 1.0F), 0.0D); ++ var9.addVertex((double)this.posX, (double)(this.posY + (float)(this.FONT_HEIGHT / 2) - 1.0F), 0.0D); ++ var9.draw(); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ } ++ ++ if (this.underlineStyle) ++ { ++ var9 = Tessellator.instance; ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ var9.startDrawingQuads(); ++ int var10 = this.underlineStyle ? -1 : 0; ++ var9.addVertex((double)(this.posX + (float)var10), (double)(this.posY + (float)this.FONT_HEIGHT), 0.0D); ++ var9.addVertex((double)(this.posX + var8), (double)(this.posY + (float)this.FONT_HEIGHT), 0.0D); ++ var9.addVertex((double)(this.posX + var8), (double)(this.posY + (float)this.FONT_HEIGHT - 1.0F), 0.0D); ++ var9.addVertex((double)(this.posX + (float)var10), (double)(this.posY + (float)this.FONT_HEIGHT - 1.0F), 0.0D); ++ var9.draw(); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ } ++ ++ this.posX += (float)((int)var8); ++ } ++ } ++ } ++ ++ /** ++ * Render string either left or right aligned depending on bidiFlag ++ */ ++ private int renderStringAligned(String par1Str, int par2, int par3, int par4, int par5, boolean par6) ++ { ++ if (this.bidiFlag) ++ { ++ par1Str = this.bidiReorder(par1Str); ++ int var7 = this.getStringWidth(par1Str); ++ par2 = par2 + par4 - var7; ++ } ++ ++ return this.renderString(par1Str, par2, par3, par5, par6); ++ } ++ ++ /** ++ * Render single line string by setting GL color, current (posX,posY), and calling renderStringAtPos() ++ */ ++ private int renderString(String par1Str, int par2, int par3, int par4, boolean par5) ++ { ++ if (par1Str == null) ++ { ++ return 0; ++ } ++ else ++ { ++ if ((par4 & -67108864) == 0) ++ { ++ par4 |= -16777216; ++ } ++ ++ if (par5) ++ { ++ par4 = (par4 & 16579836) >> 2 | par4 & -16777216; ++ } ++ ++ this.red = (float)(par4 >> 16 & 255) / 255.0F; ++ this.blue = (float)(par4 >> 8 & 255) / 255.0F; ++ this.green = (float)(par4 & 255) / 255.0F; ++ this.alpha = (float)(par4 >> 24 & 255) / 255.0F; ++ GL11.glColor4f(this.red, this.blue, this.green, this.alpha); ++ this.posX = (float)par2; ++ this.posY = (float)par3; ++ this.renderStringAtPos(par1Str, par5); ++ return (int)this.posX; ++ } ++ } ++ ++ /** ++ * Returns the width of this string. Equivalent of FontMetrics.stringWidth(String s). ++ */ ++ public int getStringWidth(String par1Str) ++ { ++ if (par1Str == null) ++ { ++ return 0; ++ } ++ else ++ { ++ int var2 = 0; ++ boolean var3 = false; ++ ++ for (int var4 = 0; var4 < par1Str.length(); ++var4) ++ { ++ char var5 = par1Str.charAt(var4); ++ int var6 = this.getCharWidth(var5); ++ ++ if (var6 < 0 && var4 < par1Str.length() - 1) ++ { ++ ++var4; ++ var5 = par1Str.charAt(var4); ++ ++ if (var5 != 108 && var5 != 76) ++ { ++ if (var5 == 114 || var5 == 82) ++ { ++ var3 = false; ++ } ++ } ++ else ++ { ++ var3 = true; ++ } ++ ++ var6 = 0; ++ } ++ ++ var2 += var6; ++ ++ if (var3) ++ { ++ ++var2; ++ } ++ } ++ ++ return var2; ++ } ++ } ++ ++ /** ++ * Returns the width of this character as rendered. ++ */ ++ public int getCharWidth(char par1) ++ { ++ if (par1 == 167) ++ { ++ return -1; ++ } ++ else if (par1 == 32) ++ { ++ return 4; ++ } ++ else ++ { ++ int var2 = ChatAllowedCharacters.allowedCharacters.indexOf(par1); ++ ++ if (var2 >= 0 && !this.unicodeFlag) ++ { ++ return this.charWidth[var2 + 32]; ++ } ++ else if (this.glyphWidth[par1] != 0) ++ { ++ int var3 = this.glyphWidth[par1] >>> 4; ++ int var4 = this.glyphWidth[par1] & 15; ++ ++ if (var4 > 7) ++ { ++ var4 = 15; ++ var3 = 0; ++ } ++ ++ ++var4; ++ return (var4 - var3) / 2 + 1; ++ } ++ else ++ { ++ return 0; ++ } ++ } ++ } ++ ++ /** ++ * Trims a string to fit a specified Width. ++ */ ++ public String trimStringToWidth(String par1Str, int par2) ++ { ++ return this.trimStringToWidth(par1Str, par2, false); ++ } ++ ++ /** ++ * Trims a string to a specified width, and will reverse it if par3 is set. ++ */ ++ public String trimStringToWidth(String par1Str, int par2, boolean par3) ++ { ++ StringBuilder var4 = new StringBuilder(); ++ int var5 = 0; ++ int var6 = par3 ? par1Str.length() - 1 : 0; ++ int var7 = par3 ? -1 : 1; ++ boolean var8 = false; ++ boolean var9 = false; ++ ++ for (int var10 = var6; var10 >= 0 && var10 < par1Str.length() && var5 < par2; var10 += var7) ++ { ++ char var11 = par1Str.charAt(var10); ++ int var12 = this.getCharWidth(var11); ++ ++ if (var8) ++ { ++ var8 = false; ++ ++ if (var11 != 108 && var11 != 76) ++ { ++ if (var11 == 114 || var11 == 82) ++ { ++ var9 = false; ++ } ++ } ++ else ++ { ++ var9 = true; ++ } ++ } ++ else if (var12 < 0) ++ { ++ var8 = true; ++ } ++ else ++ { ++ var5 += var12; ++ ++ if (var9) ++ { ++ ++var5; ++ } ++ } ++ ++ if (var5 > par2) ++ { ++ break; ++ } ++ ++ if (par3) ++ { ++ var4.insert(0, var11); ++ } ++ else ++ { ++ var4.append(var11); ++ } ++ } ++ ++ return var4.toString(); ++ } ++ ++ /** ++ * Remove all newline characters from the end of the string ++ */ ++ private String trimStringNewline(String par1Str) ++ { ++ while (par1Str != null && par1Str.endsWith("\n")) ++ { ++ par1Str = par1Str.substring(0, par1Str.length() - 1); ++ } ++ ++ return par1Str; ++ } ++ ++ /** ++ * Splits and draws a String with wordwrap (maximum length is parameter k) ++ */ ++ public void drawSplitString(String par1Str, int par2, int par3, int par4, int par5) ++ { ++ this.resetStyles(); ++ this.textColor = par5; ++ par1Str = this.trimStringNewline(par1Str); ++ this.renderSplitString(par1Str, par2, par3, par4, false); ++ } ++ ++ /** ++ * Perform actual work of rendering a multi-line string with wordwrap and with darker drop shadow color if flag is ++ * set ++ */ ++ private void renderSplitString(String par1Str, int par2, int par3, int par4, boolean par5) ++ { ++ List var6 = this.listFormattedStringToWidth(par1Str, par4); ++ ++ for (Iterator var7 = var6.iterator(); var7.hasNext(); par3 += this.FONT_HEIGHT) ++ { ++ String var8 = (String)var7.next(); ++ this.renderStringAligned(var8, par2, par3, par4, this.textColor, par5); ++ } ++ } ++ ++ /** ++ * Returns the width of the wordwrapped String (maximum length is parameter k) ++ */ ++ public int splitStringWidth(String par1Str, int par2) ++ { ++ return this.FONT_HEIGHT * this.listFormattedStringToWidth(par1Str, par2).size(); ++ } ++ ++ /** ++ * Set unicodeFlag controlling whether strings should be rendered with Unicode fonts instead of the default.png ++ * font. ++ */ ++ public void setUnicodeFlag(boolean par1) ++ { ++ this.unicodeFlag = par1; ++ } ++ ++ /** ++ * Get unicodeFlag controlling whether strings should be rendered with Unicode fonts instead of the default.png ++ * font. ++ */ ++ public boolean getUnicodeFlag() ++ { ++ return this.unicodeFlag; ++ } ++ ++ /** ++ * Set bidiFlag to control if the Unicode Bidirectional Algorithm should be run before rendering any string. ++ */ ++ public void setBidiFlag(boolean par1) ++ { ++ this.bidiFlag = par1; ++ } ++ ++ /** ++ * Breaks a string into a list of pieces that will fit a specified width. ++ */ ++ public List listFormattedStringToWidth(String par1Str, int par2) ++ { ++ return Arrays.asList(this.wrapFormattedStringToWidth(par1Str, par2).split("\n")); ++ } ++ ++ /** ++ * Inserts newline and formatting into a string to wrap it within the specified width. ++ */ ++ String wrapFormattedStringToWidth(String par1Str, int par2) ++ { ++ int var3 = this.sizeStringToWidth(par1Str, par2); ++ ++ if (par1Str.length() <= var3) ++ { ++ return par1Str; ++ } ++ else ++ { ++ String var4 = par1Str.substring(0, var3); ++ char var5 = par1Str.charAt(var3); ++ boolean var6 = var5 == 32 || var5 == 10; ++ String var7 = getFormatFromString(var4) + par1Str.substring(var3 + (var6 ? 1 : 0)); ++ return var4 + "\n" + this.wrapFormattedStringToWidth(var7, par2); ++ } ++ } ++ ++ /** ++ * Determines how many characters from the string will fit into the specified width. ++ */ ++ private int sizeStringToWidth(String par1Str, int par2) ++ { ++ int var3 = par1Str.length(); ++ int var4 = 0; ++ int var5 = 0; ++ int var6 = -1; ++ ++ for (boolean var7 = false; var5 < var3; ++var5) ++ { ++ char var8 = par1Str.charAt(var5); ++ ++ switch (var8) ++ { ++ case 10: ++ --var5; ++ break; ++ ++ case 167: ++ if (var5 < var3 - 1) ++ { ++ ++var5; ++ char var9 = par1Str.charAt(var5); ++ ++ if (var9 != 108 && var9 != 76) ++ { ++ if (var9 == 114 || var9 == 82 || isFormatColor(var9)) ++ { ++ var7 = false; ++ } ++ } ++ else ++ { ++ var7 = true; ++ } ++ } ++ ++ break; ++ ++ case 32: ++ var6 = var5; ++ ++ default: ++ var4 += this.getCharWidth(var8); ++ ++ if (var7) ++ { ++ ++var4; ++ } ++ } ++ ++ if (var8 == 10) ++ { ++ ++var5; ++ var6 = var5; ++ break; ++ } ++ ++ if (var4 > par2) ++ { ++ break; ++ } ++ } ++ ++ return var5 != var3 && var6 != -1 && var6 < var5 ? var6 : var5; ++ } ++ ++ /** ++ * Checks if the char code is a hexadecimal character, used to set colour. ++ */ ++ private static boolean isFormatColor(char par0) ++ { ++ return par0 >= 48 && par0 <= 57 || par0 >= 97 && par0 <= 102 || par0 >= 65 && par0 <= 70; ++ } ++ ++ /** ++ * Checks if the char code is O-K...lLrRk-o... used to set special formatting. ++ */ ++ private static boolean isFormatSpecial(char par0) ++ { ++ return par0 >= 107 && par0 <= 111 || par0 >= 75 && par0 <= 79 || par0 == 114 || par0 == 82; ++ } ++ ++ /** ++ * Digests a string for nonprinting formatting characters then returns a string containing only that formatting. ++ */ ++ private static String getFormatFromString(String par0Str) ++ { ++ String var1 = ""; ++ int var2 = -1; ++ int var3 = par0Str.length(); ++ ++ while ((var2 = par0Str.indexOf(167, var2 + 1)) != -1) ++ { ++ if (var2 < var3 - 1) ++ { ++ char var4 = par0Str.charAt(var2 + 1); ++ ++ if (isFormatColor(var4)) ++ { ++ var1 = "\u00a7" + var4; ++ } ++ else if (isFormatSpecial(var4)) ++ { ++ var1 = var1 + "\u00a7" + var4; ++ } ++ } ++ } ++ ++ return var1; ++ } ++ ++ /** ++ * Get bidiFlag that controls if the Unicode Bidirectional Algorithm should be run before rendering any string ++ */ ++ public boolean getBidiFlag() ++ { ++ return this.bidiFlag; ++ } ++ } +*** FoodStats.java Sat Feb 5 04:13:13 2022 +--- FoodStats.java Sat Feb 5 04:12:34 2022 +*************** +*** 84,94 **** + this.foodTimer = 0; + } + } + + /** +! * Reads the food data for the player. + */ + public void readNBT(NBTTagCompound par1NBTTagCompound) + { + if (par1NBTTagCompound.hasKey("foodLevel")) + { +--- 84,94 ---- + this.foodTimer = 0; + } + } + + /** +! * Reads food stats from an NBT object. + */ + public void readNBT(NBTTagCompound par1NBTTagCompound) + { + if (par1NBTTagCompound.hasKey("foodLevel")) + { +*************** +*** 98,108 **** + this.foodExhaustionLevel = par1NBTTagCompound.getFloat("foodExhaustionLevel"); + } + } + + /** +! * Writes the food data for the player. + */ + public void writeNBT(NBTTagCompound par1NBTTagCompound) + { + par1NBTTagCompound.setInteger("foodLevel", this.foodLevel); + par1NBTTagCompound.setInteger("foodTickTimer", this.foodTimer); +--- 98,108 ---- + this.foodExhaustionLevel = par1NBTTagCompound.getFloat("foodExhaustionLevel"); + } + } + + /** +! * Writes food stats to an NBT object. + */ + public void writeNBT(NBTTagCompound par1NBTTagCompound) + { + par1NBTTagCompound.setInteger("foodLevel", this.foodLevel); + par1NBTTagCompound.setInteger("foodTickTimer", this.foodTimer); +*************** +*** 116,127 **** + public int getFoodLevel() + { + return this.foodLevel; + } + + /** +! * Get whether the player must eat food. + */ + public boolean needFood() + { + return this.foodLevel < 20; + } +--- 116,132 ---- + public int getFoodLevel() + { + return this.foodLevel; + } + ++ public int getPrevFoodLevel() ++ { ++ return this.prevFoodLevel; ++ } ++ + /** +! * If foodLevel is not max. + */ + public boolean needFood() + { + return this.foodLevel < 20; + } +*************** +*** 138,144 **** +--- 143,159 ---- + * Get the player's food saturation level. + */ + public float getSaturationLevel() + { + return this.foodSaturationLevel; ++ } ++ ++ public void setFoodLevel(int par1) ++ { ++ this.foodLevel = par1; ++ } ++ ++ public void setFoodSaturationLevel(float par1) ++ { ++ this.foodSaturationLevel = par1; + } + } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- Frustrum.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,32 ---- ++ package net.minecraft.src; ++ ++ public class Frustrum implements ICamera ++ { ++ private ClippingHelper clippingHelper = ClippingHelperImpl.getInstance(); ++ private double xPosition; ++ private double yPosition; ++ private double zPosition; ++ ++ public void setPosition(double par1, double par3, double par5) ++ { ++ this.xPosition = par1; ++ this.yPosition = par3; ++ this.zPosition = par5; ++ } ++ ++ /** ++ * Calls the clipping helper. Returns true if the box is inside all 6 clipping planes, otherwise returns false. ++ */ ++ public boolean isBoxInFrustum(double par1, double par3, double par5, double par7, double par9, double par11) ++ { ++ return this.clippingHelper.isBoxInFrustum(par1 - this.xPosition, par3 - this.yPosition, par5 - this.zPosition, par7 - this.xPosition, par9 - this.yPosition, par11 - this.zPosition); ++ } ++ ++ /** ++ * Returns true if the bounding box is inside all 6 clipping planes, otherwise returns false. ++ */ ++ public boolean isBoundingBoxInFrustum(AxisAlignedBB par1AxisAlignedBB) ++ { ++ return this.isBoxInFrustum(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ, par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ); ++ } ++ } +*** FurnaceRecipes.java Sat Feb 5 04:13:13 2022 +--- FurnaceRecipes.java Sat Feb 5 04:12:34 2022 +*** GameRules.java Sat Feb 5 04:13:13 2022 +--- GameRules.java Sat Feb 5 04:12:34 2022 +*** GameRuleValue.java Sat Feb 5 04:13:13 2022 +--- GameRuleValue.java Sat Feb 5 04:12:34 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GameSettings.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,866 ---- ++ package net.minecraft.src; ++ ++ import java.io.BufferedReader; ++ import java.io.File; ++ import java.io.FileReader; ++ import java.io.FileWriter; ++ import java.io.PrintWriter; ++ import org.lwjgl.input.Keyboard; ++ import org.lwjgl.input.Mouse; ++ import org.lwjgl.opengl.Display; ++ ++ public class GameSettings ++ { ++ private static final String[] RENDER_DISTANCES = new String[] {"options.renderDistance.far", "options.renderDistance.normal", "options.renderDistance.short", "options.renderDistance.tiny"}; ++ private static final String[] DIFFICULTIES = new String[] {"options.difficulty.peaceful", "options.difficulty.easy", "options.difficulty.normal", "options.difficulty.hard"}; ++ ++ /** GUI scale values */ ++ private static final String[] GUISCALES = new String[] {"options.guiScale.auto", "options.guiScale.small", "options.guiScale.normal", "options.guiScale.large"}; ++ private static final String[] CHAT_VISIBILITIES = new String[] {"options.chat.visibility.full", "options.chat.visibility.system", "options.chat.visibility.hidden"}; ++ private static final String[] PARTICLES = new String[] {"options.particles.all", "options.particles.decreased", "options.particles.minimal"}; ++ ++ /** Limit framerate labels */ ++ private static final String[] LIMIT_FRAMERATES = new String[] {"performance.max", "performance.balanced", "performance.powersaver"}; ++ private static final String[] AMBIENT_OCCLUSIONS = new String[] {"options.ao.off", "options.ao.min", "options.ao.max"}; ++ public float musicVolume = 1.0F; ++ public float soundVolume = 1.0F; ++ public float mouseSensitivity = 0.5F; ++ public boolean invertMouse; ++ public int renderDistance; ++ public boolean viewBobbing = true; ++ public boolean anaglyph; ++ ++ /** Advanced OpenGL */ ++ public boolean advancedOpengl; ++ public int limitFramerate = 1; ++ public boolean fancyGraphics = true; ++ ++ /** Smooth Lighting */ ++ public int ambientOcclusion = 2; ++ ++ /** Clouds flag */ ++ public boolean clouds = true; ++ ++ /** The name of the selected texture pack. */ ++ public String skin = "Default"; ++ public int chatVisibility; ++ public boolean chatColours = true; ++ public boolean chatLinks = true; ++ public boolean chatLinksPrompt = true; ++ public float chatOpacity = 1.0F; ++ public boolean serverTextures = true; ++ public boolean snooperEnabled = true; ++ public boolean fullScreen; ++ public boolean enableVsync = true; ++ public boolean hideServerAddress; ++ ++ /** ++ * Whether to show advanced information on item tooltips, toggled by F3+H ++ */ ++ public boolean advancedItemTooltips; ++ ++ /** Whether to pause when the game loses focus, toggled by F3+P */ ++ public boolean pauseOnLostFocus = true; ++ ++ /** Whether to show your cape */ ++ public boolean showCape = true; ++ public boolean touchscreen; ++ public int overrideWidth; ++ public int overrideHeight; ++ public boolean heldItemTooltips = true; ++ public float chatScale = 1.0F; ++ public float chatWidth = 1.0F; ++ public float chatHeightUnfocused = 0.44366196F; ++ public float chatHeightFocused = 1.0F; ++ public KeyBinding keyBindForward = new KeyBinding("key.forward", 17); ++ public KeyBinding keyBindLeft = new KeyBinding("key.left", 30); ++ public KeyBinding keyBindBack = new KeyBinding("key.back", 31); ++ public KeyBinding keyBindRight = new KeyBinding("key.right", 32); ++ public KeyBinding keyBindJump = new KeyBinding("key.jump", 57); ++ public KeyBinding keyBindInventory = new KeyBinding("key.inventory", 18); ++ public KeyBinding keyBindDrop = new KeyBinding("key.drop", 16); ++ public KeyBinding keyBindChat = new KeyBinding("key.chat", 20); ++ public KeyBinding keyBindSneak = new KeyBinding("key.sneak", 42); ++ public KeyBinding keyBindAttack = new KeyBinding("key.attack", -100); ++ public KeyBinding keyBindUseItem = new KeyBinding("key.use", -99); ++ public KeyBinding keyBindPlayerList = new KeyBinding("key.playerlist", 15); ++ public KeyBinding keyBindPickBlock = new KeyBinding("key.pickItem", -98); ++ public KeyBinding keyBindCommand = new KeyBinding("key.command", 53); ++ public KeyBinding[] keyBindings; ++ protected Minecraft mc; ++ private File optionsFile; ++ public int difficulty; ++ public boolean hideGUI; ++ public int thirdPersonView; ++ ++ /** true if debug info should be displayed instead of version */ ++ public boolean showDebugInfo; ++ public boolean showDebugProfilerChart; ++ ++ /** The lastServer string. */ ++ public String lastServer; ++ ++ /** No clipping for singleplayer */ ++ public boolean noclip; ++ ++ /** Smooth Camera Toggle */ ++ public boolean smoothCamera; ++ public boolean debugCamEnable; ++ ++ /** No clipping movement rate */ ++ public float noclipRate; ++ ++ /** Change rate for debug camera */ ++ public float debugCamRate; ++ public float fovSetting; ++ public float gammaSetting; ++ ++ /** GUI scale */ ++ public int guiScale; ++ ++ /** Determines amount of particles. 0 = All, 1 = Decreased, 2 = Minimal */ ++ public int particleSetting; ++ ++ /** Game settings language */ ++ public String language; ++ ++ public GameSettings(Minecraft par1Minecraft, File par2File) ++ { ++ this.keyBindings = new KeyBinding[] {this.keyBindAttack, this.keyBindUseItem, this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindPlayerList, this.keyBindPickBlock, this.keyBindCommand}; ++ this.difficulty = 2; ++ this.lastServer = ""; ++ this.noclipRate = 1.0F; ++ this.debugCamRate = 1.0F; ++ this.language = "en_US"; ++ this.mc = par1Minecraft; ++ this.optionsFile = new File(par2File, "options.txt"); ++ this.loadOptions(); ++ } ++ ++ public GameSettings() ++ { ++ this.keyBindings = new KeyBinding[] {this.keyBindAttack, this.keyBindUseItem, this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindPlayerList, this.keyBindPickBlock, this.keyBindCommand}; ++ this.difficulty = 2; ++ this.lastServer = ""; ++ this.noclipRate = 1.0F; ++ this.debugCamRate = 1.0F; ++ this.language = "en_US"; ++ } ++ ++ public String getKeyBindingDescription(int par1) ++ { ++ return I18n.getString(this.keyBindings[par1].keyDescription); ++ } ++ ++ /** ++ * The string that appears inside the button/slider in the options menu. ++ */ ++ public String getOptionDisplayString(int par1) ++ { ++ int var2 = this.keyBindings[par1].keyCode; ++ return getKeyDisplayString(var2); ++ } ++ ++ /** ++ * Represents a key or mouse button as a string. Args: key ++ */ ++ public static String getKeyDisplayString(int par0) ++ { ++ return par0 < 0 ? I18n.getStringParams("key.mouseButton", new Object[] {Integer.valueOf(par0 + 101)}): Keyboard.getKeyName(par0); ++ } ++ ++ /** ++ * Returns whether the specified key binding is currently being pressed. ++ */ ++ public static boolean isKeyDown(KeyBinding par0KeyBinding) ++ { ++ return par0KeyBinding.keyCode < 0 ? Mouse.isButtonDown(par0KeyBinding.keyCode + 100) : Keyboard.isKeyDown(par0KeyBinding.keyCode); ++ } ++ ++ /** ++ * Sets a key binding. ++ */ ++ public void setKeyBinding(int par1, int par2) ++ { ++ this.keyBindings[par1].keyCode = par2; ++ this.saveOptions(); ++ } ++ ++ /** ++ * If the specified option is controlled by a slider (float value), this will set the float value. ++ */ ++ public void setOptionFloatValue(EnumOptions par1EnumOptions, float par2) ++ { ++ if (par1EnumOptions == EnumOptions.MUSIC) ++ { ++ this.musicVolume = par2; ++ this.mc.sndManager.onSoundOptionsChanged(); ++ } ++ ++ if (par1EnumOptions == EnumOptions.SOUND) ++ { ++ this.soundVolume = par2; ++ this.mc.sndManager.onSoundOptionsChanged(); ++ } ++ ++ if (par1EnumOptions == EnumOptions.SENSITIVITY) ++ { ++ this.mouseSensitivity = par2; ++ } ++ ++ if (par1EnumOptions == EnumOptions.FOV) ++ { ++ this.fovSetting = par2; ++ } ++ ++ if (par1EnumOptions == EnumOptions.GAMMA) ++ { ++ this.gammaSetting = par2; ++ } ++ ++ if (par1EnumOptions == EnumOptions.CHAT_OPACITY) ++ { ++ this.chatOpacity = par2; ++ this.mc.ingameGUI.getChatGUI().func_96132_b(); ++ } ++ ++ if (par1EnumOptions == EnumOptions.CHAT_HEIGHT_FOCUSED) ++ { ++ this.chatHeightFocused = par2; ++ this.mc.ingameGUI.getChatGUI().func_96132_b(); ++ } ++ ++ if (par1EnumOptions == EnumOptions.CHAT_HEIGHT_UNFOCUSED) ++ { ++ this.chatHeightUnfocused = par2; ++ this.mc.ingameGUI.getChatGUI().func_96132_b(); ++ } ++ ++ if (par1EnumOptions == EnumOptions.CHAT_WIDTH) ++ { ++ this.chatWidth = par2; ++ this.mc.ingameGUI.getChatGUI().func_96132_b(); ++ } ++ ++ if (par1EnumOptions == EnumOptions.CHAT_SCALE) ++ { ++ this.chatScale = par2; ++ this.mc.ingameGUI.getChatGUI().func_96132_b(); ++ } ++ } ++ ++ /** ++ * For non-float options. Toggles the option on/off, or cycles through the list i.e. render distances. ++ */ ++ public void setOptionValue(EnumOptions par1EnumOptions, int par2) ++ { ++ if (par1EnumOptions == EnumOptions.INVERT_MOUSE) ++ { ++ this.invertMouse = !this.invertMouse; ++ } ++ ++ if (par1EnumOptions == EnumOptions.RENDER_DISTANCE) ++ { ++ this.renderDistance = this.renderDistance + par2 & 3; ++ } ++ ++ if (par1EnumOptions == EnumOptions.GUI_SCALE) ++ { ++ this.guiScale = this.guiScale + par2 & 3; ++ } ++ ++ if (par1EnumOptions == EnumOptions.PARTICLES) ++ { ++ this.particleSetting = (this.particleSetting + par2) % 3; ++ } ++ ++ if (par1EnumOptions == EnumOptions.VIEW_BOBBING) ++ { ++ this.viewBobbing = !this.viewBobbing; ++ } ++ ++ if (par1EnumOptions == EnumOptions.RENDER_CLOUDS) ++ { ++ this.clouds = !this.clouds; ++ } ++ ++ if (par1EnumOptions == EnumOptions.ADVANCED_OPENGL) ++ { ++ this.advancedOpengl = !this.advancedOpengl; ++ this.mc.renderGlobal.loadRenderers(); ++ } ++ ++ if (par1EnumOptions == EnumOptions.ANAGLYPH) ++ { ++ this.anaglyph = !this.anaglyph; ++ this.mc.refreshResources(); ++ } ++ ++ if (par1EnumOptions == EnumOptions.FRAMERATE_LIMIT) ++ { ++ this.limitFramerate = (this.limitFramerate + par2 + 3) % 3; ++ } ++ ++ if (par1EnumOptions == EnumOptions.DIFFICULTY) ++ { ++ this.difficulty = this.difficulty + par2 & 3; ++ } ++ ++ if (par1EnumOptions == EnumOptions.GRAPHICS) ++ { ++ this.fancyGraphics = !this.fancyGraphics; ++ this.mc.renderGlobal.loadRenderers(); ++ } ++ ++ if (par1EnumOptions == EnumOptions.AMBIENT_OCCLUSION) ++ { ++ this.ambientOcclusion = (this.ambientOcclusion + par2) % 3; ++ this.mc.renderGlobal.loadRenderers(); ++ } ++ ++ if (par1EnumOptions == EnumOptions.CHAT_VISIBILITY) ++ { ++ this.chatVisibility = (this.chatVisibility + par2) % 3; ++ } ++ ++ if (par1EnumOptions == EnumOptions.CHAT_COLOR) ++ { ++ this.chatColours = !this.chatColours; ++ } ++ ++ if (par1EnumOptions == EnumOptions.CHAT_LINKS) ++ { ++ this.chatLinks = !this.chatLinks; ++ } ++ ++ if (par1EnumOptions == EnumOptions.CHAT_LINKS_PROMPT) ++ { ++ this.chatLinksPrompt = !this.chatLinksPrompt; ++ } ++ ++ if (par1EnumOptions == EnumOptions.USE_SERVER_TEXTURES) ++ { ++ this.serverTextures = !this.serverTextures; ++ } ++ ++ if (par1EnumOptions == EnumOptions.SNOOPER_ENABLED) ++ { ++ this.snooperEnabled = !this.snooperEnabled; ++ } ++ ++ if (par1EnumOptions == EnumOptions.SHOW_CAPE) ++ { ++ this.showCape = !this.showCape; ++ } ++ ++ if (par1EnumOptions == EnumOptions.TOUCHSCREEN) ++ { ++ this.touchscreen = !this.touchscreen; ++ } ++ ++ if (par1EnumOptions == EnumOptions.USE_FULLSCREEN) ++ { ++ this.fullScreen = !this.fullScreen; ++ ++ if (this.mc.isFullScreen() != this.fullScreen) ++ { ++ this.mc.toggleFullscreen(); ++ } ++ } ++ ++ if (par1EnumOptions == EnumOptions.ENABLE_VSYNC) ++ { ++ this.enableVsync = !this.enableVsync; ++ Display.setVSyncEnabled(this.enableVsync); ++ } ++ ++ this.saveOptions(); ++ } ++ ++ public float getOptionFloatValue(EnumOptions par1EnumOptions) ++ { ++ return par1EnumOptions == EnumOptions.FOV ? this.fovSetting : (par1EnumOptions == EnumOptions.GAMMA ? this.gammaSetting : (par1EnumOptions == EnumOptions.MUSIC ? this.musicVolume : (par1EnumOptions == EnumOptions.SOUND ? this.soundVolume : (par1EnumOptions == EnumOptions.SENSITIVITY ? this.mouseSensitivity : (par1EnumOptions == EnumOptions.CHAT_OPACITY ? this.chatOpacity : (par1EnumOptions == EnumOptions.CHAT_HEIGHT_FOCUSED ? this.chatHeightFocused : (par1EnumOptions == EnumOptions.CHAT_HEIGHT_UNFOCUSED ? this.chatHeightUnfocused : (par1EnumOptions == EnumOptions.CHAT_SCALE ? this.chatScale : (par1EnumOptions == EnumOptions.CHAT_WIDTH ? this.chatWidth : 0.0F))))))))); ++ } ++ ++ public boolean getOptionOrdinalValue(EnumOptions par1EnumOptions) ++ { ++ switch (EnumOptionsHelper.enumOptionsMappingHelperArray[par1EnumOptions.ordinal()]) ++ { ++ case 1: ++ return this.invertMouse; ++ ++ case 2: ++ return this.viewBobbing; ++ ++ case 3: ++ return this.anaglyph; ++ ++ case 4: ++ return this.advancedOpengl; ++ ++ case 5: ++ return this.clouds; ++ ++ case 6: ++ return this.chatColours; ++ ++ case 7: ++ return this.chatLinks; ++ ++ case 8: ++ return this.chatLinksPrompt; ++ ++ case 9: ++ return this.serverTextures; ++ ++ case 10: ++ return this.snooperEnabled; ++ ++ case 11: ++ return this.fullScreen; ++ ++ case 12: ++ return this.enableVsync; ++ ++ case 13: ++ return this.showCape; ++ ++ case 14: ++ return this.touchscreen; ++ ++ default: ++ return false; ++ } ++ } ++ ++ /** ++ * Returns the translation of the given index in the given String array. If the index is smaller than 0 or greater ++ * than/equal to the length of the String array, it is changed to 0. ++ */ ++ private static String getTranslation(String[] par0ArrayOfStr, int par1) ++ { ++ if (par1 < 0 || par1 >= par0ArrayOfStr.length) ++ { ++ par1 = 0; ++ } ++ ++ return I18n.getString(par0ArrayOfStr[par1]); ++ } ++ ++ /** ++ * Gets a key binding. ++ */ ++ public String getKeyBinding(EnumOptions par1EnumOptions) ++ { ++ String var2 = I18n.getString(par1EnumOptions.getEnumString()) + ": "; ++ ++ if (par1EnumOptions.getEnumFloat()) ++ { ++ float var5 = this.getOptionFloatValue(par1EnumOptions); ++ return par1EnumOptions == EnumOptions.SENSITIVITY ? (var5 == 0.0F ? var2 + I18n.getString("options.sensitivity.min") : (var5 == 1.0F ? var2 + I18n.getString("options.sensitivity.max") : var2 + (int)(var5 * 200.0F) + "%")) : (par1EnumOptions == EnumOptions.FOV ? (var5 == 0.0F ? var2 + I18n.getString("options.fov.min") : (var5 == 1.0F ? var2 + I18n.getString("options.fov.max") : var2 + (int)(70.0F + var5 * 40.0F))) : (par1EnumOptions == EnumOptions.GAMMA ? (var5 == 0.0F ? var2 + I18n.getString("options.gamma.min") : (var5 == 1.0F ? var2 + I18n.getString("options.gamma.max") : var2 + "+" + (int)(var5 * 100.0F) + "%")) : (par1EnumOptions == EnumOptions.CHAT_OPACITY ? var2 + (int)(var5 * 90.0F + 10.0F) + "%" : (par1EnumOptions == EnumOptions.CHAT_HEIGHT_UNFOCUSED ? var2 + GuiNewChat.func_96130_b(var5) + "px" : (par1EnumOptions == EnumOptions.CHAT_HEIGHT_FOCUSED ? var2 + GuiNewChat.func_96130_b(var5) + "px" : (par1EnumOptions == EnumOptions.CHAT_WIDTH ? var2 + GuiNewChat.func_96128_a(var5) + "px" : (var5 == 0.0F ? var2 + I18n.getString("options.off") : var2 + (int)(var5 * 100.0F) + "%"))))))); ++ } ++ else if (par1EnumOptions.getEnumBoolean()) ++ { ++ boolean var4 = this.getOptionOrdinalValue(par1EnumOptions); ++ return var4 ? var2 + I18n.getString("options.on") : var2 + I18n.getString("options.off"); ++ } ++ else if (par1EnumOptions == EnumOptions.RENDER_DISTANCE) ++ { ++ return var2 + getTranslation(RENDER_DISTANCES, this.renderDistance); ++ } ++ else if (par1EnumOptions == EnumOptions.DIFFICULTY) ++ { ++ return var2 + getTranslation(DIFFICULTIES, this.difficulty); ++ } ++ else if (par1EnumOptions == EnumOptions.GUI_SCALE) ++ { ++ return var2 + getTranslation(GUISCALES, this.guiScale); ++ } ++ else if (par1EnumOptions == EnumOptions.CHAT_VISIBILITY) ++ { ++ return var2 + getTranslation(CHAT_VISIBILITIES, this.chatVisibility); ++ } ++ else if (par1EnumOptions == EnumOptions.PARTICLES) ++ { ++ return var2 + getTranslation(PARTICLES, this.particleSetting); ++ } ++ else if (par1EnumOptions == EnumOptions.FRAMERATE_LIMIT) ++ { ++ return var2 + getTranslation(LIMIT_FRAMERATES, this.limitFramerate); ++ } ++ else if (par1EnumOptions == EnumOptions.AMBIENT_OCCLUSION) ++ { ++ return var2 + getTranslation(AMBIENT_OCCLUSIONS, this.ambientOcclusion); ++ } ++ else if (par1EnumOptions == EnumOptions.GRAPHICS) ++ { ++ if (this.fancyGraphics) ++ { ++ return var2 + I18n.getString("options.graphics.fancy"); ++ } ++ else ++ { ++ String var3 = "options.graphics.fast"; ++ return var2 + I18n.getString("options.graphics.fast"); ++ } ++ } ++ else ++ { ++ return var2; ++ } ++ } ++ ++ /** ++ * Loads the options from the options file. It appears that this has replaced the previous 'loadOptions' ++ */ ++ public void loadOptions() ++ { ++ try ++ { ++ if (!this.optionsFile.exists()) ++ { ++ return; ++ } ++ ++ BufferedReader var1 = new BufferedReader(new FileReader(this.optionsFile)); ++ String var2 = ""; ++ ++ while ((var2 = var1.readLine()) != null) ++ { ++ try ++ { ++ String[] var3 = var2.split(":"); ++ ++ if (var3[0].equals("music")) ++ { ++ this.musicVolume = this.parseFloat(var3[1]); ++ } ++ ++ if (var3[0].equals("sound")) ++ { ++ this.soundVolume = this.parseFloat(var3[1]); ++ } ++ ++ if (var3[0].equals("mouseSensitivity")) ++ { ++ this.mouseSensitivity = this.parseFloat(var3[1]); ++ } ++ ++ if (var3[0].equals("fov")) ++ { ++ this.fovSetting = this.parseFloat(var3[1]); ++ } ++ ++ if (var3[0].equals("gamma")) ++ { ++ this.gammaSetting = this.parseFloat(var3[1]); ++ } ++ ++ if (var3[0].equals("invertYMouse")) ++ { ++ this.invertMouse = var3[1].equals("true"); ++ } ++ ++ if (var3[0].equals("viewDistance")) ++ { ++ this.renderDistance = Integer.parseInt(var3[1]); ++ } ++ ++ if (var3[0].equals("guiScale")) ++ { ++ this.guiScale = Integer.parseInt(var3[1]); ++ } ++ ++ if (var3[0].equals("particles")) ++ { ++ this.particleSetting = Integer.parseInt(var3[1]); ++ } ++ ++ if (var3[0].equals("bobView")) ++ { ++ this.viewBobbing = var3[1].equals("true"); ++ } ++ ++ if (var3[0].equals("anaglyph3d")) ++ { ++ this.anaglyph = var3[1].equals("true"); ++ } ++ ++ if (var3[0].equals("advancedOpengl")) ++ { ++ this.advancedOpengl = var3[1].equals("true"); ++ } ++ ++ if (var3[0].equals("fpsLimit")) ++ { ++ this.limitFramerate = Integer.parseInt(var3[1]); ++ } ++ ++ if (var3[0].equals("difficulty")) ++ { ++ this.difficulty = Integer.parseInt(var3[1]); ++ } ++ ++ if (var3[0].equals("fancyGraphics")) ++ { ++ this.fancyGraphics = var3[1].equals("true"); ++ } ++ ++ if (var3[0].equals("ao")) ++ { ++ if (var3[1].equals("true")) ++ { ++ this.ambientOcclusion = 2; ++ } ++ else if (var3[1].equals("false")) ++ { ++ this.ambientOcclusion = 0; ++ } ++ else ++ { ++ this.ambientOcclusion = Integer.parseInt(var3[1]); ++ } ++ } ++ ++ if (var3[0].equals("clouds")) ++ { ++ this.clouds = var3[1].equals("true"); ++ } ++ ++ if (var3[0].equals("skin")) ++ { ++ this.skin = var3[1]; ++ } ++ ++ if (var3[0].equals("lastServer") && var3.length >= 2) ++ { ++ this.lastServer = var2.substring(var2.indexOf(58) + 1); ++ } ++ ++ if (var3[0].equals("lang") && var3.length >= 2) ++ { ++ this.language = var3[1]; ++ } ++ ++ if (var3[0].equals("chatVisibility")) ++ { ++ this.chatVisibility = Integer.parseInt(var3[1]); ++ } ++ ++ if (var3[0].equals("chatColors")) ++ { ++ this.chatColours = var3[1].equals("true"); ++ } ++ ++ if (var3[0].equals("chatLinks")) ++ { ++ this.chatLinks = var3[1].equals("true"); ++ } ++ ++ if (var3[0].equals("chatLinksPrompt")) ++ { ++ this.chatLinksPrompt = var3[1].equals("true"); ++ } ++ ++ if (var3[0].equals("chatOpacity")) ++ { ++ this.chatOpacity = this.parseFloat(var3[1]); ++ } ++ ++ if (var3[0].equals("serverTextures")) ++ { ++ this.serverTextures = var3[1].equals("true"); ++ } ++ ++ if (var3[0].equals("snooperEnabled")) ++ { ++ this.snooperEnabled = var3[1].equals("true"); ++ } ++ ++ if (var3[0].equals("fullscreen")) ++ { ++ this.fullScreen = var3[1].equals("true"); ++ } ++ ++ if (var3[0].equals("enableVsync")) ++ { ++ this.enableVsync = var3[1].equals("true"); ++ } ++ ++ if (var3[0].equals("hideServerAddress")) ++ { ++ this.hideServerAddress = var3[1].equals("true"); ++ } ++ ++ if (var3[0].equals("advancedItemTooltips")) ++ { ++ this.advancedItemTooltips = var3[1].equals("true"); ++ } ++ ++ if (var3[0].equals("pauseOnLostFocus")) ++ { ++ this.pauseOnLostFocus = var3[1].equals("true"); ++ } ++ ++ if (var3[0].equals("showCape")) ++ { ++ this.showCape = var3[1].equals("true"); ++ } ++ ++ if (var3[0].equals("touchscreen")) ++ { ++ this.touchscreen = var3[1].equals("true"); ++ } ++ ++ if (var3[0].equals("overrideHeight")) ++ { ++ this.overrideHeight = Integer.parseInt(var3[1]); ++ } ++ ++ if (var3[0].equals("overrideWidth")) ++ { ++ this.overrideWidth = Integer.parseInt(var3[1]); ++ } ++ ++ if (var3[0].equals("heldItemTooltips")) ++ { ++ this.heldItemTooltips = var3[1].equals("true"); ++ } ++ ++ if (var3[0].equals("chatHeightFocused")) ++ { ++ this.chatHeightFocused = this.parseFloat(var3[1]); ++ } ++ ++ if (var3[0].equals("chatHeightUnfocused")) ++ { ++ this.chatHeightUnfocused = this.parseFloat(var3[1]); ++ } ++ ++ if (var3[0].equals("chatScale")) ++ { ++ this.chatScale = this.parseFloat(var3[1]); ++ } ++ ++ if (var3[0].equals("chatWidth")) ++ { ++ this.chatWidth = this.parseFloat(var3[1]); ++ } ++ ++ for (int var4 = 0; var4 < this.keyBindings.length; ++var4) ++ { ++ if (var3[0].equals("key_" + this.keyBindings[var4].keyDescription)) ++ { ++ this.keyBindings[var4].keyCode = Integer.parseInt(var3[1]); ++ } ++ } ++ } ++ catch (Exception var5) ++ { ++ this.mc.getLogAgent().logWarning("Skipping bad option: " + var2); ++ } ++ } ++ ++ KeyBinding.resetKeyBindingArrayAndHash(); ++ var1.close(); ++ } ++ catch (Exception var6) ++ { ++ this.mc.getLogAgent().logWarning("Failed to load options"); ++ var6.printStackTrace(); ++ } ++ } ++ ++ /** ++ * Parses a string into a float. ++ */ ++ private float parseFloat(String par1Str) ++ { ++ return par1Str.equals("true") ? 1.0F : (par1Str.equals("false") ? 0.0F : Float.parseFloat(par1Str)); ++ } ++ ++ /** ++ * Saves the options to the options file. ++ */ ++ public void saveOptions() ++ { ++ try ++ { ++ PrintWriter var1 = new PrintWriter(new FileWriter(this.optionsFile)); ++ var1.println("music:" + this.musicVolume); ++ var1.println("sound:" + this.soundVolume); ++ var1.println("invertYMouse:" + this.invertMouse); ++ var1.println("mouseSensitivity:" + this.mouseSensitivity); ++ var1.println("fov:" + this.fovSetting); ++ var1.println("gamma:" + this.gammaSetting); ++ var1.println("viewDistance:" + this.renderDistance); ++ var1.println("guiScale:" + this.guiScale); ++ var1.println("particles:" + this.particleSetting); ++ var1.println("bobView:" + this.viewBobbing); ++ var1.println("anaglyph3d:" + this.anaglyph); ++ var1.println("advancedOpengl:" + this.advancedOpengl); ++ var1.println("fpsLimit:" + this.limitFramerate); ++ var1.println("difficulty:" + this.difficulty); ++ var1.println("fancyGraphics:" + this.fancyGraphics); ++ var1.println("ao:" + this.ambientOcclusion); ++ var1.println("clouds:" + this.clouds); ++ var1.println("skin:" + this.skin); ++ var1.println("lastServer:" + this.lastServer); ++ var1.println("lang:" + this.language); ++ var1.println("chatVisibility:" + this.chatVisibility); ++ var1.println("chatColors:" + this.chatColours); ++ var1.println("chatLinks:" + this.chatLinks); ++ var1.println("chatLinksPrompt:" + this.chatLinksPrompt); ++ var1.println("chatOpacity:" + this.chatOpacity); ++ var1.println("serverTextures:" + this.serverTextures); ++ var1.println("snooperEnabled:" + this.snooperEnabled); ++ var1.println("fullscreen:" + this.fullScreen); ++ var1.println("enableVsync:" + this.enableVsync); ++ var1.println("hideServerAddress:" + this.hideServerAddress); ++ var1.println("advancedItemTooltips:" + this.advancedItemTooltips); ++ var1.println("pauseOnLostFocus:" + this.pauseOnLostFocus); ++ var1.println("showCape:" + this.showCape); ++ var1.println("touchscreen:" + this.touchscreen); ++ var1.println("overrideWidth:" + this.overrideWidth); ++ var1.println("overrideHeight:" + this.overrideHeight); ++ var1.println("heldItemTooltips:" + this.heldItemTooltips); ++ var1.println("chatHeightFocused:" + this.chatHeightFocused); ++ var1.println("chatHeightUnfocused:" + this.chatHeightUnfocused); ++ var1.println("chatScale:" + this.chatScale); ++ var1.println("chatWidth:" + this.chatWidth); ++ ++ for (int var2 = 0; var2 < this.keyBindings.length; ++var2) ++ { ++ var1.println("key_" + this.keyBindings[var2].keyDescription + ":" + this.keyBindings[var2].keyCode); ++ } ++ ++ var1.close(); ++ } ++ catch (Exception var3) ++ { ++ this.mc.getLogAgent().logWarning("Failed to save options"); ++ var3.printStackTrace(); ++ } ++ ++ this.sendSettingsToServer(); ++ } ++ ++ /** ++ * Send a client info packet with settings information to the server ++ */ ++ public void sendSettingsToServer() ++ { ++ if (this.mc.thePlayer != null) ++ { ++ this.mc.thePlayer.sendQueue.addToSendQueue(new Packet204ClientInfo(this.language, this.renderDistance, this.chatVisibility, this.chatColours, this.difficulty, this.showCape)); ++ } ++ } ++ ++ /** ++ * Should render clouds ++ */ ++ public boolean shouldRenderClouds() ++ { ++ return this.renderDistance < 2 && this.clouds; ++ } ++ } +*** GenLayer.java Sat Feb 5 04:13:13 2022 +--- GenLayer.java Sat Feb 5 04:12:34 2022 +*** GenLayerAddIsland.java Sat Feb 5 04:13:13 2022 +--- GenLayerAddIsland.java Sat Feb 5 04:12:34 2022 +*** GenLayerAddMushroomIsland.java Sat Feb 5 04:13:13 2022 +--- GenLayerAddMushroomIsland.java Sat Feb 5 04:12:34 2022 +*** GenLayerAddSnow.java Sat Feb 5 04:13:13 2022 +--- GenLayerAddSnow.java Sat Feb 5 04:12:34 2022 +*** GenLayerBiome.java Sat Feb 5 04:13:13 2022 +--- GenLayerBiome.java Sat Feb 5 04:12:34 2022 +*** GenLayerFuzzyZoom.java Sat Feb 5 04:13:13 2022 +--- GenLayerFuzzyZoom.java Sat Feb 5 04:12:34 2022 +*** GenLayerHills.java Sat Feb 5 04:13:13 2022 +--- GenLayerHills.java Sat Feb 5 04:12:34 2022 +*** GenLayerIsland.java Sat Feb 5 04:13:13 2022 +--- GenLayerIsland.java Sat Feb 5 04:12:34 2022 +*** GenLayerRiver.java Sat Feb 5 04:13:13 2022 +--- GenLayerRiver.java Sat Feb 5 04:12:34 2022 +*** GenLayerRiverInit.java Sat Feb 5 04:13:13 2022 +--- GenLayerRiverInit.java Sat Feb 5 04:12:34 2022 +*** GenLayerRiverMix.java Sat Feb 5 04:13:13 2022 +--- GenLayerRiverMix.java Sat Feb 5 04:12:34 2022 +*** GenLayerShore.java Sat Feb 5 04:13:13 2022 +--- GenLayerShore.java Sat Feb 5 04:12:34 2022 +*** GenLayerSmooth.java Sat Feb 5 04:13:13 2022 +--- GenLayerSmooth.java Sat Feb 5 04:12:34 2022 +*** GenLayerSwampRivers.java Sat Feb 5 04:13:13 2022 +--- GenLayerSwampRivers.java Sat Feb 5 04:12:34 2022 +*** GenLayerVoronoiZoom.java Sat Feb 5 04:13:13 2022 +--- GenLayerVoronoiZoom.java Sat Feb 5 04:12:34 2022 +*** GenLayerZoom.java Sat Feb 5 04:13:13 2022 +--- GenLayerZoom.java Sat Feb 5 04:12:34 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GLAllocation.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,86 ---- ++ package net.minecraft.src; ++ ++ import java.nio.ByteBuffer; ++ import java.nio.ByteOrder; ++ import java.nio.FloatBuffer; ++ import java.nio.IntBuffer; ++ import java.util.ArrayList; ++ import java.util.HashMap; ++ import java.util.Iterator; ++ import java.util.List; ++ import java.util.Map; ++ import java.util.Map.Entry; ++ import org.lwjgl.opengl.GL11; ++ ++ public class GLAllocation ++ { ++ private static final Map field_74531_a = new HashMap(); ++ private static final List field_74530_b = new ArrayList(); ++ ++ /** ++ * Generates the specified number of display lists and returns the first index. ++ */ ++ public static synchronized int generateDisplayLists(int par0) ++ { ++ int var1 = GL11.glGenLists(par0); ++ field_74531_a.put(Integer.valueOf(var1), Integer.valueOf(par0)); ++ return var1; ++ } ++ ++ public static synchronized void deleteDisplayLists(int par0) ++ { ++ GL11.glDeleteLists(par0, ((Integer)field_74531_a.remove(Integer.valueOf(par0))).intValue()); ++ } ++ ++ public static synchronized void func_98302_b() ++ { ++ for (int var0 = 0; var0 < field_74530_b.size(); ++var0) ++ { ++ GL11.glDeleteTextures(((Integer)field_74530_b.get(var0)).intValue()); ++ } ++ ++ field_74530_b.clear(); ++ } ++ ++ /** ++ * Deletes all textures and display lists. Called when Minecraft is shutdown to free up resources. ++ */ ++ public static synchronized void deleteTexturesAndDisplayLists() ++ { ++ Iterator var0 = field_74531_a.entrySet().iterator(); ++ ++ while (var0.hasNext()) ++ { ++ Entry var1 = (Entry)var0.next(); ++ GL11.glDeleteLists(((Integer)var1.getKey()).intValue(), ((Integer)var1.getValue()).intValue()); ++ } ++ ++ field_74531_a.clear(); ++ func_98302_b(); ++ } ++ ++ /** ++ * Creates and returns a direct byte buffer with the specified capacity. Applies native ordering to speed up access. ++ */ ++ public static synchronized ByteBuffer createDirectByteBuffer(int par0) ++ { ++ return ByteBuffer.allocateDirect(par0).order(ByteOrder.nativeOrder()); ++ } ++ ++ /** ++ * Creates and returns a direct int buffer with the specified capacity. Applies native ordering to speed up access. ++ */ ++ public static IntBuffer createDirectIntBuffer(int par0) ++ { ++ return createDirectByteBuffer(par0 << 2).asIntBuffer(); ++ } ++ ++ /** ++ * Creates and returns a direct float buffer with the specified capacity. Applies native ordering to speed up ++ * access. ++ */ ++ public static FloatBuffer createDirectFloatBuffer(int par0) ++ { ++ return createDirectByteBuffer(par0 << 2).asFloatBuffer(); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GrassColorReloadListener.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,20 ---- ++ package net.minecraft.src; ++ ++ import java.io.IOException; ++ ++ public class GrassColorReloadListener implements ResourceManagerReloadListener ++ { ++ private static final ResourceLocation field_130078_a = new ResourceLocation("textures/colormap/grass.png"); ++ ++ public void onResourceManagerReload(ResourceManager par1ResourceManager) ++ { ++ try ++ { ++ ColorizerGrass.setGrassBiomeColorizer(TextureUtil.readImageData(par1ResourceManager, field_130078_a)); ++ } ++ catch (IOException var3) ++ { ++ ; ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- Gui.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,151 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class Gui ++ { ++ public static final ResourceLocation optionsBackground = new ResourceLocation("textures/gui/options_background.png"); ++ public static final ResourceLocation statIcons = new ResourceLocation("textures/gui/container/stats_icons.png"); ++ public static final ResourceLocation icons = new ResourceLocation("textures/gui/icons.png"); ++ protected float zLevel; ++ ++ protected void drawHorizontalLine(int par1, int par2, int par3, int par4) ++ { ++ if (par2 < par1) ++ { ++ int var5 = par1; ++ par1 = par2; ++ par2 = var5; ++ } ++ ++ drawRect(par1, par3, par2 + 1, par3 + 1, par4); ++ } ++ ++ protected void drawVerticalLine(int par1, int par2, int par3, int par4) ++ { ++ if (par3 < par2) ++ { ++ int var5 = par2; ++ par2 = par3; ++ par3 = var5; ++ } ++ ++ drawRect(par1, par2 + 1, par1 + 1, par3, par4); ++ } ++ ++ /** ++ * Draws a solid color rectangle with the specified coordinates and color. Args: x1, y1, x2, y2, color ++ */ ++ public static void drawRect(int par0, int par1, int par2, int par3, int par4) ++ { ++ int var5; ++ ++ if (par0 < par2) ++ { ++ var5 = par0; ++ par0 = par2; ++ par2 = var5; ++ } ++ ++ if (par1 < par3) ++ { ++ var5 = par1; ++ par1 = par3; ++ par3 = var5; ++ } ++ ++ float var10 = (float)(par4 >> 24 & 255) / 255.0F; ++ float var6 = (float)(par4 >> 16 & 255) / 255.0F; ++ float var7 = (float)(par4 >> 8 & 255) / 255.0F; ++ float var8 = (float)(par4 & 255) / 255.0F; ++ Tessellator var9 = Tessellator.instance; ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ GL11.glColor4f(var6, var7, var8, var10); ++ var9.startDrawingQuads(); ++ var9.addVertex((double)par0, (double)par3, 0.0D); ++ var9.addVertex((double)par2, (double)par3, 0.0D); ++ var9.addVertex((double)par2, (double)par1, 0.0D); ++ var9.addVertex((double)par0, (double)par1, 0.0D); ++ var9.draw(); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ GL11.glDisable(GL11.GL_BLEND); ++ } ++ ++ /** ++ * Draws a rectangle with a vertical gradient between the specified colors. ++ */ ++ protected void drawGradientRect(int par1, int par2, int par3, int par4, int par5, int par6) ++ { ++ float var7 = (float)(par5 >> 24 & 255) / 255.0F; ++ float var8 = (float)(par5 >> 16 & 255) / 255.0F; ++ float var9 = (float)(par5 >> 8 & 255) / 255.0F; ++ float var10 = (float)(par5 & 255) / 255.0F; ++ float var11 = (float)(par6 >> 24 & 255) / 255.0F; ++ float var12 = (float)(par6 >> 16 & 255) / 255.0F; ++ float var13 = (float)(par6 >> 8 & 255) / 255.0F; ++ float var14 = (float)(par6 & 255) / 255.0F; ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glDisable(GL11.GL_ALPHA_TEST); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ GL11.glShadeModel(GL11.GL_SMOOTH); ++ Tessellator var15 = Tessellator.instance; ++ var15.startDrawingQuads(); ++ var15.setColorRGBA_F(var8, var9, var10, var7); ++ var15.addVertex((double)par3, (double)par2, (double)this.zLevel); ++ var15.addVertex((double)par1, (double)par2, (double)this.zLevel); ++ var15.setColorRGBA_F(var12, var13, var14, var11); ++ var15.addVertex((double)par1, (double)par4, (double)this.zLevel); ++ var15.addVertex((double)par3, (double)par4, (double)this.zLevel); ++ var15.draw(); ++ GL11.glShadeModel(GL11.GL_FLAT); ++ GL11.glDisable(GL11.GL_BLEND); ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ } ++ ++ /** ++ * Renders the specified text to the screen, center-aligned. ++ */ ++ public void drawCenteredString(FontRenderer par1FontRenderer, String par2Str, int par3, int par4, int par5) ++ { ++ par1FontRenderer.drawStringWithShadow(par2Str, par3 - par1FontRenderer.getStringWidth(par2Str) / 2, par4, par5); ++ } ++ ++ /** ++ * Renders the specified text to the screen. ++ */ ++ public void drawString(FontRenderer par1FontRenderer, String par2Str, int par3, int par4, int par5) ++ { ++ par1FontRenderer.drawStringWithShadow(par2Str, par3, par4, par5); ++ } ++ ++ /** ++ * Draws a textured rectangle at the stored z-value. Args: x, y, u, v, width, height ++ */ ++ public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) ++ { ++ float var7 = 0.00390625F; ++ float var8 = 0.00390625F; ++ Tessellator var9 = Tessellator.instance; ++ var9.startDrawingQuads(); ++ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + 0) * var7), (double)((float)(par4 + par6) * var8)); ++ var9.addVertexWithUV((double)(par1 + par5), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + par5) * var7), (double)((float)(par4 + par6) * var8)); ++ var9.addVertexWithUV((double)(par1 + par5), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + par5) * var7), (double)((float)(par4 + 0) * var8)); ++ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + 0) * var7), (double)((float)(par4 + 0) * var8)); ++ var9.draw(); ++ } ++ ++ public void drawTexturedModelRectFromIcon(int par1, int par2, Icon par3Icon, int par4, int par5) ++ { ++ Tessellator var6 = Tessellator.instance; ++ var6.startDrawingQuads(); ++ var6.addVertexWithUV((double)(par1 + 0), (double)(par2 + par5), (double)this.zLevel, (double)par3Icon.getMinU(), (double)par3Icon.getMaxV()); ++ var6.addVertexWithUV((double)(par1 + par4), (double)(par2 + par5), (double)this.zLevel, (double)par3Icon.getMaxU(), (double)par3Icon.getMaxV()); ++ var6.addVertexWithUV((double)(par1 + par4), (double)(par2 + 0), (double)this.zLevel, (double)par3Icon.getMaxU(), (double)par3Icon.getMinV()); ++ var6.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.zLevel, (double)par3Icon.getMinU(), (double)par3Icon.getMinV()); ++ var6.draw(); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiAchievement.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,150 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ import org.lwjgl.opengl.GL12; ++ ++ public class GuiAchievement extends Gui ++ { ++ private static final ResourceLocation achievementTextures = new ResourceLocation("textures/gui/achievement/achievement_background.png"); ++ ++ /** Holds the instance of the game (Minecraft) */ ++ private Minecraft theGame; ++ ++ /** Holds the latest width scaled to fit the game window. */ ++ private int achievementWindowWidth; ++ ++ /** Holds the latest height scaled to fit the game window. */ ++ private int achievementWindowHeight; ++ private String achievementGetLocalText; ++ private String achievementStatName; ++ ++ /** Holds the achievement that will be displayed on the GUI. */ ++ private Achievement theAchievement; ++ private long achievementTime; ++ ++ /** ++ * Holds a instance of RenderItem, used to draw the achievement icons on screen (is based on ItemStack) ++ */ ++ private RenderItem itemRender; ++ private boolean haveAchiement; ++ ++ public GuiAchievement(Minecraft par1Minecraft) ++ { ++ this.theGame = par1Minecraft; ++ this.itemRender = new RenderItem(); ++ } ++ ++ /** ++ * Queue a taken achievement to be displayed. ++ */ ++ public void queueTakenAchievement(Achievement par1Achievement) ++ { ++ this.achievementGetLocalText = I18n.getString("achievement.get"); ++ this.achievementStatName = I18n.getString(par1Achievement.getName()); ++ this.achievementTime = Minecraft.getSystemTime(); ++ this.theAchievement = par1Achievement; ++ this.haveAchiement = false; ++ } ++ ++ /** ++ * Queue a information about a achievement to be displayed. ++ */ ++ public void queueAchievementInformation(Achievement par1Achievement) ++ { ++ this.achievementGetLocalText = I18n.getString(par1Achievement.getName()); ++ this.achievementStatName = par1Achievement.getDescription(); ++ this.achievementTime = Minecraft.getSystemTime() - 2500L; ++ this.theAchievement = par1Achievement; ++ this.haveAchiement = true; ++ } ++ ++ /** ++ * Update the display of the achievement window to match the game window. ++ */ ++ private void updateAchievementWindowScale() ++ { ++ GL11.glViewport(0, 0, this.theGame.displayWidth, this.theGame.displayHeight); ++ GL11.glMatrixMode(GL11.GL_PROJECTION); ++ GL11.glLoadIdentity(); ++ GL11.glMatrixMode(GL11.GL_MODELVIEW); ++ GL11.glLoadIdentity(); ++ this.achievementWindowWidth = this.theGame.displayWidth; ++ this.achievementWindowHeight = this.theGame.displayHeight; ++ ScaledResolution var1 = new ScaledResolution(this.theGame.gameSettings, this.theGame.displayWidth, this.theGame.displayHeight); ++ this.achievementWindowWidth = var1.getScaledWidth(); ++ this.achievementWindowHeight = var1.getScaledHeight(); ++ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); ++ GL11.glMatrixMode(GL11.GL_PROJECTION); ++ GL11.glLoadIdentity(); ++ GL11.glOrtho(0.0D, (double)this.achievementWindowWidth, (double)this.achievementWindowHeight, 0.0D, 1000.0D, 3000.0D); ++ GL11.glMatrixMode(GL11.GL_MODELVIEW); ++ GL11.glLoadIdentity(); ++ GL11.glTranslatef(0.0F, 0.0F, -2000.0F); ++ } ++ ++ /** ++ * Updates the small achievement tooltip window, showing a queued achievement if is needed. ++ */ ++ public void updateAchievementWindow() ++ { ++ if (this.theAchievement != null && this.achievementTime != 0L) ++ { ++ double var1 = (double)(Minecraft.getSystemTime() - this.achievementTime) / 3000.0D; ++ ++ if (!this.haveAchiement && (var1 < 0.0D || var1 > 1.0D)) ++ { ++ this.achievementTime = 0L; ++ } ++ else ++ { ++ this.updateAchievementWindowScale(); ++ GL11.glDisable(GL11.GL_DEPTH_TEST); ++ GL11.glDepthMask(false); ++ double var3 = var1 * 2.0D; ++ ++ if (var3 > 1.0D) ++ { ++ var3 = 2.0D - var3; ++ } ++ ++ var3 *= 4.0D; ++ var3 = 1.0D - var3; ++ ++ if (var3 < 0.0D) ++ { ++ var3 = 0.0D; ++ } ++ ++ var3 *= var3; ++ var3 *= var3; ++ int var5 = this.achievementWindowWidth - 160; ++ int var6 = 0 - (int)(var3 * 36.0D); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ this.theGame.getTextureManager().bindTexture(achievementTextures); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ this.drawTexturedModalRect(var5, var6, 96, 202, 160, 32); ++ ++ if (this.haveAchiement) ++ { ++ this.theGame.fontRenderer.drawSplitString(this.achievementStatName, var5 + 30, var6 + 7, 120, -1); ++ } ++ else ++ { ++ this.theGame.fontRenderer.drawString(this.achievementGetLocalText, var5 + 30, var6 + 7, -256); ++ this.theGame.fontRenderer.drawString(this.achievementStatName, var5 + 30, var6 + 18, -1); ++ } ++ ++ RenderHelper.enableGUIStandardItemLighting(); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glEnable(GL12.GL_RESCALE_NORMAL); ++ GL11.glEnable(GL11.GL_COLOR_MATERIAL); ++ GL11.glEnable(GL11.GL_LIGHTING); ++ this.itemRender.renderItemAndEffectIntoGUI(this.theGame.fontRenderer, this.theGame.getTextureManager(), this.theAchievement.theItemStack, var5 + 8, var6 + 8); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glDepthMask(true); ++ GL11.glEnable(GL11.GL_DEPTH_TEST); ++ } ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiAchievements.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,463 ---- ++ package net.minecraft.src; ++ ++ import java.util.Random; ++ import org.lwjgl.input.Mouse; ++ import org.lwjgl.opengl.GL11; ++ import org.lwjgl.opengl.GL12; ++ ++ public class GuiAchievements extends GuiScreen ++ { ++ /** The top x coordinate of the achievement map */ ++ private static final int guiMapTop = AchievementList.minDisplayColumn * 24 - 112; ++ ++ /** The left y coordinate of the achievement map */ ++ private static final int guiMapLeft = AchievementList.minDisplayRow * 24 - 112; ++ ++ /** The bottom x coordinate of the achievement map */ ++ private static final int guiMapBottom = AchievementList.maxDisplayColumn * 24 - 77; ++ ++ /** The right y coordinate of the achievement map */ ++ private static final int guiMapRight = AchievementList.maxDisplayRow * 24 - 77; ++ private static final ResourceLocation achievementTextures = new ResourceLocation("textures/gui/achievement/achievement_background.png"); ++ protected int achievementsPaneWidth = 256; ++ protected int achievementsPaneHeight = 202; ++ ++ /** The current mouse x coordinate */ ++ protected int mouseX; ++ ++ /** The current mouse y coordinate */ ++ protected int mouseY; ++ protected double field_74117_m; ++ protected double field_74115_n; ++ ++ /** The x position of the achievement map */ ++ protected double guiMapX; ++ ++ /** The y position of the achievement map */ ++ protected double guiMapY; ++ protected double field_74124_q; ++ protected double field_74123_r; ++ ++ /** Whether the Mouse Button is down or not */ ++ private int isMouseButtonDown; ++ private StatFileWriter statFileWriter; ++ ++ public GuiAchievements(StatFileWriter par1StatFileWriter) ++ { ++ this.statFileWriter = par1StatFileWriter; ++ short var2 = 141; ++ short var3 = 141; ++ this.field_74117_m = this.guiMapX = this.field_74124_q = (double)(AchievementList.openInventory.displayColumn * 24 - var2 / 2 - 12); ++ this.field_74115_n = this.guiMapY = this.field_74123_r = (double)(AchievementList.openInventory.displayRow * 24 - var3 / 2); ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiSmallButton(1, this.width / 2 + 24, this.height / 2 + 74, 80, 20, I18n.getString("gui.done"))); ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ if (par1GuiButton.id == 1) ++ { ++ this.mc.displayGuiScreen((GuiScreen)null); ++ this.mc.setIngameFocus(); ++ } ++ ++ super.actionPerformed(par1GuiButton); ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) ++ { ++ if (par2 == this.mc.gameSettings.keyBindInventory.keyCode) ++ { ++ this.mc.displayGuiScreen((GuiScreen)null); ++ this.mc.setIngameFocus(); ++ } ++ else ++ { ++ super.keyTyped(par1, par2); ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ if (Mouse.isButtonDown(0)) ++ { ++ int var4 = (this.width - this.achievementsPaneWidth) / 2; ++ int var5 = (this.height - this.achievementsPaneHeight) / 2; ++ int var6 = var4 + 8; ++ int var7 = var5 + 17; ++ ++ if ((this.isMouseButtonDown == 0 || this.isMouseButtonDown == 1) && par1 >= var6 && par1 < var6 + 224 && par2 >= var7 && par2 < var7 + 155) ++ { ++ if (this.isMouseButtonDown == 0) ++ { ++ this.isMouseButtonDown = 1; ++ } ++ else ++ { ++ this.guiMapX -= (double)(par1 - this.mouseX); ++ this.guiMapY -= (double)(par2 - this.mouseY); ++ this.field_74124_q = this.field_74117_m = this.guiMapX; ++ this.field_74123_r = this.field_74115_n = this.guiMapY; ++ } ++ ++ this.mouseX = par1; ++ this.mouseY = par2; ++ } ++ ++ if (this.field_74124_q < (double)guiMapTop) ++ { ++ this.field_74124_q = (double)guiMapTop; ++ } ++ ++ if (this.field_74123_r < (double)guiMapLeft) ++ { ++ this.field_74123_r = (double)guiMapLeft; ++ } ++ ++ if (this.field_74124_q >= (double)guiMapBottom) ++ { ++ this.field_74124_q = (double)(guiMapBottom - 1); ++ } ++ ++ if (this.field_74123_r >= (double)guiMapRight) ++ { ++ this.field_74123_r = (double)(guiMapRight - 1); ++ } ++ } ++ else ++ { ++ this.isMouseButtonDown = 0; ++ } ++ ++ this.drawDefaultBackground(); ++ this.genAchievementBackground(par1, par2, par3); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glDisable(GL11.GL_DEPTH_TEST); ++ this.drawTitle(); ++ GL11.glEnable(GL11.GL_LIGHTING); ++ GL11.glEnable(GL11.GL_DEPTH_TEST); ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ this.field_74117_m = this.guiMapX; ++ this.field_74115_n = this.guiMapY; ++ double var1 = this.field_74124_q - this.guiMapX; ++ double var3 = this.field_74123_r - this.guiMapY; ++ ++ if (var1 * var1 + var3 * var3 < 4.0D) ++ { ++ this.guiMapX += var1; ++ this.guiMapY += var3; ++ } ++ else ++ { ++ this.guiMapX += var1 * 0.85D; ++ this.guiMapY += var3 * 0.85D; ++ } ++ } ++ ++ /** ++ * Draws the "Achievements" title at the top of the GUI. ++ */ ++ protected void drawTitle() ++ { ++ int var1 = (this.width - this.achievementsPaneWidth) / 2; ++ int var2 = (this.height - this.achievementsPaneHeight) / 2; ++ this.fontRenderer.drawString("Achievements", var1 + 15, var2 + 5, 4210752); ++ } ++ ++ protected void genAchievementBackground(int par1, int par2, float par3) ++ { ++ int var4 = MathHelper.floor_double(this.field_74117_m + (this.guiMapX - this.field_74117_m) * (double)par3); ++ int var5 = MathHelper.floor_double(this.field_74115_n + (this.guiMapY - this.field_74115_n) * (double)par3); ++ ++ if (var4 < guiMapTop) ++ { ++ var4 = guiMapTop; ++ } ++ ++ if (var5 < guiMapLeft) ++ { ++ var5 = guiMapLeft; ++ } ++ ++ if (var4 >= guiMapBottom) ++ { ++ var4 = guiMapBottom - 1; ++ } ++ ++ if (var5 >= guiMapRight) ++ { ++ var5 = guiMapRight - 1; ++ } ++ ++ int var6 = (this.width - this.achievementsPaneWidth) / 2; ++ int var7 = (this.height - this.achievementsPaneHeight) / 2; ++ int var8 = var6 + 16; ++ int var9 = var7 + 17; ++ this.zLevel = 0.0F; ++ GL11.glDepthFunc(GL11.GL_GEQUAL); ++ GL11.glPushMatrix(); ++ GL11.glTranslatef(0.0F, 0.0F, -200.0F); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glEnable(GL12.GL_RESCALE_NORMAL); ++ GL11.glEnable(GL11.GL_COLOR_MATERIAL); ++ int var10 = var4 + 288 >> 4; ++ int var11 = var5 + 288 >> 4; ++ int var12 = (var4 + 288) % 16; ++ int var13 = (var5 + 288) % 16; ++ boolean var14 = true; ++ boolean var15 = true; ++ boolean var16 = true; ++ boolean var17 = true; ++ boolean var18 = true; ++ Random var19 = new Random(); ++ int var20; ++ int var22; ++ int var23; ++ ++ for (var20 = 0; var20 * 16 - var13 < 155; ++var20) ++ { ++ float var21 = 0.6F - (float)(var11 + var20) / 25.0F * 0.3F; ++ GL11.glColor4f(var21, var21, var21, 1.0F); ++ ++ for (var22 = 0; var22 * 16 - var12 < 224; ++var22) ++ { ++ var19.setSeed((long)(1234 + var10 + var22)); ++ var19.nextInt(); ++ var23 = var19.nextInt(1 + var11 + var20) + (var11 + var20) / 2; ++ Icon var24 = Block.sand.getIcon(0, 0); ++ ++ if (var23 <= 37 && var11 + var20 != 35) ++ { ++ if (var23 == 22) ++ { ++ if (var19.nextInt(2) == 0) ++ { ++ var24 = Block.oreDiamond.getIcon(0, 0); ++ } ++ else ++ { ++ var24 = Block.oreRedstone.getIcon(0, 0); ++ } ++ } ++ else if (var23 == 10) ++ { ++ var24 = Block.oreIron.getIcon(0, 0); ++ } ++ else if (var23 == 8) ++ { ++ var24 = Block.oreCoal.getIcon(0, 0); ++ } ++ else if (var23 > 4) ++ { ++ var24 = Block.stone.getIcon(0, 0); ++ } ++ else if (var23 > 0) ++ { ++ var24 = Block.dirt.getIcon(0, 0); ++ } ++ } ++ else ++ { ++ var24 = Block.bedrock.getIcon(0, 0); ++ } ++ ++ this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); ++ this.drawTexturedModelRectFromIcon(var8 + var22 * 16 - var12, var9 + var20 * 16 - var13, var24, 16, 16); ++ } ++ } ++ ++ GL11.glEnable(GL11.GL_DEPTH_TEST); ++ GL11.glDepthFunc(GL11.GL_LEQUAL); ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ int var25; ++ int var28; ++ int var37; ++ ++ for (var20 = 0; var20 < AchievementList.achievementList.size(); ++var20) ++ { ++ Achievement var31 = (Achievement)AchievementList.achievementList.get(var20); ++ ++ if (var31.parentAchievement != null) ++ { ++ var22 = var31.displayColumn * 24 - var4 + 11 + var8; ++ var23 = var31.displayRow * 24 - var5 + 11 + var9; ++ var37 = var31.parentAchievement.displayColumn * 24 - var4 + 11 + var8; ++ var25 = var31.parentAchievement.displayRow * 24 - var5 + 11 + var9; ++ boolean var26 = this.statFileWriter.hasAchievementUnlocked(var31); ++ boolean var27 = this.statFileWriter.canUnlockAchievement(var31); ++ var28 = Math.sin((double)(Minecraft.getSystemTime() % 600L) / 600.0D * Math.PI * 2.0D) > 0.6D ? 255 : 130; ++ int var29 = -16777216; ++ ++ if (var26) ++ { ++ var29 = -9408400; ++ } ++ else if (var27) ++ { ++ var29 = 65280 + (var28 << 24); ++ } ++ ++ this.drawHorizontalLine(var22, var37, var23, var29); ++ this.drawVerticalLine(var37, var23, var25, var29); ++ } ++ } ++ ++ Achievement var30 = null; ++ RenderItem var32 = new RenderItem(); ++ RenderHelper.enableGUIStandardItemLighting(); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glEnable(GL12.GL_RESCALE_NORMAL); ++ GL11.glEnable(GL11.GL_COLOR_MATERIAL); ++ int var38; ++ int var39; ++ ++ for (var22 = 0; var22 < AchievementList.achievementList.size(); ++var22) ++ { ++ Achievement var33 = (Achievement)AchievementList.achievementList.get(var22); ++ var37 = var33.displayColumn * 24 - var4; ++ var25 = var33.displayRow * 24 - var5; ++ ++ if (var37 >= -24 && var25 >= -24 && var37 <= 224 && var25 <= 155) ++ { ++ float var36; ++ ++ if (this.statFileWriter.hasAchievementUnlocked(var33)) ++ { ++ var36 = 1.0F; ++ GL11.glColor4f(var36, var36, var36, 1.0F); ++ } ++ else if (this.statFileWriter.canUnlockAchievement(var33)) ++ { ++ var36 = Math.sin((double)(Minecraft.getSystemTime() % 600L) / 600.0D * Math.PI * 2.0D) < 0.6D ? 0.6F : 0.8F; ++ GL11.glColor4f(var36, var36, var36, 1.0F); ++ } ++ else ++ { ++ var36 = 0.3F; ++ GL11.glColor4f(var36, var36, var36, 1.0F); ++ } ++ ++ this.mc.getTextureManager().bindTexture(achievementTextures); ++ var38 = var8 + var37; ++ var39 = var9 + var25; ++ ++ if (var33.getSpecial()) ++ { ++ this.drawTexturedModalRect(var38 - 2, var39 - 2, 26, 202, 26, 26); ++ } ++ else ++ { ++ this.drawTexturedModalRect(var38 - 2, var39 - 2, 0, 202, 26, 26); ++ } ++ ++ if (!this.statFileWriter.canUnlockAchievement(var33)) ++ { ++ float var40 = 0.1F; ++ GL11.glColor4f(var40, var40, var40, 1.0F); ++ var32.renderWithColor = false; ++ } ++ ++ GL11.glEnable(GL11.GL_LIGHTING); ++ GL11.glEnable(GL11.GL_CULL_FACE); ++ var32.renderItemAndEffectIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), var33.theItemStack, var38 + 3, var39 + 3); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ ++ if (!this.statFileWriter.canUnlockAchievement(var33)) ++ { ++ var32.renderWithColor = true; ++ } ++ ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ ++ if (par1 >= var8 && par2 >= var9 && par1 < var8 + 224 && par2 < var9 + 155 && par1 >= var38 && par1 <= var38 + 22 && par2 >= var39 && par2 <= var39 + 22) ++ { ++ var30 = var33; ++ } ++ } ++ } ++ ++ GL11.glDisable(GL11.GL_DEPTH_TEST); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.mc.getTextureManager().bindTexture(achievementTextures); ++ this.drawTexturedModalRect(var6, var7, 0, 0, this.achievementsPaneWidth, this.achievementsPaneHeight); ++ GL11.glPopMatrix(); ++ this.zLevel = 0.0F; ++ GL11.glDepthFunc(GL11.GL_LEQUAL); ++ GL11.glDisable(GL11.GL_DEPTH_TEST); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ super.drawScreen(par1, par2, par3); ++ ++ if (var30 != null) ++ { ++ String var34 = I18n.getString(var30.getName()); ++ String var35 = var30.getDescription(); ++ var37 = par1 + 12; ++ var25 = par2 - 4; ++ ++ if (this.statFileWriter.canUnlockAchievement(var30)) ++ { ++ var38 = Math.max(this.fontRenderer.getStringWidth(var34), 120); ++ var39 = this.fontRenderer.splitStringWidth(var35, var38); ++ ++ if (this.statFileWriter.hasAchievementUnlocked(var30)) ++ { ++ var39 += 12; ++ } ++ ++ this.drawGradientRect(var37 - 3, var25 - 3, var37 + var38 + 3, var25 + var39 + 3 + 12, -1073741824, -1073741824); ++ this.fontRenderer.drawSplitString(var35, var37, var25 + 12, var38, -6250336); ++ ++ if (this.statFileWriter.hasAchievementUnlocked(var30)) ++ { ++ this.fontRenderer.drawStringWithShadow(I18n.getString("achievement.taken"), var37, var25 + var39 + 4, -7302913); ++ } ++ } ++ else ++ { ++ var38 = Math.max(this.fontRenderer.getStringWidth(var34), 120); ++ String var41 = I18n.getStringParams("achievement.requires", new Object[] {I18n.getString(var30.parentAchievement.getName())}); ++ var28 = this.fontRenderer.splitStringWidth(var41, var38); ++ this.drawGradientRect(var37 - 3, var25 - 3, var37 + var38 + 3, var25 + var28 + 12 + 3, -1073741824, -1073741824); ++ this.fontRenderer.drawSplitString(var41, var37, var25 + 12, var38, -9416624); ++ } ++ ++ this.fontRenderer.drawStringWithShadow(var34, var37, var25, this.statFileWriter.canUnlockAchievement(var30) ? (var30.getSpecial() ? -128 : -1) : (var30.getSpecial() ? -8355776 : -8355712)); ++ } ++ ++ GL11.glEnable(GL11.GL_DEPTH_TEST); ++ GL11.glEnable(GL11.GL_LIGHTING); ++ RenderHelper.disableStandardItemLighting(); ++ } ++ ++ /** ++ * Returns true if this GUI should pause the game when it is displayed in single-player ++ */ ++ public boolean doesGuiPauseGame() ++ { ++ return true; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiBeacon.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,212 ---- ++ package net.minecraft.src; ++ ++ import java.io.ByteArrayOutputStream; ++ import java.io.DataOutputStream; ++ import java.util.Iterator; ++ import org.lwjgl.opengl.GL11; ++ ++ public class GuiBeacon extends GuiContainer ++ { ++ private static final ResourceLocation beaconGuiTextures = new ResourceLocation("textures/gui/container/beacon.png"); ++ private TileEntityBeacon beacon; ++ private GuiBeaconButtonConfirm beaconConfirmButton; ++ private boolean buttonsNotDrawn; ++ ++ public GuiBeacon(InventoryPlayer par1InventoryPlayer, TileEntityBeacon par2TileEntityBeacon) ++ { ++ super(new ContainerBeacon(par1InventoryPlayer, par2TileEntityBeacon)); ++ this.beacon = par2TileEntityBeacon; ++ this.xSize = 230; ++ this.ySize = 219; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ super.initGui(); ++ this.buttonList.add(this.beaconConfirmButton = new GuiBeaconButtonConfirm(this, -1, this.guiLeft + 164, this.guiTop + 107)); ++ this.buttonList.add(new GuiBeaconButtonCancel(this, -2, this.guiLeft + 190, this.guiTop + 107)); ++ this.buttonsNotDrawn = true; ++ this.beaconConfirmButton.enabled = false; ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ super.updateScreen(); ++ ++ if (this.buttonsNotDrawn && this.beacon.getLevels() >= 0) ++ { ++ this.buttonsNotDrawn = false; ++ int var2; ++ int var3; ++ int var4; ++ int var5; ++ GuiBeaconButtonPower var6; ++ ++ for (int var1 = 0; var1 <= 2; ++var1) ++ { ++ var2 = TileEntityBeacon.effectsList[var1].length; ++ var3 = var2 * 22 + (var2 - 1) * 2; ++ ++ for (var4 = 0; var4 < var2; ++var4) ++ { ++ var5 = TileEntityBeacon.effectsList[var1][var4].id; ++ var6 = new GuiBeaconButtonPower(this, var1 << 8 | var5, this.guiLeft + 76 + var4 * 24 - var3 / 2, this.guiTop + 22 + var1 * 25, var5, var1); ++ this.buttonList.add(var6); ++ ++ if (var1 >= this.beacon.getLevels()) ++ { ++ var6.enabled = false; ++ } ++ else if (var5 == this.beacon.getPrimaryEffect()) ++ { ++ var6.func_82254_b(true); ++ } ++ } ++ } ++ ++ byte var7 = 3; ++ var2 = TileEntityBeacon.effectsList[var7].length + 1; ++ var3 = var2 * 22 + (var2 - 1) * 2; ++ ++ for (var4 = 0; var4 < var2 - 1; ++var4) ++ { ++ var5 = TileEntityBeacon.effectsList[var7][var4].id; ++ var6 = new GuiBeaconButtonPower(this, var7 << 8 | var5, this.guiLeft + 167 + var4 * 24 - var3 / 2, this.guiTop + 47, var5, var7); ++ this.buttonList.add(var6); ++ ++ if (var7 >= this.beacon.getLevels()) ++ { ++ var6.enabled = false; ++ } ++ else if (var5 == this.beacon.getSecondaryEffect()) ++ { ++ var6.func_82254_b(true); ++ } ++ } ++ ++ if (this.beacon.getPrimaryEffect() > 0) ++ { ++ GuiBeaconButtonPower var8 = new GuiBeaconButtonPower(this, var7 << 8 | this.beacon.getPrimaryEffect(), this.guiLeft + 167 + (var2 - 1) * 24 - var3 / 2, this.guiTop + 47, this.beacon.getPrimaryEffect(), var7); ++ this.buttonList.add(var8); ++ ++ if (var7 >= this.beacon.getLevels()) ++ { ++ var8.enabled = false; ++ } ++ else if (this.beacon.getPrimaryEffect() == this.beacon.getSecondaryEffect()) ++ { ++ var8.func_82254_b(true); ++ } ++ } ++ } ++ ++ this.beaconConfirmButton.enabled = this.beacon.getStackInSlot(0) != null && this.beacon.getPrimaryEffect() > 0; ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ if (par1GuiButton.id == -2) ++ { ++ this.mc.displayGuiScreen((GuiScreen)null); ++ } ++ else if (par1GuiButton.id == -1) ++ { ++ String var2 = "MC|Beacon"; ++ ByteArrayOutputStream var3 = new ByteArrayOutputStream(); ++ DataOutputStream var4 = new DataOutputStream(var3); ++ ++ try ++ { ++ var4.writeInt(this.beacon.getPrimaryEffect()); ++ var4.writeInt(this.beacon.getSecondaryEffect()); ++ this.mc.getNetHandler().addToSendQueue(new Packet250CustomPayload(var2, var3.toByteArray())); ++ } ++ catch (Exception var6) ++ { ++ var6.printStackTrace(); ++ } ++ ++ this.mc.displayGuiScreen((GuiScreen)null); ++ } ++ else if (par1GuiButton instanceof GuiBeaconButtonPower) ++ { ++ if (((GuiBeaconButtonPower)par1GuiButton).func_82255_b()) ++ { ++ return; ++ } ++ ++ int var7 = par1GuiButton.id; ++ int var8 = var7 & 255; ++ int var9 = var7 >> 8; ++ ++ if (var9 < 3) ++ { ++ this.beacon.setPrimaryEffect(var8); ++ } ++ else ++ { ++ this.beacon.setSecondaryEffect(var8); ++ } ++ ++ this.buttonList.clear(); ++ this.initGui(); ++ this.updateScreen(); ++ } ++ } ++ ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) ++ { ++ RenderHelper.disableStandardItemLighting(); ++ this.drawCenteredString(this.fontRenderer, I18n.getString("tile.beacon.primary"), 62, 10, 14737632); ++ this.drawCenteredString(this.fontRenderer, I18n.getString("tile.beacon.secondary"), 169, 10, 14737632); ++ Iterator var3 = this.buttonList.iterator(); ++ ++ while (var3.hasNext()) ++ { ++ GuiButton var4 = (GuiButton)var3.next(); ++ ++ if (var4.func_82252_a()) ++ { ++ var4.func_82251_b(par1 - this.guiLeft, par2 - this.guiTop); ++ break; ++ } ++ } ++ ++ RenderHelper.enableGUIStandardItemLighting(); ++ } ++ ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) ++ { ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.mc.getTextureManager().bindTexture(beaconGuiTextures); ++ int var4 = (this.width - this.xSize) / 2; ++ int var5 = (this.height - this.ySize) / 2; ++ this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); ++ itemRenderer.zLevel = 100.0F; ++ itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.getTextureManager(), new ItemStack(Item.emerald), var4 + 42, var5 + 109); ++ itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.getTextureManager(), new ItemStack(Item.diamond), var4 + 42 + 22, var5 + 109); ++ itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.getTextureManager(), new ItemStack(Item.ingotGold), var4 + 42 + 44, var5 + 109); ++ itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.getTextureManager(), new ItemStack(Item.ingotIron), var4 + 42 + 66, var5 + 109); ++ itemRenderer.zLevel = 0.0F; ++ } ++ ++ static ResourceLocation getBeaconGuiTextures() ++ { ++ return beaconGuiTextures; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiBeaconButton.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,67 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ class GuiBeaconButton extends GuiButton ++ { ++ /** Texture for this button. */ ++ private final ResourceLocation buttonTexture; ++ private final int field_82257_l; ++ private final int field_82258_m; ++ private boolean field_82256_n; ++ ++ protected GuiBeaconButton(int par1, int par2, int par3, ResourceLocation par4ResourceLocation, int par5, int par6) ++ { ++ super(par1, par2, par3, 22, 22, ""); ++ this.buttonTexture = par4ResourceLocation; ++ this.field_82257_l = par5; ++ this.field_82258_m = par6; ++ } ++ ++ /** ++ * Draws this button to the screen. ++ */ ++ public void drawButton(Minecraft par1Minecraft, int par2, int par3) ++ { ++ if (this.drawButton) ++ { ++ par1Minecraft.getTextureManager().bindTexture(GuiBeacon.getBeaconGuiTextures()); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.field_82253_i = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; ++ short var4 = 219; ++ int var5 = 0; ++ ++ if (!this.enabled) ++ { ++ var5 += this.width * 2; ++ } ++ else if (this.field_82256_n) ++ { ++ var5 += this.width * 1; ++ } ++ else if (this.field_82253_i) ++ { ++ var5 += this.width * 3; ++ } ++ ++ this.drawTexturedModalRect(this.xPosition, this.yPosition, var5, var4, this.width, this.height); ++ ++ if (!GuiBeacon.getBeaconGuiTextures().equals(this.buttonTexture)) ++ { ++ par1Minecraft.getTextureManager().bindTexture(this.buttonTexture); ++ } ++ ++ this.drawTexturedModalRect(this.xPosition + 2, this.yPosition + 2, this.field_82257_l, this.field_82258_m, 18, 18); ++ } ++ } ++ ++ public boolean func_82255_b() ++ { ++ return this.field_82256_n; ++ } ++ ++ public void func_82254_b(boolean par1) ++ { ++ this.field_82256_n = par1; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiBeaconButtonCancel.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,18 ---- ++ package net.minecraft.src; ++ ++ class GuiBeaconButtonCancel extends GuiBeaconButton ++ { ++ /** Beacon GUI this button belongs to. */ ++ final GuiBeacon beaconGui; ++ ++ public GuiBeaconButtonCancel(GuiBeacon par1GuiBeacon, int par2, int par3, int par4) ++ { ++ super(par2, par3, par4, GuiBeacon.getBeaconGuiTextures(), 112, 220); ++ this.beaconGui = par1GuiBeacon; ++ } ++ ++ public void func_82251_b(int par1, int par2) ++ { ++ this.beaconGui.drawCreativeTabHoveringText(I18n.getString("gui.cancel"), par1, par2); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiBeaconButtonConfirm.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,18 ---- ++ package net.minecraft.src; ++ ++ class GuiBeaconButtonConfirm extends GuiBeaconButton ++ { ++ /** Beacon GUI this button belongs to. */ ++ final GuiBeacon beaconGui; ++ ++ public GuiBeaconButtonConfirm(GuiBeacon par1GuiBeacon, int par2, int par3, int par4) ++ { ++ super(par2, par3, par4, GuiBeacon.getBeaconGuiTextures(), 90, 220); ++ this.beaconGui = par1GuiBeacon; ++ } ++ ++ public void func_82251_b(int par1, int par2) ++ { ++ this.beaconGui.drawCreativeTabHoveringText(I18n.getString("gui.done"), par1, par2); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiBeaconButtonPower.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,30 ---- ++ package net.minecraft.src; ++ ++ class GuiBeaconButtonPower extends GuiBeaconButton ++ { ++ private final int field_82261_l; ++ private final int field_82262_m; ++ ++ /** Beacon GUI this button belongs to. */ ++ final GuiBeacon beaconGui; ++ ++ public GuiBeaconButtonPower(GuiBeacon par1GuiBeacon, int par2, int par3, int par4, int par5, int par6) ++ { ++ super(par2, par3, par4, GuiContainer.field_110408_a, 0 + Potion.potionTypes[par5].getStatusIconIndex() % 8 * 18, 198 + Potion.potionTypes[par5].getStatusIconIndex() / 8 * 18); ++ this.beaconGui = par1GuiBeacon; ++ this.field_82261_l = par5; ++ this.field_82262_m = par6; ++ } ++ ++ public void func_82251_b(int par1, int par2) ++ { ++ String var3 = I18n.getString(Potion.potionTypes[this.field_82261_l].getName()); ++ ++ if (this.field_82262_m >= 3 && this.field_82261_l != Potion.regeneration.id) ++ { ++ var3 = var3 + " II"; ++ } ++ ++ this.beaconGui.drawCreativeTabHoveringText(var3, par1, par2); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiBrewingStand.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,85 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class GuiBrewingStand extends GuiContainer ++ { ++ private static final ResourceLocation brewingStandGuiTextures = new ResourceLocation("textures/gui/container/brewing_stand.png"); ++ private TileEntityBrewingStand brewingStand; ++ ++ public GuiBrewingStand(InventoryPlayer par1InventoryPlayer, TileEntityBrewingStand par2TileEntityBrewingStand) ++ { ++ super(new ContainerBrewingStand(par1InventoryPlayer, par2TileEntityBrewingStand)); ++ this.brewingStand = par2TileEntityBrewingStand; ++ } ++ ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) ++ { ++ String var3 = this.brewingStand.isInvNameLocalized() ? this.brewingStand.getInvName() : I18n.getString(this.brewingStand.getInvName()); ++ this.fontRenderer.drawString(var3, this.xSize / 2 - this.fontRenderer.getStringWidth(var3) / 2, 6, 4210752); ++ this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752); ++ } ++ ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) ++ { ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.mc.getTextureManager().bindTexture(brewingStandGuiTextures); ++ int var4 = (this.width - this.xSize) / 2; ++ int var5 = (this.height - this.ySize) / 2; ++ this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); ++ int var6 = this.brewingStand.getBrewTime(); ++ ++ if (var6 > 0) ++ { ++ int var7 = (int)(28.0F * (1.0F - (float)var6 / 400.0F)); ++ ++ if (var7 > 0) ++ { ++ this.drawTexturedModalRect(var4 + 97, var5 + 16, 176, 0, 9, var7); ++ } ++ ++ int var8 = var6 / 2 % 7; ++ ++ switch (var8) ++ { ++ case 0: ++ var7 = 29; ++ break; ++ ++ case 1: ++ var7 = 24; ++ break; ++ ++ case 2: ++ var7 = 20; ++ break; ++ ++ case 3: ++ var7 = 16; ++ break; ++ ++ case 4: ++ var7 = 11; ++ break; ++ ++ case 5: ++ var7 = 6; ++ break; ++ ++ case 6: ++ var7 = 0; ++ } ++ ++ if (var7 > 0) ++ { ++ this.drawTexturedModalRect(var4 + 65, var5 + 14 + 29 - var7, 185, 29 - var7, 12, var7); ++ } ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiButton.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,128 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class GuiButton extends Gui ++ { ++ protected static final ResourceLocation buttonTextures = new ResourceLocation("textures/gui/widgets.png"); ++ ++ /** Button width in pixels */ ++ protected int width; ++ ++ /** Button height in pixels */ ++ protected int height; ++ ++ /** The x position of this control. */ ++ public int xPosition; ++ ++ /** The y position of this control. */ ++ public int yPosition; ++ ++ /** The string displayed on this control. */ ++ public String displayString; ++ ++ /** ID for this control. */ ++ public int id; ++ ++ /** True if this control is enabled, false to disable. */ ++ public boolean enabled; ++ ++ /** Hides the button completely if false. */ ++ public boolean drawButton; ++ protected boolean field_82253_i; ++ ++ public GuiButton(int par1, int par2, int par3, String par4Str) ++ { ++ this(par1, par2, par3, 200, 20, par4Str); ++ } ++ ++ public GuiButton(int par1, int par2, int par3, int par4, int par5, String par6Str) ++ { ++ this.width = 200; ++ this.height = 20; ++ this.enabled = true; ++ this.drawButton = true; ++ this.id = par1; ++ this.xPosition = par2; ++ this.yPosition = par3; ++ this.width = par4; ++ this.height = par5; ++ this.displayString = par6Str; ++ } ++ ++ /** ++ * Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over ++ * this button. ++ */ ++ protected int getHoverState(boolean par1) ++ { ++ byte var2 = 1; ++ ++ if (!this.enabled) ++ { ++ var2 = 0; ++ } ++ else if (par1) ++ { ++ var2 = 2; ++ } ++ ++ return var2; ++ } ++ ++ /** ++ * Draws this button to the screen. ++ */ ++ public void drawButton(Minecraft par1Minecraft, int par2, int par3) ++ { ++ if (this.drawButton) ++ { ++ FontRenderer var4 = par1Minecraft.fontRenderer; ++ par1Minecraft.getTextureManager().bindTexture(buttonTextures); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.field_82253_i = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; ++ int var5 = this.getHoverState(this.field_82253_i); ++ this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + var5 * 20, this.width / 2, this.height); ++ this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + var5 * 20, this.width / 2, this.height); ++ this.mouseDragged(par1Minecraft, par2, par3); ++ int var6 = 14737632; ++ ++ if (!this.enabled) ++ { ++ var6 = -6250336; ++ } ++ else if (this.field_82253_i) ++ { ++ var6 = 16777120; ++ } ++ ++ this.drawCenteredString(var4, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, var6); ++ } ++ } ++ ++ /** ++ * Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e). ++ */ ++ protected void mouseDragged(Minecraft par1Minecraft, int par2, int par3) {} ++ ++ /** ++ * Fired when the mouse button is released. Equivalent of MouseListener.mouseReleased(MouseEvent e). ++ */ ++ public void mouseReleased(int par1, int par2) {} ++ ++ /** ++ * Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent ++ * e). ++ */ ++ public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3) ++ { ++ return this.enabled && this.drawButton && par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; ++ } ++ ++ public boolean func_82252_a() ++ { ++ return this.field_82253_i; ++ } ++ ++ public void func_82251_b(int par1, int par2) {} ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiButtonLanguage.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,32 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class GuiButtonLanguage extends GuiButton ++ { ++ public GuiButtonLanguage(int par1, int par2, int par3) ++ { ++ super(par1, par2, par3, 20, 20, ""); ++ } ++ ++ /** ++ * Draws this button to the screen. ++ */ ++ public void drawButton(Minecraft par1Minecraft, int par2, int par3) ++ { ++ if (this.drawButton) ++ { ++ par1Minecraft.getTextureManager().bindTexture(GuiButton.buttonTextures); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ boolean var4 = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; ++ int var5 = 106; ++ ++ if (var4) ++ { ++ var5 += this.height; ++ } ++ ++ this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, var5, this.width, this.height); ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiButtonLink.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,26 ---- ++ package net.minecraft.src; ++ ++ import java.net.URI; ++ ++ public class GuiButtonLink extends GuiButton ++ { ++ public GuiButtonLink(int par1, int par2, int par3, int par4, int par5, String par6Str) ++ { ++ super(par1, par2, par3, par4, par5, par6Str); ++ } ++ ++ public void func_96135_a(String par1Str) ++ { ++ try ++ { ++ URI var2 = new URI(par1Str); ++ Class var3 = Class.forName("java.awt.Desktop"); ++ Object var4 = var3.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); ++ var3.getMethod("browse", new Class[] {URI.class}).invoke(var4, new Object[] {var2}); ++ } ++ catch (Throwable var5) ++ { ++ var5.printStackTrace(); ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiButtonMerchant.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,48 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ class GuiButtonMerchant extends GuiButton ++ { ++ /** ++ * If true, then next page button will face to right, if false then next page button will face to left. ++ */ ++ private final boolean mirrored; ++ ++ public GuiButtonMerchant(int par1, int par2, int par3, boolean par4) ++ { ++ super(par1, par2, par3, 12, 19, ""); ++ this.mirrored = par4; ++ } ++ ++ /** ++ * Draws this button to the screen. ++ */ ++ public void drawButton(Minecraft par1Minecraft, int par2, int par3) ++ { ++ if (this.drawButton) ++ { ++ par1Minecraft.getTextureManager().bindTexture(GuiMerchant.func_110417_h()); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ boolean var4 = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; ++ int var5 = 0; ++ int var6 = 176; ++ ++ if (!this.enabled) ++ { ++ var6 += this.width * 2; ++ } ++ else if (var4) ++ { ++ var6 += this.width; ++ } ++ ++ if (!this.mirrored) ++ { ++ var5 += this.height; ++ } ++ ++ this.drawTexturedModalRect(this.xPosition, this.yPosition, var6, var5, this.width, this.height); ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiButtonNextPage.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,44 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ class GuiButtonNextPage extends GuiButton ++ { ++ /** ++ * True for pointing right (next page), false for pointing left (previous page). ++ */ ++ private final boolean nextPage; ++ ++ public GuiButtonNextPage(int par1, int par2, int par3, boolean par4) ++ { ++ super(par1, par2, par3, 23, 13, ""); ++ this.nextPage = par4; ++ } ++ ++ /** ++ * Draws this button to the screen. ++ */ ++ public void drawButton(Minecraft par1Minecraft, int par2, int par3) ++ { ++ if (this.drawButton) ++ { ++ boolean var4 = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ par1Minecraft.getTextureManager().bindTexture(GuiScreenBook.func_110404_g()); ++ int var5 = 0; ++ int var6 = 192; ++ ++ if (var4) ++ { ++ var5 += 23; ++ } ++ ++ if (!this.nextPage) ++ { ++ var6 += 13; ++ } ++ ++ this.drawTexturedModalRect(this.xPosition, this.yPosition, var5, var6, 23, 13); ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiChat.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,371 ---- ++ package net.minecraft.src; ++ ++ import java.net.URI; ++ import java.util.ArrayList; ++ import java.util.Iterator; ++ import java.util.List; ++ import org.lwjgl.input.Keyboard; ++ import org.lwjgl.input.Mouse; ++ ++ public class GuiChat extends GuiScreen ++ { ++ private String field_73898_b = ""; ++ ++ /** ++ * keeps position of which chat message you will select when you press up, (does not increase for duplicated ++ * messages sent immediately after each other) ++ */ ++ private int sentHistoryCursor = -1; ++ private boolean field_73897_d; ++ private boolean field_73905_m; ++ private int field_73903_n; ++ private List field_73904_o = new ArrayList(); ++ ++ /** used to pass around the URI to various dialogues and to the host os */ ++ private URI clickedURI; ++ ++ /** Chat entry field */ ++ protected GuiTextField inputField; ++ ++ /** ++ * is the text that appears when you press the chat key and the input box appears pre-filled ++ */ ++ private String defaultInputFieldText = ""; ++ ++ public GuiChat() {} ++ ++ public GuiChat(String par1Str) ++ { ++ this.defaultInputFieldText = par1Str; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ Keyboard.enableRepeatEvents(true); ++ this.sentHistoryCursor = this.mc.ingameGUI.getChatGUI().getSentMessages().size(); ++ this.inputField = new GuiTextField(this.fontRenderer, 4, this.height - 12, this.width - 4, 12); ++ this.inputField.setMaxStringLength(100); ++ this.inputField.setEnableBackgroundDrawing(false); ++ this.inputField.setFocused(true); ++ this.inputField.setText(this.defaultInputFieldText); ++ this.inputField.setCanLoseFocus(false); ++ } ++ ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ ++ public void onGuiClosed() ++ { ++ Keyboard.enableRepeatEvents(false); ++ this.mc.ingameGUI.getChatGUI().resetScroll(); ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ this.inputField.updateCursorCounter(); ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) ++ { ++ this.field_73905_m = false; ++ ++ if (par2 == 15) ++ { ++ this.completePlayerName(); ++ } ++ else ++ { ++ this.field_73897_d = false; ++ } ++ ++ if (par2 == 1) ++ { ++ this.mc.displayGuiScreen((GuiScreen)null); ++ } ++ else if (par2 != 28 && par2 != 156) ++ { ++ if (par2 == 200) ++ { ++ this.getSentHistory(-1); ++ } ++ else if (par2 == 208) ++ { ++ this.getSentHistory(1); ++ } ++ else if (par2 == 201) ++ { ++ this.mc.ingameGUI.getChatGUI().scroll(this.mc.ingameGUI.getChatGUI().func_96127_i() - 1); ++ } ++ else if (par2 == 209) ++ { ++ this.mc.ingameGUI.getChatGUI().scroll(-this.mc.ingameGUI.getChatGUI().func_96127_i() + 1); ++ } ++ else ++ { ++ this.inputField.textboxKeyTyped(par1, par2); ++ } ++ } ++ else ++ { ++ String var3 = this.inputField.getText().trim(); ++ ++ if (var3.length() > 0) ++ { ++ this.mc.ingameGUI.getChatGUI().addToSentMessages(var3); ++ ++ if (!this.mc.handleClientCommand(var3)) ++ { ++ this.mc.thePlayer.sendChatMessage(var3); ++ } ++ } ++ ++ this.mc.displayGuiScreen((GuiScreen)null); ++ } ++ } ++ ++ /** ++ * Handles mouse input. ++ */ ++ public void handleMouseInput() ++ { ++ super.handleMouseInput(); ++ int var1 = Mouse.getEventDWheel(); ++ ++ if (var1 != 0) ++ { ++ if (var1 > 1) ++ { ++ var1 = 1; ++ } ++ ++ if (var1 < -1) ++ { ++ var1 = -1; ++ } ++ ++ if (!isShiftKeyDown()) ++ { ++ var1 *= 7; ++ } ++ ++ this.mc.ingameGUI.getChatGUI().scroll(var1); ++ } ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) ++ { ++ if (par3 == 0 && this.mc.gameSettings.chatLinks) ++ { ++ ChatClickData var4 = this.mc.ingameGUI.getChatGUI().func_73766_a(Mouse.getX(), Mouse.getY()); ++ ++ if (var4 != null) ++ { ++ URI var5 = var4.getURI(); ++ ++ if (var5 != null) ++ { ++ if (this.mc.gameSettings.chatLinksPrompt) ++ { ++ this.clickedURI = var5; ++ this.mc.displayGuiScreen(new GuiConfirmOpenLink(this, var4.getClickedUrl(), 0, false)); ++ } ++ else ++ { ++ this.func_73896_a(var5); ++ } ++ ++ return; ++ } ++ } ++ } ++ ++ this.inputField.mouseClicked(par1, par2, par3); ++ super.mouseClicked(par1, par2, par3); ++ } ++ ++ public void confirmClicked(boolean par1, int par2) ++ { ++ if (par2 == 0) ++ { ++ if (par1) ++ { ++ this.func_73896_a(this.clickedURI); ++ } ++ ++ this.clickedURI = null; ++ this.mc.displayGuiScreen(this); ++ } ++ } ++ ++ private void func_73896_a(URI par1URI) ++ { ++ try ++ { ++ Class var2 = Class.forName("java.awt.Desktop"); ++ Object var3 = var2.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); ++ var2.getMethod("browse", new Class[] {URI.class}).invoke(var3, new Object[] {par1URI}); ++ } ++ catch (Throwable var4) ++ { ++ var4.printStackTrace(); ++ } ++ } ++ ++ /** ++ * Autocompletes player name ++ */ ++ public void completePlayerName() ++ { ++ String var3; ++ ++ if (this.field_73897_d) ++ { ++ this.inputField.deleteFromCursor(this.inputField.func_73798_a(-1, this.inputField.getCursorPosition(), false) - this.inputField.getCursorPosition()); ++ ++ if (this.field_73903_n >= this.field_73904_o.size()) ++ { ++ this.field_73903_n = 0; ++ } ++ } ++ else ++ { ++ int var1 = this.inputField.func_73798_a(-1, this.inputField.getCursorPosition(), false); ++ this.field_73904_o.clear(); ++ this.field_73903_n = 0; ++ String var2 = this.inputField.getText().substring(var1).toLowerCase(); ++ var3 = this.inputField.getText().substring(0, this.inputField.getCursorPosition()); ++ this.func_73893_a(var3, var2); ++ ++ if (this.field_73904_o.isEmpty()) ++ { ++ return; ++ } ++ ++ this.field_73897_d = true; ++ this.inputField.deleteFromCursor(var1 - this.inputField.getCursorPosition()); ++ } ++ ++ if (this.field_73904_o.size() > 1) ++ { ++ StringBuilder var4 = new StringBuilder(); ++ ++ for (Iterator var5 = this.field_73904_o.iterator(); var5.hasNext(); var4.append(var3)) ++ { ++ var3 = (String)var5.next(); ++ ++ if (var4.length() > 0) ++ { ++ var4.append(", "); ++ } ++ } ++ ++ this.mc.ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(var4.toString(), 1); ++ } ++ ++ this.inputField.writeText((String)this.field_73904_o.get(this.field_73903_n++)); ++ } ++ ++ private void func_73893_a(String par1Str, String par2Str) ++ { ++ if (par1Str.length() >= 1) ++ { ++ this.mc.thePlayer.sendQueue.addToSendQueue(new Packet203AutoComplete(par1Str)); ++ this.field_73905_m = true; ++ } ++ } ++ ++ /** ++ * input is relative and is applied directly to the sentHistoryCursor so -1 is the previous message, 1 is the next ++ * message from the current cursor position ++ */ ++ public void getSentHistory(int par1) ++ { ++ int var2 = this.sentHistoryCursor + par1; ++ int var3 = this.mc.ingameGUI.getChatGUI().getSentMessages().size(); ++ ++ if (var2 < 0) ++ { ++ var2 = 0; ++ } ++ ++ if (var2 > var3) ++ { ++ var2 = var3; ++ } ++ ++ if (var2 != this.sentHistoryCursor) ++ { ++ if (var2 == var3) ++ { ++ this.sentHistoryCursor = var3; ++ this.inputField.setText(this.field_73898_b); ++ } ++ else ++ { ++ if (this.sentHistoryCursor == var3) ++ { ++ this.field_73898_b = this.inputField.getText(); ++ } ++ ++ this.inputField.setText((String)this.mc.ingameGUI.getChatGUI().getSentMessages().get(var2)); ++ this.sentHistoryCursor = var2; ++ } ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ drawRect(2, this.height - 14, this.width - 2, this.height - 2, Integer.MIN_VALUE); ++ this.inputField.drawTextBox(); ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ public void func_73894_a(String[] par1ArrayOfStr) ++ { ++ if (this.field_73905_m) ++ { ++ this.field_73904_o.clear(); ++ String[] var2 = par1ArrayOfStr; ++ int var3 = par1ArrayOfStr.length; ++ ++ for (int var4 = 0; var4 < var3; ++var4) ++ { ++ String var5 = var2[var4]; ++ ++ if (var5.length() > 0) ++ { ++ this.field_73904_o.add(var5); ++ } ++ } ++ ++ if (this.field_73904_o.size() > 0) ++ { ++ this.field_73897_d = true; ++ this.completePlayerName(); ++ } ++ } ++ } ++ ++ /** ++ * Returns true if this GUI should pause the game when it is displayed in single-player ++ */ ++ public boolean doesGuiPauseGame() ++ { ++ return false; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiChest.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,49 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class GuiChest extends GuiContainer ++ { ++ private static final ResourceLocation field_110421_t = new ResourceLocation("textures/gui/container/generic_54.png"); ++ private IInventory upperChestInventory; ++ private IInventory lowerChestInventory; ++ ++ /** ++ * window height is calculated with this values, the more rows, the heigher ++ */ ++ private int inventoryRows; ++ ++ public GuiChest(IInventory par1IInventory, IInventory par2IInventory) ++ { ++ super(new ContainerChest(par1IInventory, par2IInventory)); ++ this.upperChestInventory = par1IInventory; ++ this.lowerChestInventory = par2IInventory; ++ this.allowUserInput = false; ++ short var3 = 222; ++ int var4 = var3 - 108; ++ this.inventoryRows = par2IInventory.getSizeInventory() / 9; ++ this.ySize = var4 + this.inventoryRows * 18; ++ } ++ ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) ++ { ++ this.fontRenderer.drawString(this.lowerChestInventory.isInvNameLocalized() ? this.lowerChestInventory.getInvName() : I18n.getString(this.lowerChestInventory.getInvName()), 8, 6, 4210752); ++ this.fontRenderer.drawString(this.upperChestInventory.isInvNameLocalized() ? this.upperChestInventory.getInvName() : I18n.getString(this.upperChestInventory.getInvName()), 8, this.ySize - 96 + 2, 4210752); ++ } ++ ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) ++ { ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.mc.getTextureManager().bindTexture(field_110421_t); ++ int var4 = (this.width - this.xSize) / 2; ++ int var5 = (this.height - this.ySize) / 2; ++ this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.inventoryRows * 18 + 17); ++ this.drawTexturedModalRect(var4, var5 + this.inventoryRows * 18 + 17, 0, 126, this.xSize, 96); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiCommandBlock.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,133 ---- ++ package net.minecraft.src; ++ ++ import java.io.ByteArrayOutputStream; ++ import java.io.DataOutputStream; ++ import org.lwjgl.input.Keyboard; ++ ++ public class GuiCommandBlock extends GuiScreen ++ { ++ /** Text field containing the command block's command. */ ++ private GuiTextField commandTextField; ++ ++ /** Command block being edited. */ ++ private final TileEntityCommandBlock commandBlock; ++ private GuiButton doneBtn; ++ private GuiButton cancelBtn; ++ ++ public GuiCommandBlock(TileEntityCommandBlock par1TileEntityCommandBlock) ++ { ++ this.commandBlock = par1TileEntityCommandBlock; ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ this.commandTextField.updateCursorCounter(); ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ Keyboard.enableRepeatEvents(true); ++ this.buttonList.clear(); ++ this.buttonList.add(this.doneBtn = new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("gui.done"))); ++ this.buttonList.add(this.cancelBtn = new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); ++ this.commandTextField = new GuiTextField(this.fontRenderer, this.width / 2 - 150, 60, 300, 20); ++ this.commandTextField.setMaxStringLength(32767); ++ this.commandTextField.setFocused(true); ++ this.commandTextField.setText(this.commandBlock.getCommand()); ++ this.doneBtn.enabled = this.commandTextField.getText().trim().length() > 0; ++ } ++ ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ ++ public void onGuiClosed() ++ { ++ Keyboard.enableRepeatEvents(false); ++ } ++ ++ /** ++ * 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 == 1) ++ { ++ this.mc.displayGuiScreen((GuiScreen)null); ++ } ++ else if (par1GuiButton.id == 0) ++ { ++ String var2 = "MC|AdvCdm"; ++ ByteArrayOutputStream var3 = new ByteArrayOutputStream(); ++ DataOutputStream var4 = new DataOutputStream(var3); ++ ++ try ++ { ++ var4.writeInt(this.commandBlock.xCoord); ++ var4.writeInt(this.commandBlock.yCoord); ++ var4.writeInt(this.commandBlock.zCoord); ++ Packet.writeString(this.commandTextField.getText(), var4); ++ this.mc.getNetHandler().addToSendQueue(new Packet250CustomPayload(var2, var3.toByteArray())); ++ } ++ catch (Exception var6) ++ { ++ var6.printStackTrace(); ++ } ++ ++ this.mc.displayGuiScreen((GuiScreen)null); ++ } ++ } ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) ++ { ++ this.commandTextField.textboxKeyTyped(par1, par2); ++ this.doneBtn.enabled = this.commandTextField.getText().trim().length() > 0; ++ ++ if (par2 != 28 && par2 != 156) ++ { ++ if (par2 == 1) ++ { ++ this.actionPerformed(this.cancelBtn); ++ } ++ } ++ else ++ { ++ this.actionPerformed(this.doneBtn); ++ } ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) ++ { ++ super.mouseClicked(par1, par2, par3); ++ this.commandTextField.mouseClicked(par1, par2, par3); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.drawCenteredString(this.fontRenderer, I18n.getString("advMode.setCommand"), this.width / 2, 20, 16777215); ++ this.drawString(this.fontRenderer, I18n.getString("advMode.command"), this.width / 2 - 150, 47, 10526880); ++ this.drawString(this.fontRenderer, I18n.getString("advMode.nearestPlayer"), this.width / 2 - 150, 97, 10526880); ++ this.drawString(this.fontRenderer, I18n.getString("advMode.randomPlayer"), this.width / 2 - 150, 108, 10526880); ++ this.drawString(this.fontRenderer, I18n.getString("advMode.allPlayers"), this.width / 2 - 150, 119, 10526880); ++ this.commandTextField.drawTextBox(); ++ super.drawScreen(par1, par2, par3); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiConfirmOpenLink.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,71 ---- ++ package net.minecraft.src; ++ ++ public class GuiConfirmOpenLink extends GuiYesNo ++ { ++ /** Text to warn players from opening unsafe links. */ ++ private String openLinkWarning; ++ ++ /** Label for the Copy to Clipboard button. */ ++ private String copyLinkButtonText; ++ private String field_92028_p; ++ private boolean field_92027_q = true; ++ ++ public GuiConfirmOpenLink(GuiScreen par1GuiScreen, String par2Str, int par3, boolean par4) ++ { ++ super(par1GuiScreen, I18n.getString(par4 ? "chat.link.confirmTrusted" : "chat.link.confirm"), par2Str, par3); ++ this.buttonText1 = I18n.getString(par4 ? "chat.link.open" : "gui.yes"); ++ this.buttonText2 = I18n.getString(par4 ? "gui.cancel" : "gui.no"); ++ this.copyLinkButtonText = I18n.getString("chat.copy"); ++ this.openLinkWarning = I18n.getString("chat.link.warning"); ++ this.field_92028_p = par2Str; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.buttonList.add(new GuiButton(0, this.width / 3 - 83 + 0, this.height / 6 + 96, 100, 20, this.buttonText1)); ++ this.buttonList.add(new GuiButton(2, this.width / 3 - 83 + 105, this.height / 6 + 96, 100, 20, this.copyLinkButtonText)); ++ this.buttonList.add(new GuiButton(1, this.width / 3 - 83 + 210, this.height / 6 + 96, 100, 20, this.buttonText2)); ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ if (par1GuiButton.id == 2) ++ { ++ this.copyLinkToClipboard(); ++ } ++ ++ this.parentScreen.confirmClicked(par1GuiButton.id == 0, this.worldNumber); ++ } ++ ++ /** ++ * Copies the link to the system clipboard. ++ */ ++ public void copyLinkToClipboard() ++ { ++ setClipboardString(this.field_92028_p); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ super.drawScreen(par1, par2, par3); ++ ++ if (this.field_92027_q) ++ { ++ this.drawCenteredString(this.fontRenderer, this.openLinkWarning, this.width / 2, 110, 16764108); ++ } ++ } ++ ++ public void func_92026_h() ++ { ++ this.field_92027_q = false; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiConnecting.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,150 ---- ++ package net.minecraft.src; ++ ++ public class GuiConnecting extends GuiScreen ++ { ++ /** A reference to the NetClientHandler. */ ++ private NetClientHandler clientHandler; ++ ++ /** True if the connection attempt has been cancelled. */ ++ private boolean cancelled; ++ private final GuiScreen field_98098_c; ++ ++ public GuiConnecting(GuiScreen par1GuiScreen, Minecraft par2Minecraft, ServerData par3ServerData) ++ { ++ this.mc = par2Minecraft; ++ this.field_98098_c = par1GuiScreen; ++ ServerAddress var4 = ServerAddress.func_78860_a(par3ServerData.serverIP); ++ par2Minecraft.loadWorld((WorldClient)null); ++ par2Minecraft.setServerData(par3ServerData); ++ this.spawnNewServerThread(var4.getIP(), var4.getPort()); ++ } ++ ++ public GuiConnecting(GuiScreen par1GuiScreen, Minecraft par2Minecraft, String par3Str, int par4) ++ { ++ this.mc = par2Minecraft; ++ this.field_98098_c = par1GuiScreen; ++ par2Minecraft.loadWorld((WorldClient)null); ++ this.spawnNewServerThread(par3Str, par4); ++ } ++ ++ private void spawnNewServerThread(String par1Str, int par2) ++ { ++ this.mc.getLogAgent().logInfo("Connecting to " + par1Str + ", " + par2); ++ (new ThreadConnectToServer(this, par1Str, par2)).start(); ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ if (this.clientHandler != null) ++ { ++ this.clientHandler.processReadPackets(); ++ } ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) {} ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ if (par1GuiButton.id == 0) ++ { ++ this.cancelled = true; ++ ++ if (this.clientHandler != null) ++ { ++ this.clientHandler.disconnect(); ++ } ++ ++ this.mc.displayGuiScreen(this.field_98098_c); ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ ++ if (this.clientHandler == null) ++ { ++ this.drawCenteredString(this.fontRenderer, I18n.getString("connect.connecting"), this.width / 2, this.height / 2 - 50, 16777215); ++ this.drawCenteredString(this.fontRenderer, "", this.width / 2, this.height / 2 - 10, 16777215); ++ } ++ else ++ { ++ this.drawCenteredString(this.fontRenderer, I18n.getString("connect.authorizing"), this.width / 2, this.height / 2 - 50, 16777215); ++ this.drawCenteredString(this.fontRenderer, this.clientHandler.field_72560_a, this.width / 2, this.height / 2 - 10, 16777215); ++ } ++ ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ /** ++ * Sets the NetClientHandler. ++ */ ++ static NetClientHandler setNetClientHandler(GuiConnecting par0GuiConnecting, NetClientHandler par1NetClientHandler) ++ { ++ return par0GuiConnecting.clientHandler = par1NetClientHandler; ++ } ++ ++ static Minecraft func_74256_a(GuiConnecting par0GuiConnecting) ++ { ++ return par0GuiConnecting.mc; ++ } ++ ++ static boolean isCancelled(GuiConnecting par0GuiConnecting) ++ { ++ return par0GuiConnecting.cancelled; ++ } ++ ++ static Minecraft func_74254_c(GuiConnecting par0GuiConnecting) ++ { ++ return par0GuiConnecting.mc; ++ } ++ ++ /** ++ * Gets the NetClientHandler. ++ */ ++ static NetClientHandler getNetClientHandler(GuiConnecting par0GuiConnecting) ++ { ++ return par0GuiConnecting.clientHandler; ++ } ++ ++ static GuiScreen func_98097_e(GuiConnecting par0GuiConnecting) ++ { ++ return par0GuiConnecting.field_98098_c; ++ } ++ ++ static Minecraft func_74250_f(GuiConnecting par0GuiConnecting) ++ { ++ return par0GuiConnecting.mc; ++ } ++ ++ static Minecraft func_74251_g(GuiConnecting par0GuiConnecting) ++ { ++ return par0GuiConnecting.mc; ++ } ++ ++ static Minecraft func_98096_h(GuiConnecting par0GuiConnecting) ++ { ++ return par0GuiConnecting.mc; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiContainer.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,859 ---- ++ package net.minecraft.src; ++ ++ import java.util.Arrays; ++ import java.util.HashSet; ++ import java.util.Iterator; ++ import java.util.List; ++ import java.util.Set; ++ import org.lwjgl.input.Keyboard; ++ import org.lwjgl.opengl.GL11; ++ import org.lwjgl.opengl.GL12; ++ ++ public abstract class GuiContainer extends GuiScreen ++ { ++ protected static final ResourceLocation field_110408_a = new ResourceLocation("textures/gui/container/inventory.png"); ++ ++ /** Stacks renderer. Icons, stack size, health, etc... */ ++ protected static RenderItem itemRenderer = new RenderItem(); ++ ++ /** The X size of the inventory window in pixels. */ ++ protected int xSize = 176; ++ ++ /** The Y size of the inventory window in pixels. */ ++ protected int ySize = 166; ++ ++ /** A list of the players inventory slots. */ ++ public Container inventorySlots; ++ ++ /** ++ * Starting X position for the Gui. Inconsistent use for Gui backgrounds. ++ */ ++ protected int guiLeft; ++ ++ /** ++ * Starting Y position for the Gui. Inconsistent use for Gui backgrounds. ++ */ ++ protected int guiTop; ++ private Slot theSlot; ++ ++ /** Used when touchscreen is enabled */ ++ private Slot clickedSlot; ++ ++ /** Used when touchscreen is enabled */ ++ private boolean isRightMouseClick; ++ ++ /** Used when touchscreen is enabled */ ++ private ItemStack draggedStack; ++ private int field_85049_r; ++ private int field_85048_s; ++ private Slot returningStackDestSlot; ++ private long returningStackTime; ++ ++ /** Used when touchscreen is enabled */ ++ private ItemStack returningStack; ++ private Slot field_92033_y; ++ private long field_92032_z; ++ protected final Set field_94077_p = new HashSet(); ++ protected boolean field_94076_q; ++ private int field_94071_C; ++ private int field_94067_D; ++ private boolean field_94068_E; ++ private int field_94069_F; ++ private long field_94070_G; ++ private Slot field_94072_H; ++ private int field_94073_I; ++ private boolean field_94074_J; ++ private ItemStack field_94075_K; ++ ++ public GuiContainer(Container par1Container) ++ { ++ this.inventorySlots = par1Container; ++ this.field_94068_E = true; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ super.initGui(); ++ this.mc.thePlayer.openContainer = this.inventorySlots; ++ this.guiLeft = (this.width - this.xSize) / 2; ++ this.guiTop = (this.height - this.ySize) / 2; ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ int var4 = this.guiLeft; ++ int var5 = this.guiTop; ++ this.drawGuiContainerBackgroundLayer(par3, par1, par2); ++ GL11.glDisable(GL12.GL_RESCALE_NORMAL); ++ RenderHelper.disableStandardItemLighting(); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glDisable(GL11.GL_DEPTH_TEST); ++ super.drawScreen(par1, par2, par3); ++ RenderHelper.enableGUIStandardItemLighting(); ++ GL11.glPushMatrix(); ++ GL11.glTranslatef((float)var4, (float)var5, 0.0F); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glEnable(GL12.GL_RESCALE_NORMAL); ++ this.theSlot = null; ++ short var6 = 240; ++ short var7 = 240; ++ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var6 / 1.0F, (float)var7 / 1.0F); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ int var9; ++ ++ for (int var13 = 0; var13 < this.inventorySlots.inventorySlots.size(); ++var13) ++ { ++ Slot var15 = (Slot)this.inventorySlots.inventorySlots.get(var13); ++ this.drawSlotInventory(var15); ++ ++ if (this.isMouseOverSlot(var15, par1, par2) && var15.func_111238_b()) ++ { ++ this.theSlot = var15; ++ GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glDisable(GL11.GL_DEPTH_TEST); ++ int var8 = var15.xDisplayPosition; ++ var9 = var15.yDisplayPosition; ++ this.drawGradientRect(var8, var9, var8 + 16, var9 + 16, -2130706433, -2130706433); ++ GL11.glEnable(GL11.GL_LIGHTING); ++ GL11.glEnable(GL11.GL_DEPTH_TEST); ++ } ++ } ++ ++ this.drawGuiContainerForegroundLayer(par1, par2); ++ InventoryPlayer var14 = this.mc.thePlayer.inventory; ++ ItemStack var16 = this.draggedStack == null ? var14.getItemStack() : this.draggedStack; ++ ++ if (var16 != null) ++ { ++ byte var17 = 8; ++ var9 = this.draggedStack == null ? 8 : 16; ++ String var10 = null; ++ ++ if (this.draggedStack != null && this.isRightMouseClick) ++ { ++ var16 = var16.copy(); ++ var16.stackSize = MathHelper.ceiling_float_int((float)var16.stackSize / 2.0F); ++ } ++ else if (this.field_94076_q && this.field_94077_p.size() > 1) ++ { ++ var16 = var16.copy(); ++ var16.stackSize = this.field_94069_F; ++ ++ if (var16.stackSize == 0) ++ { ++ var10 = "" + EnumChatFormatting.YELLOW + "0"; ++ } ++ } ++ ++ this.drawItemStack(var16, par1 - var4 - var17, par2 - var5 - var9, var10); ++ } ++ ++ if (this.returningStack != null) ++ { ++ float var18 = (float)(Minecraft.getSystemTime() - this.returningStackTime) / 100.0F; ++ ++ if (var18 >= 1.0F) ++ { ++ var18 = 1.0F; ++ this.returningStack = null; ++ } ++ ++ var9 = this.returningStackDestSlot.xDisplayPosition - this.field_85049_r; ++ int var20 = this.returningStackDestSlot.yDisplayPosition - this.field_85048_s; ++ int var11 = this.field_85049_r + (int)((float)var9 * var18); ++ int var12 = this.field_85048_s + (int)((float)var20 * var18); ++ this.drawItemStack(this.returningStack, var11, var12, (String)null); ++ } ++ ++ GL11.glPopMatrix(); ++ ++ if (var14.getItemStack() == null && this.theSlot != null && this.theSlot.getHasStack()) ++ { ++ ItemStack var19 = this.theSlot.getStack(); ++ this.drawItemStackTooltip(var19, par1, par2); ++ } ++ ++ GL11.glEnable(GL11.GL_LIGHTING); ++ GL11.glEnable(GL11.GL_DEPTH_TEST); ++ RenderHelper.enableStandardItemLighting(); ++ } ++ ++ private void drawItemStack(ItemStack par1ItemStack, int par2, int par3, String par4Str) ++ { ++ GL11.glTranslatef(0.0F, 0.0F, 32.0F); ++ this.zLevel = 200.0F; ++ itemRenderer.zLevel = 200.0F; ++ itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.getTextureManager(), par1ItemStack, par2, par3); ++ itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.getTextureManager(), par1ItemStack, par2, par3 - (this.draggedStack == null ? 0 : 8), par4Str); ++ this.zLevel = 0.0F; ++ itemRenderer.zLevel = 0.0F; ++ } ++ ++ protected void drawItemStackTooltip(ItemStack par1ItemStack, int par2, int par3) ++ { ++ List var4 = par1ItemStack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips); ++ ++ for (int var5 = 0; var5 < var4.size(); ++var5) ++ { ++ if (var5 == 0) ++ { ++ var4.set(var5, "\u00a7" + Integer.toHexString(par1ItemStack.getRarity().rarityColor) + (String)var4.get(var5)); ++ } ++ else ++ { ++ var4.set(var5, EnumChatFormatting.GRAY + (String)var4.get(var5)); ++ } ++ } ++ ++ this.func_102021_a(var4, par2, par3); ++ } ++ ++ /** ++ * Draws the text when mouse is over creative inventory tab. Params: current creative tab to be checked, current ++ * mouse x position, current mouse y position. ++ */ ++ protected void drawCreativeTabHoveringText(String par1Str, int par2, int par3) ++ { ++ this.func_102021_a(Arrays.asList(new String[] {par1Str}), par2, par3); ++ } ++ ++ protected void func_102021_a(List par1List, int par2, int par3) ++ { ++ if (!par1List.isEmpty()) ++ { ++ GL11.glDisable(GL12.GL_RESCALE_NORMAL); ++ RenderHelper.disableStandardItemLighting(); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glDisable(GL11.GL_DEPTH_TEST); ++ int var4 = 0; ++ Iterator var5 = par1List.iterator(); ++ ++ while (var5.hasNext()) ++ { ++ String var6 = (String)var5.next(); ++ int var7 = this.fontRenderer.getStringWidth(var6); ++ ++ if (var7 > var4) ++ { ++ var4 = var7; ++ } ++ } ++ ++ int var14 = par2 + 12; ++ int var15 = par3 - 12; ++ int var8 = 8; ++ ++ if (par1List.size() > 1) ++ { ++ var8 += 2 + (par1List.size() - 1) * 10; ++ } ++ ++ if (var14 + var4 > this.width) ++ { ++ var14 -= 28 + var4; ++ } ++ ++ if (var15 + var8 + 6 > this.height) ++ { ++ var15 = this.height - var8 - 6; ++ } ++ ++ this.zLevel = 300.0F; ++ itemRenderer.zLevel = 300.0F; ++ int var9 = -267386864; ++ this.drawGradientRect(var14 - 3, var15 - 4, var14 + var4 + 3, var15 - 3, var9, var9); ++ this.drawGradientRect(var14 - 3, var15 + var8 + 3, var14 + var4 + 3, var15 + var8 + 4, var9, var9); ++ this.drawGradientRect(var14 - 3, var15 - 3, var14 + var4 + 3, var15 + var8 + 3, var9, var9); ++ this.drawGradientRect(var14 - 4, var15 - 3, var14 - 3, var15 + var8 + 3, var9, var9); ++ this.drawGradientRect(var14 + var4 + 3, var15 - 3, var14 + var4 + 4, var15 + var8 + 3, var9, var9); ++ int var10 = 1347420415; ++ int var11 = (var10 & 16711422) >> 1 | var10 & -16777216; ++ this.drawGradientRect(var14 - 3, var15 - 3 + 1, var14 - 3 + 1, var15 + var8 + 3 - 1, var10, var11); ++ this.drawGradientRect(var14 + var4 + 2, var15 - 3 + 1, var14 + var4 + 3, var15 + var8 + 3 - 1, var10, var11); ++ this.drawGradientRect(var14 - 3, var15 - 3, var14 + var4 + 3, var15 - 3 + 1, var10, var10); ++ this.drawGradientRect(var14 - 3, var15 + var8 + 2, var14 + var4 + 3, var15 + var8 + 3, var11, var11); ++ ++ for (int var12 = 0; var12 < par1List.size(); ++var12) ++ { ++ String var13 = (String)par1List.get(var12); ++ this.fontRenderer.drawStringWithShadow(var13, var14, var15, -1); ++ ++ if (var12 == 0) ++ { ++ var15 += 2; ++ } ++ ++ var15 += 10; ++ } ++ ++ this.zLevel = 0.0F; ++ itemRenderer.zLevel = 0.0F; ++ GL11.glEnable(GL11.GL_LIGHTING); ++ GL11.glEnable(GL11.GL_DEPTH_TEST); ++ RenderHelper.enableStandardItemLighting(); ++ GL11.glEnable(GL12.GL_RESCALE_NORMAL); ++ } ++ } ++ ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) {} ++ ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected abstract void drawGuiContainerBackgroundLayer(float var1, int var2, int var3); ++ ++ /** ++ * Draws an inventory slot ++ */ ++ private void drawSlotInventory(Slot par1Slot) ++ { ++ int var2 = par1Slot.xDisplayPosition; ++ int var3 = par1Slot.yDisplayPosition; ++ ItemStack var4 = par1Slot.getStack(); ++ boolean var5 = false; ++ boolean var6 = par1Slot == this.clickedSlot && this.draggedStack != null && !this.isRightMouseClick; ++ ItemStack var7 = this.mc.thePlayer.inventory.getItemStack(); ++ String var8 = null; ++ ++ if (par1Slot == this.clickedSlot && this.draggedStack != null && this.isRightMouseClick && var4 != null) ++ { ++ var4 = var4.copy(); ++ var4.stackSize /= 2; ++ } ++ else if (this.field_94076_q && this.field_94077_p.contains(par1Slot) && var7 != null) ++ { ++ if (this.field_94077_p.size() == 1) ++ { ++ return; ++ } ++ ++ if (Container.func_94527_a(par1Slot, var7, true) && this.inventorySlots.canDragIntoSlot(par1Slot)) ++ { ++ var4 = var7.copy(); ++ var5 = true; ++ Container.func_94525_a(this.field_94077_p, this.field_94071_C, var4, par1Slot.getStack() == null ? 0 : par1Slot.getStack().stackSize); ++ ++ if (var4.stackSize > var4.getMaxStackSize()) ++ { ++ var8 = EnumChatFormatting.YELLOW + "" + var4.getMaxStackSize(); ++ var4.stackSize = var4.getMaxStackSize(); ++ } ++ ++ if (var4.stackSize > par1Slot.getSlotStackLimit()) ++ { ++ var8 = EnumChatFormatting.YELLOW + "" + par1Slot.getSlotStackLimit(); ++ var4.stackSize = par1Slot.getSlotStackLimit(); ++ } ++ } ++ else ++ { ++ this.field_94077_p.remove(par1Slot); ++ this.func_94066_g(); ++ } ++ } ++ ++ this.zLevel = 100.0F; ++ itemRenderer.zLevel = 100.0F; ++ ++ if (var4 == null) ++ { ++ Icon var9 = par1Slot.getBackgroundIconIndex(); ++ ++ if (var9 != null) ++ { ++ GL11.glDisable(GL11.GL_LIGHTING); ++ this.mc.getTextureManager().bindTexture(TextureMap.locationItemsTexture); ++ this.drawTexturedModelRectFromIcon(var2, var3, var9, 16, 16); ++ GL11.glEnable(GL11.GL_LIGHTING); ++ var6 = true; ++ } ++ } ++ ++ if (!var6) ++ { ++ if (var5) ++ { ++ drawRect(var2, var3, var2 + 16, var3 + 16, -2130706433); ++ } ++ ++ GL11.glEnable(GL11.GL_DEPTH_TEST); ++ itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var4, var2, var3); ++ itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var4, var2, var3, var8); ++ } ++ ++ itemRenderer.zLevel = 0.0F; ++ this.zLevel = 0.0F; ++ } ++ ++ private void func_94066_g() ++ { ++ ItemStack var1 = this.mc.thePlayer.inventory.getItemStack(); ++ ++ if (var1 != null && this.field_94076_q) ++ { ++ this.field_94069_F = var1.stackSize; ++ ItemStack var4; ++ int var5; ++ ++ for (Iterator var2 = this.field_94077_p.iterator(); var2.hasNext(); this.field_94069_F -= var4.stackSize - var5) ++ { ++ Slot var3 = (Slot)var2.next(); ++ var4 = var1.copy(); ++ var5 = var3.getStack() == null ? 0 : var3.getStack().stackSize; ++ Container.func_94525_a(this.field_94077_p, this.field_94071_C, var4, var5); ++ ++ if (var4.stackSize > var4.getMaxStackSize()) ++ { ++ var4.stackSize = var4.getMaxStackSize(); ++ } ++ ++ if (var4.stackSize > var3.getSlotStackLimit()) ++ { ++ var4.stackSize = var3.getSlotStackLimit(); ++ } ++ } ++ } ++ } ++ ++ /** ++ * Returns the slot at the given coordinates or null if there is none. ++ */ ++ private Slot getSlotAtPosition(int par1, int par2) ++ { ++ for (int var3 = 0; var3 < this.inventorySlots.inventorySlots.size(); ++var3) ++ { ++ Slot var4 = (Slot)this.inventorySlots.inventorySlots.get(var3); ++ ++ if (this.isMouseOverSlot(var4, par1, par2)) ++ { ++ return var4; ++ } ++ } ++ ++ return null; ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) ++ { ++ super.mouseClicked(par1, par2, par3); ++ boolean var4 = par3 == this.mc.gameSettings.keyBindPickBlock.keyCode + 100; ++ Slot var5 = this.getSlotAtPosition(par1, par2); ++ long var6 = Minecraft.getSystemTime(); ++ this.field_94074_J = this.field_94072_H == var5 && var6 - this.field_94070_G < 250L && this.field_94073_I == par3; ++ this.field_94068_E = false; ++ ++ if (par3 == 0 || par3 == 1 || var4) ++ { ++ int var8 = this.guiLeft; ++ int var9 = this.guiTop; ++ boolean var10 = par1 < var8 || par2 < var9 || par1 >= var8 + this.xSize || par2 >= var9 + this.ySize; ++ int var11 = -1; ++ ++ if (var5 != null) ++ { ++ var11 = var5.slotNumber; ++ } ++ ++ if (var10) ++ { ++ var11 = -999; ++ } ++ ++ if (this.mc.gameSettings.touchscreen && var10 && this.mc.thePlayer.inventory.getItemStack() == null) ++ { ++ this.mc.displayGuiScreen((GuiScreen)null); ++ return; ++ } ++ ++ if (var11 != -1) ++ { ++ if (this.mc.gameSettings.touchscreen) ++ { ++ if (var5 != null && var5.getHasStack()) ++ { ++ this.clickedSlot = var5; ++ this.draggedStack = null; ++ this.isRightMouseClick = par3 == 1; ++ } ++ else ++ { ++ this.clickedSlot = null; ++ } ++ } ++ else if (!this.field_94076_q) ++ { ++ if (this.mc.thePlayer.inventory.getItemStack() == null) ++ { ++ if (par3 == this.mc.gameSettings.keyBindPickBlock.keyCode + 100) ++ { ++ this.handleMouseClick(var5, var11, par3, 3); ++ } ++ else ++ { ++ boolean var12 = var11 != -999 && (Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54)); ++ byte var13 = 0; ++ ++ if (var12) ++ { ++ this.field_94075_K = var5 != null && var5.getHasStack() ? var5.getStack() : null; ++ var13 = 1; ++ } ++ else if (var11 == -999) ++ { ++ var13 = 4; ++ } ++ ++ this.handleMouseClick(var5, var11, par3, var13); ++ } ++ ++ this.field_94068_E = true; ++ } ++ else ++ { ++ this.field_94076_q = true; ++ this.field_94067_D = par3; ++ this.field_94077_p.clear(); ++ ++ if (par3 == 0) ++ { ++ this.field_94071_C = 0; ++ } ++ else if (par3 == 1) ++ { ++ this.field_94071_C = 1; ++ } ++ } ++ } ++ } ++ } ++ ++ this.field_94072_H = var5; ++ this.field_94070_G = var6; ++ this.field_94073_I = par3; ++ } ++ ++ /** ++ * Called when a mouse button is pressed and the mouse is moved around. Parameters are : mouseX, mouseY, ++ * lastButtonClicked & timeSinceMouseClick. ++ */ ++ protected void mouseClickMove(int par1, int par2, int par3, long par4) ++ { ++ Slot var6 = this.getSlotAtPosition(par1, par2); ++ ItemStack var7 = this.mc.thePlayer.inventory.getItemStack(); ++ ++ if (this.clickedSlot != null && this.mc.gameSettings.touchscreen) ++ { ++ if (par3 == 0 || par3 == 1) ++ { ++ if (this.draggedStack == null) ++ { ++ if (var6 != this.clickedSlot) ++ { ++ this.draggedStack = this.clickedSlot.getStack().copy(); ++ } ++ } ++ else if (this.draggedStack.stackSize > 1 && var6 != null && Container.func_94527_a(var6, this.draggedStack, false)) ++ { ++ long var8 = Minecraft.getSystemTime(); ++ ++ if (this.field_92033_y == var6) ++ { ++ if (var8 - this.field_92032_z > 500L) ++ { ++ this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, 0, 0); ++ this.handleMouseClick(var6, var6.slotNumber, 1, 0); ++ this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, 0, 0); ++ this.field_92032_z = var8 + 750L; ++ --this.draggedStack.stackSize; ++ } ++ } ++ else ++ { ++ this.field_92033_y = var6; ++ this.field_92032_z = var8; ++ } ++ } ++ } ++ } ++ else if (this.field_94076_q && var6 != null && var7 != null && var7.stackSize > this.field_94077_p.size() && Container.func_94527_a(var6, var7, true) && var6.isItemValid(var7) && this.inventorySlots.canDragIntoSlot(var6)) ++ { ++ this.field_94077_p.add(var6); ++ this.func_94066_g(); ++ } ++ } ++ ++ /** ++ * 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) ++ { ++ Slot var4 = this.getSlotAtPosition(par1, par2); ++ int var5 = this.guiLeft; ++ int var6 = this.guiTop; ++ boolean var7 = par1 < var5 || par2 < var6 || par1 >= var5 + this.xSize || par2 >= var6 + this.ySize; ++ int var8 = -1; ++ ++ if (var4 != null) ++ { ++ var8 = var4.slotNumber; ++ } ++ ++ if (var7) ++ { ++ var8 = -999; ++ } ++ ++ Slot var10; ++ Iterator var11; ++ ++ if (this.field_94074_J && var4 != null && par3 == 0 && this.inventorySlots.func_94530_a((ItemStack)null, var4)) ++ { ++ if (isShiftKeyDown()) ++ { ++ if (var4 != null && var4.inventory != null && this.field_94075_K != null) ++ { ++ var11 = this.inventorySlots.inventorySlots.iterator(); ++ ++ while (var11.hasNext()) ++ { ++ var10 = (Slot)var11.next(); ++ ++ if (var10 != null && var10.canTakeStack(this.mc.thePlayer) && var10.getHasStack() && var10.inventory == var4.inventory && Container.func_94527_a(var10, this.field_94075_K, true)) ++ { ++ this.handleMouseClick(var10, var10.slotNumber, par3, 1); ++ } ++ } ++ } ++ } ++ else ++ { ++ this.handleMouseClick(var4, var8, par3, 6); ++ } ++ ++ this.field_94074_J = false; ++ this.field_94070_G = 0L; ++ } ++ else ++ { ++ if (this.field_94076_q && this.field_94067_D != par3) ++ { ++ this.field_94076_q = false; ++ this.field_94077_p.clear(); ++ this.field_94068_E = true; ++ return; ++ } ++ ++ if (this.field_94068_E) ++ { ++ this.field_94068_E = false; ++ return; ++ } ++ ++ boolean var9; ++ ++ if (this.clickedSlot != null && this.mc.gameSettings.touchscreen) ++ { ++ if (par3 == 0 || par3 == 1) ++ { ++ if (this.draggedStack == null && var4 != this.clickedSlot) ++ { ++ this.draggedStack = this.clickedSlot.getStack(); ++ } ++ ++ var9 = Container.func_94527_a(var4, this.draggedStack, false); ++ ++ if (var8 != -1 && this.draggedStack != null && var9) ++ { ++ this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, par3, 0); ++ this.handleMouseClick(var4, var8, 0, 0); ++ ++ if (this.mc.thePlayer.inventory.getItemStack() != null) ++ { ++ this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, par3, 0); ++ this.field_85049_r = par1 - var5; ++ this.field_85048_s = par2 - var6; ++ this.returningStackDestSlot = this.clickedSlot; ++ this.returningStack = this.draggedStack; ++ this.returningStackTime = Minecraft.getSystemTime(); ++ } ++ else ++ { ++ this.returningStack = null; ++ } ++ } ++ else if (this.draggedStack != null) ++ { ++ this.field_85049_r = par1 - var5; ++ this.field_85048_s = par2 - var6; ++ this.returningStackDestSlot = this.clickedSlot; ++ this.returningStack = this.draggedStack; ++ this.returningStackTime = Minecraft.getSystemTime(); ++ } ++ ++ this.draggedStack = null; ++ this.clickedSlot = null; ++ } ++ } ++ else if (this.field_94076_q && !this.field_94077_p.isEmpty()) ++ { ++ this.handleMouseClick((Slot)null, -999, Container.func_94534_d(0, this.field_94071_C), 5); ++ var11 = this.field_94077_p.iterator(); ++ ++ while (var11.hasNext()) ++ { ++ var10 = (Slot)var11.next(); ++ this.handleMouseClick(var10, var10.slotNumber, Container.func_94534_d(1, this.field_94071_C), 5); ++ } ++ ++ this.handleMouseClick((Slot)null, -999, Container.func_94534_d(2, this.field_94071_C), 5); ++ } ++ else if (this.mc.thePlayer.inventory.getItemStack() != null) ++ { ++ if (par3 == this.mc.gameSettings.keyBindPickBlock.keyCode + 100) ++ { ++ this.handleMouseClick(var4, var8, par3, 3); ++ } ++ else ++ { ++ var9 = var8 != -999 && (Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54)); ++ ++ if (var9) ++ { ++ this.field_94075_K = var4 != null && var4.getHasStack() ? var4.getStack() : null; ++ } ++ ++ this.handleMouseClick(var4, var8, par3, var9 ? 1 : 0); ++ } ++ } ++ } ++ ++ if (this.mc.thePlayer.inventory.getItemStack() == null) ++ { ++ this.field_94070_G = 0L; ++ } ++ ++ this.field_94076_q = false; ++ } ++ ++ /** ++ * Returns if the passed mouse position is over the specified slot. ++ */ ++ private boolean isMouseOverSlot(Slot par1Slot, int par2, int par3) ++ { ++ return this.isPointInRegion(par1Slot.xDisplayPosition, par1Slot.yDisplayPosition, 16, 16, par2, par3); ++ } ++ ++ /** ++ * Args: left, top, width, height, pointX, pointY. Note: left, top are local to Gui, pointX, pointY are local to ++ * screen ++ */ ++ protected boolean isPointInRegion(int par1, int par2, int par3, int par4, int par5, int par6) ++ { ++ int var7 = this.guiLeft; ++ int var8 = this.guiTop; ++ par5 -= var7; ++ par6 -= var8; ++ return par5 >= par1 - 1 && par5 < par1 + par3 + 1 && par6 >= par2 - 1 && par6 < par2 + par4 + 1; ++ } ++ ++ protected void handleMouseClick(Slot par1Slot, int par2, int par3, int par4) ++ { ++ if (par1Slot != null) ++ { ++ par2 = par1Slot.slotNumber; ++ } ++ ++ this.mc.playerController.windowClick(this.inventorySlots.windowId, par2, par3, par4, this.mc.thePlayer); ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) ++ { ++ if (par2 == 1 || par2 == this.mc.gameSettings.keyBindInventory.keyCode) ++ { ++ this.mc.thePlayer.closeScreen(); ++ } ++ ++ this.checkHotbarKeys(par2); ++ ++ if (this.theSlot != null && this.theSlot.getHasStack()) ++ { ++ if (par2 == this.mc.gameSettings.keyBindPickBlock.keyCode) ++ { ++ this.handleMouseClick(this.theSlot, this.theSlot.slotNumber, 0, 3); ++ } ++ else if (par2 == this.mc.gameSettings.keyBindDrop.keyCode) ++ { ++ this.handleMouseClick(this.theSlot, this.theSlot.slotNumber, isCtrlKeyDown() ? 1 : 0, 4); ++ } ++ } ++ } ++ ++ /** ++ * This function is what controls the hotbar shortcut check when you press a number key when hovering a stack. ++ */ ++ protected boolean checkHotbarKeys(int par1) ++ { ++ if (this.mc.thePlayer.inventory.getItemStack() == null && this.theSlot != null) ++ { ++ for (int var2 = 0; var2 < 9; ++var2) ++ { ++ if (par1 == 2 + var2) ++ { ++ this.handleMouseClick(this.theSlot, this.theSlot.slotNumber, var2, 2); ++ return true; ++ } ++ } ++ } ++ ++ return false; ++ } ++ ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ ++ public void onGuiClosed() ++ { ++ if (this.mc.thePlayer != null) ++ { ++ this.inventorySlots.onContainerClosed(this.mc.thePlayer); ++ } ++ } ++ ++ /** ++ * Returns true if this GUI should pause the game when it is displayed in single-player ++ */ ++ public boolean doesGuiPauseGame() ++ { ++ return false; ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ super.updateScreen(); ++ ++ if (!this.mc.thePlayer.isEntityAlive() || this.mc.thePlayer.isDead) ++ { ++ this.mc.thePlayer.closeScreen(); ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiContainerCreative.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,908 ---- ++ package net.minecraft.src; ++ ++ import java.util.ArrayList; ++ import java.util.Iterator; ++ import java.util.List; ++ import java.util.Map; ++ import org.lwjgl.input.Keyboard; ++ import org.lwjgl.input.Mouse; ++ import org.lwjgl.opengl.GL11; ++ import org.lwjgl.opengl.GL12; ++ ++ public class GuiContainerCreative extends InventoryEffectRenderer ++ { ++ private static final ResourceLocation field_110424_t = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); ++ private static InventoryBasic inventory = new InventoryBasic("tmp", true, 45); ++ ++ /** Currently selected creative inventory tab index. */ ++ private static int selectedTabIndex = CreativeTabs.tabBlock.getTabIndex(); ++ ++ /** Amount scrolled in Creative mode inventory (0 = top, 1 = bottom) */ ++ private float currentScroll; ++ ++ /** True if the scrollbar is being dragged */ ++ private boolean isScrolling; ++ ++ /** ++ * True if the left mouse button was held down last time drawScreen was called. ++ */ ++ private boolean wasClicking; ++ private GuiTextField searchField; ++ ++ /** ++ * Used to back up the ContainerCreative's inventory slots before filling it with the player's inventory slots for ++ * the inventory tab. ++ */ ++ private List backupContainerSlots; ++ private Slot field_74235_v; ++ private boolean field_74234_w; ++ private CreativeCrafting field_82324_x; ++ ++ public GuiContainerCreative(EntityPlayer par1EntityPlayer) ++ { ++ super(new ContainerCreative(par1EntityPlayer)); ++ par1EntityPlayer.openContainer = this.inventorySlots; ++ this.allowUserInput = true; ++ par1EntityPlayer.addStat(AchievementList.openInventory, 1); ++ this.ySize = 136; ++ this.xSize = 195; ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ if (!this.mc.playerController.isInCreativeMode()) ++ { ++ this.mc.displayGuiScreen(new GuiInventory(this.mc.thePlayer)); ++ } ++ } ++ ++ protected void handleMouseClick(Slot par1Slot, int par2, int par3, int par4) ++ { ++ this.field_74234_w = true; ++ boolean var5 = par4 == 1; ++ par4 = par2 == -999 && par4 == 0 ? 4 : par4; ++ ItemStack var7; ++ InventoryPlayer var11; ++ ++ if (par1Slot == null && selectedTabIndex != CreativeTabs.tabInventory.getTabIndex() && par4 != 5) ++ { ++ var11 = this.mc.thePlayer.inventory; ++ ++ if (var11.getItemStack() != null) ++ { ++ if (par3 == 0) ++ { ++ this.mc.thePlayer.dropPlayerItem(var11.getItemStack()); ++ this.mc.playerController.func_78752_a(var11.getItemStack()); ++ var11.setItemStack((ItemStack)null); ++ } ++ ++ if (par3 == 1) ++ { ++ var7 = var11.getItemStack().splitStack(1); ++ this.mc.thePlayer.dropPlayerItem(var7); ++ this.mc.playerController.func_78752_a(var7); ++ ++ if (var11.getItemStack().stackSize == 0) ++ { ++ var11.setItemStack((ItemStack)null); ++ } ++ } ++ } ++ } ++ else ++ { ++ int var10; ++ ++ if (par1Slot == this.field_74235_v && var5) ++ { ++ for (var10 = 0; var10 < this.mc.thePlayer.inventoryContainer.getInventory().size(); ++var10) ++ { ++ this.mc.playerController.sendSlotPacket((ItemStack)null, var10); ++ } ++ } ++ else ++ { ++ ItemStack var6; ++ ++ if (selectedTabIndex == CreativeTabs.tabInventory.getTabIndex()) ++ { ++ if (par1Slot == this.field_74235_v) ++ { ++ this.mc.thePlayer.inventory.setItemStack((ItemStack)null); ++ } ++ else if (par4 == 4 && par1Slot != null && par1Slot.getHasStack()) ++ { ++ var6 = par1Slot.decrStackSize(par3 == 0 ? 1 : par1Slot.getStack().getMaxStackSize()); ++ this.mc.thePlayer.dropPlayerItem(var6); ++ this.mc.playerController.func_78752_a(var6); ++ } ++ else if (par4 == 4 && this.mc.thePlayer.inventory.getItemStack() != null) ++ { ++ this.mc.thePlayer.dropPlayerItem(this.mc.thePlayer.inventory.getItemStack()); ++ this.mc.playerController.func_78752_a(this.mc.thePlayer.inventory.getItemStack()); ++ this.mc.thePlayer.inventory.setItemStack((ItemStack)null); ++ } ++ else ++ { ++ this.mc.thePlayer.inventoryContainer.slotClick(par1Slot == null ? par2 : SlotCreativeInventory.func_75240_a((SlotCreativeInventory)par1Slot).slotNumber, par3, par4, this.mc.thePlayer); ++ this.mc.thePlayer.inventoryContainer.detectAndSendChanges(); ++ } ++ } ++ else if (par4 != 5 && par1Slot.inventory == inventory) ++ { ++ var11 = this.mc.thePlayer.inventory; ++ var7 = var11.getItemStack(); ++ ItemStack var8 = par1Slot.getStack(); ++ ItemStack var9; ++ ++ if (par4 == 2) ++ { ++ if (var8 != null && par3 >= 0 && par3 < 9) ++ { ++ var9 = var8.copy(); ++ var9.stackSize = var9.getMaxStackSize(); ++ this.mc.thePlayer.inventory.setInventorySlotContents(par3, var9); ++ this.mc.thePlayer.inventoryContainer.detectAndSendChanges(); ++ } ++ ++ return; ++ } ++ ++ if (par4 == 3) ++ { ++ if (var11.getItemStack() == null && par1Slot.getHasStack()) ++ { ++ var9 = par1Slot.getStack().copy(); ++ var9.stackSize = var9.getMaxStackSize(); ++ var11.setItemStack(var9); ++ } ++ ++ return; ++ } ++ ++ if (par4 == 4) ++ { ++ if (var8 != null) ++ { ++ var9 = var8.copy(); ++ var9.stackSize = par3 == 0 ? 1 : var9.getMaxStackSize(); ++ this.mc.thePlayer.dropPlayerItem(var9); ++ this.mc.playerController.func_78752_a(var9); ++ } ++ ++ return; ++ } ++ ++ if (var7 != null && var8 != null && var7.isItemEqual(var8)) ++ { ++ if (par3 == 0) ++ { ++ if (var5) ++ { ++ var7.stackSize = var7.getMaxStackSize(); ++ } ++ else if (var7.stackSize < var7.getMaxStackSize()) ++ { ++ ++var7.stackSize; ++ } ++ } ++ else if (var7.stackSize <= 1) ++ { ++ var11.setItemStack((ItemStack)null); ++ } ++ else ++ { ++ --var7.stackSize; ++ } ++ } ++ else if (var8 != null && var7 == null) ++ { ++ var11.setItemStack(ItemStack.copyItemStack(var8)); ++ var7 = var11.getItemStack(); ++ ++ if (var5) ++ { ++ var7.stackSize = var7.getMaxStackSize(); ++ } ++ } ++ else ++ { ++ var11.setItemStack((ItemStack)null); ++ } ++ } ++ else ++ { ++ this.inventorySlots.slotClick(par1Slot == null ? par2 : par1Slot.slotNumber, par3, par4, this.mc.thePlayer); ++ ++ if (Container.func_94532_c(par3) == 2) ++ { ++ for (var10 = 0; var10 < 9; ++var10) ++ { ++ this.mc.playerController.sendSlotPacket(this.inventorySlots.getSlot(45 + var10).getStack(), 36 + var10); ++ } ++ } ++ else if (par1Slot != null) ++ { ++ var6 = this.inventorySlots.getSlot(par1Slot.slotNumber).getStack(); ++ this.mc.playerController.sendSlotPacket(var6, par1Slot.slotNumber - this.inventorySlots.inventorySlots.size() + 9 + 36); ++ } ++ } ++ } ++ } ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ if (this.mc.playerController.isInCreativeMode()) ++ { ++ super.initGui(); ++ this.buttonList.clear(); ++ Keyboard.enableRepeatEvents(true); ++ this.searchField = new GuiTextField(this.fontRenderer, this.guiLeft + 82, this.guiTop + 6, 89, this.fontRenderer.FONT_HEIGHT); ++ this.searchField.setMaxStringLength(15); ++ this.searchField.setEnableBackgroundDrawing(false); ++ this.searchField.setVisible(false); ++ this.searchField.setTextColor(16777215); ++ int var1 = selectedTabIndex; ++ selectedTabIndex = -1; ++ this.setCurrentCreativeTab(CreativeTabs.creativeTabArray[var1]); ++ this.field_82324_x = new CreativeCrafting(this.mc); ++ this.mc.thePlayer.inventoryContainer.addCraftingToCrafters(this.field_82324_x); ++ } ++ else ++ { ++ this.mc.displayGuiScreen(new GuiInventory(this.mc.thePlayer)); ++ } ++ } ++ ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ ++ public void onGuiClosed() ++ { ++ super.onGuiClosed(); ++ ++ if (this.mc.thePlayer != null && this.mc.thePlayer.inventory != null) ++ { ++ this.mc.thePlayer.inventoryContainer.removeCraftingFromCrafters(this.field_82324_x); ++ } ++ ++ Keyboard.enableRepeatEvents(false); ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) ++ { ++ if (selectedTabIndex != CreativeTabs.tabAllSearch.getTabIndex()) ++ { ++ if (GameSettings.isKeyDown(this.mc.gameSettings.keyBindChat)) ++ { ++ this.setCurrentCreativeTab(CreativeTabs.tabAllSearch); ++ } ++ else ++ { ++ super.keyTyped(par1, par2); ++ } ++ } ++ else ++ { ++ if (this.field_74234_w) ++ { ++ this.field_74234_w = false; ++ this.searchField.setText(""); ++ } ++ ++ if (!this.checkHotbarKeys(par2)) ++ { ++ if (this.searchField.textboxKeyTyped(par1, par2)) ++ { ++ this.updateCreativeSearch(); ++ } ++ else ++ { ++ super.keyTyped(par1, par2); ++ } ++ } ++ } ++ } ++ ++ private void updateCreativeSearch() ++ { ++ ContainerCreative var1 = (ContainerCreative)this.inventorySlots; ++ var1.itemList.clear(); ++ Item[] var2 = Item.itemsList; ++ int var3 = var2.length; ++ int var4; ++ ++ for (var4 = 0; var4 < var3; ++var4) ++ { ++ Item var5 = var2[var4]; ++ ++ if (var5 != null && var5.getCreativeTab() != null) ++ { ++ var5.getSubItems(var5.itemID, (CreativeTabs)null, var1.itemList); ++ } ++ } ++ ++ Enchantment[] var8 = Enchantment.enchantmentsList; ++ var3 = var8.length; ++ ++ for (var4 = 0; var4 < var3; ++var4) ++ { ++ Enchantment var11 = var8[var4]; ++ ++ if (var11 != null && var11.type != null) ++ { ++ Item.enchantedBook.func_92113_a(var11, var1.itemList); ++ } ++ } ++ ++ Iterator var9 = var1.itemList.iterator(); ++ String var10 = this.searchField.getText().toLowerCase(); ++ ++ while (var9.hasNext()) ++ { ++ ItemStack var12 = (ItemStack)var9.next(); ++ boolean var13 = false; ++ Iterator var6 = var12.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips).iterator(); ++ ++ while (true) ++ { ++ if (var6.hasNext()) ++ { ++ String var7 = (String)var6.next(); ++ ++ if (!var7.toLowerCase().contains(var10)) ++ { ++ continue; ++ } ++ ++ var13 = true; ++ } ++ ++ if (!var13) ++ { ++ var9.remove(); ++ } ++ ++ break; ++ } ++ } ++ ++ this.currentScroll = 0.0F; ++ var1.scrollTo(0.0F); ++ } ++ ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) ++ { ++ CreativeTabs var3 = CreativeTabs.creativeTabArray[selectedTabIndex]; ++ ++ if (var3.drawInForegroundOfTab()) ++ { ++ this.fontRenderer.drawString(I18n.getString(var3.getTranslatedTabLabel()), 8, 6, 4210752); ++ } ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) ++ { ++ if (par3 == 0) ++ { ++ int var4 = par1 - this.guiLeft; ++ int var5 = par2 - this.guiTop; ++ CreativeTabs[] var6 = CreativeTabs.creativeTabArray; ++ int var7 = var6.length; ++ ++ for (int var8 = 0; var8 < var7; ++var8) ++ { ++ CreativeTabs var9 = var6[var8]; ++ ++ if (this.func_74232_a(var9, var4, var5)) ++ { ++ return; ++ } ++ } ++ } ++ ++ 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) ++ { ++ if (par3 == 0) ++ { ++ int var4 = par1 - this.guiLeft; ++ int var5 = par2 - this.guiTop; ++ CreativeTabs[] var6 = CreativeTabs.creativeTabArray; ++ int var7 = var6.length; ++ ++ for (int var8 = 0; var8 < var7; ++var8) ++ { ++ CreativeTabs var9 = var6[var8]; ++ ++ if (this.func_74232_a(var9, var4, var5)) ++ { ++ this.setCurrentCreativeTab(var9); ++ return; ++ } ++ } ++ } ++ ++ super.mouseMovedOrUp(par1, par2, par3); ++ } ++ ++ /** ++ * returns (if you are not on the inventoryTab) and (the flag isn't set) and( you have more than 1 page of items) ++ */ ++ private boolean needsScrollBars() ++ { ++ return selectedTabIndex != CreativeTabs.tabInventory.getTabIndex() && CreativeTabs.creativeTabArray[selectedTabIndex].shouldHidePlayerInventory() && ((ContainerCreative)this.inventorySlots).hasMoreThan1PageOfItemsInList(); ++ } ++ ++ private void setCurrentCreativeTab(CreativeTabs par1CreativeTabs) ++ { ++ int var2 = selectedTabIndex; ++ selectedTabIndex = par1CreativeTabs.getTabIndex(); ++ ContainerCreative var3 = (ContainerCreative)this.inventorySlots; ++ this.field_94077_p.clear(); ++ var3.itemList.clear(); ++ par1CreativeTabs.displayAllReleventItems(var3.itemList); ++ ++ if (par1CreativeTabs == CreativeTabs.tabInventory) ++ { ++ Container var4 = this.mc.thePlayer.inventoryContainer; ++ ++ if (this.backupContainerSlots == null) ++ { ++ this.backupContainerSlots = var3.inventorySlots; ++ } ++ ++ var3.inventorySlots = new ArrayList(); ++ ++ for (int var5 = 0; var5 < var4.inventorySlots.size(); ++var5) ++ { ++ SlotCreativeInventory var6 = new SlotCreativeInventory(this, (Slot)var4.inventorySlots.get(var5), var5); ++ var3.inventorySlots.add(var6); ++ int var7; ++ int var8; ++ int var9; ++ ++ if (var5 >= 5 && var5 < 9) ++ { ++ var7 = var5 - 5; ++ var8 = var7 / 2; ++ var9 = var7 % 2; ++ var6.xDisplayPosition = 9 + var8 * 54; ++ var6.yDisplayPosition = 6 + var9 * 27; ++ } ++ else if (var5 >= 0 && var5 < 5) ++ { ++ var6.yDisplayPosition = -2000; ++ var6.xDisplayPosition = -2000; ++ } ++ else if (var5 < var4.inventorySlots.size()) ++ { ++ var7 = var5 - 9; ++ var8 = var7 % 9; ++ var9 = var7 / 9; ++ var6.xDisplayPosition = 9 + var8 * 18; ++ ++ if (var5 >= 36) ++ { ++ var6.yDisplayPosition = 112; ++ } ++ else ++ { ++ var6.yDisplayPosition = 54 + var9 * 18; ++ } ++ } ++ } ++ ++ this.field_74235_v = new Slot(inventory, 0, 173, 112); ++ var3.inventorySlots.add(this.field_74235_v); ++ } ++ else if (var2 == CreativeTabs.tabInventory.getTabIndex()) ++ { ++ var3.inventorySlots = this.backupContainerSlots; ++ this.backupContainerSlots = null; ++ } ++ ++ if (this.searchField != null) ++ { ++ if (par1CreativeTabs == CreativeTabs.tabAllSearch) ++ { ++ this.searchField.setVisible(true); ++ this.searchField.setCanLoseFocus(false); ++ this.searchField.setFocused(true); ++ this.searchField.setText(""); ++ this.updateCreativeSearch(); ++ } ++ else ++ { ++ this.searchField.setVisible(false); ++ this.searchField.setCanLoseFocus(true); ++ this.searchField.setFocused(false); ++ } ++ } ++ ++ this.currentScroll = 0.0F; ++ var3.scrollTo(0.0F); ++ } ++ ++ /** ++ * Handles mouse input. ++ */ ++ public void handleMouseInput() ++ { ++ super.handleMouseInput(); ++ int var1 = Mouse.getEventDWheel(); ++ ++ if (var1 != 0 && this.needsScrollBars()) ++ { ++ int var2 = ((ContainerCreative)this.inventorySlots).itemList.size() / 9 - 5 + 1; ++ ++ if (var1 > 0) ++ { ++ var1 = 1; ++ } ++ ++ if (var1 < 0) ++ { ++ var1 = -1; ++ } ++ ++ this.currentScroll = (float)((double)this.currentScroll - (double)var1 / (double)var2); ++ ++ if (this.currentScroll < 0.0F) ++ { ++ this.currentScroll = 0.0F; ++ } ++ ++ if (this.currentScroll > 1.0F) ++ { ++ this.currentScroll = 1.0F; ++ } ++ ++ ((ContainerCreative)this.inventorySlots).scrollTo(this.currentScroll); ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ boolean var4 = Mouse.isButtonDown(0); ++ int var5 = this.guiLeft; ++ int var6 = this.guiTop; ++ int var7 = var5 + 175; ++ int var8 = var6 + 18; ++ int var9 = var7 + 14; ++ int var10 = var8 + 112; ++ ++ if (!this.wasClicking && var4 && par1 >= var7 && par2 >= var8 && par1 < var9 && par2 < var10) ++ { ++ this.isScrolling = this.needsScrollBars(); ++ } ++ ++ if (!var4) ++ { ++ this.isScrolling = false; ++ } ++ ++ this.wasClicking = var4; ++ ++ if (this.isScrolling) ++ { ++ this.currentScroll = ((float)(par2 - var8) - 7.5F) / ((float)(var10 - var8) - 15.0F); ++ ++ if (this.currentScroll < 0.0F) ++ { ++ this.currentScroll = 0.0F; ++ } ++ ++ if (this.currentScroll > 1.0F) ++ { ++ this.currentScroll = 1.0F; ++ } ++ ++ ((ContainerCreative)this.inventorySlots).scrollTo(this.currentScroll); ++ } ++ ++ super.drawScreen(par1, par2, par3); ++ CreativeTabs[] var11 = CreativeTabs.creativeTabArray; ++ int var12 = var11.length; ++ ++ for (int var13 = 0; var13 < var12; ++var13) ++ { ++ CreativeTabs var14 = var11[var13]; ++ ++ if (this.renderCreativeInventoryHoveringText(var14, par1, par2)) ++ { ++ break; ++ } ++ } ++ ++ if (this.field_74235_v != null && selectedTabIndex == CreativeTabs.tabInventory.getTabIndex() && this.isPointInRegion(this.field_74235_v.xDisplayPosition, this.field_74235_v.yDisplayPosition, 16, 16, par1, par2)) ++ { ++ this.drawCreativeTabHoveringText(I18n.getString("inventory.binSlot"), par1, par2); ++ } ++ ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ } ++ ++ protected void drawItemStackTooltip(ItemStack par1ItemStack, int par2, int par3) ++ { ++ if (selectedTabIndex == CreativeTabs.tabAllSearch.getTabIndex()) ++ { ++ List var4 = par1ItemStack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips); ++ CreativeTabs var5 = par1ItemStack.getItem().getCreativeTab(); ++ ++ if (var5 == null && par1ItemStack.itemID == Item.enchantedBook.itemID) ++ { ++ Map var6 = EnchantmentHelper.getEnchantments(par1ItemStack); ++ ++ if (var6.size() == 1) ++ { ++ Enchantment var7 = Enchantment.enchantmentsList[((Integer)var6.keySet().iterator().next()).intValue()]; ++ CreativeTabs[] var8 = CreativeTabs.creativeTabArray; ++ int var9 = var8.length; ++ ++ for (int var10 = 0; var10 < var9; ++var10) ++ { ++ CreativeTabs var11 = var8[var10]; ++ ++ if (var11.func_111226_a(var7.type)) ++ { ++ var5 = var11; ++ break; ++ } ++ } ++ } ++ } ++ ++ if (var5 != null) ++ { ++ var4.add(1, "" + EnumChatFormatting.BOLD + EnumChatFormatting.BLUE + I18n.getString(var5.getTranslatedTabLabel())); ++ } ++ ++ for (int var12 = 0; var12 < var4.size(); ++var12) ++ { ++ if (var12 == 0) ++ { ++ var4.set(var12, "\u00a7" + Integer.toHexString(par1ItemStack.getRarity().rarityColor) + (String)var4.get(var12)); ++ } ++ else ++ { ++ var4.set(var12, EnumChatFormatting.GRAY + (String)var4.get(var12)); ++ } ++ } ++ ++ this.func_102021_a(var4, par2, par3); ++ } ++ else ++ { ++ super.drawItemStackTooltip(par1ItemStack, par2, par3); ++ } ++ } ++ ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) ++ { ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ RenderHelper.enableGUIStandardItemLighting(); ++ CreativeTabs var4 = CreativeTabs.creativeTabArray[selectedTabIndex]; ++ CreativeTabs[] var5 = CreativeTabs.creativeTabArray; ++ int var6 = var5.length; ++ int var7; ++ ++ for (var7 = 0; var7 < var6; ++var7) ++ { ++ CreativeTabs var8 = var5[var7]; ++ this.mc.getTextureManager().bindTexture(field_110424_t); ++ ++ if (var8.getTabIndex() != selectedTabIndex) ++ { ++ this.renderCreativeTab(var8); ++ } ++ } ++ ++ this.mc.getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + var4.getBackgroundImageName())); ++ this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize); ++ this.searchField.drawTextBox(); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ int var9 = this.guiLeft + 175; ++ var6 = this.guiTop + 18; ++ var7 = var6 + 112; ++ this.mc.getTextureManager().bindTexture(field_110424_t); ++ ++ if (var4.shouldHidePlayerInventory()) ++ { ++ this.drawTexturedModalRect(var9, var6 + (int)((float)(var7 - var6 - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15); ++ } ++ ++ this.renderCreativeTab(var4); ++ ++ if (var4 == CreativeTabs.tabInventory) ++ { ++ GuiInventory.func_110423_a(this.guiLeft + 43, this.guiTop + 45, 20, (float)(this.guiLeft + 43 - par2), (float)(this.guiTop + 45 - 30 - par3), this.mc.thePlayer); ++ } ++ } ++ ++ protected boolean func_74232_a(CreativeTabs par1CreativeTabs, int par2, int par3) ++ { ++ int var4 = par1CreativeTabs.getTabColumn(); ++ int var5 = 28 * var4; ++ byte var6 = 0; ++ ++ if (var4 == 5) ++ { ++ var5 = this.xSize - 28 + 2; ++ } ++ else if (var4 > 0) ++ { ++ var5 += var4; ++ } ++ ++ int var7; ++ ++ if (par1CreativeTabs.isTabInFirstRow()) ++ { ++ var7 = var6 - 32; ++ } ++ else ++ { ++ var7 = var6 + this.ySize; ++ } ++ ++ return par2 >= var5 && par2 <= var5 + 28 && par3 >= var7 && par3 <= var7 + 32; ++ } ++ ++ /** ++ * Renders the creative inventory hovering text if mouse is over it. Returns true if did render or false otherwise. ++ * Params: current creative tab to be checked, current mouse x position, current mouse y position. ++ */ ++ protected boolean renderCreativeInventoryHoveringText(CreativeTabs par1CreativeTabs, int par2, int par3) ++ { ++ int var4 = par1CreativeTabs.getTabColumn(); ++ int var5 = 28 * var4; ++ byte var6 = 0; ++ ++ if (var4 == 5) ++ { ++ var5 = this.xSize - 28 + 2; ++ } ++ else if (var4 > 0) ++ { ++ var5 += var4; ++ } ++ ++ int var7; ++ ++ if (par1CreativeTabs.isTabInFirstRow()) ++ { ++ var7 = var6 - 32; ++ } ++ else ++ { ++ var7 = var6 + this.ySize; ++ } ++ ++ if (this.isPointInRegion(var5 + 3, var7 + 3, 23, 27, par2, par3)) ++ { ++ this.drawCreativeTabHoveringText(I18n.getString(par1CreativeTabs.getTranslatedTabLabel()), par2, par3); ++ return true; ++ } ++ else ++ { ++ return false; ++ } ++ } ++ ++ /** ++ * Renders passed creative inventory tab into the screen. ++ */ ++ protected void renderCreativeTab(CreativeTabs par1CreativeTabs) ++ { ++ boolean var2 = par1CreativeTabs.getTabIndex() == selectedTabIndex; ++ boolean var3 = par1CreativeTabs.isTabInFirstRow(); ++ int var4 = par1CreativeTabs.getTabColumn(); ++ int var5 = var4 * 28; ++ int var6 = 0; ++ int var7 = this.guiLeft + 28 * var4; ++ int var8 = this.guiTop; ++ byte var9 = 32; ++ ++ if (var2) ++ { ++ var6 += 32; ++ } ++ ++ if (var4 == 5) ++ { ++ var7 = this.guiLeft + this.xSize - 28; ++ } ++ else if (var4 > 0) ++ { ++ var7 += var4; ++ } ++ ++ if (var3) ++ { ++ var8 -= 28; ++ } ++ else ++ { ++ var6 += 64; ++ var8 += this.ySize - 4; ++ } ++ ++ GL11.glDisable(GL11.GL_LIGHTING); ++ this.drawTexturedModalRect(var7, var8, var5, var6, 28, var9); ++ this.zLevel = 100.0F; ++ itemRenderer.zLevel = 100.0F; ++ var7 += 6; ++ var8 += 8 + (var3 ? 1 : -1); ++ GL11.glEnable(GL11.GL_LIGHTING); ++ GL11.glEnable(GL12.GL_RESCALE_NORMAL); ++ ItemStack var10 = new ItemStack(par1CreativeTabs.getTabIconItem()); ++ itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var10, var7, var8); ++ itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var10, var7, var8); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ itemRenderer.zLevel = 0.0F; ++ this.zLevel = 0.0F; ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ if (par1GuiButton.id == 0) ++ { ++ this.mc.displayGuiScreen(new GuiAchievements(this.mc.statFileWriter)); ++ } ++ ++ if (par1GuiButton.id == 1) ++ { ++ this.mc.displayGuiScreen(new GuiStats(this, this.mc.statFileWriter)); ++ } ++ } ++ ++ /** ++ * Returns the current creative tab index. ++ */ ++ public int getCurrentTabIndex() ++ { ++ return selectedTabIndex; ++ } ++ ++ /** ++ * Returns the creative inventory ++ */ ++ static InventoryBasic getInventory() ++ { ++ return inventory; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiControls.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,155 ---- ++ package net.minecraft.src; ++ ++ public class GuiControls extends GuiScreen ++ { ++ /** ++ * A reference to the screen object that created this. Used for navigating between screens. ++ */ ++ private GuiScreen parentScreen; ++ ++ /** The title string that is displayed in the top-center of the screen. */ ++ protected String screenTitle = "Controls"; ++ ++ /** Reference to the GameSettings object. */ ++ private GameSettings options; ++ ++ /** The ID of the button that has been pressed. */ ++ private int buttonId = -1; ++ ++ public GuiControls(GuiScreen par1GuiScreen, GameSettings par2GameSettings) ++ { ++ this.parentScreen = par1GuiScreen; ++ this.options = par2GameSettings; ++ } ++ ++ /** ++ * Gets the distance from the left border of the window to left border of the controls screen ++ */ ++ private int getLeftBorder() ++ { ++ return this.width / 2 - 155; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ int var1 = this.getLeftBorder(); ++ ++ for (int var2 = 0; var2 < this.options.keyBindings.length; ++var2) ++ { ++ this.buttonList.add(new GuiSmallButton(var2, var1 + var2 % 2 * 160, this.height / 6 + 24 * (var2 >> 1), 70, 20, this.options.getOptionDisplayString(var2))); ++ } ++ ++ this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done"))); ++ this.screenTitle = I18n.getString("controls.title"); ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ for (int var2 = 0; var2 < this.options.keyBindings.length; ++var2) ++ { ++ ((GuiButton)this.buttonList.get(var2)).displayString = this.options.getOptionDisplayString(var2); ++ } ++ ++ if (par1GuiButton.id == 200) ++ { ++ this.mc.displayGuiScreen(this.parentScreen); ++ } ++ else ++ { ++ this.buttonId = par1GuiButton.id; ++ par1GuiButton.displayString = "> " + this.options.getOptionDisplayString(par1GuiButton.id) + " <"; ++ } ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) ++ { ++ if (this.buttonId >= 0) ++ { ++ this.options.setKeyBinding(this.buttonId, -100 + par3); ++ ((GuiButton)this.buttonList.get(this.buttonId)).displayString = this.options.getOptionDisplayString(this.buttonId); ++ this.buttonId = -1; ++ KeyBinding.resetKeyBindingArrayAndHash(); ++ } ++ else ++ { ++ super.mouseClicked(par1, par2, par3); ++ } ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) ++ { ++ if (this.buttonId >= 0) ++ { ++ this.options.setKeyBinding(this.buttonId, par2); ++ ((GuiButton)this.buttonList.get(this.buttonId)).displayString = this.options.getOptionDisplayString(this.buttonId); ++ this.buttonId = -1; ++ KeyBinding.resetKeyBindingArrayAndHash(); ++ } ++ else ++ { ++ super.keyTyped(par1, par2); ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 20, 16777215); ++ int var4 = this.getLeftBorder(); ++ int var5 = 0; ++ ++ while (var5 < this.options.keyBindings.length) ++ { ++ boolean var6 = false; ++ int var7 = 0; ++ ++ while (true) ++ { ++ if (var7 < this.options.keyBindings.length) ++ { ++ if (var7 == var5 || this.options.keyBindings[var5].keyCode != this.options.keyBindings[var7].keyCode) ++ { ++ ++var7; ++ continue; ++ } ++ ++ var6 = true; ++ } ++ ++ if (this.buttonId == var5) ++ { ++ ((GuiButton)this.buttonList.get(var5)).displayString = "" + EnumChatFormatting.WHITE + "> " + EnumChatFormatting.YELLOW + "??? " + EnumChatFormatting.WHITE + "<"; ++ } ++ else if (var6) ++ { ++ ((GuiButton)this.buttonList.get(var5)).displayString = EnumChatFormatting.RED + this.options.getOptionDisplayString(var5); ++ } ++ else ++ { ++ ((GuiButton)this.buttonList.get(var5)).displayString = this.options.getOptionDisplayString(var5); ++ } ++ ++ this.drawString(this.fontRenderer, this.options.getKeyBindingDescription(var5), var4 + var5 % 2 * 160 + 70 + 6, this.height / 6 + 24 * (var5 >> 1) + 7, -1); ++ ++var5; ++ break; ++ } ++ } ++ ++ super.drawScreen(par1, par2, par3); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiCrafting.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,34 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class GuiCrafting extends GuiContainer ++ { ++ private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation("textures/gui/container/crafting_table.png"); ++ ++ public GuiCrafting(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5) ++ { ++ super(new ContainerWorkbench(par1InventoryPlayer, par2World, par3, par4, par5)); ++ } ++ ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) ++ { ++ this.fontRenderer.drawString(I18n.getString("container.crafting"), 28, 6, 4210752); ++ this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752); ++ } ++ ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) ++ { ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.mc.getTextureManager().bindTexture(craftingTableGuiTextures); ++ int var4 = (this.width - this.xSize) / 2; ++ int var5 = (this.height - this.ySize) / 2; ++ this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiCreateFlatWorld.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,120 ---- ++ package net.minecraft.src; ++ ++ public class GuiCreateFlatWorld extends GuiScreen ++ { ++ private static RenderItem theRenderItem = new RenderItem(); ++ private final GuiCreateWorld createWorldGui; ++ private FlatGeneratorInfo theFlatGeneratorInfo = FlatGeneratorInfo.getDefaultFlatGenerator(); ++ private String customizationTitle; ++ private String layerMaterialLabel; ++ private String heightLabel; ++ private GuiCreateFlatWorldListSlot createFlatWorldListSlotGui; ++ private GuiButton buttonAddLayer; ++ private GuiButton buttonEditLayer; ++ private GuiButton buttonRemoveLayer; ++ ++ public GuiCreateFlatWorld(GuiCreateWorld par1GuiCreateWorld, String par2Str) ++ { ++ this.createWorldGui = par1GuiCreateWorld; ++ this.setFlatGeneratorInfo(par2Str); ++ } ++ ++ public String getFlatGeneratorInfo() ++ { ++ return this.theFlatGeneratorInfo.toString(); ++ } ++ ++ public void setFlatGeneratorInfo(String par1Str) ++ { ++ this.theFlatGeneratorInfo = FlatGeneratorInfo.createFlatGeneratorFromString(par1Str); ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.buttonList.clear(); ++ this.customizationTitle = I18n.getString("createWorld.customize.flat.title"); ++ this.layerMaterialLabel = I18n.getString("createWorld.customize.flat.tile"); ++ this.heightLabel = I18n.getString("createWorld.customize.flat.height"); ++ this.createFlatWorldListSlotGui = new GuiCreateFlatWorldListSlot(this); ++ this.buttonList.add(this.buttonAddLayer = new GuiButton(2, this.width / 2 - 154, this.height - 52, 100, 20, I18n.getString("createWorld.customize.flat.addLayer") + " (NYI)")); ++ this.buttonList.add(this.buttonEditLayer = new GuiButton(3, this.width / 2 - 50, this.height - 52, 100, 20, I18n.getString("createWorld.customize.flat.editLayer") + " (NYI)")); ++ this.buttonList.add(this.buttonRemoveLayer = new GuiButton(4, this.width / 2 - 155, this.height - 52, 150, 20, I18n.getString("createWorld.customize.flat.removeLayer"))); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.getString("gui.done"))); ++ this.buttonList.add(new GuiButton(5, this.width / 2 + 5, this.height - 52, 150, 20, I18n.getString("createWorld.customize.presets"))); ++ this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.getString("gui.cancel"))); ++ this.buttonAddLayer.drawButton = this.buttonEditLayer.drawButton = false; ++ this.theFlatGeneratorInfo.func_82645_d(); ++ this.func_82270_g(); ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ int var2 = this.theFlatGeneratorInfo.getFlatLayers().size() - this.createFlatWorldListSlotGui.field_82454_a - 1; ++ ++ if (par1GuiButton.id == 1) ++ { ++ this.mc.displayGuiScreen(this.createWorldGui); ++ } ++ else if (par1GuiButton.id == 0) ++ { ++ this.createWorldGui.generatorOptionsToUse = this.getFlatGeneratorInfo(); ++ this.mc.displayGuiScreen(this.createWorldGui); ++ } ++ else if (par1GuiButton.id == 5) ++ { ++ this.mc.displayGuiScreen(new GuiFlatPresets(this)); ++ } ++ else if (par1GuiButton.id == 4 && this.func_82272_i()) ++ { ++ this.theFlatGeneratorInfo.getFlatLayers().remove(var2); ++ this.createFlatWorldListSlotGui.field_82454_a = Math.min(this.createFlatWorldListSlotGui.field_82454_a, this.theFlatGeneratorInfo.getFlatLayers().size() - 1); ++ } ++ ++ this.theFlatGeneratorInfo.func_82645_d(); ++ this.func_82270_g(); ++ } ++ ++ public void func_82270_g() ++ { ++ boolean var1 = this.func_82272_i(); ++ this.buttonRemoveLayer.enabled = var1; ++ this.buttonEditLayer.enabled = var1; ++ this.buttonEditLayer.enabled = false; ++ this.buttonAddLayer.enabled = false; ++ } ++ ++ private boolean func_82272_i() ++ { ++ return this.createFlatWorldListSlotGui.field_82454_a > -1 && this.createFlatWorldListSlotGui.field_82454_a < this.theFlatGeneratorInfo.getFlatLayers().size(); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.createFlatWorldListSlotGui.drawScreen(par1, par2, par3); ++ this.drawCenteredString(this.fontRenderer, this.customizationTitle, this.width / 2, 8, 16777215); ++ int var4 = this.width / 2 - 92 - 16; ++ this.drawString(this.fontRenderer, this.layerMaterialLabel, var4, 32, 16777215); ++ this.drawString(this.fontRenderer, this.heightLabel, var4 + 2 + 213 - this.fontRenderer.getStringWidth(this.heightLabel), 32, 16777215); ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ static RenderItem getRenderItem() ++ { ++ return theRenderItem; ++ } ++ ++ static FlatGeneratorInfo func_82271_a(GuiCreateFlatWorld par0GuiCreateFlatWorld) ++ { ++ return par0GuiCreateFlatWorld.theFlatGeneratorInfo; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiCreateFlatWorldListSlot.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,112 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ import org.lwjgl.opengl.GL12; ++ ++ class GuiCreateFlatWorldListSlot extends GuiSlot ++ { ++ public int field_82454_a; ++ ++ final GuiCreateFlatWorld createFlatWorldGui; ++ ++ public GuiCreateFlatWorldListSlot(GuiCreateFlatWorld par1GuiCreateFlatWorld) ++ { ++ super(par1GuiCreateFlatWorld.mc, par1GuiCreateFlatWorld.width, par1GuiCreateFlatWorld.height, 43, par1GuiCreateFlatWorld.height - 60, 24); ++ this.createFlatWorldGui = par1GuiCreateFlatWorld; ++ this.field_82454_a = -1; ++ } ++ ++ private void func_82452_a(int par1, int par2, ItemStack par3ItemStack) ++ { ++ this.func_82451_d(par1 + 1, par2 + 1); ++ GL11.glEnable(GL12.GL_RESCALE_NORMAL); ++ ++ if (par3ItemStack != null) ++ { ++ RenderHelper.enableGUIStandardItemLighting(); ++ GuiCreateFlatWorld.getRenderItem().renderItemIntoGUI(this.createFlatWorldGui.fontRenderer, this.createFlatWorldGui.mc.getTextureManager(), par3ItemStack, par1 + 2, par2 + 2); ++ RenderHelper.disableStandardItemLighting(); ++ } ++ ++ GL11.glDisable(GL12.GL_RESCALE_NORMAL); ++ } ++ ++ private void func_82451_d(int par1, int par2) ++ { ++ this.func_82450_b(par1, par2, 0, 0); ++ } ++ ++ private void func_82450_b(int par1, int par2, int par3, int par4) ++ { ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.createFlatWorldGui.mc.getTextureManager().bindTexture(Gui.statIcons); ++ float var5 = 0.0078125F; ++ float var6 = 0.0078125F; ++ boolean var7 = true; ++ boolean var8 = true; ++ Tessellator var9 = Tessellator.instance; ++ var9.startDrawingQuads(); ++ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 18), (double)this.createFlatWorldGui.zLevel, (double)((float)(par3 + 0) * 0.0078125F), (double)((float)(par4 + 18) * 0.0078125F)); ++ var9.addVertexWithUV((double)(par1 + 18), (double)(par2 + 18), (double)this.createFlatWorldGui.zLevel, (double)((float)(par3 + 18) * 0.0078125F), (double)((float)(par4 + 18) * 0.0078125F)); ++ var9.addVertexWithUV((double)(par1 + 18), (double)(par2 + 0), (double)this.createFlatWorldGui.zLevel, (double)((float)(par3 + 18) * 0.0078125F), (double)((float)(par4 + 0) * 0.0078125F)); ++ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.createFlatWorldGui.zLevel, (double)((float)(par3 + 0) * 0.0078125F), (double)((float)(par4 + 0) * 0.0078125F)); ++ var9.draw(); ++ } ++ ++ /** ++ * Gets the size of the current slot list. ++ */ ++ protected int getSize() ++ { ++ return GuiCreateFlatWorld.func_82271_a(this.createFlatWorldGui).getFlatLayers().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) ++ { ++ this.field_82454_a = par1; ++ this.createFlatWorldGui.func_82270_g(); ++ } ++ ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) ++ { ++ return par1 == this.field_82454_a; ++ } ++ ++ protected void drawBackground() {} ++ ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) ++ { ++ FlatLayerInfo var6 = (FlatLayerInfo)GuiCreateFlatWorld.func_82271_a(this.createFlatWorldGui).getFlatLayers().get(GuiCreateFlatWorld.func_82271_a(this.createFlatWorldGui).getFlatLayers().size() - par1 - 1); ++ ItemStack var7 = var6.getFillBlock() == 0 ? null : new ItemStack(var6.getFillBlock(), 1, var6.getFillBlockMeta()); ++ String var8 = var7 == null ? "Air" : Item.itemsList[var6.getFillBlock()].getItemStackDisplayName(var7); ++ this.func_82452_a(par2, par3, var7); ++ this.createFlatWorldGui.fontRenderer.drawString(var8, par2 + 18 + 5, par3 + 3, 16777215); ++ String var9; ++ ++ if (par1 == 0) ++ { ++ var9 = I18n.getStringParams("createWorld.customize.flat.layer.top", new Object[] {Integer.valueOf(var6.getLayerCount())}); ++ } ++ else if (par1 == GuiCreateFlatWorld.func_82271_a(this.createFlatWorldGui).getFlatLayers().size() - 1) ++ { ++ var9 = I18n.getStringParams("createWorld.customize.flat.layer.bottom", new Object[] {Integer.valueOf(var6.getLayerCount())}); ++ } ++ else ++ { ++ var9 = I18n.getStringParams("createWorld.customize.flat.layer", new Object[] {Integer.valueOf(var6.getLayerCount())}); ++ } ++ ++ this.createFlatWorldGui.fontRenderer.drawString(var9, par2 + 2 + 213 - this.createFlatWorldGui.fontRenderer.getStringWidth(var9), par3 + 3, 16777215); ++ } ++ ++ protected int getScrollBarX() ++ { ++ return this.createFlatWorldGui.width - 70; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiCreateWorld.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,487 ---- ++ package net.minecraft.src; ++ ++ import java.util.Random; ++ import org.lwjgl.input.Keyboard; ++ ++ public class GuiCreateWorld extends GuiScreen ++ { ++ private GuiScreen parentGuiScreen; ++ private GuiTextField textboxWorldName; ++ private GuiTextField textboxSeed; ++ private String folderName; ++ ++ /** hardcore', 'creative' or 'survival */ ++ private String gameMode = "survival"; ++ private boolean generateStructures = true; ++ private boolean commandsAllowed; ++ ++ /** True iif player has clicked buttonAllowCommands at least once */ ++ private boolean commandsToggled; ++ ++ /** toggles when GUIButton 7 is pressed */ ++ private boolean bonusItems; ++ ++ /** True if and only if gameMode.equals("hardcore") */ ++ private boolean isHardcore; ++ private boolean createClicked; ++ ++ /** ++ * True if the extra options (Seed box, structure toggle button, world type button, etc.) are being shown ++ */ ++ private boolean moreOptions; ++ ++ /** The GUIButton that you click to change game modes. */ ++ private GuiButton buttonGameMode; ++ ++ /** ++ * The GUIButton that you click to get to options like the seed when creating a world. ++ */ ++ private GuiButton moreWorldOptions; ++ ++ /** The GuiButton in the 'More World Options' screen. Toggles ON/OFF */ ++ private GuiButton buttonGenerateStructures; ++ private GuiButton buttonBonusItems; ++ ++ /** The GuiButton in the more world options screen. */ ++ private GuiButton buttonWorldType; ++ private GuiButton buttonAllowCommands; ++ ++ /** GuiButton in the more world options screen. */ ++ private GuiButton buttonCustomize; ++ ++ /** The first line of text describing the currently selected game mode. */ ++ private String gameModeDescriptionLine1; ++ ++ /** The second line of text describing the currently selected game mode. */ ++ private String gameModeDescriptionLine2; ++ ++ /** The current textboxSeed text */ ++ private String seed; ++ ++ /** E.g. New World, Neue Welt, Nieuwe wereld, Neuvo Mundo */ ++ private String localizedNewWorldText; ++ private int worldTypeId; ++ ++ /** Generator options to use when creating the world. */ ++ public String generatorOptionsToUse = ""; ++ ++ /** ++ * If the world name is one of these, it'll be surrounded with underscores. ++ */ ++ private static final String[] ILLEGAL_WORLD_NAMES = new String[] {"CON", "COM", "PRN", "AUX", "CLOCK$", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9"}; ++ ++ public GuiCreateWorld(GuiScreen par1GuiScreen) ++ { ++ this.parentGuiScreen = par1GuiScreen; ++ this.seed = ""; ++ this.localizedNewWorldText = I18n.getString("selectWorld.newWorld"); ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ this.textboxWorldName.updateCursorCounter(); ++ this.textboxSeed.updateCursorCounter(); ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ Keyboard.enableRepeatEvents(true); ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.getString("selectWorld.create"))); ++ this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.getString("gui.cancel"))); ++ this.buttonList.add(this.buttonGameMode = new GuiButton(2, this.width / 2 - 75, 115, 150, 20, I18n.getString("selectWorld.gameMode"))); ++ this.buttonList.add(this.moreWorldOptions = new GuiButton(3, this.width / 2 - 75, 187, 150, 20, I18n.getString("selectWorld.moreWorldOptions"))); ++ this.buttonList.add(this.buttonGenerateStructures = new GuiButton(4, this.width / 2 - 155, 100, 150, 20, I18n.getString("selectWorld.mapFeatures"))); ++ this.buttonGenerateStructures.drawButton = false; ++ this.buttonList.add(this.buttonBonusItems = new GuiButton(7, this.width / 2 + 5, 151, 150, 20, I18n.getString("selectWorld.bonusItems"))); ++ this.buttonBonusItems.drawButton = false; ++ this.buttonList.add(this.buttonWorldType = new GuiButton(5, this.width / 2 + 5, 100, 150, 20, I18n.getString("selectWorld.mapType"))); ++ this.buttonWorldType.drawButton = false; ++ this.buttonList.add(this.buttonAllowCommands = new GuiButton(6, this.width / 2 - 155, 151, 150, 20, I18n.getString("selectWorld.allowCommands"))); ++ this.buttonAllowCommands.drawButton = false; ++ this.buttonList.add(this.buttonCustomize = new GuiButton(8, this.width / 2 + 5, 120, 150, 20, I18n.getString("selectWorld.customizeType"))); ++ this.buttonCustomize.drawButton = false; ++ this.textboxWorldName = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 60, 200, 20); ++ this.textboxWorldName.setFocused(true); ++ this.textboxWorldName.setText(this.localizedNewWorldText); ++ this.textboxSeed = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 60, 200, 20); ++ this.textboxSeed.setText(this.seed); ++ this.func_82288_a(this.moreOptions); ++ this.makeUseableName(); ++ this.updateButtonText(); ++ } ++ ++ /** ++ * Makes a the name for a world save folder based on your world name, replacing specific characters for _s and ++ * appending -s to the end until a free name is available. ++ */ ++ private void makeUseableName() ++ { ++ this.folderName = this.textboxWorldName.getText().trim(); ++ char[] var1 = ChatAllowedCharacters.allowedCharactersArray; ++ int var2 = var1.length; ++ ++ for (int var3 = 0; var3 < var2; ++var3) ++ { ++ char var4 = var1[var3]; ++ this.folderName = this.folderName.replace(var4, '_'); ++ } ++ ++ if (MathHelper.stringNullOrLengthZero(this.folderName)) ++ { ++ this.folderName = "World"; ++ } ++ ++ this.folderName = func_73913_a(this.mc.getSaveLoader(), this.folderName); ++ } ++ ++ private void updateButtonText() ++ { ++ this.buttonGameMode.displayString = I18n.getString("selectWorld.gameMode") + " " + I18n.getString("selectWorld.gameMode." + this.gameMode); ++ this.gameModeDescriptionLine1 = I18n.getString("selectWorld.gameMode." + this.gameMode + ".line1"); ++ this.gameModeDescriptionLine2 = I18n.getString("selectWorld.gameMode." + this.gameMode + ".line2"); ++ this.buttonGenerateStructures.displayString = I18n.getString("selectWorld.mapFeatures") + " "; ++ ++ if (this.generateStructures) ++ { ++ this.buttonGenerateStructures.displayString = this.buttonGenerateStructures.displayString + I18n.getString("options.on"); ++ } ++ else ++ { ++ this.buttonGenerateStructures.displayString = this.buttonGenerateStructures.displayString + I18n.getString("options.off"); ++ } ++ ++ this.buttonBonusItems.displayString = I18n.getString("selectWorld.bonusItems") + " "; ++ ++ if (this.bonusItems && !this.isHardcore) ++ { ++ this.buttonBonusItems.displayString = this.buttonBonusItems.displayString + I18n.getString("options.on"); ++ } ++ else ++ { ++ this.buttonBonusItems.displayString = this.buttonBonusItems.displayString + I18n.getString("options.off"); ++ } ++ ++ this.buttonWorldType.displayString = I18n.getString("selectWorld.mapType") + " " + I18n.getString(WorldType.worldTypes[this.worldTypeId].getTranslateName()); ++ this.buttonAllowCommands.displayString = I18n.getString("selectWorld.allowCommands") + " "; ++ ++ if (this.commandsAllowed && !this.isHardcore) ++ { ++ this.buttonAllowCommands.displayString = this.buttonAllowCommands.displayString + I18n.getString("options.on"); ++ } ++ else ++ { ++ this.buttonAllowCommands.displayString = this.buttonAllowCommands.displayString + I18n.getString("options.off"); ++ } ++ } ++ ++ public static String func_73913_a(ISaveFormat par0ISaveFormat, String par1Str) ++ { ++ par1Str = par1Str.replaceAll("[\\./\"]", "_"); ++ String[] var2 = ILLEGAL_WORLD_NAMES; ++ int var3 = var2.length; ++ ++ for (int var4 = 0; var4 < var3; ++var4) ++ { ++ String var5 = var2[var4]; ++ ++ if (par1Str.equalsIgnoreCase(var5)) ++ { ++ par1Str = "_" + par1Str + "_"; ++ } ++ } ++ ++ while (par0ISaveFormat.getWorldInfo(par1Str) != null) ++ { ++ par1Str = par1Str + "-"; ++ } ++ ++ return par1Str; ++ } ++ ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ ++ public void onGuiClosed() ++ { ++ Keyboard.enableRepeatEvents(false); ++ } ++ ++ /** ++ * 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 == 1) ++ { ++ this.mc.displayGuiScreen(this.parentGuiScreen); ++ } ++ else if (par1GuiButton.id == 0) ++ { ++ this.mc.displayGuiScreen((GuiScreen)null); ++ ++ if (this.createClicked) ++ { ++ return; ++ } ++ ++ this.createClicked = true; ++ long var2 = (new Random()).nextLong(); ++ String var4 = this.textboxSeed.getText(); ++ ++ if (!MathHelper.stringNullOrLengthZero(var4)) ++ { ++ try ++ { ++ long var5 = Long.parseLong(var4); ++ ++ if (var5 != 0L) ++ { ++ var2 = var5; ++ } ++ } ++ catch (NumberFormatException var7) ++ { ++ var2 = (long)var4.hashCode(); ++ } ++ } ++ ++ EnumGameType var8 = EnumGameType.getByName(this.gameMode); ++ WorldSettings var6 = new WorldSettings(var2, var8, this.generateStructures, this.isHardcore, WorldType.worldTypes[this.worldTypeId]); ++ var6.func_82750_a(this.generatorOptionsToUse); ++ ++ if (this.bonusItems && !this.isHardcore) ++ { ++ var6.enableBonusChest(); ++ } ++ ++ if (this.commandsAllowed && !this.isHardcore) ++ { ++ var6.enableCommands(); ++ } ++ ++ this.mc.launchIntegratedServer(this.folderName, this.textboxWorldName.getText().trim(), var6); ++ this.mc.statFileWriter.readStat(StatList.createWorldStat, 1); ++ } ++ else if (par1GuiButton.id == 3) ++ { ++ this.func_82287_i(); ++ } ++ else if (par1GuiButton.id == 2) ++ { ++ if (this.gameMode.equals("survival")) ++ { ++ if (!this.commandsToggled) ++ { ++ this.commandsAllowed = false; ++ } ++ ++ this.isHardcore = false; ++ this.gameMode = "hardcore"; ++ this.isHardcore = true; ++ this.buttonAllowCommands.enabled = false; ++ this.buttonBonusItems.enabled = false; ++ this.updateButtonText(); ++ } ++ else if (this.gameMode.equals("hardcore")) ++ { ++ if (!this.commandsToggled) ++ { ++ this.commandsAllowed = true; ++ } ++ ++ this.isHardcore = false; ++ this.gameMode = "creative"; ++ this.updateButtonText(); ++ this.isHardcore = false; ++ this.buttonAllowCommands.enabled = true; ++ this.buttonBonusItems.enabled = true; ++ } ++ else ++ { ++ if (!this.commandsToggled) ++ { ++ this.commandsAllowed = false; ++ } ++ ++ this.gameMode = "survival"; ++ this.updateButtonText(); ++ this.buttonAllowCommands.enabled = true; ++ this.buttonBonusItems.enabled = true; ++ this.isHardcore = false; ++ } ++ ++ this.updateButtonText(); ++ } ++ else if (par1GuiButton.id == 4) ++ { ++ this.generateStructures = !this.generateStructures; ++ this.updateButtonText(); ++ } ++ else if (par1GuiButton.id == 7) ++ { ++ this.bonusItems = !this.bonusItems; ++ this.updateButtonText(); ++ } ++ else if (par1GuiButton.id == 5) ++ { ++ ++this.worldTypeId; ++ ++ if (this.worldTypeId >= WorldType.worldTypes.length) ++ { ++ this.worldTypeId = 0; ++ } ++ ++ while (WorldType.worldTypes[this.worldTypeId] == null || !WorldType.worldTypes[this.worldTypeId].getCanBeCreated()) ++ { ++ ++this.worldTypeId; ++ ++ if (this.worldTypeId >= WorldType.worldTypes.length) ++ { ++ this.worldTypeId = 0; ++ } ++ } ++ ++ this.generatorOptionsToUse = ""; ++ this.updateButtonText(); ++ this.func_82288_a(this.moreOptions); ++ } ++ else if (par1GuiButton.id == 6) ++ { ++ this.commandsToggled = true; ++ this.commandsAllowed = !this.commandsAllowed; ++ this.updateButtonText(); ++ } ++ else if (par1GuiButton.id == 8) ++ { ++ this.mc.displayGuiScreen(new GuiCreateFlatWorld(this, this.generatorOptionsToUse)); ++ } ++ } ++ } ++ ++ private void func_82287_i() ++ { ++ this.func_82288_a(!this.moreOptions); ++ } ++ ++ private void func_82288_a(boolean par1) ++ { ++ this.moreOptions = par1; ++ this.buttonGameMode.drawButton = !this.moreOptions; ++ this.buttonGenerateStructures.drawButton = this.moreOptions; ++ this.buttonBonusItems.drawButton = this.moreOptions; ++ this.buttonWorldType.drawButton = this.moreOptions; ++ this.buttonAllowCommands.drawButton = this.moreOptions; ++ this.buttonCustomize.drawButton = this.moreOptions && WorldType.worldTypes[this.worldTypeId] == WorldType.FLAT; ++ ++ if (this.moreOptions) ++ { ++ this.moreWorldOptions.displayString = I18n.getString("gui.done"); ++ } ++ else ++ { ++ this.moreWorldOptions.displayString = I18n.getString("selectWorld.moreWorldOptions"); ++ } ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) ++ { ++ if (this.textboxWorldName.isFocused() && !this.moreOptions) ++ { ++ this.textboxWorldName.textboxKeyTyped(par1, par2); ++ this.localizedNewWorldText = this.textboxWorldName.getText(); ++ } ++ else if (this.textboxSeed.isFocused() && this.moreOptions) ++ { ++ this.textboxSeed.textboxKeyTyped(par1, par2); ++ this.seed = this.textboxSeed.getText(); ++ } ++ ++ if (par2 == 28 || par2 == 156) ++ { ++ this.actionPerformed((GuiButton)this.buttonList.get(0)); ++ } ++ ++ ((GuiButton)this.buttonList.get(0)).enabled = this.textboxWorldName.getText().length() > 0; ++ this.makeUseableName(); ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) ++ { ++ super.mouseClicked(par1, par2, par3); ++ ++ if (this.moreOptions) ++ { ++ this.textboxSeed.mouseClicked(par1, par2, par3); ++ } ++ else ++ { ++ this.textboxWorldName.mouseClicked(par1, par2, par3); ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.drawCenteredString(this.fontRenderer, I18n.getString("selectWorld.create"), this.width / 2, 20, 16777215); ++ ++ if (this.moreOptions) ++ { ++ this.drawString(this.fontRenderer, I18n.getString("selectWorld.enterSeed"), this.width / 2 - 100, 47, 10526880); ++ this.drawString(this.fontRenderer, I18n.getString("selectWorld.seedInfo"), this.width / 2 - 100, 85, 10526880); ++ this.drawString(this.fontRenderer, I18n.getString("selectWorld.mapFeatures.info"), this.width / 2 - 150, 122, 10526880); ++ this.drawString(this.fontRenderer, I18n.getString("selectWorld.allowCommands.info"), this.width / 2 - 150, 172, 10526880); ++ this.textboxSeed.drawTextBox(); ++ } ++ else ++ { ++ this.drawString(this.fontRenderer, I18n.getString("selectWorld.enterName"), this.width / 2 - 100, 47, 10526880); ++ this.drawString(this.fontRenderer, I18n.getString("selectWorld.resultFolder") + " " + this.folderName, this.width / 2 - 100, 85, 10526880); ++ this.textboxWorldName.drawTextBox(); ++ this.drawString(this.fontRenderer, this.gameModeDescriptionLine1, this.width / 2 - 100, 137, 10526880); ++ this.drawString(this.fontRenderer, this.gameModeDescriptionLine2, this.width / 2 - 100, 149, 10526880); ++ } ++ ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ public void func_82286_a(WorldInfo par1WorldInfo) ++ { ++ this.localizedNewWorldText = I18n.getStringParams("selectWorld.newWorld.copyOf", new Object[] {par1WorldInfo.getWorldName()}); ++ this.seed = par1WorldInfo.getSeed() + ""; ++ this.worldTypeId = par1WorldInfo.getTerrainType().getWorldTypeID(); ++ this.generatorOptionsToUse = par1WorldInfo.getGeneratorOptions(); ++ this.generateStructures = par1WorldInfo.isMapFeaturesEnabled(); ++ this.commandsAllowed = par1WorldInfo.areCommandsAllowed(); ++ ++ if (par1WorldInfo.isHardcoreModeEnabled()) ++ { ++ this.gameMode = "hardcore"; ++ } ++ else if (par1WorldInfo.getGameType().isSurvivalOrAdventure()) ++ { ++ this.gameMode = "survival"; ++ } ++ else if (par1WorldInfo.getGameType().isCreative()) ++ { ++ this.gameMode = "creative"; ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiDisconnected.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,79 ---- ++ package net.minecraft.src; ++ ++ import java.util.Iterator; ++ import java.util.List; ++ ++ public class GuiDisconnected extends GuiScreen ++ { ++ /** The error message. */ ++ private String errorMessage; ++ ++ /** The details about the error. */ ++ private String errorDetail; ++ private Object[] field_74247_c; ++ private List field_74245_d; ++ private final GuiScreen field_98095_n; ++ ++ public GuiDisconnected(GuiScreen par1GuiScreen, String par2Str, String par3Str, Object ... par4ArrayOfObj) ++ { ++ this.field_98095_n = par1GuiScreen; ++ this.errorMessage = I18n.getString(par2Str); ++ this.errorDetail = par3Str; ++ this.field_74247_c = par4ArrayOfObj; ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) {} ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.toMenu"))); ++ ++ if (this.field_74247_c != null) ++ { ++ this.field_74245_d = this.fontRenderer.listFormattedStringToWidth(I18n.getStringParams(this.errorDetail, this.field_74247_c), this.width - 50); ++ } ++ else ++ { ++ this.field_74245_d = this.fontRenderer.listFormattedStringToWidth(I18n.getString(this.errorDetail), this.width - 50); ++ } ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ if (par1GuiButton.id == 0) ++ { ++ this.mc.displayGuiScreen(this.field_98095_n); ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.drawCenteredString(this.fontRenderer, this.errorMessage, this.width / 2, this.height / 2 - 50, 11184810); ++ int var4 = this.height / 2 - 30; ++ ++ if (this.field_74245_d != null) ++ { ++ for (Iterator var5 = this.field_74245_d.iterator(); var5.hasNext(); var4 += this.fontRenderer.FONT_HEIGHT) ++ { ++ String var6 = (String)var5.next(); ++ this.drawCenteredString(this.fontRenderer, var6, this.width / 2, var4, 16777215); ++ } ++ } ++ ++ super.drawScreen(par1, par2, par3); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiDispenser.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,37 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class GuiDispenser extends GuiContainer ++ { ++ private static final ResourceLocation dispenserGuiTextures = new ResourceLocation("textures/gui/container/dispenser.png"); ++ public TileEntityDispenser theDispenser; ++ ++ public GuiDispenser(InventoryPlayer par1InventoryPlayer, TileEntityDispenser par2TileEntityDispenser) ++ { ++ super(new ContainerDispenser(par1InventoryPlayer, par2TileEntityDispenser)); ++ this.theDispenser = par2TileEntityDispenser; ++ } ++ ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) ++ { ++ String var3 = this.theDispenser.isInvNameLocalized() ? this.theDispenser.getInvName() : I18n.getString(this.theDispenser.getInvName()); ++ this.fontRenderer.drawString(var3, this.xSize / 2 - this.fontRenderer.getStringWidth(var3) / 2, 6, 4210752); ++ this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752); ++ } ++ ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) ++ { ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.mc.getTextureManager().bindTexture(dispenserGuiTextures); ++ int var4 = (this.width - this.xSize) / 2; ++ int var5 = (this.height - this.ySize) / 2; ++ this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiDownloadTerrain.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,56 ---- ++ package net.minecraft.src; ++ ++ public class GuiDownloadTerrain extends GuiScreen ++ { ++ /** Network object that downloads the terrain data. */ ++ private NetClientHandler netHandler; ++ ++ /** Counts the number of screen updates. */ ++ private int updateCounter; ++ ++ public GuiDownloadTerrain(NetClientHandler par1NetClientHandler) ++ { ++ this.netHandler = par1NetClientHandler; ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) {} ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.buttonList.clear(); ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ ++this.updateCounter; ++ ++ if (this.updateCounter % 20 == 0) ++ { ++ this.netHandler.addToSendQueue(new Packet0KeepAlive()); ++ } ++ ++ if (this.netHandler != null) ++ { ++ this.netHandler.processReadPackets(); ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawBackground(0); ++ this.drawCenteredString(this.fontRenderer, I18n.getString("multiplayer.downloadingTerrain"), this.width / 2, this.height / 2 - 50, 16777215); ++ super.drawScreen(par1, par2, par3); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiEditSign.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,168 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.input.Keyboard; ++ import org.lwjgl.opengl.GL11; ++ ++ public class GuiEditSign extends GuiScreen ++ { ++ /** ++ * This String is just a local copy of the characters allowed in text rendering of minecraft. ++ */ ++ private static final String allowedCharacters = ChatAllowedCharacters.allowedCharacters; ++ ++ /** The title string that is displayed in the top-center of the screen. */ ++ protected String screenTitle = "Edit sign message:"; ++ ++ /** Reference to the sign object. */ ++ private TileEntitySign entitySign; ++ ++ /** Counts the number of screen updates. */ ++ private int updateCounter; ++ ++ /** The number of the line that is being edited. */ ++ private int editLine; ++ ++ /** "Done" button for the GUI. */ ++ private GuiButton doneBtn; ++ ++ public GuiEditSign(TileEntitySign par1TileEntitySign) ++ { ++ this.entitySign = par1TileEntitySign; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.buttonList.clear(); ++ Keyboard.enableRepeatEvents(true); ++ this.buttonList.add(this.doneBtn = new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, "Done")); ++ this.entitySign.setEditable(false); ++ } ++ ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ ++ public void onGuiClosed() ++ { ++ Keyboard.enableRepeatEvents(false); ++ NetClientHandler var1 = this.mc.getNetHandler(); ++ ++ if (var1 != null) ++ { ++ var1.addToSendQueue(new Packet130UpdateSign(this.entitySign.xCoord, this.entitySign.yCoord, this.entitySign.zCoord, this.entitySign.signText)); ++ } ++ ++ this.entitySign.setEditable(true); ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ ++this.updateCounter; ++ } ++ ++ /** ++ * 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 == 0) ++ { ++ this.entitySign.onInventoryChanged(); ++ this.mc.displayGuiScreen((GuiScreen)null); ++ } ++ } ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) ++ { ++ if (par2 == 200) ++ { ++ this.editLine = this.editLine - 1 & 3; ++ } ++ ++ if (par2 == 208 || par2 == 28 || par2 == 156) ++ { ++ this.editLine = this.editLine + 1 & 3; ++ } ++ ++ if (par2 == 14 && this.entitySign.signText[this.editLine].length() > 0) ++ { ++ this.entitySign.signText[this.editLine] = this.entitySign.signText[this.editLine].substring(0, this.entitySign.signText[this.editLine].length() - 1); ++ } ++ ++ if (allowedCharacters.indexOf(par1) >= 0 && this.entitySign.signText[this.editLine].length() < 15) ++ { ++ this.entitySign.signText[this.editLine] = this.entitySign.signText[this.editLine] + par1; ++ } ++ ++ if (par2 == 1) ++ { ++ this.actionPerformed(this.doneBtn); ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 40, 16777215); ++ GL11.glPushMatrix(); ++ GL11.glTranslatef((float)(this.width / 2), 0.0F, 50.0F); ++ float var4 = 93.75F; ++ GL11.glScalef(-var4, -var4, -var4); ++ GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); ++ Block var5 = this.entitySign.getBlockType(); ++ ++ if (var5 == Block.signPost) ++ { ++ float var6 = (float)(this.entitySign.getBlockMetadata() * 360) / 16.0F; ++ GL11.glRotatef(var6, 0.0F, 1.0F, 0.0F); ++ GL11.glTranslatef(0.0F, -1.0625F, 0.0F); ++ } ++ else ++ { ++ int var8 = this.entitySign.getBlockMetadata(); ++ float var7 = 0.0F; ++ ++ if (var8 == 2) ++ { ++ var7 = 180.0F; ++ } ++ ++ if (var8 == 4) ++ { ++ var7 = 90.0F; ++ } ++ ++ if (var8 == 5) ++ { ++ var7 = -90.0F; ++ } ++ ++ GL11.glRotatef(var7, 0.0F, 1.0F, 0.0F); ++ GL11.glTranslatef(0.0F, -1.0625F, 0.0F); ++ } ++ ++ if (this.updateCounter / 6 % 2 == 0) ++ { ++ this.entitySign.lineBeingEdited = this.editLine; ++ } ++ ++ TileEntityRenderer.instance.renderTileEntityAt(this.entitySign, -0.5D, -0.75D, -0.5D, 0.0F); ++ this.entitySign.lineBeingEdited = -1; ++ GL11.glPopMatrix(); ++ super.drawScreen(par1, par2, par3); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiEnchantment.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,259 ---- ++ package net.minecraft.src; ++ ++ import java.util.Random; ++ import org.lwjgl.opengl.GL11; ++ import org.lwjgl.opengl.GL12; ++ import org.lwjgl.util.glu.Project; ++ ++ public class GuiEnchantment extends GuiContainer ++ { ++ private static final ResourceLocation enchantingTableGuiTextures = new ResourceLocation("textures/gui/container/enchanting_table.png"); ++ private static final ResourceLocation enchantingTableBookTextures = new ResourceLocation("textures/entity/enchanting_table_book.png"); ++ ++ /** The book model used on the GUI. */ ++ private static final ModelBook bookModel = new ModelBook(); ++ private Random rand = new Random(); ++ ++ /** ContainerEnchantment object associated with this gui */ ++ private ContainerEnchantment containerEnchantment; ++ public int field_74214_o; ++ public float field_74213_p; ++ public float field_74212_q; ++ public float field_74211_r; ++ public float field_74210_s; ++ public float field_74209_t; ++ public float field_74208_u; ++ ItemStack theItemStack; ++ private String field_94079_C; ++ ++ public GuiEnchantment(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5, String par6Str) ++ { ++ super(new ContainerEnchantment(par1InventoryPlayer, par2World, par3, par4, par5)); ++ this.containerEnchantment = (ContainerEnchantment)this.inventorySlots; ++ this.field_94079_C = par6Str; ++ } ++ ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) ++ { ++ this.fontRenderer.drawString(this.field_94079_C == null ? I18n.getString("container.enchant") : this.field_94079_C, 12, 5, 4210752); ++ this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752); ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ super.updateScreen(); ++ this.func_74205_h(); ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) ++ { ++ super.mouseClicked(par1, par2, par3); ++ int var4 = (this.width - this.xSize) / 2; ++ int var5 = (this.height - this.ySize) / 2; ++ ++ for (int var6 = 0; var6 < 3; ++var6) ++ { ++ int var7 = par1 - (var4 + 60); ++ int var8 = par2 - (var5 + 14 + 19 * var6); ++ ++ if (var7 >= 0 && var8 >= 0 && var7 < 108 && var8 < 19 && this.containerEnchantment.enchantItem(this.mc.thePlayer, var6)) ++ { ++ this.mc.playerController.sendEnchantPacket(this.containerEnchantment.windowId, var6); ++ } ++ } ++ } ++ ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) ++ { ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.mc.getTextureManager().bindTexture(enchantingTableGuiTextures); ++ int var4 = (this.width - this.xSize) / 2; ++ int var5 = (this.height - this.ySize) / 2; ++ this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); ++ GL11.glPushMatrix(); ++ GL11.glMatrixMode(GL11.GL_PROJECTION); ++ GL11.glPushMatrix(); ++ GL11.glLoadIdentity(); ++ ScaledResolution var6 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); ++ GL11.glViewport((var6.getScaledWidth() - 320) / 2 * var6.getScaleFactor(), (var6.getScaledHeight() - 240) / 2 * var6.getScaleFactor(), 320 * var6.getScaleFactor(), 240 * var6.getScaleFactor()); ++ GL11.glTranslatef(-0.34F, 0.23F, 0.0F); ++ Project.gluPerspective(90.0F, 1.3333334F, 9.0F, 80.0F); ++ float var7 = 1.0F; ++ GL11.glMatrixMode(GL11.GL_MODELVIEW); ++ GL11.glLoadIdentity(); ++ RenderHelper.enableStandardItemLighting(); ++ GL11.glTranslatef(0.0F, 3.3F, -16.0F); ++ GL11.glScalef(var7, var7, var7); ++ float var8 = 5.0F; ++ GL11.glScalef(var8, var8, var8); ++ GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); ++ this.mc.getTextureManager().bindTexture(enchantingTableBookTextures); ++ GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); ++ float var9 = this.field_74208_u + (this.field_74209_t - this.field_74208_u) * par1; ++ GL11.glTranslatef((1.0F - var9) * 0.2F, (1.0F - var9) * 0.1F, (1.0F - var9) * 0.25F); ++ GL11.glRotatef(-(1.0F - var9) * 90.0F - 90.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F); ++ float var10 = this.field_74212_q + (this.field_74213_p - this.field_74212_q) * par1 + 0.25F; ++ float var11 = this.field_74212_q + (this.field_74213_p - this.field_74212_q) * par1 + 0.75F; ++ var10 = (var10 - (float)MathHelper.truncateDoubleToInt((double)var10)) * 1.6F - 0.3F; ++ var11 = (var11 - (float)MathHelper.truncateDoubleToInt((double)var11)) * 1.6F - 0.3F; ++ ++ if (var10 < 0.0F) ++ { ++ var10 = 0.0F; ++ } ++ ++ if (var11 < 0.0F) ++ { ++ var11 = 0.0F; ++ } ++ ++ if (var10 > 1.0F) ++ { ++ var10 = 1.0F; ++ } ++ ++ if (var11 > 1.0F) ++ { ++ var11 = 1.0F; ++ } ++ ++ GL11.glEnable(GL12.GL_RESCALE_NORMAL); ++ bookModel.render((Entity)null, 0.0F, var10, var11, var9, 0.0F, 0.0625F); ++ GL11.glDisable(GL12.GL_RESCALE_NORMAL); ++ RenderHelper.disableStandardItemLighting(); ++ GL11.glMatrixMode(GL11.GL_PROJECTION); ++ GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); ++ GL11.glPopMatrix(); ++ GL11.glMatrixMode(GL11.GL_MODELVIEW); ++ GL11.glPopMatrix(); ++ RenderHelper.disableStandardItemLighting(); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ EnchantmentNameParts.instance.setRandSeed(this.containerEnchantment.nameSeed); ++ ++ for (int var12 = 0; var12 < 3; ++var12) ++ { ++ String var13 = EnchantmentNameParts.instance.generateRandomEnchantName(); ++ this.zLevel = 0.0F; ++ this.mc.getTextureManager().bindTexture(enchantingTableGuiTextures); ++ int var14 = this.containerEnchantment.enchantLevels[var12]; ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ ++ if (var14 == 0) ++ { ++ this.drawTexturedModalRect(var4 + 60, var5 + 14 + 19 * var12, 0, 185, 108, 19); ++ } ++ else ++ { ++ String var15 = "" + var14; ++ FontRenderer var16 = this.mc.standardGalacticFontRenderer; ++ int var17 = 6839882; ++ ++ if (this.mc.thePlayer.experienceLevel < var14 && !this.mc.thePlayer.capabilities.isCreativeMode) ++ { ++ this.drawTexturedModalRect(var4 + 60, var5 + 14 + 19 * var12, 0, 185, 108, 19); ++ var16.drawSplitString(var13, var4 + 62, var5 + 16 + 19 * var12, 104, (var17 & 16711422) >> 1); ++ var16 = this.mc.fontRenderer; ++ var17 = 4226832; ++ var16.drawStringWithShadow(var15, var4 + 62 + 104 - var16.getStringWidth(var15), var5 + 16 + 19 * var12 + 7, var17); ++ } ++ else ++ { ++ int var18 = par2 - (var4 + 60); ++ int var19 = par3 - (var5 + 14 + 19 * var12); ++ ++ if (var18 >= 0 && var19 >= 0 && var18 < 108 && var19 < 19) ++ { ++ this.drawTexturedModalRect(var4 + 60, var5 + 14 + 19 * var12, 0, 204, 108, 19); ++ var17 = 16777088; ++ } ++ else ++ { ++ this.drawTexturedModalRect(var4 + 60, var5 + 14 + 19 * var12, 0, 166, 108, 19); ++ } ++ ++ var16.drawSplitString(var13, var4 + 62, var5 + 16 + 19 * var12, 104, var17); ++ var16 = this.mc.fontRenderer; ++ var17 = 8453920; ++ var16.drawStringWithShadow(var15, var4 + 62 + 104 - var16.getStringWidth(var15), var5 + 16 + 19 * var12 + 7, var17); ++ } ++ } ++ } ++ } ++ ++ public void func_74205_h() ++ { ++ ItemStack var1 = this.inventorySlots.getSlot(0).getStack(); ++ ++ if (!ItemStack.areItemStacksEqual(var1, this.theItemStack)) ++ { ++ this.theItemStack = var1; ++ ++ do ++ { ++ this.field_74211_r += (float)(this.rand.nextInt(4) - this.rand.nextInt(4)); ++ } ++ while (this.field_74213_p <= this.field_74211_r + 1.0F && this.field_74213_p >= this.field_74211_r - 1.0F); ++ } ++ ++ ++this.field_74214_o; ++ this.field_74212_q = this.field_74213_p; ++ this.field_74208_u = this.field_74209_t; ++ boolean var2 = false; ++ ++ for (int var3 = 0; var3 < 3; ++var3) ++ { ++ if (this.containerEnchantment.enchantLevels[var3] != 0) ++ { ++ var2 = true; ++ } ++ } ++ ++ if (var2) ++ { ++ this.field_74209_t += 0.2F; ++ } ++ else ++ { ++ this.field_74209_t -= 0.2F; ++ } ++ ++ if (this.field_74209_t < 0.0F) ++ { ++ this.field_74209_t = 0.0F; ++ } ++ ++ if (this.field_74209_t > 1.0F) ++ { ++ this.field_74209_t = 1.0F; ++ } ++ ++ float var5 = (this.field_74211_r - this.field_74213_p) * 0.4F; ++ float var4 = 0.2F; ++ ++ if (var5 < -var4) ++ { ++ var5 = -var4; ++ } ++ ++ if (var5 > var4) ++ { ++ var5 = var4; ++ } ++ ++ this.field_74210_s += (var5 - this.field_74210_s) * 0.9F; ++ this.field_74213_p += this.field_74210_s; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiErrorScreen.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,53 ---- ++ package net.minecraft.src; ++ ++ public class GuiErrorScreen extends GuiScreen ++ { ++ /** ++ * Unused class. Would contain a message drawn to the center of the screen. ++ */ ++ private String message1; ++ ++ /** ++ * Unused class. Would contain a message drawn to the center of the screen. ++ */ ++ private String message2; ++ ++ public GuiErrorScreen(String par1Str, String par2Str) ++ { ++ this.message1 = par1Str; ++ this.message2 = par2Str; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ super.initGui(); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, 140, I18n.getString("gui.cancel"))); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawGradientRect(0, 0, this.width, this.height, -12574688, -11530224); ++ this.drawCenteredString(this.fontRenderer, this.message1, this.width / 2, 90, 16777215); ++ this.drawCenteredString(this.fontRenderer, this.message2, this.width / 2, 110, 16777215); ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) {} ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ this.mc.displayGuiScreen((GuiScreen)null); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiFlatPresets.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,201 ---- ++ package net.minecraft.src; ++ ++ import java.util.ArrayList; ++ import java.util.Arrays; ++ import java.util.HashMap; ++ import java.util.Iterator; ++ import java.util.List; ++ import org.lwjgl.input.Keyboard; ++ ++ public class GuiFlatPresets extends GuiScreen ++ { ++ /** RenderItem instance used to render preset icons. */ ++ private static RenderItem presetIconRenderer = new RenderItem(); ++ ++ /** List of defined flat world presets. */ ++ private static final List presets = new ArrayList(); ++ private final GuiCreateFlatWorld createFlatWorldGui; ++ private String field_82300_d; ++ private String field_82308_m; ++ private String field_82306_n; ++ private GuiFlatPresetsListSlot theFlatPresetsListSlot; ++ private GuiButton theButton; ++ private GuiTextField theTextField; ++ ++ public GuiFlatPresets(GuiCreateFlatWorld par1GuiCreateFlatWorld) ++ { ++ this.createFlatWorldGui = par1GuiCreateFlatWorld; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.buttonList.clear(); ++ Keyboard.enableRepeatEvents(true); ++ this.field_82300_d = I18n.getString("createWorld.customize.presets.title"); ++ this.field_82308_m = I18n.getString("createWorld.customize.presets.share"); ++ this.field_82306_n = I18n.getString("createWorld.customize.presets.list"); ++ this.theTextField = new GuiTextField(this.fontRenderer, 50, 40, this.width - 100, 20); ++ this.theFlatPresetsListSlot = new GuiFlatPresetsListSlot(this); ++ this.theTextField.setMaxStringLength(1230); ++ this.theTextField.setText(this.createFlatWorldGui.getFlatGeneratorInfo()); ++ this.buttonList.add(this.theButton = new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.getString("createWorld.customize.presets.select"))); ++ this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.getString("gui.cancel"))); ++ this.func_82296_g(); ++ } ++ ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ ++ public void onGuiClosed() ++ { ++ Keyboard.enableRepeatEvents(false); ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) ++ { ++ this.theTextField.mouseClicked(par1, par2, par3); ++ super.mouseClicked(par1, par2, par3); ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) ++ { ++ if (!this.theTextField.textboxKeyTyped(par1, par2)) ++ { ++ super.keyTyped(par1, par2); ++ } ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ if (par1GuiButton.id == 0 && this.func_82293_j()) ++ { ++ this.createFlatWorldGui.setFlatGeneratorInfo(this.theTextField.getText()); ++ this.mc.displayGuiScreen(this.createFlatWorldGui); ++ } ++ else if (par1GuiButton.id == 1) ++ { ++ this.mc.displayGuiScreen(this.createFlatWorldGui); ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.theFlatPresetsListSlot.drawScreen(par1, par2, par3); ++ this.drawCenteredString(this.fontRenderer, this.field_82300_d, this.width / 2, 8, 16777215); ++ this.drawString(this.fontRenderer, this.field_82308_m, 50, 30, 10526880); ++ this.drawString(this.fontRenderer, this.field_82306_n, 50, 70, 10526880); ++ this.theTextField.drawTextBox(); ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ this.theTextField.updateCursorCounter(); ++ super.updateScreen(); ++ } ++ ++ public void func_82296_g() ++ { ++ boolean var1 = this.func_82293_j(); ++ this.theButton.enabled = var1; ++ } ++ ++ private boolean func_82293_j() ++ { ++ return this.theFlatPresetsListSlot.field_82459_a > -1 && this.theFlatPresetsListSlot.field_82459_a < presets.size() || this.theTextField.getText().length() > 1; ++ } ++ ++ /** ++ * Add a flat world preset with no world features. ++ */ ++ private static void addPresetNoFeatures(String par0Str, int par1, BiomeGenBase par2BiomeGenBase, FlatLayerInfo ... par3ArrayOfFlatLayerInfo) ++ { ++ addPreset(par0Str, par1, par2BiomeGenBase, (List)null, par3ArrayOfFlatLayerInfo); ++ } ++ ++ /** ++ * Add a flat world preset. ++ */ ++ private static void addPreset(String par0Str, int par1, BiomeGenBase par2BiomeGenBase, List par3List, FlatLayerInfo ... par4ArrayOfFlatLayerInfo) ++ { ++ FlatGeneratorInfo var5 = new FlatGeneratorInfo(); ++ ++ for (int var6 = par4ArrayOfFlatLayerInfo.length - 1; var6 >= 0; --var6) ++ { ++ var5.getFlatLayers().add(par4ArrayOfFlatLayerInfo[var6]); ++ } ++ ++ var5.setBiome(par2BiomeGenBase.biomeID); ++ var5.func_82645_d(); ++ ++ if (par3List != null) ++ { ++ Iterator var8 = par3List.iterator(); ++ ++ while (var8.hasNext()) ++ { ++ String var7 = (String)var8.next(); ++ var5.getWorldFeatures().put(var7, new HashMap()); ++ } ++ } ++ ++ presets.add(new GuiFlatPresetsItem(par1, par0Str, var5.toString())); ++ } ++ ++ /** ++ * Return the RenderItem instance used to render preset icons. ++ */ ++ static RenderItem getPresetIconRenderer() ++ { ++ return presetIconRenderer; ++ } ++ ++ /** ++ * Return the list of defined flat world presets. ++ */ ++ static List getPresets() ++ { ++ return presets; ++ } ++ ++ static GuiFlatPresetsListSlot func_82292_a(GuiFlatPresets par0GuiFlatPresets) ++ { ++ return par0GuiFlatPresets.theFlatPresetsListSlot; ++ } ++ ++ static GuiTextField func_82298_b(GuiFlatPresets par0GuiFlatPresets) ++ { ++ return par0GuiFlatPresets.theTextField; ++ } ++ ++ static ++ { ++ addPreset("Classic Flat", Block.grass.blockID, BiomeGenBase.plains, Arrays.asList(new String[] {"village"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(2, Block.dirt.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); ++ addPreset("Tunnelers\' Dream", Block.stone.blockID, BiomeGenBase.extremeHills, Arrays.asList(new String[] {"biome_1", "dungeon", "decoration", "stronghold", "mineshaft"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(5, Block.dirt.blockID), new FlatLayerInfo(230, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); ++ addPreset("Water World", Block.waterMoving.blockID, BiomeGenBase.plains, Arrays.asList(new String[] {"village", "biome_1"}), new FlatLayerInfo[] {new FlatLayerInfo(90, Block.waterStill.blockID), new FlatLayerInfo(5, Block.sand.blockID), new FlatLayerInfo(5, Block.dirt.blockID), new FlatLayerInfo(5, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); ++ addPreset("Overworld", Block.tallGrass.blockID, BiomeGenBase.plains, Arrays.asList(new String[] {"village", "biome_1", "decoration", "stronghold", "mineshaft", "dungeon", "lake", "lava_lake"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(3, Block.dirt.blockID), new FlatLayerInfo(59, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); ++ addPreset("Snowy Kingdom", Block.snow.blockID, BiomeGenBase.icePlains, Arrays.asList(new String[] {"village", "biome_1"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Block.snow.blockID), new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(3, Block.dirt.blockID), new FlatLayerInfo(59, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); ++ addPreset("Bottomless Pit", Item.feather.itemID, BiomeGenBase.plains, Arrays.asList(new String[] {"village", "biome_1"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(3, Block.dirt.blockID), new FlatLayerInfo(2, Block.cobblestone.blockID)}); ++ addPreset("Desert", Block.sand.blockID, BiomeGenBase.desert, Arrays.asList(new String[] {"village", "biome_1", "decoration", "stronghold", "mineshaft", "dungeon"}), new FlatLayerInfo[] {new FlatLayerInfo(8, Block.sand.blockID), new FlatLayerInfo(52, Block.sandStone.blockID), new FlatLayerInfo(3, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); ++ addPresetNoFeatures("Redstone Ready", Item.redstone.itemID, BiomeGenBase.desert, new FlatLayerInfo[] {new FlatLayerInfo(52, Block.sandStone.blockID), new FlatLayerInfo(3, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiFlatPresetsItem.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,20 ---- ++ package net.minecraft.src; ++ ++ class GuiFlatPresetsItem ++ { ++ /** ID for the item used as icon for this preset. */ ++ public int iconId; ++ ++ /** Name for this preset. */ ++ public String presetName; ++ ++ /** Data for this preset. */ ++ public String presetData; ++ ++ public GuiFlatPresetsItem(int par1, String par2Str, String par3Str) ++ { ++ this.iconId = par1; ++ this.presetName = par2Str; ++ this.presetData = par3Str; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiFlatPresetsListSlot.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,85 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ import org.lwjgl.opengl.GL12; ++ ++ class GuiFlatPresetsListSlot extends GuiSlot ++ { ++ public int field_82459_a; ++ ++ final GuiFlatPresets flatPresetsGui; ++ ++ public GuiFlatPresetsListSlot(GuiFlatPresets par1GuiFlatPresets) ++ { ++ super(par1GuiFlatPresets.mc, par1GuiFlatPresets.width, par1GuiFlatPresets.height, 80, par1GuiFlatPresets.height - 37, 24); ++ this.flatPresetsGui = par1GuiFlatPresets; ++ this.field_82459_a = -1; ++ } ++ ++ private void func_82457_a(int par1, int par2, int par3) ++ { ++ this.func_82456_d(par1 + 1, par2 + 1); ++ GL11.glEnable(GL12.GL_RESCALE_NORMAL); ++ RenderHelper.enableGUIStandardItemLighting(); ++ GuiFlatPresets.getPresetIconRenderer().renderItemIntoGUI(this.flatPresetsGui.fontRenderer, this.flatPresetsGui.mc.getTextureManager(), new ItemStack(par3, 1, 0), par1 + 2, par2 + 2); ++ RenderHelper.disableStandardItemLighting(); ++ GL11.glDisable(GL12.GL_RESCALE_NORMAL); ++ } ++ ++ private void func_82456_d(int par1, int par2) ++ { ++ this.func_82455_b(par1, par2, 0, 0); ++ } ++ ++ private void func_82455_b(int par1, int par2, int par3, int par4) ++ { ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.flatPresetsGui.mc.getTextureManager().bindTexture(Gui.statIcons); ++ float var5 = 0.0078125F; ++ float var6 = 0.0078125F; ++ boolean var7 = true; ++ boolean var8 = true; ++ Tessellator var9 = Tessellator.instance; ++ var9.startDrawingQuads(); ++ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 18), (double)this.flatPresetsGui.zLevel, (double)((float)(par3 + 0) * 0.0078125F), (double)((float)(par4 + 18) * 0.0078125F)); ++ var9.addVertexWithUV((double)(par1 + 18), (double)(par2 + 18), (double)this.flatPresetsGui.zLevel, (double)((float)(par3 + 18) * 0.0078125F), (double)((float)(par4 + 18) * 0.0078125F)); ++ var9.addVertexWithUV((double)(par1 + 18), (double)(par2 + 0), (double)this.flatPresetsGui.zLevel, (double)((float)(par3 + 18) * 0.0078125F), (double)((float)(par4 + 0) * 0.0078125F)); ++ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.flatPresetsGui.zLevel, (double)((float)(par3 + 0) * 0.0078125F), (double)((float)(par4 + 0) * 0.0078125F)); ++ var9.draw(); ++ } ++ ++ /** ++ * Gets the size of the current slot list. ++ */ ++ protected int getSize() ++ { ++ return GuiFlatPresets.getPresets().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) ++ { ++ this.field_82459_a = par1; ++ this.flatPresetsGui.func_82296_g(); ++ GuiFlatPresets.func_82298_b(this.flatPresetsGui).setText(((GuiFlatPresetsItem)GuiFlatPresets.getPresets().get(GuiFlatPresets.func_82292_a(this.flatPresetsGui).field_82459_a)).presetData); ++ } ++ ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) ++ { ++ return par1 == this.field_82459_a; ++ } ++ ++ protected void drawBackground() {} ++ ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) ++ { ++ GuiFlatPresetsItem var6 = (GuiFlatPresetsItem)GuiFlatPresets.getPresets().get(par1); ++ this.func_82457_a(par2, par3, var6.iconId); ++ this.flatPresetsGui.fontRenderer.drawString(var6.presetName, par2 + 18 + 5, par3 + 6, 16777215); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiFurnace.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,47 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class GuiFurnace extends GuiContainer ++ { ++ private static final ResourceLocation furnaceGuiTextures = new ResourceLocation("textures/gui/container/furnace.png"); ++ private TileEntityFurnace furnaceInventory; ++ ++ public GuiFurnace(InventoryPlayer par1InventoryPlayer, TileEntityFurnace par2TileEntityFurnace) ++ { ++ super(new ContainerFurnace(par1InventoryPlayer, par2TileEntityFurnace)); ++ this.furnaceInventory = par2TileEntityFurnace; ++ } ++ ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) ++ { ++ String var3 = this.furnaceInventory.isInvNameLocalized() ? this.furnaceInventory.getInvName() : I18n.getString(this.furnaceInventory.getInvName()); ++ this.fontRenderer.drawString(var3, this.xSize / 2 - this.fontRenderer.getStringWidth(var3) / 2, 6, 4210752); ++ this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752); ++ } ++ ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) ++ { ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.mc.getTextureManager().bindTexture(furnaceGuiTextures); ++ int var4 = (this.width - this.xSize) / 2; ++ int var5 = (this.height - this.ySize) / 2; ++ this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); ++ int var6; ++ ++ if (this.furnaceInventory.isBurning()) ++ { ++ var6 = this.furnaceInventory.getBurnTimeRemainingScaled(12); ++ this.drawTexturedModalRect(var4 + 56, var5 + 36 + 12 - var6, 176, 12 - var6, 14, var6 + 2); ++ } ++ ++ var6 = this.furnaceInventory.getCookProgressScaled(24); ++ this.drawTexturedModalRect(var4 + 79, var5 + 34, 176, 14, var6 + 1, 16); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiGameOver.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,121 ---- ++ package net.minecraft.src; ++ ++ import java.util.Iterator; ++ import org.lwjgl.opengl.GL11; ++ ++ public class GuiGameOver extends GuiScreen ++ { ++ /** ++ * The cooldown timer for the buttons, increases every tick and enables all buttons when reaching 20. ++ */ ++ private int cooldownTimer; ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.buttonList.clear(); ++ ++ if (this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) ++ { ++ if (this.mc.isIntegratedServerRunning()) ++ { ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 96, I18n.getString("deathScreen.deleteWorld"))); ++ } ++ else ++ { ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 96, I18n.getString("deathScreen.leaveServer"))); ++ } ++ } ++ else ++ { ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 72, I18n.getString("deathScreen.respawn"))); ++ this.buttonList.add(new GuiButton(2, this.width / 2 - 100, this.height / 4 + 96, I18n.getString("deathScreen.titleScreen"))); ++ ++ if (this.mc.getSession() == null) ++ { ++ ((GuiButton)this.buttonList.get(1)).enabled = false; ++ } ++ } ++ ++ GuiButton var2; ++ ++ for (Iterator var1 = this.buttonList.iterator(); var1.hasNext(); var2.enabled = false) ++ { ++ var2 = (GuiButton)var1.next(); ++ } ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) {} ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ switch (par1GuiButton.id) ++ { ++ case 1: ++ this.mc.thePlayer.respawnPlayer(); ++ this.mc.displayGuiScreen((GuiScreen)null); ++ break; ++ ++ case 2: ++ this.mc.theWorld.sendQuittingDisconnectingPacket(); ++ this.mc.loadWorld((WorldClient)null); ++ this.mc.displayGuiScreen(new GuiMainMenu()); ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawGradientRect(0, 0, this.width, this.height, 1615855616, -1602211792); ++ GL11.glPushMatrix(); ++ GL11.glScalef(2.0F, 2.0F, 2.0F); ++ boolean var4 = this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled(); ++ String var5 = var4 ? I18n.getString("deathScreen.title.hardcore") : I18n.getString("deathScreen.title"); ++ this.drawCenteredString(this.fontRenderer, var5, this.width / 2 / 2, 30, 16777215); ++ GL11.glPopMatrix(); ++ ++ if (var4) ++ { ++ this.drawCenteredString(this.fontRenderer, I18n.getString("deathScreen.hardcoreInfo"), this.width / 2, 144, 16777215); ++ } ++ ++ this.drawCenteredString(this.fontRenderer, I18n.getString("deathScreen.score") + ": " + EnumChatFormatting.YELLOW + this.mc.thePlayer.getScore(), this.width / 2, 100, 16777215); ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ /** ++ * Returns true if this GUI should pause the game when it is displayed in single-player ++ */ ++ public boolean doesGuiPauseGame() ++ { ++ return false; ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ super.updateScreen(); ++ ++this.cooldownTimer; ++ GuiButton var2; ++ ++ if (this.cooldownTimer == 20) ++ { ++ for (Iterator var1 = this.buttonList.iterator(); var1.hasNext(); var2.enabled = true) ++ { ++ var2 = (GuiButton)var1.next(); ++ } ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiHopper.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,40 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class GuiHopper extends GuiContainer ++ { ++ private static final ResourceLocation hopperGuiTextures = new ResourceLocation("textures/gui/container/hopper.png"); ++ private IInventory field_94081_r; ++ private IInventory field_94080_s; ++ ++ public GuiHopper(InventoryPlayer par1InventoryPlayer, IInventory par2IInventory) ++ { ++ super(new ContainerHopper(par1InventoryPlayer, par2IInventory)); ++ this.field_94081_r = par1InventoryPlayer; ++ this.field_94080_s = par2IInventory; ++ this.allowUserInput = false; ++ this.ySize = 133; ++ } ++ ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) ++ { ++ this.fontRenderer.drawString(this.field_94080_s.isInvNameLocalized() ? this.field_94080_s.getInvName() : I18n.getString(this.field_94080_s.getInvName()), 8, 6, 4210752); ++ this.fontRenderer.drawString(this.field_94081_r.isInvNameLocalized() ? this.field_94081_r.getInvName() : I18n.getString(this.field_94081_r.getInvName()), 8, this.ySize - 96 + 2, 4210752); ++ } ++ ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) ++ { ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.mc.getTextureManager().bindTexture(hopperGuiTextures); ++ int var4 = (this.width - this.xSize) / 2; ++ int var5 = (this.height - this.ySize) / 2; ++ this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiIngame.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,995 ---- ++ package net.minecraft.src; ++ ++ import java.awt.Color; ++ import java.util.Collection; ++ import java.util.Iterator; ++ import java.util.List; ++ import java.util.Random; ++ import org.lwjgl.opengl.GL11; ++ import org.lwjgl.opengl.GL12; ++ ++ public class GuiIngame extends Gui ++ { ++ private static final ResourceLocation vignetteTexPath = new ResourceLocation("textures/misc/vignette.png"); ++ private static final ResourceLocation widgetsTexPath = new ResourceLocation("textures/gui/widgets.png"); ++ private static final ResourceLocation pumpkinBlurTexPath = new ResourceLocation("textures/misc/pumpkinblur.png"); ++ private static final RenderItem itemRenderer = new RenderItem(); ++ private final Random rand = new Random(); ++ private final Minecraft mc; ++ ++ /** ChatGUI instance that retains all previous chat data */ ++ private final GuiNewChat persistantChatGUI; ++ private int updateCounter; ++ ++ /** The string specifying which record music is playing */ ++ private String recordPlaying = ""; ++ ++ /** How many ticks the record playing message will be displayed */ ++ private int recordPlayingUpFor; ++ private boolean recordIsPlaying; ++ ++ /** Previous frame vignette brightness (slowly changes by 1% each frame) */ ++ public float prevVignetteBrightness = 1.0F; ++ ++ /** Remaining ticks the item highlight should be visible */ ++ private int remainingHighlightTicks; ++ ++ /** The ItemStack that is currently being highlighted */ ++ private ItemStack highlightingItemStack; ++ ++ public GuiIngame(Minecraft par1Minecraft) ++ { ++ this.mc = par1Minecraft; ++ this.persistantChatGUI = new GuiNewChat(par1Minecraft); ++ } ++ ++ /** ++ * Render the ingame overlay with quick icon bar, ... ++ */ ++ public void renderGameOverlay(float par1, boolean par2, int par3, int par4) ++ { ++ ScaledResolution var5 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); ++ int var6 = var5.getScaledWidth(); ++ int var7 = var5.getScaledHeight(); ++ FontRenderer var8 = this.mc.fontRenderer; ++ this.mc.entityRenderer.setupOverlayRendering(); ++ GL11.glEnable(GL11.GL_BLEND); ++ ++ if (Minecraft.isFancyGraphicsEnabled()) ++ { ++ this.renderVignette(this.mc.thePlayer.getBrightness(par1), var6, var7); ++ } ++ else ++ { ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ } ++ ++ ItemStack var9 = this.mc.thePlayer.inventory.armorItemInSlot(3); ++ ++ if (this.mc.gameSettings.thirdPersonView == 0 && var9 != null && var9.itemID == Block.pumpkin.blockID) ++ { ++ this.renderPumpkinBlur(var6, var7); ++ } ++ ++ if (!this.mc.thePlayer.isPotionActive(Potion.confusion)) ++ { ++ float var10 = this.mc.thePlayer.prevTimeInPortal + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * par1; ++ ++ if (var10 > 0.0F) ++ { ++ this.func_130015_b(var10, var6, var7); ++ } ++ } ++ ++ int var11; ++ int var12; ++ int var13; ++ ++ if (!this.mc.playerController.enableEverythingIsScrewedUpMode()) ++ { ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.mc.getTextureManager().bindTexture(widgetsTexPath); ++ InventoryPlayer var31 = this.mc.thePlayer.inventory; ++ this.zLevel = -90.0F; ++ this.drawTexturedModalRect(var6 / 2 - 91, var7 - 22, 0, 0, 182, 22); ++ this.drawTexturedModalRect(var6 / 2 - 91 - 1 + var31.currentItem * 20, var7 - 22 - 1, 0, 22, 24, 22); ++ this.mc.getTextureManager().bindTexture(icons); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR); ++ this.drawTexturedModalRect(var6 / 2 - 7, var7 / 2 - 7, 0, 0, 16, 16); ++ GL11.glDisable(GL11.GL_BLEND); ++ this.mc.mcProfiler.startSection("bossHealth"); ++ this.renderBossHealth(); ++ this.mc.mcProfiler.endSection(); ++ ++ if (this.mc.playerController.shouldDrawHUD()) ++ { ++ this.func_110327_a(var6, var7); ++ } ++ ++ GL11.glDisable(GL11.GL_BLEND); ++ this.mc.mcProfiler.startSection("actionBar"); ++ GL11.glEnable(GL12.GL_RESCALE_NORMAL); ++ RenderHelper.enableGUIStandardItemLighting(); ++ ++ for (var11 = 0; var11 < 9; ++var11) ++ { ++ var12 = var6 / 2 - 90 + var11 * 20 + 2; ++ var13 = var7 - 16 - 3; ++ this.renderInventorySlot(var11, var12, var13, par1); ++ } ++ ++ RenderHelper.disableStandardItemLighting(); ++ GL11.glDisable(GL12.GL_RESCALE_NORMAL); ++ this.mc.mcProfiler.endSection(); ++ } ++ ++ int var32; ++ ++ if (this.mc.thePlayer.getSleepTimer() > 0) ++ { ++ this.mc.mcProfiler.startSection("sleep"); ++ GL11.glDisable(GL11.GL_DEPTH_TEST); ++ GL11.glDisable(GL11.GL_ALPHA_TEST); ++ var32 = this.mc.thePlayer.getSleepTimer(); ++ float var33 = (float)var32 / 100.0F; ++ ++ if (var33 > 1.0F) ++ { ++ var33 = 1.0F - (float)(var32 - 100) / 10.0F; ++ } ++ ++ var12 = (int)(220.0F * var33) << 24 | 1052704; ++ drawRect(0, 0, var6, var7, var12); ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ GL11.glEnable(GL11.GL_DEPTH_TEST); ++ this.mc.mcProfiler.endSection(); ++ } ++ ++ var32 = 16777215; ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ var11 = var6 / 2 - 91; ++ int var14; ++ int var15; ++ int var16; ++ int var17; ++ float var34; ++ short var35; ++ ++ if (this.mc.thePlayer.isRidingHorse()) ++ { ++ this.mc.mcProfiler.startSection("jumpBar"); ++ this.mc.getTextureManager().bindTexture(Gui.icons); ++ var34 = this.mc.thePlayer.getHorseJumpPower(); ++ var35 = 182; ++ var14 = (int)(var34 * (float)(var35 + 1)); ++ var15 = var7 - 32 + 3; ++ this.drawTexturedModalRect(var11, var15, 0, 84, var35, 5); ++ ++ if (var14 > 0) ++ { ++ this.drawTexturedModalRect(var11, var15, 0, 89, var14, 5); ++ } ++ ++ this.mc.mcProfiler.endSection(); ++ } ++ else if (this.mc.playerController.func_78763_f()) ++ { ++ this.mc.mcProfiler.startSection("expBar"); ++ this.mc.getTextureManager().bindTexture(Gui.icons); ++ var12 = this.mc.thePlayer.xpBarCap(); ++ ++ if (var12 > 0) ++ { ++ var35 = 182; ++ var14 = (int)(this.mc.thePlayer.experience * (float)(var35 + 1)); ++ var15 = var7 - 32 + 3; ++ this.drawTexturedModalRect(var11, var15, 0, 64, var35, 5); ++ ++ if (var14 > 0) ++ { ++ this.drawTexturedModalRect(var11, var15, 0, 69, var14, 5); ++ } ++ } ++ ++ this.mc.mcProfiler.endSection(); ++ ++ if (this.mc.thePlayer.experienceLevel > 0) ++ { ++ this.mc.mcProfiler.startSection("expLevel"); ++ boolean var37 = false; ++ var14 = var37 ? 16777215 : 8453920; ++ String var39 = "" + this.mc.thePlayer.experienceLevel; ++ var16 = (var6 - var8.getStringWidth(var39)) / 2; ++ var17 = var7 - 31 - 4; ++ boolean var18 = false; ++ var8.drawString(var39, var16 + 1, var17, 0); ++ var8.drawString(var39, var16 - 1, var17, 0); ++ var8.drawString(var39, var16, var17 + 1, 0); ++ var8.drawString(var39, var16, var17 - 1, 0); ++ var8.drawString(var39, var16, var17, var14); ++ this.mc.mcProfiler.endSection(); ++ } ++ } ++ ++ String var36; ++ ++ if (this.mc.gameSettings.heldItemTooltips) ++ { ++ this.mc.mcProfiler.startSection("toolHighlight"); ++ ++ if (this.remainingHighlightTicks > 0 && this.highlightingItemStack != null) ++ { ++ var36 = this.highlightingItemStack.getDisplayName(); ++ var13 = (var6 - var8.getStringWidth(var36)) / 2; ++ var14 = var7 - 59; ++ ++ if (!this.mc.playerController.shouldDrawHUD()) ++ { ++ var14 += 14; ++ } ++ ++ var15 = (int)((float)this.remainingHighlightTicks * 256.0F / 10.0F); ++ ++ if (var15 > 255) ++ { ++ var15 = 255; ++ } ++ ++ if (var15 > 0) ++ { ++ GL11.glPushMatrix(); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ var8.drawStringWithShadow(var36, var13, var14, 16777215 + (var15 << 24)); ++ GL11.glDisable(GL11.GL_BLEND); ++ GL11.glPopMatrix(); ++ } ++ } ++ ++ this.mc.mcProfiler.endSection(); ++ } ++ ++ if (this.mc.isDemo()) ++ { ++ this.mc.mcProfiler.startSection("demo"); ++ var36 = ""; ++ ++ if (this.mc.theWorld.getTotalWorldTime() >= 120500L) ++ { ++ var36 = I18n.getString("demo.demoExpired"); ++ } ++ else ++ { ++ var36 = I18n.getStringParams("demo.remainingTime", new Object[] {StringUtils.ticksToElapsedTime((int)(120500L - this.mc.theWorld.getTotalWorldTime()))}); ++ } ++ ++ var13 = var8.getStringWidth(var36); ++ var8.drawStringWithShadow(var36, var6 - var13 - 10, 5, 16777215); ++ this.mc.mcProfiler.endSection(); ++ } ++ ++ int var21; ++ int var22; ++ int var23; ++ ++ if (this.mc.gameSettings.showDebugInfo) ++ { ++ this.mc.mcProfiler.startSection("debug"); ++ GL11.glPushMatrix(); ++ var8.drawStringWithShadow("Minecraft 1.6.4 (" + this.mc.debug + ")", 2, 2, 16777215); ++ var8.drawStringWithShadow(this.mc.debugInfoRenders(), 2, 12, 16777215); ++ var8.drawStringWithShadow(this.mc.getEntityDebug(), 2, 22, 16777215); ++ var8.drawStringWithShadow(this.mc.debugInfoEntities(), 2, 32, 16777215); ++ var8.drawStringWithShadow(this.mc.getWorldProviderName(), 2, 42, 16777215); ++ long var38 = Runtime.getRuntime().maxMemory(); ++ long var41 = Runtime.getRuntime().totalMemory(); ++ long var43 = Runtime.getRuntime().freeMemory(); ++ long var45 = var41 - var43; ++ String var20 = "Used memory: " + var45 * 100L / var38 + "% (" + var45 / 1024L / 1024L + "MB) of " + var38 / 1024L / 1024L + "MB"; ++ var21 = 14737632; ++ this.drawString(var8, var20, var6 - var8.getStringWidth(var20) - 2, 2, 14737632); ++ var20 = "Allocated memory: " + var41 * 100L / var38 + "% (" + var41 / 1024L / 1024L + "MB)"; ++ this.drawString(var8, var20, var6 - var8.getStringWidth(var20) - 2, 12, 14737632); ++ var22 = MathHelper.floor_double(this.mc.thePlayer.posX); ++ var23 = MathHelper.floor_double(this.mc.thePlayer.posY); ++ int var24 = MathHelper.floor_double(this.mc.thePlayer.posZ); ++ this.drawString(var8, String.format("x: %.5f (%d) // c: %d (%d)", new Object[] {Double.valueOf(this.mc.thePlayer.posX), Integer.valueOf(var22), Integer.valueOf(var22 >> 4), Integer.valueOf(var22 & 15)}), 2, 64, 14737632); ++ this.drawString(var8, String.format("y: %.3f (feet pos, %.3f eyes pos)", new Object[] {Double.valueOf(this.mc.thePlayer.boundingBox.minY), Double.valueOf(this.mc.thePlayer.posY)}), 2, 72, 14737632); ++ this.drawString(var8, String.format("z: %.5f (%d) // c: %d (%d)", new Object[] {Double.valueOf(this.mc.thePlayer.posZ), Integer.valueOf(var24), Integer.valueOf(var24 >> 4), Integer.valueOf(var24 & 15)}), 2, 80, 14737632); ++ int var25 = MathHelper.floor_double((double)(this.mc.thePlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; ++ this.drawString(var8, "f: " + var25 + " (" + Direction.directions[var25] + ") / " + MathHelper.wrapAngleTo180_float(this.mc.thePlayer.rotationYaw), 2, 88, 14737632); ++ ++ if (this.mc.theWorld != null && this.mc.theWorld.blockExists(var22, var23, var24)) ++ { ++ Chunk var26 = this.mc.theWorld.getChunkFromBlockCoords(var22, var24); ++ this.drawString(var8, "lc: " + (var26.getTopFilledSegment() + 15) + " b: " + var26.getBiomeGenForWorldCoords(var22 & 15, var24 & 15, this.mc.theWorld.getWorldChunkManager()).biomeName + " bl: " + var26.getSavedLightValue(EnumSkyBlock.Block, var22 & 15, var23, var24 & 15) + " sl: " + var26.getSavedLightValue(EnumSkyBlock.Sky, var22 & 15, var23, var24 & 15) + " rl: " + var26.getBlockLightValue(var22 & 15, var23, var24 & 15, 0), 2, 96, 14737632); ++ } ++ ++ this.drawString(var8, String.format("ws: %.3f, fs: %.3f, g: %b, fl: %d", new Object[] {Float.valueOf(this.mc.thePlayer.capabilities.getWalkSpeed()), Float.valueOf(this.mc.thePlayer.capabilities.getFlySpeed()), Boolean.valueOf(this.mc.thePlayer.onGround), Integer.valueOf(this.mc.theWorld.getHeightValue(var22, var24))}), 2, 104, 14737632); ++ GL11.glPopMatrix(); ++ this.mc.mcProfiler.endSection(); ++ } ++ ++ if (this.recordPlayingUpFor > 0) ++ { ++ this.mc.mcProfiler.startSection("overlayMessage"); ++ var34 = (float)this.recordPlayingUpFor - par1; ++ var13 = (int)(var34 * 255.0F / 20.0F); ++ ++ if (var13 > 255) ++ { ++ var13 = 255; ++ } ++ ++ if (var13 > 8) ++ { ++ GL11.glPushMatrix(); ++ GL11.glTranslatef((float)(var6 / 2), (float)(var7 - 68), 0.0F); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ var14 = 16777215; ++ ++ if (this.recordIsPlaying) ++ { ++ var14 = Color.HSBtoRGB(var34 / 50.0F, 0.7F, 0.6F) & 16777215; ++ } ++ ++ var8.drawString(this.recordPlaying, -var8.getStringWidth(this.recordPlaying) / 2, -4, var14 + (var13 << 24 & -16777216)); ++ GL11.glDisable(GL11.GL_BLEND); ++ GL11.glPopMatrix(); ++ } ++ ++ this.mc.mcProfiler.endSection(); ++ } ++ ++ ScoreObjective var40 = this.mc.theWorld.getScoreboard().func_96539_a(1); ++ ++ if (var40 != null) ++ { ++ this.func_96136_a(var40, var7, var6, var8); ++ } ++ ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ GL11.glDisable(GL11.GL_ALPHA_TEST); ++ GL11.glPushMatrix(); ++ GL11.glTranslatef(0.0F, (float)(var7 - 48), 0.0F); ++ this.mc.mcProfiler.startSection("chat"); ++ this.persistantChatGUI.drawChat(this.updateCounter); ++ this.mc.mcProfiler.endSection(); ++ GL11.glPopMatrix(); ++ var40 = this.mc.theWorld.getScoreboard().func_96539_a(0); ++ ++ if (this.mc.gameSettings.keyBindPlayerList.pressed && (!this.mc.isIntegratedServerRunning() || this.mc.thePlayer.sendQueue.playerInfoList.size() > 1 || var40 != null)) ++ { ++ this.mc.mcProfiler.startSection("playerList"); ++ NetClientHandler var42 = this.mc.thePlayer.sendQueue; ++ List var44 = var42.playerInfoList; ++ var15 = var42.currentServerMaxPlayers; ++ var16 = var15; ++ ++ for (var17 = 1; var16 > 20; var16 = (var15 + var17 - 1) / var17) ++ { ++ ++var17; ++ } ++ ++ int var46 = 300 / var17; ++ ++ if (var46 > 150) ++ { ++ var46 = 150; ++ } ++ ++ int var19 = (var6 - var17 * var46) / 2; ++ byte var47 = 10; ++ drawRect(var19 - 1, var47 - 1, var19 + var46 * var17, var47 + 9 * var16, Integer.MIN_VALUE); ++ ++ for (var21 = 0; var21 < var15; ++var21) ++ { ++ var22 = var19 + var21 % var17 * var46; ++ var23 = var47 + var21 / var17 * 9; ++ drawRect(var22, var23, var22 + var46 - 1, var23 + 8, 553648127); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ ++ if (var21 < var44.size()) ++ { ++ GuiPlayerInfo var48 = (GuiPlayerInfo)var44.get(var21); ++ ScorePlayerTeam var49 = this.mc.theWorld.getScoreboard().getPlayersTeam(var48.name); ++ String var50 = ScorePlayerTeam.formatPlayerName(var49, var48.name); ++ var8.drawStringWithShadow(var50, var22, var23, 16777215); ++ ++ if (var40 != null) ++ { ++ int var27 = var22 + var8.getStringWidth(var50) + 5; ++ int var28 = var22 + var46 - 12 - 5; ++ ++ if (var28 - var27 > 5) ++ { ++ Score var29 = var40.getScoreboard().func_96529_a(var48.name, var40); ++ String var30 = EnumChatFormatting.YELLOW + "" + var29.getScorePoints(); ++ var8.drawStringWithShadow(var30, var28 - var8.getStringWidth(var30), var23, 16777215); ++ } ++ } ++ ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.mc.getTextureManager().bindTexture(icons); ++ byte var51 = 0; ++ boolean var52 = false; ++ byte var53; ++ ++ if (var48.responseTime < 0) ++ { ++ var53 = 5; ++ } ++ else if (var48.responseTime < 150) ++ { ++ var53 = 0; ++ } ++ else if (var48.responseTime < 300) ++ { ++ var53 = 1; ++ } ++ else if (var48.responseTime < 600) ++ { ++ var53 = 2; ++ } ++ else if (var48.responseTime < 1000) ++ { ++ var53 = 3; ++ } ++ else ++ { ++ var53 = 4; ++ } ++ ++ this.zLevel += 100.0F; ++ this.drawTexturedModalRect(var22 + var46 - 12, var23, 0 + var51 * 10, 176 + var53 * 8, 10, 8); ++ this.zLevel -= 100.0F; ++ } ++ } ++ } ++ ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ } ++ ++ private void func_96136_a(ScoreObjective par1ScoreObjective, int par2, int par3, FontRenderer par4FontRenderer) ++ { ++ Scoreboard var5 = par1ScoreObjective.getScoreboard(); ++ Collection var6 = var5.func_96534_i(par1ScoreObjective); ++ ++ if (var6.size() <= 15) ++ { ++ int var7 = par4FontRenderer.getStringWidth(par1ScoreObjective.getDisplayName()); ++ String var11; ++ ++ for (Iterator var8 = var6.iterator(); var8.hasNext(); var7 = Math.max(var7, par4FontRenderer.getStringWidth(var11))) ++ { ++ Score var9 = (Score)var8.next(); ++ ScorePlayerTeam var10 = var5.getPlayersTeam(var9.getPlayerName()); ++ var11 = ScorePlayerTeam.formatPlayerName(var10, var9.getPlayerName()) + ": " + EnumChatFormatting.RED + var9.getScorePoints(); ++ } ++ ++ int var22 = var6.size() * par4FontRenderer.FONT_HEIGHT; ++ int var23 = par2 / 2 + var22 / 3; ++ byte var24 = 3; ++ int var25 = par3 - var7 - var24; ++ int var12 = 0; ++ Iterator var13 = var6.iterator(); ++ ++ while (var13.hasNext()) ++ { ++ Score var14 = (Score)var13.next(); ++ ++var12; ++ ScorePlayerTeam var15 = var5.getPlayersTeam(var14.getPlayerName()); ++ String var16 = ScorePlayerTeam.formatPlayerName(var15, var14.getPlayerName()); ++ String var17 = EnumChatFormatting.RED + "" + var14.getScorePoints(); ++ int var19 = var23 - var12 * par4FontRenderer.FONT_HEIGHT; ++ int var20 = par3 - var24 + 2; ++ drawRect(var25 - 2, var19, var20, var19 + par4FontRenderer.FONT_HEIGHT, 1342177280); ++ par4FontRenderer.drawString(var16, var25, var19, 553648127); ++ par4FontRenderer.drawString(var17, var20 - par4FontRenderer.getStringWidth(var17), var19, 553648127); ++ ++ if (var12 == var6.size()) ++ { ++ String var21 = par1ScoreObjective.getDisplayName(); ++ drawRect(var25 - 2, var19 - par4FontRenderer.FONT_HEIGHT - 1, var20, var19 - 1, 1610612736); ++ drawRect(var25 - 2, var19 - 1, var20, var19, 1342177280); ++ par4FontRenderer.drawString(var21, var25 + var7 / 2 - par4FontRenderer.getStringWidth(var21) / 2, var19 - par4FontRenderer.FONT_HEIGHT, 553648127); ++ } ++ } ++ } ++ } ++ ++ private void func_110327_a(int par1, int par2) ++ { ++ boolean var3 = this.mc.thePlayer.hurtResistantTime / 3 % 2 == 1; ++ ++ if (this.mc.thePlayer.hurtResistantTime < 10) ++ { ++ var3 = false; ++ } ++ ++ int var4 = MathHelper.ceiling_float_int(this.mc.thePlayer.getHealth()); ++ int var5 = MathHelper.ceiling_float_int(this.mc.thePlayer.prevHealth); ++ this.rand.setSeed((long)(this.updateCounter * 312871)); ++ boolean var6 = false; ++ FoodStats var7 = this.mc.thePlayer.getFoodStats(); ++ int var8 = var7.getFoodLevel(); ++ int var9 = var7.getPrevFoodLevel(); ++ AttributeInstance var10 = this.mc.thePlayer.getEntityAttribute(SharedMonsterAttributes.maxHealth); ++ int var11 = par1 / 2 - 91; ++ int var12 = par1 / 2 + 91; ++ int var13 = par2 - 39; ++ float var14 = (float)var10.getAttributeValue(); ++ float var15 = this.mc.thePlayer.getAbsorptionAmount(); ++ int var16 = MathHelper.ceiling_float_int((var14 + var15) / 2.0F / 10.0F); ++ int var17 = Math.max(10 - (var16 - 2), 3); ++ int var18 = var13 - (var16 - 1) * var17 - 10; ++ float var19 = var15; ++ int var20 = this.mc.thePlayer.getTotalArmorValue(); ++ int var21 = -1; ++ ++ if (this.mc.thePlayer.isPotionActive(Potion.regeneration)) ++ { ++ var21 = this.updateCounter % MathHelper.ceiling_float_int(var14 + 5.0F); ++ } ++ ++ this.mc.mcProfiler.startSection("armor"); ++ int var22; ++ int var23; ++ ++ for (var22 = 0; var22 < 10; ++var22) ++ { ++ if (var20 > 0) ++ { ++ var23 = var11 + var22 * 8; ++ ++ if (var22 * 2 + 1 < var20) ++ { ++ this.drawTexturedModalRect(var23, var18, 34, 9, 9, 9); ++ } ++ ++ if (var22 * 2 + 1 == var20) ++ { ++ this.drawTexturedModalRect(var23, var18, 25, 9, 9, 9); ++ } ++ ++ if (var22 * 2 + 1 > var20) ++ { ++ this.drawTexturedModalRect(var23, var18, 16, 9, 9, 9); ++ } ++ } ++ } ++ ++ this.mc.mcProfiler.endStartSection("health"); ++ int var25; ++ int var26; ++ int var27; ++ ++ for (var22 = MathHelper.ceiling_float_int((var14 + var15) / 2.0F) - 1; var22 >= 0; --var22) ++ { ++ var23 = 16; ++ ++ if (this.mc.thePlayer.isPotionActive(Potion.poison)) ++ { ++ var23 += 36; ++ } ++ else if (this.mc.thePlayer.isPotionActive(Potion.wither)) ++ { ++ var23 += 72; ++ } ++ ++ byte var24 = 0; ++ ++ if (var3) ++ { ++ var24 = 1; ++ } ++ ++ var25 = MathHelper.ceiling_float_int((float)(var22 + 1) / 10.0F) - 1; ++ var26 = var11 + var22 % 10 * 8; ++ var27 = var13 - var25 * var17; ++ ++ if (var4 <= 4) ++ { ++ var27 += this.rand.nextInt(2); ++ } ++ ++ if (var22 == var21) ++ { ++ var27 -= 2; ++ } ++ ++ byte var28 = 0; ++ ++ if (this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) ++ { ++ var28 = 5; ++ } ++ ++ this.drawTexturedModalRect(var26, var27, 16 + var24 * 9, 9 * var28, 9, 9); ++ ++ if (var3) ++ { ++ if (var22 * 2 + 1 < var5) ++ { ++ this.drawTexturedModalRect(var26, var27, var23 + 54, 9 * var28, 9, 9); ++ } ++ ++ if (var22 * 2 + 1 == var5) ++ { ++ this.drawTexturedModalRect(var26, var27, var23 + 63, 9 * var28, 9, 9); ++ } ++ } ++ ++ if (var19 > 0.0F) ++ { ++ if (var19 == var15 && var15 % 2.0F == 1.0F) ++ { ++ this.drawTexturedModalRect(var26, var27, var23 + 153, 9 * var28, 9, 9); ++ } ++ else ++ { ++ this.drawTexturedModalRect(var26, var27, var23 + 144, 9 * var28, 9, 9); ++ } ++ ++ var19 -= 2.0F; ++ } ++ else ++ { ++ if (var22 * 2 + 1 < var4) ++ { ++ this.drawTexturedModalRect(var26, var27, var23 + 36, 9 * var28, 9, 9); ++ } ++ ++ if (var22 * 2 + 1 == var4) ++ { ++ this.drawTexturedModalRect(var26, var27, var23 + 45, 9 * var28, 9, 9); ++ } ++ } ++ } ++ ++ Entity var34 = this.mc.thePlayer.ridingEntity; ++ int var35; ++ ++ if (var34 == null) ++ { ++ this.mc.mcProfiler.endStartSection("food"); ++ ++ for (var23 = 0; var23 < 10; ++var23) ++ { ++ var35 = var13; ++ var25 = 16; ++ byte var36 = 0; ++ ++ if (this.mc.thePlayer.isPotionActive(Potion.hunger)) ++ { ++ var25 += 36; ++ var36 = 13; ++ } ++ ++ if (this.mc.thePlayer.getFoodStats().getSaturationLevel() <= 0.0F && this.updateCounter % (var8 * 3 + 1) == 0) ++ { ++ var35 = var13 + (this.rand.nextInt(3) - 1); ++ } ++ ++ if (var6) ++ { ++ var36 = 1; ++ } ++ ++ var27 = var12 - var23 * 8 - 9; ++ this.drawTexturedModalRect(var27, var35, 16 + var36 * 9, 27, 9, 9); ++ ++ if (var6) ++ { ++ if (var23 * 2 + 1 < var9) ++ { ++ this.drawTexturedModalRect(var27, var35, var25 + 54, 27, 9, 9); ++ } ++ ++ if (var23 * 2 + 1 == var9) ++ { ++ this.drawTexturedModalRect(var27, var35, var25 + 63, 27, 9, 9); ++ } ++ } ++ ++ if (var23 * 2 + 1 < var8) ++ { ++ this.drawTexturedModalRect(var27, var35, var25 + 36, 27, 9, 9); ++ } ++ ++ if (var23 * 2 + 1 == var8) ++ { ++ this.drawTexturedModalRect(var27, var35, var25 + 45, 27, 9, 9); ++ } ++ } ++ } ++ else if (var34 instanceof EntityLivingBase) ++ { ++ this.mc.mcProfiler.endStartSection("mountHealth"); ++ EntityLivingBase var37 = (EntityLivingBase)var34; ++ var35 = (int)Math.ceil((double)var37.getHealth()); ++ float var38 = var37.getMaxHealth(); ++ var26 = (int)(var38 + 0.5F) / 2; ++ ++ if (var26 > 30) ++ { ++ var26 = 30; ++ } ++ ++ var27 = var13; ++ ++ for (int var39 = 0; var26 > 0; var39 += 20) ++ { ++ int var29 = Math.min(var26, 10); ++ var26 -= var29; ++ ++ for (int var30 = 0; var30 < var29; ++var30) ++ { ++ byte var31 = 52; ++ byte var32 = 0; ++ ++ if (var6) ++ { ++ var32 = 1; ++ } ++ ++ int var33 = var12 - var30 * 8 - 9; ++ this.drawTexturedModalRect(var33, var27, var31 + var32 * 9, 9, 9, 9); ++ ++ if (var30 * 2 + 1 + var39 < var35) ++ { ++ this.drawTexturedModalRect(var33, var27, var31 + 36, 9, 9, 9); ++ } ++ ++ if (var30 * 2 + 1 + var39 == var35) ++ { ++ this.drawTexturedModalRect(var33, var27, var31 + 45, 9, 9, 9); ++ } ++ } ++ ++ var27 -= 10; ++ } ++ } ++ ++ this.mc.mcProfiler.endStartSection("air"); ++ ++ if (this.mc.thePlayer.isInsideOfMaterial(Material.water)) ++ { ++ var23 = this.mc.thePlayer.getAir(); ++ var35 = MathHelper.ceiling_double_int((double)(var23 - 2) * 10.0D / 300.0D); ++ var25 = MathHelper.ceiling_double_int((double)var23 * 10.0D / 300.0D) - var35; ++ ++ for (var26 = 0; var26 < var35 + var25; ++var26) ++ { ++ if (var26 < var35) ++ { ++ this.drawTexturedModalRect(var12 - var26 * 8 - 9, var18, 16, 18, 9, 9); ++ } ++ else ++ { ++ this.drawTexturedModalRect(var12 - var26 * 8 - 9, var18, 25, 18, 9, 9); ++ } ++ } ++ } ++ ++ this.mc.mcProfiler.endSection(); ++ } ++ ++ /** ++ * Renders dragon's (boss) health on the HUD ++ */ ++ private void renderBossHealth() ++ { ++ if (BossStatus.bossName != null && BossStatus.statusBarLength > 0) ++ { ++ --BossStatus.statusBarLength; ++ FontRenderer var1 = this.mc.fontRenderer; ++ ScaledResolution var2 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); ++ int var3 = var2.getScaledWidth(); ++ short var4 = 182; ++ int var5 = var3 / 2 - var4 / 2; ++ int var6 = (int)(BossStatus.healthScale * (float)(var4 + 1)); ++ byte var7 = 12; ++ this.drawTexturedModalRect(var5, var7, 0, 74, var4, 5); ++ this.drawTexturedModalRect(var5, var7, 0, 74, var4, 5); ++ ++ if (var6 > 0) ++ { ++ this.drawTexturedModalRect(var5, var7, 0, 79, var6, 5); ++ } ++ ++ String var8 = BossStatus.bossName; ++ var1.drawStringWithShadow(var8, var3 / 2 - var1.getStringWidth(var8) / 2, var7 - 10, 16777215); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.mc.getTextureManager().bindTexture(icons); ++ } ++ } ++ ++ private void renderPumpkinBlur(int par1, int par2) ++ { ++ GL11.glDisable(GL11.GL_DEPTH_TEST); ++ GL11.glDepthMask(false); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glDisable(GL11.GL_ALPHA_TEST); ++ this.mc.getTextureManager().bindTexture(pumpkinBlurTexPath); ++ Tessellator var3 = Tessellator.instance; ++ var3.startDrawingQuads(); ++ var3.addVertexWithUV(0.0D, (double)par2, -90.0D, 0.0D, 1.0D); ++ var3.addVertexWithUV((double)par1, (double)par2, -90.0D, 1.0D, 1.0D); ++ var3.addVertexWithUV((double)par1, 0.0D, -90.0D, 1.0D, 0.0D); ++ var3.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D); ++ var3.draw(); ++ GL11.glDepthMask(true); ++ GL11.glEnable(GL11.GL_DEPTH_TEST); ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ } ++ ++ /** ++ * Renders the vignette. Args: vignetteBrightness, width, height ++ */ ++ private void renderVignette(float par1, int par2, int par3) ++ { ++ par1 = 1.0F - par1; ++ ++ if (par1 < 0.0F) ++ { ++ par1 = 0.0F; ++ } ++ ++ if (par1 > 1.0F) ++ { ++ par1 = 1.0F; ++ } ++ ++ this.prevVignetteBrightness = (float)((double)this.prevVignetteBrightness + (double)(par1 - this.prevVignetteBrightness) * 0.01D); ++ GL11.glDisable(GL11.GL_DEPTH_TEST); ++ GL11.glDepthMask(false); ++ GL11.glBlendFunc(GL11.GL_ZERO, GL11.GL_ONE_MINUS_SRC_COLOR); ++ GL11.glColor4f(this.prevVignetteBrightness, this.prevVignetteBrightness, this.prevVignetteBrightness, 1.0F); ++ this.mc.getTextureManager().bindTexture(vignetteTexPath); ++ Tessellator var4 = Tessellator.instance; ++ var4.startDrawingQuads(); ++ var4.addVertexWithUV(0.0D, (double)par3, -90.0D, 0.0D, 1.0D); ++ var4.addVertexWithUV((double)par2, (double)par3, -90.0D, 1.0D, 1.0D); ++ var4.addVertexWithUV((double)par2, 0.0D, -90.0D, 1.0D, 0.0D); ++ var4.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D); ++ var4.draw(); ++ GL11.glDepthMask(true); ++ GL11.glEnable(GL11.GL_DEPTH_TEST); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ } ++ ++ private void func_130015_b(float par1, int par2, int par3) ++ { ++ if (par1 < 1.0F) ++ { ++ par1 *= par1; ++ par1 *= par1; ++ par1 = par1 * 0.8F + 0.2F; ++ } ++ ++ GL11.glDisable(GL11.GL_ALPHA_TEST); ++ GL11.glDisable(GL11.GL_DEPTH_TEST); ++ GL11.glDepthMask(false); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, par1); ++ Icon var4 = Block.portal.getBlockTextureFromSide(1); ++ this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); ++ float var5 = var4.getMinU(); ++ float var6 = var4.getMinV(); ++ float var7 = var4.getMaxU(); ++ float var8 = var4.getMaxV(); ++ Tessellator var9 = Tessellator.instance; ++ var9.startDrawingQuads(); ++ var9.addVertexWithUV(0.0D, (double)par3, -90.0D, (double)var5, (double)var8); ++ var9.addVertexWithUV((double)par2, (double)par3, -90.0D, (double)var7, (double)var8); ++ var9.addVertexWithUV((double)par2, 0.0D, -90.0D, (double)var7, (double)var6); ++ var9.addVertexWithUV(0.0D, 0.0D, -90.0D, (double)var5, (double)var6); ++ var9.draw(); ++ GL11.glDepthMask(true); ++ GL11.glEnable(GL11.GL_DEPTH_TEST); ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ } ++ ++ /** ++ * Renders the specified item of the inventory slot at the specified location. Args: slot, x, y, partialTick ++ */ ++ private void renderInventorySlot(int par1, int par2, int par3, float par4) ++ { ++ ItemStack var5 = this.mc.thePlayer.inventory.mainInventory[par1]; ++ ++ if (var5 != null) ++ { ++ float var6 = (float)var5.animationsToGo - par4; ++ ++ if (var6 > 0.0F) ++ { ++ GL11.glPushMatrix(); ++ float var7 = 1.0F + var6 / 5.0F; ++ GL11.glTranslatef((float)(par2 + 8), (float)(par3 + 12), 0.0F); ++ GL11.glScalef(1.0F / var7, (var7 + 1.0F) / 2.0F, 1.0F); ++ GL11.glTranslatef((float)(-(par2 + 8)), (float)(-(par3 + 12)), 0.0F); ++ } ++ ++ itemRenderer.renderItemAndEffectIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), var5, par2, par3); ++ ++ if (var6 > 0.0F) ++ { ++ GL11.glPopMatrix(); ++ } ++ ++ itemRenderer.renderItemOverlayIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), var5, par2, par3); ++ } ++ } ++ ++ /** ++ * The update tick for the ingame UI ++ */ ++ public void updateTick() ++ { ++ if (this.recordPlayingUpFor > 0) ++ { ++ --this.recordPlayingUpFor; ++ } ++ ++ ++this.updateCounter; ++ ++ if (this.mc.thePlayer != null) ++ { ++ ItemStack var1 = this.mc.thePlayer.inventory.getCurrentItem(); ++ ++ if (var1 == null) ++ { ++ this.remainingHighlightTicks = 0; ++ } ++ else if (this.highlightingItemStack != null && var1.itemID == this.highlightingItemStack.itemID && ItemStack.areItemStackTagsEqual(var1, this.highlightingItemStack) && (var1.isItemStackDamageable() || var1.getItemDamage() == this.highlightingItemStack.getItemDamage())) ++ { ++ if (this.remainingHighlightTicks > 0) ++ { ++ --this.remainingHighlightTicks; ++ } ++ } ++ else ++ { ++ this.remainingHighlightTicks = 40; ++ } ++ ++ this.highlightingItemStack = var1; ++ } ++ } ++ ++ public void setRecordPlayingMessage(String par1Str) ++ { ++ this.func_110326_a("Now playing: " + par1Str, true); ++ } ++ ++ public void func_110326_a(String par1Str, boolean par2) ++ { ++ this.recordPlaying = par1Str; ++ this.recordPlayingUpFor = 60; ++ this.recordIsPlaying = par2; ++ } ++ ++ /** ++ * returns a pointer to the persistant Chat GUI, containing all previous chat messages and such ++ */ ++ public GuiNewChat getChatGUI() ++ { ++ return this.persistantChatGUI; ++ } ++ ++ public int getUpdateCounter() ++ { ++ return this.updateCounter; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiIngameMenu.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,96 ---- ++ package net.minecraft.src; ++ ++ public class GuiIngameMenu extends GuiScreen ++ { ++ /** Also counts the number of updates, not certain as to why yet. */ ++ private int updateCounter2; ++ ++ /** Counts the number of screen updates. */ ++ private int updateCounter; ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.updateCounter2 = 0; ++ this.buttonList.clear(); ++ byte var1 = -16; ++ boolean var2 = true; ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + var1, I18n.getString("menu.returnToMenu"))); ++ ++ if (!this.mc.isIntegratedServerRunning()) ++ { ++ ((GuiButton)this.buttonList.get(0)).displayString = I18n.getString("menu.disconnect"); ++ } ++ ++ this.buttonList.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 24 + var1, I18n.getString("menu.returnToGame"))); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + var1, 98, 20, I18n.getString("menu.options"))); ++ GuiButton var3; ++ this.buttonList.add(var3 = new GuiButton(7, this.width / 2 + 2, this.height / 4 + 96 + var1, 98, 20, I18n.getString("menu.shareToLan"))); ++ this.buttonList.add(new GuiButton(5, this.width / 2 - 100, this.height / 4 + 48 + var1, 98, 20, I18n.getString("gui.achievements"))); ++ this.buttonList.add(new GuiButton(6, this.width / 2 + 2, this.height / 4 + 48 + var1, 98, 20, I18n.getString("gui.stats"))); ++ var3.enabled = this.mc.isSingleplayer() && !this.mc.getIntegratedServer().getPublic(); ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ switch (par1GuiButton.id) ++ { ++ case 0: ++ this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings)); ++ break; ++ ++ case 1: ++ par1GuiButton.enabled = false; ++ this.mc.statFileWriter.readStat(StatList.leaveGameStat, 1); ++ this.mc.theWorld.sendQuittingDisconnectingPacket(); ++ this.mc.loadWorld((WorldClient)null); ++ this.mc.displayGuiScreen(new GuiMainMenu()); ++ ++ case 2: ++ case 3: ++ default: ++ break; ++ ++ case 4: ++ this.mc.displayGuiScreen((GuiScreen)null); ++ this.mc.setIngameFocus(); ++ this.mc.sndManager.resumeAllSounds(); ++ break; ++ ++ case 5: ++ this.mc.displayGuiScreen(new GuiAchievements(this.mc.statFileWriter)); ++ break; ++ ++ case 6: ++ this.mc.displayGuiScreen(new GuiStats(this, this.mc.statFileWriter)); ++ break; ++ ++ case 7: ++ this.mc.displayGuiScreen(new GuiShareToLan(this)); ++ } ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ super.updateScreen(); ++ ++this.updateCounter; ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.drawCenteredString(this.fontRenderer, "Game menu", this.width / 2, 40, 16777215); ++ super.drawScreen(par1, par2, par3); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiInventory.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,136 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ import org.lwjgl.opengl.GL12; ++ ++ public class GuiInventory extends InventoryEffectRenderer ++ { ++ /** ++ * x size of the inventory window in pixels. Defined as float, passed as int ++ */ ++ private float xSize_lo; ++ ++ /** ++ * y size of the inventory window in pixels. Defined as float, passed as int. ++ */ ++ private float ySize_lo; ++ ++ public GuiInventory(EntityPlayer par1EntityPlayer) ++ { ++ super(par1EntityPlayer.inventoryContainer); ++ this.allowUserInput = true; ++ par1EntityPlayer.addStat(AchievementList.openInventory, 1); ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ if (this.mc.playerController.isInCreativeMode()) ++ { ++ this.mc.displayGuiScreen(new GuiContainerCreative(this.mc.thePlayer)); ++ } ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.buttonList.clear(); ++ ++ if (this.mc.playerController.isInCreativeMode()) ++ { ++ this.mc.displayGuiScreen(new GuiContainerCreative(this.mc.thePlayer)); ++ } ++ else ++ { ++ super.initGui(); ++ } ++ } ++ ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) ++ { ++ this.fontRenderer.drawString(I18n.getString("container.crafting"), 86, 16, 4210752); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ super.drawScreen(par1, par2, par3); ++ this.xSize_lo = (float)par1; ++ this.ySize_lo = (float)par2; ++ } ++ ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) ++ { ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.mc.getTextureManager().bindTexture(field_110408_a); ++ int var4 = this.guiLeft; ++ int var5 = this.guiTop; ++ this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); ++ func_110423_a(var4 + 51, var5 + 75, 30, (float)(var4 + 51) - this.xSize_lo, (float)(var5 + 75 - 50) - this.ySize_lo, this.mc.thePlayer); ++ } ++ ++ public static void func_110423_a(int par0, int par1, int par2, float par3, float par4, EntityLivingBase par5EntityLivingBase) ++ { ++ GL11.glEnable(GL11.GL_COLOR_MATERIAL); ++ GL11.glPushMatrix(); ++ GL11.glTranslatef((float)par0, (float)par1, 50.0F); ++ GL11.glScalef((float)(-par2), (float)par2, (float)par2); ++ GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); ++ float var6 = par5EntityLivingBase.renderYawOffset; ++ float var7 = par5EntityLivingBase.rotationYaw; ++ float var8 = par5EntityLivingBase.rotationPitch; ++ float var9 = par5EntityLivingBase.prevRotationYawHead; ++ float var10 = par5EntityLivingBase.rotationYawHead; ++ GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F); ++ RenderHelper.enableStandardItemLighting(); ++ GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); ++ GL11.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; ++ par5EntityLivingBase.rotationYaw = (float)Math.atan((double)(par3 / 40.0F)) * 40.0F; ++ par5EntityLivingBase.rotationPitch = -((float)Math.atan((double)(par4 / 40.0F))) * 20.0F; ++ par5EntityLivingBase.rotationYawHead = par5EntityLivingBase.rotationYaw; ++ par5EntityLivingBase.prevRotationYawHead = par5EntityLivingBase.rotationYaw; ++ GL11.glTranslatef(0.0F, par5EntityLivingBase.yOffset, 0.0F); ++ RenderManager.instance.playerViewY = 180.0F; ++ RenderManager.instance.renderEntityWithPosYaw(par5EntityLivingBase, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F); ++ par5EntityLivingBase.renderYawOffset = var6; ++ par5EntityLivingBase.rotationYaw = var7; ++ par5EntityLivingBase.rotationPitch = var8; ++ par5EntityLivingBase.prevRotationYawHead = var9; ++ par5EntityLivingBase.rotationYawHead = var10; ++ GL11.glPopMatrix(); ++ RenderHelper.disableStandardItemLighting(); ++ GL11.glDisable(GL12.GL_RESCALE_NORMAL); ++ OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ if (par1GuiButton.id == 0) ++ { ++ this.mc.displayGuiScreen(new GuiAchievements(this.mc.statFileWriter)); ++ } ++ ++ if (par1GuiButton.id == 1) ++ { ++ this.mc.displayGuiScreen(new GuiStats(this, this.mc.statFileWriter)); ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiLanguage.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,88 ---- ++ package net.minecraft.src; ++ ++ public class GuiLanguage extends GuiScreen ++ { ++ /** This GUI's parent GUI. */ ++ protected GuiScreen parentGui; ++ ++ /** This GUI's language list. */ ++ private GuiSlotLanguage languageList; ++ ++ /** For saving the user's language selection to disk. */ ++ private final GameSettings theGameSettings; ++ private final LanguageManager field_135014_d; ++ ++ /** This GUI's 'Done' button. */ ++ private GuiSmallButton doneButton; ++ ++ public GuiLanguage(GuiScreen par1GuiScreen, GameSettings par2GameSettings, LanguageManager par3LanguageManager) ++ { ++ this.parentGui = par1GuiScreen; ++ this.theGameSettings = par2GameSettings; ++ this.field_135014_d = par3LanguageManager; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.buttonList.add(this.doneButton = new GuiSmallButton(6, this.width / 2 - 75, this.height - 38, I18n.getString("gui.done"))); ++ this.languageList = new GuiSlotLanguage(this); ++ this.languageList.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) ++ { ++ switch (par1GuiButton.id) ++ { ++ case 5: ++ break; ++ ++ case 6: ++ this.mc.displayGuiScreen(this.parentGui); ++ break; ++ ++ default: ++ this.languageList.actionPerformed(par1GuiButton); ++ } ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.languageList.drawScreen(par1, par2, par3); ++ this.drawCenteredString(this.fontRenderer, I18n.getString("options.language"), this.width / 2, 16, 16777215); ++ this.drawCenteredString(this.fontRenderer, "(" + I18n.getString("options.languageWarning") + ")", this.width / 2, this.height - 56, 8421504); ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ static LanguageManager func_135011_a(GuiLanguage par0GuiLanguage) ++ { ++ return par0GuiLanguage.field_135014_d; ++ } ++ ++ /** ++ * Gets the relevant instance of GameSettings. Synthetic method for use in GuiSlotLanguage ++ */ ++ static GameSettings getGameSettings(GuiLanguage par0GuiLanguage) ++ { ++ return par0GuiLanguage.theGameSettings; ++ } ++ ++ /** ++ * Returns the private doneButton field. ++ */ ++ static GuiSmallButton getDoneButton(GuiLanguage par0GuiLanguage) ++ { ++ return par0GuiLanguage.doneButton; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiMainMenu.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,611 ---- ++ package net.minecraft.src; ++ ++ import java.io.BufferedReader; ++ import java.io.IOException; ++ import java.io.InputStreamReader; ++ import java.net.URI; ++ import java.util.ArrayList; ++ import java.util.Calendar; ++ import java.util.Date; ++ import java.util.Random; ++ import org.apache.commons.io.Charsets; ++ import org.lwjgl.opengl.GL11; ++ import org.lwjgl.util.glu.Project; ++ ++ public class GuiMainMenu extends GuiScreen ++ { ++ /** The RNG used by the Main Menu Screen. */ ++ private static final Random rand = new Random(); ++ ++ /** Counts the number of screen updates. */ ++ private float updateCounter; ++ ++ /** The splash message. */ ++ private String splashText = "missingno"; ++ private GuiButton buttonResetDemo; ++ ++ /** Timer used to rotate the panorama, increases every tick. */ ++ private int panoramaTimer; ++ ++ /** ++ * Texture allocated for the current viewport of the main menu's panorama background. ++ */ ++ private DynamicTexture viewportTexture; ++ private boolean field_96141_q = true; ++ private static boolean field_96140_r; ++ private static boolean field_96139_s; ++ private final Object field_104025_t = new Object(); ++ private String field_92025_p; ++ private String field_104024_v; ++ private static final ResourceLocation splashTexts = new ResourceLocation("texts/splashes.txt"); ++ private static final ResourceLocation minecraftTitleTextures = new ResourceLocation("textures/gui/title/minecraft.png"); ++ ++ /** An array of all the paths to the panorama pictures. */ ++ private static final ResourceLocation[] titlePanoramaPaths = new ResourceLocation[] {new ResourceLocation("textures/gui/title/background/panorama_0.png"), new ResourceLocation("textures/gui/title/background/panorama_1.png"), new ResourceLocation("textures/gui/title/background/panorama_2.png"), new ResourceLocation("textures/gui/title/background/panorama_3.png"), new ResourceLocation("textures/gui/title/background/panorama_4.png"), new ResourceLocation("textures/gui/title/background/panorama_5.png")}; ++ public static final String field_96138_a = "Please click " + EnumChatFormatting.UNDERLINE + "here" + EnumChatFormatting.RESET + " for more information."; ++ private int field_92024_r; ++ private int field_92023_s; ++ private int field_92022_t; ++ private int field_92021_u; ++ private int field_92020_v; ++ private int field_92019_w; ++ private ResourceLocation field_110351_G; ++ private GuiButton minecraftRealmsButton; ++ ++ public GuiMainMenu() ++ { ++ BufferedReader var1 = null; ++ String var3; ++ ++ try ++ { ++ ArrayList var2 = new ArrayList(); ++ var1 = new BufferedReader(new InputStreamReader(Minecraft.getMinecraft().getResourceManager().getResource(splashTexts).getInputStream(), Charsets.UTF_8)); ++ ++ while ((var3 = var1.readLine()) != null) ++ { ++ var3 = var3.trim(); ++ ++ if (!var3.isEmpty()) ++ { ++ var2.add(var3); ++ } ++ } ++ ++ do ++ { ++ this.splashText = (String)var2.get(rand.nextInt(var2.size())); ++ } ++ while (this.splashText.hashCode() == 125780783); ++ } ++ catch (IOException var12) ++ { ++ ; ++ } ++ finally ++ { ++ if (var1 != null) ++ { ++ try ++ { ++ var1.close(); ++ } ++ catch (IOException var11) ++ { ++ ; ++ } ++ } ++ } ++ ++ this.updateCounter = rand.nextFloat(); ++ this.field_92025_p = ""; ++ String var14 = System.getProperty("os_architecture"); ++ var3 = System.getProperty("java_version"); ++ ++ if ("ppc".equalsIgnoreCase(var14)) ++ { ++ this.field_92025_p = "" + EnumChatFormatting.BOLD + "Notice!" + EnumChatFormatting.RESET + " PowerPC compatibility will be dropped in Minecraft 1.6"; ++ this.field_104024_v = "http://tinyurl.com/javappc"; ++ } ++ else if (var3 != null && var3.startsWith("1.5")) ++ { ++ this.field_92025_p = "" + EnumChatFormatting.BOLD + "Notice!" + EnumChatFormatting.RESET + " Java 1.5 compatibility will be dropped in Minecraft 1.6"; ++ this.field_104024_v = "http://tinyurl.com/javappc"; ++ } ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ ++this.panoramaTimer; ++ } ++ ++ /** ++ * Returns true if this GUI should pause the game when it is displayed in single-player ++ */ ++ public boolean doesGuiPauseGame() ++ { ++ return false; ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) {} ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.viewportTexture = new DynamicTexture(256, 256); ++ this.field_110351_G = this.mc.getTextureManager().getDynamicTextureLocation("background", this.viewportTexture); ++ Calendar var1 = Calendar.getInstance(); ++ var1.setTime(new Date()); ++ ++ if (var1.get(2) + 1 == 11 && var1.get(5) == 9) ++ { ++ this.splashText = "Happy birthday, ez!"; ++ } ++ else if (var1.get(2) + 1 == 6 && var1.get(5) == 1) ++ { ++ this.splashText = "Happy birthday, Notch!"; ++ } ++ else if (var1.get(2) + 1 == 12 && var1.get(5) == 24) ++ { ++ this.splashText = "Merry X-mas!"; ++ } ++ else if (var1.get(2) + 1 == 1 && var1.get(5) == 1) ++ { ++ this.splashText = "Happy new year!"; ++ } ++ else if (var1.get(2) + 1 == 10 && var1.get(5) == 31) ++ { ++ this.splashText = "OOoooOOOoooo! Spooky!"; ++ } ++ ++ boolean var2 = true; ++ int var3 = this.height / 4 + 48; ++ ++ if (this.mc.isDemo()) ++ { ++ this.addDemoButtons(var3, 24); ++ } ++ else ++ { ++ this.addSingleplayerMultiplayerButtons(var3, 24); ++ } ++ ++ this.func_130020_g(); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, var3 + 72 + 12, 98, 20, I18n.getString("menu.options"))); ++ this.buttonList.add(new GuiButton(4, this.width / 2 + 2, var3 + 72 + 12, 98, 20, I18n.getString("menu.quit"))); ++ this.buttonList.add(new GuiButtonLanguage(5, this.width / 2 - 124, var3 + 72 + 12)); ++ Object var4 = this.field_104025_t; ++ ++ synchronized (this.field_104025_t) ++ { ++ this.field_92023_s = this.fontRenderer.getStringWidth(this.field_92025_p); ++ this.field_92024_r = this.fontRenderer.getStringWidth(field_96138_a); ++ int var5 = Math.max(this.field_92023_s, this.field_92024_r); ++ this.field_92022_t = (this.width - var5) / 2; ++ this.field_92021_u = ((GuiButton)this.buttonList.get(0)).yPosition - 24; ++ this.field_92020_v = this.field_92022_t + var5; ++ this.field_92019_w = this.field_92021_u + 24; ++ } ++ } ++ ++ private void func_130020_g() ++ { ++ if (this.field_96141_q) ++ { ++ if (!field_96140_r) ++ { ++ field_96140_r = true; ++ (new RunnableTitleScreen(this)).start(); ++ } ++ else if (field_96139_s) ++ { ++ this.func_130022_h(); ++ } ++ } ++ } ++ ++ private void func_130022_h() ++ { ++ this.minecraftRealmsButton.drawButton = true; ++ } ++ ++ /** ++ * Adds Singleplayer and Multiplayer buttons on Main Menu for players who have bought the game. ++ */ ++ private void addSingleplayerMultiplayerButtons(int par1, int par2) ++ { ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, par1, I18n.getString("menu.singleplayer"))); ++ this.buttonList.add(new GuiButton(2, this.width / 2 - 100, par1 + par2 * 1, I18n.getString("menu.multiplayer"))); ++ this.buttonList.add(this.minecraftRealmsButton = new GuiButton(14, this.width / 2 - 100, par1 + par2 * 2, I18n.getString("menu.online"))); ++ this.minecraftRealmsButton.drawButton = false; ++ } ++ ++ /** ++ * Adds Demo buttons on Main Menu for players who are playing Demo. ++ */ ++ private void addDemoButtons(int par1, int par2) ++ { ++ this.buttonList.add(new GuiButton(11, this.width / 2 - 100, par1, I18n.getString("menu.playdemo"))); ++ this.buttonList.add(this.buttonResetDemo = new GuiButton(12, this.width / 2 - 100, par1 + par2 * 1, I18n.getString("menu.resetdemo"))); ++ ISaveFormat var3 = this.mc.getSaveLoader(); ++ WorldInfo var4 = var3.getWorldInfo("Demo_World"); ++ ++ if (var4 == null) ++ { ++ this.buttonResetDemo.enabled = false; ++ } ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ if (par1GuiButton.id == 0) ++ { ++ this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings)); ++ } ++ ++ if (par1GuiButton.id == 5) ++ { ++ this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings, this.mc.getLanguageManager())); ++ } ++ ++ if (par1GuiButton.id == 1) ++ { ++ this.mc.displayGuiScreen(new GuiSelectWorld(this)); ++ } ++ ++ if (par1GuiButton.id == 2) ++ { ++ this.mc.displayGuiScreen(new GuiMultiplayer(this)); ++ } ++ ++ if (par1GuiButton.id == 14 && this.minecraftRealmsButton.drawButton) ++ { ++ this.func_140005_i(); ++ } ++ ++ if (par1GuiButton.id == 4) ++ { ++ this.mc.shutdown(); ++ } ++ ++ if (par1GuiButton.id == 11) ++ { ++ this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings); ++ } ++ ++ if (par1GuiButton.id == 12) ++ { ++ ISaveFormat var2 = this.mc.getSaveLoader(); ++ WorldInfo var3 = var2.getWorldInfo("Demo_World"); ++ ++ if (var3 != null) ++ { ++ GuiYesNo var4 = GuiSelectWorld.getDeleteWorldScreen(this, var3.getWorldName(), 12); ++ this.mc.displayGuiScreen(var4); ++ } ++ } ++ } ++ ++ private void func_140005_i() ++ { ++ McoClient var1 = new McoClient(this.mc.getSession()); ++ ++ try ++ { ++ if (var1.func_140054_c().booleanValue()) ++ { ++ this.mc.displayGuiScreen(new GuiScreenClientOutdated(this)); ++ } ++ else ++ { ++ this.mc.displayGuiScreen(new GuiScreenOnlineServers(this)); ++ } ++ } ++ catch (ExceptionMcoService var3) ++ { ++ this.mc.getLogAgent().logSevere(var3.toString()); ++ } ++ catch (IOException var4) ++ { ++ this.mc.getLogAgent().logSevere(var4.getLocalizedMessage()); ++ } ++ } ++ ++ public void confirmClicked(boolean par1, int par2) ++ { ++ if (par1 && par2 == 12) ++ { ++ ISaveFormat var6 = this.mc.getSaveLoader(); ++ var6.flushCache(); ++ var6.deleteWorldDirectory("Demo_World"); ++ this.mc.displayGuiScreen(this); ++ } ++ else if (par2 == 13) ++ { ++ if (par1) ++ { ++ try ++ { ++ Class var3 = Class.forName("java.awt.Desktop"); ++ Object var4 = var3.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); ++ var3.getMethod("browse", new Class[] {URI.class}).invoke(var4, new Object[] {new URI(this.field_104024_v)}); ++ } ++ catch (Throwable var5) ++ { ++ var5.printStackTrace(); ++ } ++ } ++ ++ this.mc.displayGuiScreen(this); ++ } ++ } ++ ++ /** ++ * Draws the main menu panorama ++ */ ++ private void drawPanorama(int par1, int par2, float par3) ++ { ++ Tessellator var4 = Tessellator.instance; ++ GL11.glMatrixMode(GL11.GL_PROJECTION); ++ GL11.glPushMatrix(); ++ GL11.glLoadIdentity(); ++ Project.gluPerspective(120.0F, 1.0F, 0.05F, 10.0F); ++ GL11.glMatrixMode(GL11.GL_MODELVIEW); ++ GL11.glPushMatrix(); ++ GL11.glLoadIdentity(); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glDisable(GL11.GL_ALPHA_TEST); ++ GL11.glDisable(GL11.GL_CULL_FACE); ++ GL11.glDepthMask(false); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ byte var5 = 8; ++ ++ for (int var6 = 0; var6 < var5 * var5; ++var6) ++ { ++ GL11.glPushMatrix(); ++ float var7 = ((float)(var6 % var5) / (float)var5 - 0.5F) / 64.0F; ++ float var8 = ((float)(var6 / var5) / (float)var5 - 0.5F) / 64.0F; ++ float var9 = 0.0F; ++ GL11.glTranslatef(var7, var8, var9); ++ GL11.glRotatef(MathHelper.sin(((float)this.panoramaTimer + par3) / 400.0F) * 25.0F + 20.0F, 1.0F, 0.0F, 0.0F); ++ GL11.glRotatef(-((float)this.panoramaTimer + par3) * 0.1F, 0.0F, 1.0F, 0.0F); ++ ++ for (int var10 = 0; var10 < 6; ++var10) ++ { ++ GL11.glPushMatrix(); ++ ++ if (var10 == 1) ++ { ++ GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); ++ } ++ ++ if (var10 == 2) ++ { ++ GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); ++ } ++ ++ if (var10 == 3) ++ { ++ GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); ++ } ++ ++ if (var10 == 4) ++ { ++ GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); ++ } ++ ++ if (var10 == 5) ++ { ++ GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); ++ } ++ ++ this.mc.getTextureManager().bindTexture(titlePanoramaPaths[var10]); ++ var4.startDrawingQuads(); ++ var4.setColorRGBA_I(16777215, 255 / (var6 + 1)); ++ float var11 = 0.0F; ++ var4.addVertexWithUV(-1.0D, -1.0D, 1.0D, (double)(0.0F + var11), (double)(0.0F + var11)); ++ var4.addVertexWithUV(1.0D, -1.0D, 1.0D, (double)(1.0F - var11), (double)(0.0F + var11)); ++ var4.addVertexWithUV(1.0D, 1.0D, 1.0D, (double)(1.0F - var11), (double)(1.0F - var11)); ++ var4.addVertexWithUV(-1.0D, 1.0D, 1.0D, (double)(0.0F + var11), (double)(1.0F - var11)); ++ var4.draw(); ++ GL11.glPopMatrix(); ++ } ++ ++ GL11.glPopMatrix(); ++ GL11.glColorMask(true, true, true, false); ++ } ++ ++ var4.setTranslation(0.0D, 0.0D, 0.0D); ++ GL11.glColorMask(true, true, true, true); ++ GL11.glMatrixMode(GL11.GL_PROJECTION); ++ GL11.glPopMatrix(); ++ GL11.glMatrixMode(GL11.GL_MODELVIEW); ++ GL11.glPopMatrix(); ++ GL11.glDepthMask(true); ++ GL11.glEnable(GL11.GL_CULL_FACE); ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ GL11.glEnable(GL11.GL_DEPTH_TEST); ++ } ++ ++ /** ++ * Rotate and blurs the skybox view in the main menu ++ */ ++ private void rotateAndBlurSkybox(float par1) ++ { ++ this.mc.getTextureManager().bindTexture(this.field_110351_G); ++ GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ GL11.glColorMask(true, true, true, false); ++ Tessellator var2 = Tessellator.instance; ++ var2.startDrawingQuads(); ++ byte var3 = 3; ++ ++ for (int var4 = 0; var4 < var3; ++var4) ++ { ++ var2.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F / (float)(var4 + 1)); ++ int var5 = this.width; ++ int var6 = this.height; ++ float var7 = (float)(var4 - var3 / 2) / 256.0F; ++ var2.addVertexWithUV((double)var5, (double)var6, (double)this.zLevel, (double)(0.0F + var7), 0.0D); ++ var2.addVertexWithUV((double)var5, 0.0D, (double)this.zLevel, (double)(1.0F + var7), 0.0D); ++ var2.addVertexWithUV(0.0D, 0.0D, (double)this.zLevel, (double)(1.0F + var7), 1.0D); ++ var2.addVertexWithUV(0.0D, (double)var6, (double)this.zLevel, (double)(0.0F + var7), 1.0D); ++ } ++ ++ var2.draw(); ++ GL11.glColorMask(true, true, true, true); ++ } ++ ++ /** ++ * Renders the skybox in the main menu ++ */ ++ private void renderSkybox(int par1, int par2, float par3) ++ { ++ GL11.glViewport(0, 0, 256, 256); ++ this.drawPanorama(par1, par2, par3); ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ this.rotateAndBlurSkybox(par3); ++ this.rotateAndBlurSkybox(par3); ++ this.rotateAndBlurSkybox(par3); ++ this.rotateAndBlurSkybox(par3); ++ this.rotateAndBlurSkybox(par3); ++ this.rotateAndBlurSkybox(par3); ++ this.rotateAndBlurSkybox(par3); ++ this.rotateAndBlurSkybox(par3); ++ GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); ++ Tessellator var4 = Tessellator.instance; ++ var4.startDrawingQuads(); ++ float var5 = this.width > this.height ? 120.0F / (float)this.width : 120.0F / (float)this.height; ++ float var6 = (float)this.height * var5 / 256.0F; ++ float var7 = (float)this.width * var5 / 256.0F; ++ 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); ++ var4.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F); ++ int var8 = this.width; ++ int var9 = this.height; ++ var4.addVertexWithUV(0.0D, (double)var9, (double)this.zLevel, (double)(0.5F - var6), (double)(0.5F + var7)); ++ var4.addVertexWithUV((double)var8, (double)var9, (double)this.zLevel, (double)(0.5F - var6), (double)(0.5F - var7)); ++ var4.addVertexWithUV((double)var8, 0.0D, (double)this.zLevel, (double)(0.5F + var6), (double)(0.5F - var7)); ++ var4.addVertexWithUV(0.0D, 0.0D, (double)this.zLevel, (double)(0.5F + var6), (double)(0.5F + var7)); ++ var4.draw(); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.renderSkybox(par1, par2, par3); ++ Tessellator var4 = Tessellator.instance; ++ short var5 = 274; ++ int var6 = this.width / 2 - var5 / 2; ++ byte var7 = 30; ++ this.drawGradientRect(0, 0, this.width, this.height, -2130706433, 16777215); ++ this.drawGradientRect(0, 0, this.width, this.height, 0, Integer.MIN_VALUE); ++ this.mc.getTextureManager().bindTexture(minecraftTitleTextures); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ ++ if ((double)this.updateCounter < 1.0E-4D) ++ { ++ this.drawTexturedModalRect(var6 + 0, var7 + 0, 0, 0, 99, 44); ++ this.drawTexturedModalRect(var6 + 99, var7 + 0, 129, 0, 27, 44); ++ this.drawTexturedModalRect(var6 + 99 + 26, var7 + 0, 126, 0, 3, 44); ++ this.drawTexturedModalRect(var6 + 99 + 26 + 3, var7 + 0, 99, 0, 26, 44); ++ this.drawTexturedModalRect(var6 + 155, var7 + 0, 0, 45, 155, 44); ++ } ++ else ++ { ++ this.drawTexturedModalRect(var6 + 0, var7 + 0, 0, 0, 155, 44); ++ this.drawTexturedModalRect(var6 + 155, var7 + 0, 0, 45, 155, 44); ++ } ++ ++ var4.setColorOpaque_I(16777215); ++ GL11.glPushMatrix(); ++ GL11.glTranslatef((float)(this.width / 2 + 90), 70.0F, 0.0F); ++ GL11.glRotatef(-20.0F, 0.0F, 0.0F, 1.0F); ++ float var8 = 1.8F - MathHelper.abs(MathHelper.sin((float)(Minecraft.getSystemTime() % 1000L) / 1000.0F * (float)Math.PI * 2.0F) * 0.1F); ++ var8 = var8 * 100.0F / (float)(this.fontRenderer.getStringWidth(this.splashText) + 32); ++ GL11.glScalef(var8, var8, var8); ++ this.drawCenteredString(this.fontRenderer, this.splashText, 0, -8, 16776960); ++ GL11.glPopMatrix(); ++ String var9 = "Minecraft 1.6.4"; ++ ++ if (this.mc.isDemo()) ++ { ++ var9 = var9 + " Demo"; ++ } ++ ++ this.drawString(this.fontRenderer, var9, 2, this.height - 10, 16777215); ++ String var10 = "Copyright Mojang AB. Do not distribute!"; ++ this.drawString(this.fontRenderer, var10, this.width - this.fontRenderer.getStringWidth(var10) - 2, this.height - 10, 16777215); ++ ++ if (this.field_92025_p != null && this.field_92025_p.length() > 0) ++ { ++ drawRect(this.field_92022_t - 2, this.field_92021_u - 2, this.field_92020_v + 2, this.field_92019_w - 1, 1428160512); ++ this.drawString(this.fontRenderer, this.field_92025_p, this.field_92022_t, this.field_92021_u, 16777215); ++ this.drawString(this.fontRenderer, field_96138_a, (this.width - this.field_92024_r) / 2, ((GuiButton)this.buttonList.get(0)).yPosition - 12, 16777215); ++ } ++ ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) ++ { ++ super.mouseClicked(par1, par2, par3); ++ Object var4 = this.field_104025_t; ++ ++ synchronized (this.field_104025_t) ++ { ++ if (this.field_92025_p.length() > 0 && par1 >= this.field_92022_t && par1 <= this.field_92020_v && par2 >= this.field_92021_u && par2 <= this.field_92019_w) ++ { ++ GuiConfirmOpenLink var5 = new GuiConfirmOpenLink(this, this.field_104024_v, 13, true); ++ var5.func_92026_h(); ++ this.mc.displayGuiScreen(var5); ++ } ++ } ++ } ++ ++ static Minecraft func_110348_a(GuiMainMenu par0GuiMainMenu) ++ { ++ return par0GuiMainMenu.mc; ++ } ++ ++ static void func_130021_b(GuiMainMenu par0GuiMainMenu) ++ { ++ par0GuiMainMenu.func_130022_h(); ++ } ++ ++ static boolean func_110349_a(boolean par0) ++ { ++ field_96139_s = par0; ++ return par0; ++ } ++ ++ static Minecraft func_130018_c(GuiMainMenu par0GuiMainMenu) ++ { ++ return par0GuiMainMenu.mc; ++ } ++ ++ static Minecraft func_130019_d(GuiMainMenu par0GuiMainMenu) ++ { ++ return par0GuiMainMenu.mc; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiMemoryErrorScreen.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,53 ---- ++ package net.minecraft.src; ++ ++ public class GuiMemoryErrorScreen extends GuiScreen ++ { ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiSmallButton(0, this.width / 2 - 155, this.height / 4 + 120 + 12, I18n.getString("gui.toMenu"))); ++ this.buttonList.add(new GuiSmallButton(1, this.width / 2 - 155 + 160, this.height / 4 + 120 + 12, I18n.getString("menu.quit"))); ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ if (par1GuiButton.id == 0) ++ { ++ this.mc.displayGuiScreen(new GuiMainMenu()); ++ } ++ else if (par1GuiButton.id == 1) ++ { ++ this.mc.shutdown(); ++ } ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) {} ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.drawCenteredString(this.fontRenderer, "Out of memory!", this.width / 2, this.height / 4 - 60 + 20, 16777215); ++ this.drawString(this.fontRenderer, "Minecraft has run out of memory.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 0, 10526880); ++ this.drawString(this.fontRenderer, "This could be caused by a bug in the game or by the", this.width / 2 - 140, this.height / 4 - 60 + 60 + 18, 10526880); ++ this.drawString(this.fontRenderer, "Java Virtual Machine not being allocated enough", this.width / 2 - 140, this.height / 4 - 60 + 60 + 27, 10526880); ++ this.drawString(this.fontRenderer, "memory. If you are playing in a web browser, try", this.width / 2 - 140, this.height / 4 - 60 + 60 + 36, 10526880); ++ this.drawString(this.fontRenderer, "downloading the game and playing it offline.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 45, 10526880); ++ this.drawString(this.fontRenderer, "To prevent level corruption, the current game has quit.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 63, 10526880); ++ this.drawString(this.fontRenderer, "We\'ve tried to free up enough memory to let you go back to", this.width / 2 - 140, this.height / 4 - 60 + 60 + 81, 10526880); ++ this.drawString(this.fontRenderer, "the main menu and back to playing, but this may not have worked.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 90, 10526880); ++ this.drawString(this.fontRenderer, "Please restart the game if you see this message again.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 99, 10526880); ++ super.drawScreen(par1, par2, par3); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiMerchant.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,198 ---- ++ package net.minecraft.src; ++ ++ import java.io.ByteArrayOutputStream; ++ import java.io.DataOutputStream; ++ import org.lwjgl.opengl.GL11; ++ import org.lwjgl.opengl.GL12; ++ ++ public class GuiMerchant extends GuiContainer ++ { ++ private static final ResourceLocation merchantGuiTextures = new ResourceLocation("textures/gui/container/villager.png"); ++ ++ /** Instance of IMerchant interface. */ ++ private IMerchant theIMerchant; ++ private GuiButtonMerchant nextRecipeButtonIndex; ++ private GuiButtonMerchant previousRecipeButtonIndex; ++ private int currentRecipeIndex; ++ private String field_94082_v; ++ ++ public GuiMerchant(InventoryPlayer par1InventoryPlayer, IMerchant par2IMerchant, World par3World, String par4Str) ++ { ++ super(new ContainerMerchant(par1InventoryPlayer, par2IMerchant, par3World)); ++ this.theIMerchant = par2IMerchant; ++ this.field_94082_v = par4Str != null && par4Str.length() >= 1 ? par4Str : I18n.getString("entity.Villager.name"); ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ super.initGui(); ++ int var1 = (this.width - this.xSize) / 2; ++ int var2 = (this.height - this.ySize) / 2; ++ this.buttonList.add(this.nextRecipeButtonIndex = new GuiButtonMerchant(1, var1 + 120 + 27, var2 + 24 - 1, true)); ++ this.buttonList.add(this.previousRecipeButtonIndex = new GuiButtonMerchant(2, var1 + 36 - 19, var2 + 24 - 1, false)); ++ this.nextRecipeButtonIndex.enabled = false; ++ this.previousRecipeButtonIndex.enabled = false; ++ } ++ ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) ++ { ++ this.fontRenderer.drawString(this.field_94082_v, this.xSize / 2 - this.fontRenderer.getStringWidth(this.field_94082_v) / 2, 6, 4210752); ++ this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752); ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ super.updateScreen(); ++ MerchantRecipeList var1 = this.theIMerchant.getRecipes(this.mc.thePlayer); ++ ++ if (var1 != null) ++ { ++ this.nextRecipeButtonIndex.enabled = this.currentRecipeIndex < var1.size() - 1; ++ this.previousRecipeButtonIndex.enabled = this.currentRecipeIndex > 0; ++ } ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ boolean var2 = false; ++ ++ if (par1GuiButton == this.nextRecipeButtonIndex) ++ { ++ ++this.currentRecipeIndex; ++ var2 = true; ++ } ++ else if (par1GuiButton == this.previousRecipeButtonIndex) ++ { ++ --this.currentRecipeIndex; ++ var2 = true; ++ } ++ ++ if (var2) ++ { ++ ((ContainerMerchant)this.inventorySlots).setCurrentRecipeIndex(this.currentRecipeIndex); ++ ByteArrayOutputStream var3 = new ByteArrayOutputStream(); ++ DataOutputStream var4 = new DataOutputStream(var3); ++ ++ try ++ { ++ var4.writeInt(this.currentRecipeIndex); ++ this.mc.getNetHandler().addToSendQueue(new Packet250CustomPayload("MC|TrSel", var3.toByteArray())); ++ } ++ catch (Exception var6) ++ { ++ var6.printStackTrace(); ++ } ++ } ++ } ++ ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) ++ { ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.mc.getTextureManager().bindTexture(merchantGuiTextures); ++ int var4 = (this.width - this.xSize) / 2; ++ int var5 = (this.height - this.ySize) / 2; ++ this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); ++ MerchantRecipeList var6 = this.theIMerchant.getRecipes(this.mc.thePlayer); ++ ++ if (var6 != null && !var6.isEmpty()) ++ { ++ int var7 = this.currentRecipeIndex; ++ MerchantRecipe var8 = (MerchantRecipe)var6.get(var7); ++ ++ if (var8.func_82784_g()) ++ { ++ this.mc.getTextureManager().bindTexture(merchantGuiTextures); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ this.drawTexturedModalRect(this.guiLeft + 83, this.guiTop + 21, 212, 0, 28, 21); ++ this.drawTexturedModalRect(this.guiLeft + 83, this.guiTop + 51, 212, 0, 28, 21); ++ } ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ super.drawScreen(par1, par2, par3); ++ MerchantRecipeList var4 = this.theIMerchant.getRecipes(this.mc.thePlayer); ++ ++ if (var4 != null && !var4.isEmpty()) ++ { ++ int var5 = (this.width - this.xSize) / 2; ++ int var6 = (this.height - this.ySize) / 2; ++ int var7 = this.currentRecipeIndex; ++ MerchantRecipe var8 = (MerchantRecipe)var4.get(var7); ++ GL11.glPushMatrix(); ++ ItemStack var9 = var8.getItemToBuy(); ++ ItemStack var10 = var8.getSecondItemToBuy(); ++ ItemStack var11 = var8.getItemToSell(); ++ RenderHelper.enableGUIStandardItemLighting(); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glEnable(GL12.GL_RESCALE_NORMAL); ++ GL11.glEnable(GL11.GL_COLOR_MATERIAL); ++ GL11.glEnable(GL11.GL_LIGHTING); ++ itemRenderer.zLevel = 100.0F; ++ itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var9, var5 + 36, var6 + 24); ++ itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var9, var5 + 36, var6 + 24); ++ ++ if (var10 != null) ++ { ++ itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var10, var5 + 62, var6 + 24); ++ itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var10, var5 + 62, var6 + 24); ++ } ++ ++ itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var11, var5 + 120, var6 + 24); ++ itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var11, var5 + 120, var6 + 24); ++ itemRenderer.zLevel = 0.0F; ++ GL11.glDisable(GL11.GL_LIGHTING); ++ ++ if (this.isPointInRegion(36, 24, 16, 16, par1, par2)) ++ { ++ this.drawItemStackTooltip(var9, par1, par2); ++ } ++ else if (var10 != null && this.isPointInRegion(62, 24, 16, 16, par1, par2)) ++ { ++ this.drawItemStackTooltip(var10, par1, par2); ++ } ++ else if (this.isPointInRegion(120, 24, 16, 16, par1, par2)) ++ { ++ this.drawItemStackTooltip(var11, par1, par2); ++ } ++ ++ GL11.glPopMatrix(); ++ GL11.glEnable(GL11.GL_LIGHTING); ++ GL11.glEnable(GL11.GL_DEPTH_TEST); ++ RenderHelper.enableStandardItemLighting(); ++ } ++ } ++ ++ /** ++ * Gets the Instance of IMerchant interface. ++ */ ++ public IMerchant getIMerchant() ++ { ++ return this.theIMerchant; ++ } ++ ++ static ResourceLocation func_110417_h() ++ { ++ return merchantGuiTextures; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiMultiplayer.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,602 ---- ++ package net.minecraft.src; ++ ++ import java.io.DataInputStream; ++ import java.io.DataOutputStream; ++ import java.io.IOException; ++ import java.net.InetSocketAddress; ++ import java.net.Socket; ++ import java.util.Collections; ++ import java.util.List; ++ import org.lwjgl.input.Keyboard; ++ ++ public class GuiMultiplayer extends GuiScreen ++ { ++ /** Number of outstanding ThreadPollServers threads */ ++ private static int threadsPending; ++ ++ /** Lock object for use with synchronized() */ ++ private static Object lock = new Object(); ++ ++ /** ++ * A reference to the screen object that created this. Used for navigating between screens. ++ */ ++ private GuiScreen parentScreen; ++ ++ /** Slot container for the server list */ ++ private GuiSlotServer serverSlotContainer; ++ private ServerList internetServerList; ++ ++ /** Index of the currently selected server */ ++ private int selectedServer = -1; ++ private GuiButton field_96289_p; ++ ++ /** The 'Join Server' button */ ++ private GuiButton buttonSelect; ++ ++ /** The 'Delete' button */ ++ private GuiButton buttonDelete; ++ ++ /** The 'Delete' button was clicked */ ++ private boolean deleteClicked; ++ ++ /** The 'Add server' button was clicked */ ++ private boolean addClicked; ++ ++ /** The 'Edit' button was clicked */ ++ private boolean editClicked; ++ ++ /** The 'Direct Connect' button was clicked */ ++ private boolean directClicked; ++ ++ /** This GUI's lag tooltip text or null if no lag icon is being hovered. */ ++ private String lagTooltip; ++ ++ /** Instance of ServerData. */ ++ private ServerData theServerData; ++ private LanServerList localNetworkServerList; ++ private ThreadLanServerFind localServerFindThread; ++ ++ /** How many ticks this Gui is already opened */ ++ private int ticksOpened; ++ private boolean field_74024_A; ++ private List listofLanServers = Collections.emptyList(); ++ ++ public GuiMultiplayer(GuiScreen par1GuiScreen) ++ { ++ this.parentScreen = par1GuiScreen; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ Keyboard.enableRepeatEvents(true); ++ this.buttonList.clear(); ++ ++ if (!this.field_74024_A) ++ { ++ this.field_74024_A = true; ++ this.internetServerList = new ServerList(this.mc); ++ this.internetServerList.loadServerList(); ++ this.localNetworkServerList = new LanServerList(); ++ ++ try ++ { ++ this.localServerFindThread = new ThreadLanServerFind(this.localNetworkServerList); ++ this.localServerFindThread.start(); ++ } ++ catch (Exception var2) ++ { ++ this.mc.getLogAgent().logWarning("Unable to start LAN server detection: " + var2.getMessage()); ++ } ++ ++ this.serverSlotContainer = new GuiSlotServer(this); ++ } ++ else ++ { ++ this.serverSlotContainer.func_77207_a(this.width, this.height, 32, this.height - 64); ++ } ++ ++ this.initGuiControls(); ++ } ++ ++ /** ++ * Populate the GuiScreen controlList ++ */ ++ public void initGuiControls() ++ { ++ this.buttonList.add(this.field_96289_p = new GuiButton(7, this.width / 2 - 154, this.height - 28, 70, 20, I18n.getString("selectServer.edit"))); ++ this.buttonList.add(this.buttonDelete = new GuiButton(2, this.width / 2 - 74, this.height - 28, 70, 20, I18n.getString("selectServer.delete"))); ++ this.buttonList.add(this.buttonSelect = new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, I18n.getString("selectServer.select"))); ++ this.buttonList.add(new GuiButton(4, this.width / 2 - 50, this.height - 52, 100, 20, I18n.getString("selectServer.direct"))); ++ this.buttonList.add(new GuiButton(3, this.width / 2 + 4 + 50, this.height - 52, 100, 20, I18n.getString("selectServer.add"))); ++ this.buttonList.add(new GuiButton(8, this.width / 2 + 4, this.height - 28, 70, 20, I18n.getString("selectServer.refresh"))); ++ this.buttonList.add(new GuiButton(0, this.width / 2 + 4 + 76, this.height - 28, 75, 20, I18n.getString("gui.cancel"))); ++ boolean var1 = this.selectedServer >= 0 && this.selectedServer < this.serverSlotContainer.getSize(); ++ this.buttonSelect.enabled = var1; ++ this.field_96289_p.enabled = var1; ++ this.buttonDelete.enabled = var1; ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ super.updateScreen(); ++ ++this.ticksOpened; ++ ++ if (this.localNetworkServerList.getWasUpdated()) ++ { ++ this.listofLanServers = this.localNetworkServerList.getLanServers(); ++ this.localNetworkServerList.setWasNotUpdated(); ++ } ++ } ++ ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ ++ public void onGuiClosed() ++ { ++ Keyboard.enableRepeatEvents(false); ++ ++ if (this.localServerFindThread != null) ++ { ++ this.localServerFindThread.interrupt(); ++ this.localServerFindThread = null; ++ } ++ } ++ ++ /** ++ * 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 == 2) ++ { ++ String var2 = this.internetServerList.getServerData(this.selectedServer).serverName; ++ ++ if (var2 != null) ++ { ++ this.deleteClicked = true; ++ String var3 = I18n.getString("selectServer.deleteQuestion"); ++ String var4 = "\'" + var2 + "\' " + I18n.getString("selectServer.deleteWarning"); ++ String var5 = I18n.getString("selectServer.deleteButton"); ++ String var6 = I18n.getString("gui.cancel"); ++ GuiYesNo var7 = new GuiYesNo(this, var3, var4, var5, var6, this.selectedServer); ++ this.mc.displayGuiScreen(var7); ++ } ++ } ++ else if (par1GuiButton.id == 1) ++ { ++ this.joinServer(this.selectedServer); ++ } ++ else if (par1GuiButton.id == 4) ++ { ++ this.directClicked = true; ++ this.mc.displayGuiScreen(new GuiScreenServerList(this, this.theServerData = new ServerData(I18n.getString("selectServer.defaultName"), ""))); ++ } ++ else if (par1GuiButton.id == 3) ++ { ++ this.addClicked = true; ++ this.mc.displayGuiScreen(new GuiScreenAddServer(this, this.theServerData = new ServerData(I18n.getString("selectServer.defaultName"), ""))); ++ } ++ else if (par1GuiButton.id == 7) ++ { ++ this.editClicked = true; ++ ServerData var8 = this.internetServerList.getServerData(this.selectedServer); ++ this.theServerData = new ServerData(var8.serverName, var8.serverIP); ++ this.theServerData.setHideAddress(var8.isHidingAddress()); ++ this.mc.displayGuiScreen(new GuiScreenAddServer(this, this.theServerData)); ++ } ++ else if (par1GuiButton.id == 0) ++ { ++ this.mc.displayGuiScreen(this.parentScreen); ++ } ++ else if (par1GuiButton.id == 8) ++ { ++ this.mc.displayGuiScreen(new GuiMultiplayer(this.parentScreen)); ++ } ++ else ++ { ++ this.serverSlotContainer.actionPerformed(par1GuiButton); ++ } ++ } ++ } ++ ++ public void confirmClicked(boolean par1, int par2) ++ { ++ if (this.deleteClicked) ++ { ++ this.deleteClicked = false; ++ ++ if (par1) ++ { ++ this.internetServerList.removeServerData(par2); ++ this.internetServerList.saveServerList(); ++ this.selectedServer = -1; ++ } ++ ++ this.mc.displayGuiScreen(this); ++ } ++ else if (this.directClicked) ++ { ++ this.directClicked = false; ++ ++ if (par1) ++ { ++ this.connectToServer(this.theServerData); ++ } ++ else ++ { ++ this.mc.displayGuiScreen(this); ++ } ++ } ++ else if (this.addClicked) ++ { ++ this.addClicked = false; ++ ++ if (par1) ++ { ++ this.internetServerList.addServerData(this.theServerData); ++ this.internetServerList.saveServerList(); ++ this.selectedServer = -1; ++ } ++ ++ this.mc.displayGuiScreen(this); ++ } ++ else if (this.editClicked) ++ { ++ this.editClicked = false; ++ ++ if (par1) ++ { ++ ServerData var3 = this.internetServerList.getServerData(this.selectedServer); ++ var3.serverName = this.theServerData.serverName; ++ var3.serverIP = this.theServerData.serverIP; ++ var3.setHideAddress(this.theServerData.isHidingAddress()); ++ this.internetServerList.saveServerList(); ++ } ++ ++ this.mc.displayGuiScreen(this); ++ } ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) ++ { ++ int var3 = this.selectedServer; ++ ++ if (par2 == 59) ++ { ++ this.mc.gameSettings.hideServerAddress = !this.mc.gameSettings.hideServerAddress; ++ this.mc.gameSettings.saveOptions(); ++ } ++ else ++ { ++ if (isShiftKeyDown() && par2 == 200) ++ { ++ if (var3 > 0 && var3 < this.internetServerList.countServers()) ++ { ++ this.internetServerList.swapServers(var3, var3 - 1); ++ --this.selectedServer; ++ ++ if (var3 < this.internetServerList.countServers() - 1) ++ { ++ this.serverSlotContainer.func_77208_b(-this.serverSlotContainer.slotHeight); ++ } ++ } ++ } ++ else if (isShiftKeyDown() && par2 == 208) ++ { ++ if (var3 >= 0 & var3 < this.internetServerList.countServers() - 1) ++ { ++ this.internetServerList.swapServers(var3, var3 + 1); ++ ++this.selectedServer; ++ ++ if (var3 > 0) ++ { ++ this.serverSlotContainer.func_77208_b(this.serverSlotContainer.slotHeight); ++ } ++ } ++ } ++ else if (par2 != 28 && par2 != 156) ++ { ++ super.keyTyped(par1, par2); ++ } ++ else ++ { ++ this.actionPerformed((GuiButton)this.buttonList.get(2)); ++ } ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.lagTooltip = null; ++ this.drawDefaultBackground(); ++ this.serverSlotContainer.drawScreen(par1, par2, par3); ++ this.drawCenteredString(this.fontRenderer, I18n.getString("multiplayer.title"), this.width / 2, 20, 16777215); ++ super.drawScreen(par1, par2, par3); ++ ++ if (this.lagTooltip != null) ++ { ++ this.func_74007_a(this.lagTooltip, par1, par2); ++ } ++ } ++ ++ /** ++ * Join server by slot index ++ */ ++ private void joinServer(int par1) ++ { ++ if (par1 < this.internetServerList.countServers()) ++ { ++ this.connectToServer(this.internetServerList.getServerData(par1)); ++ } ++ else ++ { ++ par1 -= this.internetServerList.countServers(); ++ ++ if (par1 < this.listofLanServers.size()) ++ { ++ LanServer var2 = (LanServer)this.listofLanServers.get(par1); ++ this.connectToServer(new ServerData(var2.getServerMotd(), var2.getServerIpPort())); ++ } ++ } ++ } ++ ++ private void connectToServer(ServerData par1ServerData) ++ { ++ this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, par1ServerData)); ++ } ++ ++ private static void func_74017_b(ServerData par0ServerData) throws IOException ++ { ++ ServerAddress var1 = ServerAddress.func_78860_a(par0ServerData.serverIP); ++ Socket var2 = null; ++ DataInputStream var3 = null; ++ DataOutputStream var4 = null; ++ ++ try ++ { ++ var2 = new Socket(); ++ var2.setSoTimeout(3000); ++ var2.setTcpNoDelay(true); ++ var2.setTrafficClass(18); ++ var2.connect(new InetSocketAddress(var1.getIP(), var1.getPort()), 3000); ++ var3 = new DataInputStream(var2.getInputStream()); ++ var4 = new DataOutputStream(var2.getOutputStream()); ++ Packet254ServerPing var5 = new Packet254ServerPing(78, var1.getIP(), var1.getPort()); ++ var4.writeByte(var5.getPacketId()); ++ var5.writePacketData(var4); ++ ++ if (var3.read() != 255) ++ { ++ throw new IOException("Bad message"); ++ } ++ ++ String var6 = Packet.readString(var3, 256); ++ char[] var7 = var6.toCharArray(); ++ ++ for (int var8 = 0; var8 < var7.length; ++var8) ++ { ++ if (var7[var8] != 167 && var7[var8] != 0 && ChatAllowedCharacters.allowedCharacters.indexOf(var7[var8]) < 0) ++ { ++ var7[var8] = 63; ++ } ++ } ++ ++ var6 = new String(var7); ++ int var9; ++ int var10; ++ String[] var27; ++ ++ if (var6.startsWith("\u00a7") && var6.length() > 1) ++ { ++ var27 = var6.substring(1).split("\u0000"); ++ ++ if (MathHelper.parseIntWithDefault(var27[0], 0) == 1) ++ { ++ par0ServerData.serverMOTD = var27[3]; ++ par0ServerData.field_82821_f = MathHelper.parseIntWithDefault(var27[1], par0ServerData.field_82821_f); ++ par0ServerData.gameVersion = var27[2]; ++ var9 = MathHelper.parseIntWithDefault(var27[4], 0); ++ var10 = MathHelper.parseIntWithDefault(var27[5], 0); ++ ++ if (var9 >= 0 && var10 >= 0) ++ { ++ par0ServerData.populationInfo = EnumChatFormatting.GRAY + "" + var9 + "" + EnumChatFormatting.DARK_GRAY + "/" + EnumChatFormatting.GRAY + var10; ++ } ++ else ++ { ++ par0ServerData.populationInfo = "" + EnumChatFormatting.DARK_GRAY + "???"; ++ } ++ } ++ else ++ { ++ par0ServerData.gameVersion = "???"; ++ par0ServerData.serverMOTD = "" + EnumChatFormatting.DARK_GRAY + "???"; ++ par0ServerData.field_82821_f = 79; ++ par0ServerData.populationInfo = "" + EnumChatFormatting.DARK_GRAY + "???"; ++ } ++ } ++ else ++ { ++ var27 = var6.split("\u00a7"); ++ var6 = var27[0]; ++ var9 = -1; ++ var10 = -1; ++ ++ try ++ { ++ var9 = Integer.parseInt(var27[1]); ++ var10 = Integer.parseInt(var27[2]); ++ } ++ catch (Exception var25) ++ { ++ ; ++ } ++ ++ par0ServerData.serverMOTD = EnumChatFormatting.GRAY + var6; ++ ++ if (var9 >= 0 && var10 > 0) ++ { ++ par0ServerData.populationInfo = EnumChatFormatting.GRAY + "" + var9 + "" + EnumChatFormatting.DARK_GRAY + "/" + EnumChatFormatting.GRAY + var10; ++ } ++ else ++ { ++ par0ServerData.populationInfo = "" + EnumChatFormatting.DARK_GRAY + "???"; ++ } ++ ++ par0ServerData.gameVersion = "1.3"; ++ par0ServerData.field_82821_f = 77; ++ } ++ } ++ finally ++ { ++ try ++ { ++ if (var3 != null) ++ { ++ var3.close(); ++ } ++ } ++ catch (Throwable var24) ++ { ++ ; ++ } ++ ++ try ++ { ++ if (var4 != null) ++ { ++ var4.close(); ++ } ++ } ++ catch (Throwable var23) ++ { ++ ; ++ } ++ ++ try ++ { ++ if (var2 != null) ++ { ++ var2.close(); ++ } ++ } ++ catch (Throwable var22) ++ { ++ ; ++ } ++ } ++ } ++ ++ protected void func_74007_a(String par1Str, int par2, int par3) ++ { ++ if (par1Str != null) ++ { ++ int var4 = par2 + 12; ++ int var5 = par3 - 12; ++ int var6 = this.fontRenderer.getStringWidth(par1Str); ++ this.drawGradientRect(var4 - 3, var5 - 3, var4 + var6 + 3, var5 + 8 + 3, -1073741824, -1073741824); ++ this.fontRenderer.drawStringWithShadow(par1Str, var4, var5, -1); ++ } ++ } ++ ++ static ServerList getInternetServerList(GuiMultiplayer par0GuiMultiplayer) ++ { ++ return par0GuiMultiplayer.internetServerList; ++ } ++ ++ static List getListOfLanServers(GuiMultiplayer par0GuiMultiplayer) ++ { ++ return par0GuiMultiplayer.listofLanServers; ++ } ++ ++ static int getSelectedServer(GuiMultiplayer par0GuiMultiplayer) ++ { ++ return par0GuiMultiplayer.selectedServer; ++ } ++ ++ static int getAndSetSelectedServer(GuiMultiplayer par0GuiMultiplayer, int par1) ++ { ++ return par0GuiMultiplayer.selectedServer = par1; ++ } ++ ++ /** ++ * Return buttonSelect GuiButton ++ */ ++ static GuiButton getButtonSelect(GuiMultiplayer par0GuiMultiplayer) ++ { ++ return par0GuiMultiplayer.buttonSelect; ++ } ++ ++ /** ++ * Return buttonEdit GuiButton ++ */ ++ static GuiButton getButtonEdit(GuiMultiplayer par0GuiMultiplayer) ++ { ++ return par0GuiMultiplayer.field_96289_p; ++ } ++ ++ /** ++ * Return buttonDelete GuiButton ++ */ ++ static GuiButton getButtonDelete(GuiMultiplayer par0GuiMultiplayer) ++ { ++ return par0GuiMultiplayer.buttonDelete; ++ } ++ ++ static void func_74008_b(GuiMultiplayer par0GuiMultiplayer, int par1) ++ { ++ par0GuiMultiplayer.joinServer(par1); ++ } ++ ++ static int getTicksOpened(GuiMultiplayer par0GuiMultiplayer) ++ { ++ return par0GuiMultiplayer.ticksOpened; ++ } ++ ++ /** ++ * Returns the lock object for use with synchronized() ++ */ ++ static Object getLock() ++ { ++ return lock; ++ } ++ ++ static int getThreadsPending() ++ { ++ return threadsPending; ++ } ++ ++ static int increaseThreadsPending() ++ { ++ return threadsPending++; ++ } ++ ++ static void func_82291_a(ServerData par0ServerData) throws IOException ++ { ++ func_74017_b(par0ServerData); ++ } ++ ++ static int decreaseThreadsPending() ++ { ++ return threadsPending--; ++ } ++ ++ static String getAndSetLagTooltip(GuiMultiplayer par0GuiMultiplayer, String par1Str) ++ { ++ return par0GuiMultiplayer.lagTooltip = par1Str; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiNewChat.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,386 ---- ++ package net.minecraft.src; ++ ++ import java.util.ArrayList; ++ import java.util.Iterator; ++ import java.util.List; ++ import org.lwjgl.opengl.GL11; ++ ++ public class GuiNewChat extends Gui ++ { ++ /** The Minecraft instance. */ ++ private final Minecraft mc; ++ ++ /** A list of messages previously sent through the chat GUI */ ++ private final List sentMessages = new ArrayList(); ++ ++ /** Chat lines to be displayed in the chat box */ ++ private final List chatLines = new ArrayList(); ++ private final List field_96134_d = new ArrayList(); ++ private int field_73768_d; ++ private boolean field_73769_e; ++ ++ public GuiNewChat(Minecraft par1Minecraft) ++ { ++ this.mc = par1Minecraft; ++ } ++ ++ public void drawChat(int par1) ++ { ++ if (this.mc.gameSettings.chatVisibility != 2) ++ { ++ int var2 = this.func_96127_i(); ++ boolean var3 = false; ++ int var4 = 0; ++ int var5 = this.field_96134_d.size(); ++ float var6 = this.mc.gameSettings.chatOpacity * 0.9F + 0.1F; ++ ++ if (var5 > 0) ++ { ++ if (this.getChatOpen()) ++ { ++ var3 = true; ++ } ++ ++ float var7 = this.func_96131_h(); ++ int var8 = MathHelper.ceiling_float_int((float)this.func_96126_f() / var7); ++ GL11.glPushMatrix(); ++ GL11.glTranslatef(2.0F, 20.0F, 0.0F); ++ GL11.glScalef(var7, var7, 1.0F); ++ int var9; ++ int var11; ++ int var14; ++ ++ for (var9 = 0; var9 + this.field_73768_d < this.field_96134_d.size() && var9 < var2; ++var9) ++ { ++ ChatLine var10 = (ChatLine)this.field_96134_d.get(var9 + this.field_73768_d); ++ ++ if (var10 != null) ++ { ++ var11 = par1 - var10.getUpdatedCounter(); ++ ++ if (var11 < 200 || var3) ++ { ++ double var12 = (double)var11 / 200.0D; ++ var12 = 1.0D - var12; ++ var12 *= 10.0D; ++ ++ if (var12 < 0.0D) ++ { ++ var12 = 0.0D; ++ } ++ ++ if (var12 > 1.0D) ++ { ++ var12 = 1.0D; ++ } ++ ++ var12 *= var12; ++ var14 = (int)(255.0D * var12); ++ ++ if (var3) ++ { ++ var14 = 255; ++ } ++ ++ var14 = (int)((float)var14 * var6); ++ ++var4; ++ ++ if (var14 > 3) ++ { ++ byte var15 = 0; ++ int var16 = -var9 * 9; ++ drawRect(var15, var16 - 9, var15 + var8 + 4, var16, var14 / 2 << 24); ++ GL11.glEnable(GL11.GL_BLEND); ++ String var17 = var10.getChatLineString(); ++ ++ if (!this.mc.gameSettings.chatColours) ++ { ++ var17 = StringUtils.stripControlCodes(var17); ++ } ++ ++ this.mc.fontRenderer.drawStringWithShadow(var17, var15, var16 - 8, 16777215 + (var14 << 24)); ++ } ++ } ++ } ++ } ++ ++ if (var3) ++ { ++ var9 = this.mc.fontRenderer.FONT_HEIGHT; ++ GL11.glTranslatef(-3.0F, 0.0F, 0.0F); ++ int var18 = var5 * var9 + var5; ++ var11 = var4 * var9 + var4; ++ int var19 = this.field_73768_d * var11 / var5; ++ int var13 = var11 * var11 / var18; ++ ++ if (var18 != var11) ++ { ++ var14 = var19 > 0 ? 170 : 96; ++ int var20 = this.field_73769_e ? 13382451 : 3355562; ++ drawRect(0, -var19, 2, -var19 - var13, var20 + (var14 << 24)); ++ drawRect(2, -var19, 1, -var19 - var13, 13421772 + (var14 << 24)); ++ } ++ } ++ ++ GL11.glPopMatrix(); ++ } ++ } ++ } ++ ++ /** ++ * Clears the chat. ++ */ ++ public void clearChatMessages() ++ { ++ this.field_96134_d.clear(); ++ this.chatLines.clear(); ++ this.sentMessages.clear(); ++ } ++ ++ /** ++ * takes a String and prints it to chat ++ */ ++ public void printChatMessage(String par1Str) ++ { ++ this.printChatMessageWithOptionalDeletion(par1Str, 0); ++ } ++ ++ /** ++ * prints the String to Chat. If the ID is not 0, deletes an existing Chat Line of that ID from the GUI ++ */ ++ public void printChatMessageWithOptionalDeletion(String par1Str, int par2) ++ { ++ this.func_96129_a(par1Str, par2, this.mc.ingameGUI.getUpdateCounter(), false); ++ this.mc.getLogAgent().logInfo("[CHAT] " + EnumChatFormatting.func_110646_a(par1Str)); ++ } ++ ++ private void func_96129_a(String par1Str, int par2, int par3, boolean par4) ++ { ++ boolean var5 = this.getChatOpen(); ++ boolean var6 = true; ++ ++ if (par2 != 0) ++ { ++ this.deleteChatLine(par2); ++ } ++ ++ Iterator var7 = this.mc.fontRenderer.listFormattedStringToWidth(par1Str, MathHelper.floor_float((float)this.func_96126_f() / this.func_96131_h())).iterator(); ++ ++ while (var7.hasNext()) ++ { ++ String var8 = (String)var7.next(); ++ ++ if (var5 && this.field_73768_d > 0) ++ { ++ this.field_73769_e = true; ++ this.scroll(1); ++ } ++ ++ if (!var6) ++ { ++ var8 = " " + var8; ++ } ++ ++ var6 = false; ++ this.field_96134_d.add(0, new ChatLine(par3, var8, par2)); ++ } ++ ++ while (this.field_96134_d.size() > 100) ++ { ++ this.field_96134_d.remove(this.field_96134_d.size() - 1); ++ } ++ ++ if (!par4) ++ { ++ this.chatLines.add(0, new ChatLine(par3, par1Str.trim(), par2)); ++ ++ while (this.chatLines.size() > 100) ++ { ++ this.chatLines.remove(this.chatLines.size() - 1); ++ } ++ } ++ } ++ ++ public void func_96132_b() ++ { ++ this.field_96134_d.clear(); ++ this.resetScroll(); ++ ++ for (int var1 = this.chatLines.size() - 1; var1 >= 0; --var1) ++ { ++ ChatLine var2 = (ChatLine)this.chatLines.get(var1); ++ this.func_96129_a(var2.getChatLineString(), var2.getChatLineID(), var2.getUpdatedCounter(), true); ++ } ++ } ++ ++ /** ++ * Gets the list of messages previously sent through the chat GUI ++ */ ++ public List getSentMessages() ++ { ++ return this.sentMessages; ++ } ++ ++ /** ++ * Adds this string to the list of sent messages, for recall using the up/down arrow keys ++ */ ++ public void addToSentMessages(String par1Str) ++ { ++ if (this.sentMessages.isEmpty() || !((String)this.sentMessages.get(this.sentMessages.size() - 1)).equals(par1Str)) ++ { ++ this.sentMessages.add(par1Str); ++ } ++ } ++ ++ /** ++ * Resets the chat scroll (executed when the GUI is closed) ++ */ ++ public void resetScroll() ++ { ++ this.field_73768_d = 0; ++ this.field_73769_e = false; ++ } ++ ++ /** ++ * Scrolls the chat by the given number of lines. ++ */ ++ public void scroll(int par1) ++ { ++ this.field_73768_d += par1; ++ int var2 = this.field_96134_d.size(); ++ ++ if (this.field_73768_d > var2 - this.func_96127_i()) ++ { ++ this.field_73768_d = var2 - this.func_96127_i(); ++ } ++ ++ if (this.field_73768_d <= 0) ++ { ++ this.field_73768_d = 0; ++ this.field_73769_e = false; ++ } ++ } ++ ++ public ChatClickData func_73766_a(int par1, int par2) ++ { ++ if (!this.getChatOpen()) ++ { ++ return null; ++ } ++ else ++ { ++ ScaledResolution var3 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); ++ int var4 = var3.getScaleFactor(); ++ float var5 = this.func_96131_h(); ++ int var6 = par1 / var4 - 3; ++ int var7 = par2 / var4 - 25; ++ var6 = MathHelper.floor_float((float)var6 / var5); ++ var7 = MathHelper.floor_float((float)var7 / var5); ++ ++ if (var6 >= 0 && var7 >= 0) ++ { ++ int var8 = Math.min(this.func_96127_i(), this.field_96134_d.size()); ++ ++ if (var6 <= MathHelper.floor_float((float)this.func_96126_f() / this.func_96131_h()) && var7 < this.mc.fontRenderer.FONT_HEIGHT * var8 + var8) ++ { ++ int var9 = var7 / (this.mc.fontRenderer.FONT_HEIGHT + 1) + this.field_73768_d; ++ return new ChatClickData(this.mc.fontRenderer, (ChatLine)this.field_96134_d.get(var9), var6, var7 - (var9 - this.field_73768_d) * this.mc.fontRenderer.FONT_HEIGHT + var9); ++ } ++ else ++ { ++ return null; ++ } ++ } ++ else ++ { ++ return null; ++ } ++ } ++ } ++ ++ /** ++ * Adds a message to the chat after translating to the client's locale. ++ */ ++ public void addTranslatedMessage(String par1Str, Object ... par2ArrayOfObj) ++ { ++ this.printChatMessage(I18n.getStringParams(par1Str, par2ArrayOfObj)); ++ } ++ ++ /** ++ * @return {@code true} if the chat GUI is open ++ */ ++ public boolean getChatOpen() ++ { ++ return this.mc.currentScreen instanceof GuiChat; ++ } ++ ++ /** ++ * finds and deletes a Chat line by ID ++ */ ++ public void deleteChatLine(int par1) ++ { ++ Iterator var2 = this.field_96134_d.iterator(); ++ ChatLine var3; ++ ++ do ++ { ++ if (!var2.hasNext()) ++ { ++ var2 = this.chatLines.iterator(); ++ ++ do ++ { ++ if (!var2.hasNext()) ++ { ++ return; ++ } ++ ++ var3 = (ChatLine)var2.next(); ++ } ++ while (var3.getChatLineID() != par1); ++ ++ var2.remove(); ++ return; ++ } ++ ++ var3 = (ChatLine)var2.next(); ++ } ++ while (var3.getChatLineID() != par1); ++ ++ var2.remove(); ++ } ++ ++ public int func_96126_f() ++ { ++ return func_96128_a(this.mc.gameSettings.chatWidth); ++ } ++ ++ public int func_96133_g() ++ { ++ return func_96130_b(this.getChatOpen() ? this.mc.gameSettings.chatHeightFocused : this.mc.gameSettings.chatHeightUnfocused); ++ } ++ ++ public float func_96131_h() ++ { ++ return this.mc.gameSettings.chatScale; ++ } ++ ++ public static final int func_96128_a(float par0) ++ { ++ short var1 = 320; ++ byte var2 = 40; ++ return MathHelper.floor_float(par0 * (float)(var1 - var2) + (float)var2); ++ } ++ ++ public static final int func_96130_b(float par0) ++ { ++ short var1 = 180; ++ byte var2 = 20; ++ return MathHelper.floor_float(par0 * (float)(var1 - var2) + (float)var2); ++ } ++ ++ public int func_96127_i() ++ { ++ return this.func_96133_g() / 9; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiOptions.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,136 ---- ++ package net.minecraft.src; ++ ++ public class GuiOptions extends GuiScreen ++ { ++ /** ++ * An array of options that can be changed directly from the options GUI. ++ */ ++ private static final EnumOptions[] relevantOptions = new EnumOptions[] {EnumOptions.MUSIC, EnumOptions.SOUND, EnumOptions.INVERT_MOUSE, EnumOptions.SENSITIVITY, EnumOptions.FOV, EnumOptions.DIFFICULTY, EnumOptions.TOUCHSCREEN}; ++ ++ /** ++ * A reference to the screen object that created this. Used for navigating between screens. ++ */ ++ private final GuiScreen parentScreen; ++ ++ /** Reference to the GameSettings object. */ ++ private final GameSettings options; ++ ++ /** The title string that is displayed in the top-center of the screen. */ ++ protected String screenTitle = "Options"; ++ ++ public GuiOptions(GuiScreen par1GuiScreen, GameSettings par2GameSettings) ++ { ++ this.parentScreen = par1GuiScreen; ++ this.options = par2GameSettings; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ int var1 = 0; ++ this.screenTitle = I18n.getString("options.title"); ++ EnumOptions[] var2 = relevantOptions; ++ int var3 = var2.length; ++ ++ for (int var4 = 0; var4 < var3; ++var4) ++ { ++ EnumOptions var5 = var2[var4]; ++ ++ if (var5.getEnumFloat()) ++ { ++ this.buttonList.add(new GuiSlider(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 - 12 + 24 * (var1 >> 1), var5, this.options.getKeyBinding(var5), this.options.getOptionFloatValue(var5))); ++ } ++ else ++ { ++ GuiSmallButton var6 = new GuiSmallButton(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 - 12 + 24 * (var1 >> 1), var5, this.options.getKeyBinding(var5)); ++ ++ if (var5 == EnumOptions.DIFFICULTY && this.mc.theWorld != null && this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) ++ { ++ var6.enabled = false; ++ var6.displayString = I18n.getString("options.difficulty") + ": " + I18n.getString("options.difficulty.hardcore"); ++ } ++ ++ this.buttonList.add(var6); ++ } ++ ++ ++var1; ++ } ++ ++ this.buttonList.add(new GuiButton(101, this.width / 2 - 152, this.height / 6 + 96 - 6, 150, 20, I18n.getString("options.video"))); ++ this.buttonList.add(new GuiButton(100, this.width / 2 + 2, this.height / 6 + 96 - 6, 150, 20, I18n.getString("options.controls"))); ++ this.buttonList.add(new GuiButton(102, this.width / 2 - 152, this.height / 6 + 120 - 6, 150, 20, I18n.getString("options.language"))); ++ this.buttonList.add(new GuiButton(103, this.width / 2 + 2, this.height / 6 + 120 - 6, 150, 20, I18n.getString("options.multiplayer.title"))); ++ this.buttonList.add(new GuiButton(105, this.width / 2 - 152, this.height / 6 + 144 - 6, 150, 20, I18n.getString("options.resourcepack"))); ++ this.buttonList.add(new GuiButton(104, this.width / 2 + 2, this.height / 6 + 144 - 6, 150, 20, I18n.getString("options.snooper.view"))); ++ this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done"))); ++ } ++ ++ /** ++ * 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 < 100 && par1GuiButton instanceof GuiSmallButton) ++ { ++ this.options.setOptionValue(((GuiSmallButton)par1GuiButton).returnEnumOptions(), 1); ++ par1GuiButton.displayString = this.options.getKeyBinding(EnumOptions.getEnumOptions(par1GuiButton.id)); ++ } ++ ++ if (par1GuiButton.id == 101) ++ { ++ this.mc.gameSettings.saveOptions(); ++ this.mc.displayGuiScreen(new GuiVideoSettings(this, this.options)); ++ } ++ ++ if (par1GuiButton.id == 100) ++ { ++ this.mc.gameSettings.saveOptions(); ++ this.mc.displayGuiScreen(new GuiControls(this, this.options)); ++ } ++ ++ if (par1GuiButton.id == 102) ++ { ++ this.mc.gameSettings.saveOptions(); ++ this.mc.displayGuiScreen(new GuiLanguage(this, this.options, this.mc.getLanguageManager())); ++ } ++ ++ if (par1GuiButton.id == 103) ++ { ++ this.mc.gameSettings.saveOptions(); ++ this.mc.displayGuiScreen(new ScreenChatOptions(this, this.options)); ++ } ++ ++ if (par1GuiButton.id == 104) ++ { ++ this.mc.gameSettings.saveOptions(); ++ this.mc.displayGuiScreen(new GuiSnooper(this, this.options)); ++ } ++ ++ if (par1GuiButton.id == 200) ++ { ++ this.mc.gameSettings.saveOptions(); ++ this.mc.displayGuiScreen(this.parentScreen); ++ } ++ ++ if (par1GuiButton.id == 105) ++ { ++ this.mc.gameSettings.saveOptions(); ++ this.mc.displayGuiScreen(new GuiScreenTemporaryResourcePackSelect(this, this.options)); ++ } ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 15, 16777215); ++ super.drawScreen(par1, par2, par3); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiPlayerInfo.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,19 ---- ++ package net.minecraft.src; ++ ++ public class GuiPlayerInfo ++ { ++ /** The string value of the object */ ++ public final String name; ++ ++ /** Player name in lowercase. */ ++ private final String nameinLowerCase; ++ ++ /** Player response time to server in milliseconds */ ++ public int responseTime; ++ ++ public GuiPlayerInfo(String par1Str) ++ { ++ this.name = par1Str; ++ this.nameinLowerCase = par1Str.toLowerCase(); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiRenameWorld.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,104 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.input.Keyboard; ++ ++ public class GuiRenameWorld extends GuiScreen ++ { ++ private GuiScreen parentGuiScreen; ++ private GuiTextField theGuiTextField; ++ private final String worldName; ++ ++ public GuiRenameWorld(GuiScreen par1GuiScreen, String par2Str) ++ { ++ this.parentGuiScreen = par1GuiScreen; ++ this.worldName = par2Str; ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ this.theGuiTextField.updateCursorCounter(); ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ Keyboard.enableRepeatEvents(true); ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("selectWorld.renameButton"))); ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); ++ ISaveFormat var1 = this.mc.getSaveLoader(); ++ WorldInfo var2 = var1.getWorldInfo(this.worldName); ++ String var3 = var2.getWorldName(); ++ this.theGuiTextField = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 60, 200, 20); ++ this.theGuiTextField.setFocused(true); ++ this.theGuiTextField.setText(var3); ++ } ++ ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ ++ public void onGuiClosed() ++ { ++ Keyboard.enableRepeatEvents(false); ++ } ++ ++ /** ++ * 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 == 1) ++ { ++ this.mc.displayGuiScreen(this.parentGuiScreen); ++ } ++ else if (par1GuiButton.id == 0) ++ { ++ ISaveFormat var2 = this.mc.getSaveLoader(); ++ var2.renameWorld(this.worldName, this.theGuiTextField.getText().trim()); ++ this.mc.displayGuiScreen(this.parentGuiScreen); ++ } ++ } ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) ++ { ++ this.theGuiTextField.textboxKeyTyped(par1, par2); ++ ((GuiButton)this.buttonList.get(0)).enabled = this.theGuiTextField.getText().trim().length() > 0; ++ ++ if (par2 == 28 || par2 == 156) ++ { ++ this.actionPerformed((GuiButton)this.buttonList.get(0)); ++ } ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) ++ { ++ super.mouseClicked(par1, par2, par3); ++ this.theGuiTextField.mouseClicked(par1, par2, par3); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.drawCenteredString(this.fontRenderer, I18n.getString("selectWorld.renameTitle"), this.width / 2, 20, 16777215); ++ this.drawString(this.fontRenderer, I18n.getString("selectWorld.enterName"), this.width / 2 - 100, 47, 10526880); ++ this.theGuiTextField.drawTextBox(); ++ super.drawScreen(par1, par2, par3); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiRepair.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,197 ---- ++ package net.minecraft.src; ++ ++ import java.util.List; ++ import org.lwjgl.input.Keyboard; ++ import org.lwjgl.opengl.GL11; ++ ++ public class GuiRepair extends GuiContainer implements ICrafting ++ { ++ private static final ResourceLocation anvilGuiTextures = new ResourceLocation("textures/gui/container/anvil.png"); ++ private ContainerRepair repairContainer; ++ private GuiTextField itemNameField; ++ private InventoryPlayer field_82325_q; ++ ++ public GuiRepair(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5) ++ { ++ super(new ContainerRepair(par1InventoryPlayer, par2World, par3, par4, par5, Minecraft.getMinecraft().thePlayer)); ++ this.field_82325_q = par1InventoryPlayer; ++ this.repairContainer = (ContainerRepair)this.inventorySlots; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ super.initGui(); ++ Keyboard.enableRepeatEvents(true); ++ int var1 = (this.width - this.xSize) / 2; ++ int var2 = (this.height - this.ySize) / 2; ++ this.itemNameField = new GuiTextField(this.fontRenderer, var1 + 62, var2 + 24, 103, 12); ++ this.itemNameField.setTextColor(-1); ++ this.itemNameField.setDisabledTextColour(-1); ++ this.itemNameField.setEnableBackgroundDrawing(false); ++ this.itemNameField.setMaxStringLength(40); ++ this.inventorySlots.removeCraftingFromCrafters(this); ++ this.inventorySlots.addCraftingToCrafters(this); ++ } ++ ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ ++ public void onGuiClosed() ++ { ++ super.onGuiClosed(); ++ Keyboard.enableRepeatEvents(false); ++ this.inventorySlots.removeCraftingFromCrafters(this); ++ } ++ ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) ++ { ++ GL11.glDisable(GL11.GL_LIGHTING); ++ this.fontRenderer.drawString(I18n.getString("container.repair"), 60, 6, 4210752); ++ ++ if (this.repairContainer.maximumCost > 0) ++ { ++ int var3 = 8453920; ++ boolean var4 = true; ++ String var5 = I18n.getStringParams("container.repair.cost", new Object[] {Integer.valueOf(this.repairContainer.maximumCost)}); ++ ++ if (this.repairContainer.maximumCost >= 40 && !this.mc.thePlayer.capabilities.isCreativeMode) ++ { ++ var5 = I18n.getString("container.repair.expensive"); ++ var3 = 16736352; ++ } ++ else if (!this.repairContainer.getSlot(2).getHasStack()) ++ { ++ var4 = false; ++ } ++ else if (!this.repairContainer.getSlot(2).canTakeStack(this.field_82325_q.player)) ++ { ++ var3 = 16736352; ++ } ++ ++ if (var4) ++ { ++ int var6 = -16777216 | (var3 & 16579836) >> 2 | var3 & -16777216; ++ int var7 = this.xSize - 8 - this.fontRenderer.getStringWidth(var5); ++ byte var8 = 67; ++ ++ if (this.fontRenderer.getUnicodeFlag()) ++ { ++ drawRect(var7 - 3, var8 - 2, this.xSize - 7, var8 + 10, -16777216); ++ drawRect(var7 - 2, var8 - 1, this.xSize - 8, var8 + 9, -12895429); ++ } ++ else ++ { ++ this.fontRenderer.drawString(var5, var7, var8 + 1, var6); ++ this.fontRenderer.drawString(var5, var7 + 1, var8, var6); ++ this.fontRenderer.drawString(var5, var7 + 1, var8 + 1, var6); ++ } ++ ++ this.fontRenderer.drawString(var5, var7, var8, var3); ++ } ++ } ++ ++ GL11.glEnable(GL11.GL_LIGHTING); ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) ++ { ++ if (this.itemNameField.textboxKeyTyped(par1, par2)) ++ { ++ this.func_135015_g(); ++ } ++ else ++ { ++ super.keyTyped(par1, par2); ++ } ++ } ++ ++ private void func_135015_g() ++ { ++ String var1 = this.itemNameField.getText(); ++ Slot var2 = this.repairContainer.getSlot(0); ++ ++ if (var2 != null && var2.getHasStack() && !var2.getStack().hasDisplayName() && var1.equals(var2.getStack().getDisplayName())) ++ { ++ var1 = ""; ++ } ++ ++ this.repairContainer.updateItemName(var1); ++ this.mc.thePlayer.sendQueue.addToSendQueue(new Packet250CustomPayload("MC|ItemName", var1.getBytes())); ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) ++ { ++ super.mouseClicked(par1, par2, par3); ++ this.itemNameField.mouseClicked(par1, par2, par3); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ super.drawScreen(par1, par2, par3); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ this.itemNameField.drawTextBox(); ++ } ++ ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) ++ { ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.mc.getTextureManager().bindTexture(anvilGuiTextures); ++ int var4 = (this.width - this.xSize) / 2; ++ int var5 = (this.height - this.ySize) / 2; ++ this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); ++ this.drawTexturedModalRect(var4 + 59, var5 + 20, 0, this.ySize + (this.repairContainer.getSlot(0).getHasStack() ? 0 : 16), 110, 16); ++ ++ if ((this.repairContainer.getSlot(0).getHasStack() || this.repairContainer.getSlot(1).getHasStack()) && !this.repairContainer.getSlot(2).getHasStack()) ++ { ++ this.drawTexturedModalRect(var4 + 99, var5 + 45, this.xSize, 0, 28, 21); ++ } ++ } ++ ++ public void sendContainerAndContentsToPlayer(Container par1Container, List par2List) ++ { ++ this.sendSlotContents(par1Container, 0, par1Container.getSlot(0).getStack()); ++ } ++ ++ /** ++ * Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual ++ * contents of that slot. Args: Container, slot number, slot contents ++ */ ++ public void sendSlotContents(Container par1Container, int par2, ItemStack par3ItemStack) ++ { ++ if (par2 == 0) ++ { ++ this.itemNameField.setText(par3ItemStack == null ? "" : par3ItemStack.getDisplayName()); ++ this.itemNameField.setEnabled(par3ItemStack != null); ++ ++ if (par3ItemStack != null) ++ { ++ this.func_135015_g(); ++ } ++ } ++ } ++ ++ /** ++ * Sends two ints to the client-side Container. Used for furnace burning time, smelting progress, brewing progress, ++ * and enchanting level. Normally the first int identifies which variable to update, and the second contains the new ++ * value. Both are truncated to shorts in non-local SMP. ++ */ ++ public void sendProgressBarUpdate(Container par1Container, int par2, int par3) {} ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreen.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,311 ---- ++ package net.minecraft.src; ++ ++ import java.awt.Toolkit; ++ import java.awt.datatransfer.ClipboardOwner; ++ import java.awt.datatransfer.DataFlavor; ++ import java.awt.datatransfer.StringSelection; ++ import java.awt.datatransfer.Transferable; ++ import java.util.ArrayList; ++ import java.util.List; ++ import org.lwjgl.input.Keyboard; ++ import org.lwjgl.input.Mouse; ++ import org.lwjgl.opengl.GL11; ++ ++ public class GuiScreen extends Gui ++ { ++ /** Reference to the Minecraft object. */ ++ protected Minecraft mc; ++ ++ /** The width of the screen object. */ ++ public int width; ++ ++ /** The height of the screen object. */ ++ public int height; ++ ++ /** A list of all the buttons in this container. */ ++ protected List buttonList = new ArrayList(); ++ public boolean allowUserInput; ++ ++ /** The FontRenderer used by GuiScreen */ ++ protected FontRenderer fontRenderer; ++ ++ /** The button that was just pressed. */ ++ private GuiButton selectedButton; ++ private int eventButton; ++ private long lastMouseEvent; ++ private int field_92018_d; ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ for (int var4 = 0; var4 < this.buttonList.size(); ++var4) ++ { ++ GuiButton var5 = (GuiButton)this.buttonList.get(var4); ++ var5.drawButton(this.mc, par1, par2); ++ } ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) ++ { ++ if (par2 == 1) ++ { ++ this.mc.displayGuiScreen((GuiScreen)null); ++ this.mc.setIngameFocus(); ++ } ++ } ++ ++ /** ++ * Returns a string stored in the system clipboard. ++ */ ++ public static String getClipboardString() ++ { ++ try ++ { ++ Transferable var0 = Toolkit.getDefaultToolkit().getSystemClipboard().getContents((Object)null); ++ ++ if (var0 != null && var0.isDataFlavorSupported(DataFlavor.stringFlavor)) ++ { ++ return (String)var0.getTransferData(DataFlavor.stringFlavor); ++ } ++ } ++ catch (Exception var1) ++ { ++ ; ++ } ++ ++ return ""; ++ } ++ ++ /** ++ * store a string in the system clipboard ++ */ ++ public static void setClipboardString(String par0Str) ++ { ++ try ++ { ++ StringSelection var1 = new StringSelection(par0Str); ++ Toolkit.getDefaultToolkit().getSystemClipboard().setContents(var1, (ClipboardOwner)null); ++ } ++ catch (Exception var2) ++ { ++ ; ++ } ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) ++ { ++ if (par3 == 0) ++ { ++ for (int var4 = 0; var4 < this.buttonList.size(); ++var4) ++ { ++ GuiButton var5 = (GuiButton)this.buttonList.get(var4); ++ ++ if (var5.mousePressed(this.mc, par1, par2)) ++ { ++ this.selectedButton = var5; ++ this.mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F); ++ this.actionPerformed(var5); ++ } ++ } ++ } ++ } ++ ++ /** ++ * 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) ++ { ++ if (this.selectedButton != null && par3 == 0) ++ { ++ this.selectedButton.mouseReleased(par1, par2); ++ this.selectedButton = null; ++ } ++ } ++ ++ /** ++ * Called when a mouse button is pressed and the mouse is moved around. Parameters are : mouseX, mouseY, ++ * lastButtonClicked & timeSinceMouseClick. ++ */ ++ protected void mouseClickMove(int par1, int par2, int par3, long par4) {} ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) {} ++ ++ /** ++ * Causes the screen to lay out its subcomponents again. This is the equivalent of the Java call ++ * Container.validate() ++ */ ++ public void setWorldAndResolution(Minecraft par1Minecraft, int par2, int par3) ++ { ++ this.mc = par1Minecraft; ++ this.fontRenderer = par1Minecraft.fontRenderer; ++ this.width = par2; ++ this.height = par3; ++ this.buttonList.clear(); ++ this.initGui(); ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() {} ++ ++ /** ++ * Delegates mouse and keyboard input. ++ */ ++ public void handleInput() ++ { ++ while (Mouse.next()) ++ { ++ this.handleMouseInput(); ++ } ++ ++ while (Keyboard.next()) ++ { ++ this.handleKeyboardInput(); ++ } ++ } ++ ++ /** ++ * Handles mouse input. ++ */ ++ public void handleMouseInput() ++ { ++ int var1 = Mouse.getEventX() * this.width / this.mc.displayWidth; ++ int var2 = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; ++ int var3 = Mouse.getEventButton(); ++ ++ if (Minecraft.isRunningOnMac && var3 == 0 && (Keyboard.isKeyDown(29) || Keyboard.isKeyDown(157))) ++ { ++ var3 = 1; ++ } ++ ++ if (Mouse.getEventButtonState()) ++ { ++ if (this.mc.gameSettings.touchscreen && this.field_92018_d++ > 0) ++ { ++ return; ++ } ++ ++ this.eventButton = var3; ++ this.lastMouseEvent = Minecraft.getSystemTime(); ++ this.mouseClicked(var1, var2, this.eventButton); ++ } ++ else if (var3 != -1) ++ { ++ if (this.mc.gameSettings.touchscreen && --this.field_92018_d > 0) ++ { ++ return; ++ } ++ ++ this.eventButton = -1; ++ this.mouseMovedOrUp(var1, var2, var3); ++ } ++ else if (this.eventButton != -1 && this.lastMouseEvent > 0L) ++ { ++ long var4 = Minecraft.getSystemTime() - this.lastMouseEvent; ++ this.mouseClickMove(var1, var2, this.eventButton, var4); ++ } ++ } ++ ++ /** ++ * Handles keyboard input. ++ */ ++ public void handleKeyboardInput() ++ { ++ if (Keyboard.getEventKeyState()) ++ { ++ int var1 = Keyboard.getEventKey(); ++ char var2 = Keyboard.getEventCharacter(); ++ ++ if (var1 == 87) ++ { ++ this.mc.toggleFullscreen(); ++ return; ++ } ++ ++ this.keyTyped(var2, var1); ++ } ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() {} ++ ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ ++ public void onGuiClosed() {} ++ ++ /** ++ * Draws either a gradient over the background screen (when it exists) or a flat gradient over background.png ++ */ ++ public void drawDefaultBackground() ++ { ++ this.drawWorldBackground(0); ++ } ++ ++ public void drawWorldBackground(int par1) ++ { ++ if (this.mc.theWorld != null) ++ { ++ this.drawGradientRect(0, 0, this.width, this.height, -1072689136, -804253680); ++ } ++ else ++ { ++ this.drawBackground(par1); ++ } ++ } ++ ++ /** ++ * Draws the background (i is always 0 as of 1.2.2) ++ */ ++ public void drawBackground(int par1) ++ { ++ GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glDisable(GL11.GL_FOG); ++ Tessellator var2 = Tessellator.instance; ++ this.mc.getTextureManager().bindTexture(optionsBackground); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ float var3 = 32.0F; ++ var2.startDrawingQuads(); ++ var2.setColorOpaque_I(4210752); ++ var2.addVertexWithUV(0.0D, (double)this.height, 0.0D, 0.0D, (double)((float)this.height / var3 + (float)par1)); ++ var2.addVertexWithUV((double)this.width, (double)this.height, 0.0D, (double)((float)this.width / var3), (double)((float)this.height / var3 + (float)par1)); ++ var2.addVertexWithUV((double)this.width, 0.0D, 0.0D, (double)((float)this.width / var3), (double)par1); ++ var2.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, (double)par1); ++ var2.draw(); ++ } ++ ++ /** ++ * Returns true if this GUI should pause the game when it is displayed in single-player ++ */ ++ public boolean doesGuiPauseGame() ++ { ++ return true; ++ } ++ ++ public void confirmClicked(boolean par1, int par2) {} ++ ++ public static boolean isCtrlKeyDown() ++ { ++ return Minecraft.isRunningOnMac ? Keyboard.isKeyDown(219) || Keyboard.isKeyDown(220) : Keyboard.isKeyDown(29) || Keyboard.isKeyDown(157); ++ } ++ ++ public static boolean isShiftKeyDown() ++ { ++ return Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenAddServer.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,127 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.input.Keyboard; ++ ++ public class GuiScreenAddServer extends GuiScreen ++ { ++ /** This GUI's parent GUI. */ ++ private GuiScreen parentGui; ++ private GuiTextField serverAddress; ++ private GuiTextField serverName; ++ ++ /** ServerData to be modified by this GUI */ ++ private ServerData newServerData; ++ ++ public GuiScreenAddServer(GuiScreen par1GuiScreen, ServerData par2ServerData) ++ { ++ this.parentGui = par1GuiScreen; ++ this.newServerData = par2ServerData; ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ this.serverName.updateCursorCounter(); ++ this.serverAddress.updateCursorCounter(); ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ Keyboard.enableRepeatEvents(true); ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("addServer.add"))); ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); ++ this.buttonList.add(new GuiButton(2, this.width / 2 - 100, 142, I18n.getString("addServer.hideAddress") + ": " + (this.newServerData.isHidingAddress() ? I18n.getString("gui.yes") : I18n.getString("gui.no")))); ++ this.serverName = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 66, 200, 20); ++ this.serverName.setFocused(true); ++ this.serverName.setText(this.newServerData.serverName); ++ this.serverAddress = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 106, 200, 20); ++ this.serverAddress.setMaxStringLength(128); ++ this.serverAddress.setText(this.newServerData.serverIP); ++ ((GuiButton)this.buttonList.get(0)).enabled = this.serverAddress.getText().length() > 0 && this.serverAddress.getText().split(":").length > 0 && this.serverName.getText().length() > 0; ++ } ++ ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ ++ public void onGuiClosed() ++ { ++ Keyboard.enableRepeatEvents(false); ++ } ++ ++ /** ++ * 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 == 1) ++ { ++ this.parentGui.confirmClicked(false, 0); ++ } ++ else if (par1GuiButton.id == 0) ++ { ++ this.newServerData.serverName = this.serverName.getText(); ++ this.newServerData.serverIP = this.serverAddress.getText(); ++ this.parentGui.confirmClicked(true, 0); ++ } ++ else if (par1GuiButton.id == 2) ++ { ++ this.newServerData.setHideAddress(!this.newServerData.isHidingAddress()); ++ ((GuiButton)this.buttonList.get(2)).displayString = I18n.getString("addServer.hideAddress") + ": " + (this.newServerData.isHidingAddress() ? I18n.getString("gui.yes") : I18n.getString("gui.no")); ++ } ++ } ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) ++ { ++ this.serverName.textboxKeyTyped(par1, par2); ++ this.serverAddress.textboxKeyTyped(par1, par2); ++ ++ if (par2 == 15) ++ { ++ this.serverName.setFocused(!this.serverName.isFocused()); ++ this.serverAddress.setFocused(!this.serverAddress.isFocused()); ++ } ++ ++ if (par2 == 28 || par2 == 156) ++ { ++ this.actionPerformed((GuiButton)this.buttonList.get(0)); ++ } ++ ++ ((GuiButton)this.buttonList.get(0)).enabled = this.serverAddress.getText().length() > 0 && this.serverAddress.getText().split(":").length > 0 && this.serverName.getText().length() > 0; ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) ++ { ++ super.mouseClicked(par1, par2, par3); ++ this.serverAddress.mouseClicked(par1, par2, par3); ++ this.serverName.mouseClicked(par1, par2, par3); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.drawCenteredString(this.fontRenderer, I18n.getString("addServer.title"), this.width / 2, 17, 16777215); ++ this.drawString(this.fontRenderer, I18n.getString("addServer.enterName"), this.width / 2 - 100, 53, 10526880); ++ this.drawString(this.fontRenderer, I18n.getString("addServer.enterIp"), this.width / 2 - 100, 94, 10526880); ++ this.serverName.drawTextBox(); ++ this.serverAddress.drawTextBox(); ++ super.drawScreen(par1, par2, par3); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenBackup.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,166 ---- ++ package net.minecraft.src; ++ ++ import java.util.Collections; ++ import java.util.List; ++ import org.lwjgl.input.Keyboard; ++ ++ public class GuiScreenBackup extends GuiScreen ++ { ++ private final GuiScreenConfigureWorld field_110380_a; ++ private final long field_110377_b; ++ private List field_110378_c = Collections.emptyList(); ++ private GuiScreenBackupSelectionList field_110375_d; ++ private int field_110376_e = -1; ++ private GuiButton field_110379_p; ++ ++ public GuiScreenBackup(GuiScreenConfigureWorld par1GuiScreenConfigureWorld, long par2) ++ { ++ this.field_110380_a = par1GuiScreenConfigureWorld; ++ this.field_110377_b = par2; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ Keyboard.enableRepeatEvents(true); ++ this.buttonList.clear(); ++ this.field_110375_d = new GuiScreenBackupSelectionList(this); ++ (new GuiScreenBackupDownloadThread(this)).start(); ++ this.func_110369_g(); ++ } ++ ++ private void func_110369_g() ++ { ++ this.buttonList.add(new GuiButton(0, this.width / 2 + 6, this.height - 52, 153, 20, I18n.getString("gui.back"))); ++ this.buttonList.add(this.field_110379_p = new GuiButton(1, this.width / 2 - 154, this.height - 52, 153, 20, I18n.getString("mco.backup.button.restore"))); ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ super.updateScreen(); ++ } ++ ++ /** ++ * 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 == 1) ++ { ++ String var2 = I18n.getString("mco.configure.world.restore.question.line1"); ++ String var3 = I18n.getString("mco.configure.world.restore.question.line2"); ++ this.mc.displayGuiScreen(new GuiScreenConfirmation(this, GuiScreenConfirmationType.Warning, var2, var3, 1)); ++ } ++ else if (par1GuiButton.id == 0) ++ { ++ this.mc.displayGuiScreen(this.field_110380_a); ++ } ++ else ++ { ++ this.field_110375_d.actionPerformed(par1GuiButton); ++ } ++ } ++ } ++ ++ public void confirmClicked(boolean par1, int par2) ++ { ++ if (par1 && par2 == 1) ++ { ++ this.func_110374_h(); ++ } ++ else ++ { ++ this.mc.displayGuiScreen(this); ++ } ++ } ++ ++ private void func_110374_h() ++ { ++ if (this.field_110376_e >= 0 && this.field_110376_e < this.field_110378_c.size()) ++ { ++ Backup var1 = (Backup)this.field_110378_c.get(this.field_110376_e); ++ GuiScreenBackupRestoreTask var2 = new GuiScreenBackupRestoreTask(this, var1, (GuiScreenBackupDownloadThread)null); ++ GuiScreenLongRunningTask var3 = new GuiScreenLongRunningTask(this.mc, this.field_110380_a, var2); ++ var3.func_98117_g(); ++ this.mc.displayGuiScreen(var3); ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.field_110375_d.drawScreen(par1, par2, par3); ++ this.drawCenteredString(this.fontRenderer, I18n.getString("mco.backup.title"), this.width / 2, 20, 16777215); ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ static Minecraft func_110366_a(GuiScreenBackup par0GuiScreenBackup) ++ { ++ return par0GuiScreenBackup.mc; ++ } ++ ++ static List func_110373_a(GuiScreenBackup par0GuiScreenBackup, List par1List) ++ { ++ return par0GuiScreenBackup.field_110378_c = par1List; ++ } ++ ++ static long func_110367_b(GuiScreenBackup par0GuiScreenBackup) ++ { ++ return par0GuiScreenBackup.field_110377_b; ++ } ++ ++ static Minecraft func_130030_c(GuiScreenBackup par0GuiScreenBackup) ++ { ++ return par0GuiScreenBackup.mc; ++ } ++ ++ static GuiScreenConfigureWorld func_130031_d(GuiScreenBackup par0GuiScreenBackup) ++ { ++ return par0GuiScreenBackup.field_110380_a; ++ } ++ ++ static Minecraft func_130035_e(GuiScreenBackup par0GuiScreenBackup) ++ { ++ return par0GuiScreenBackup.mc; ++ } ++ ++ static Minecraft func_130036_f(GuiScreenBackup par0GuiScreenBackup) ++ { ++ return par0GuiScreenBackup.mc; ++ } ++ ++ static List func_110370_e(GuiScreenBackup par0GuiScreenBackup) ++ { ++ return par0GuiScreenBackup.field_110378_c; ++ } ++ ++ static int func_130029_a(GuiScreenBackup par0GuiScreenBackup, int par1) ++ { ++ return par0GuiScreenBackup.field_110376_e = par1; ++ } ++ ++ static int func_130034_h(GuiScreenBackup par0GuiScreenBackup) ++ { ++ return par0GuiScreenBackup.field_110376_e; ++ } ++ ++ static FontRenderer func_130032_i(GuiScreenBackup par0GuiScreenBackup) ++ { ++ return par0GuiScreenBackup.fontRenderer; ++ } ++ ++ static FontRenderer func_130033_j(GuiScreenBackup par0GuiScreenBackup) ++ { ++ return par0GuiScreenBackup.fontRenderer; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenBackupDownloadThread.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,25 ---- ++ package net.minecraft.src; ++ ++ class GuiScreenBackupDownloadThread extends Thread ++ { ++ final GuiScreenBackup field_111250_a; ++ ++ GuiScreenBackupDownloadThread(GuiScreenBackup par1GuiScreenBackup) ++ { ++ this.field_111250_a = par1GuiScreenBackup; ++ } ++ ++ public void run() ++ { ++ McoClient var1 = new McoClient(GuiScreenBackup.func_110366_a(this.field_111250_a).getSession()); ++ ++ try ++ { ++ GuiScreenBackup.func_110373_a(this.field_111250_a, var1.func_111232_c(GuiScreenBackup.func_110367_b(this.field_111250_a)).field_111223_a); ++ } ++ catch (ExceptionMcoService var3) ++ { ++ GuiScreenBackup.func_130030_c(this.field_111250_a).getLogAgent().logSevere(var3.toString()); ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenBackupRestoreTask.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,52 ---- ++ package net.minecraft.src; ++ ++ class GuiScreenBackupRestoreTask extends TaskLongRunning ++ { ++ /** The backup being restored */ ++ private final Backup theBackup; ++ ++ /** The screen running this task */ ++ final GuiScreenBackup theBackupScreen; ++ ++ private GuiScreenBackupRestoreTask(GuiScreenBackup par1GuiScreenBackup, Backup par2Backup) ++ { ++ this.theBackupScreen = par1GuiScreenBackup; ++ this.theBackup = par2Backup; ++ } ++ ++ public void run() ++ { ++ this.setMessage(I18n.getString("mco.backup.restoring")); ++ ++ try ++ { ++ McoClient var1 = new McoClient(this.getMinecraft().getSession()); ++ var1.func_111235_c(GuiScreenBackup.func_110367_b(this.theBackupScreen), this.theBackup.field_110727_a); ++ ++ try ++ { ++ Thread.sleep(1000L); ++ } ++ catch (InterruptedException var3) ++ { ++ Thread.currentThread().interrupt(); ++ } ++ ++ this.getMinecraft().displayGuiScreen(GuiScreenBackup.func_130031_d(this.theBackupScreen)); ++ } ++ catch (ExceptionMcoService var4) ++ { ++ GuiScreenBackup.func_130035_e(this.theBackupScreen).getLogAgent().logSevere(var4.toString()); ++ this.setFailedMessage(var4.toString()); ++ } ++ catch (Exception var5) ++ { ++ this.setFailedMessage(var5.getLocalizedMessage()); ++ } ++ } ++ ++ GuiScreenBackupRestoreTask(GuiScreenBackup par1GuiScreenBackup, Backup par2Backup, GuiScreenBackupDownloadThread par3GuiScreenBackupDownloadThread) ++ { ++ this(par1GuiScreenBackup, par2Backup); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenBackupSelectionList.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,115 ---- ++ package net.minecraft.src; ++ ++ import java.text.DateFormat; ++ import java.util.Date; ++ import net.minecraft.server.MinecraftServer; ++ ++ class GuiScreenBackupSelectionList extends GuiScreenSelectLocation ++ { ++ final GuiScreenBackup field_111249_a; ++ ++ public GuiScreenBackupSelectionList(GuiScreenBackup par1GuiScreenBackup) ++ { ++ super(GuiScreenBackup.func_130036_f(par1GuiScreenBackup), par1GuiScreenBackup.width, par1GuiScreenBackup.height, 32, par1GuiScreenBackup.height - 64, 36); ++ this.field_111249_a = par1GuiScreenBackup; ++ } ++ ++ /** ++ * Gets the size of the current slot list. ++ */ ++ protected int getSize() ++ { ++ return GuiScreenBackup.func_110370_e(this.field_111249_a).size() + 1; ++ } ++ ++ /** ++ * the element in the slot that was clicked, boolean for wether it was double clicked or not ++ */ ++ protected void elementClicked(int par1, boolean par2) ++ { ++ if (par1 < GuiScreenBackup.func_110370_e(this.field_111249_a).size()) ++ { ++ GuiScreenBackup.func_130029_a(this.field_111249_a, par1); ++ } ++ } ++ ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) ++ { ++ return par1 == GuiScreenBackup.func_130034_h(this.field_111249_a); ++ } ++ ++ protected boolean func_104086_b(int par1) ++ { ++ return false; ++ } ++ ++ protected int func_130003_b() ++ { ++ return this.getSize() * 36; ++ } ++ ++ protected void func_130004_c() ++ { ++ this.field_111249_a.drawDefaultBackground(); ++ } ++ ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) ++ { ++ if (par1 < GuiScreenBackup.func_110370_e(this.field_111249_a).size()) ++ { ++ this.func_111246_b(par1, par2, par3, par4, par5Tessellator); ++ } ++ } ++ ++ private void func_111246_b(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) ++ { ++ Backup var6 = (Backup)GuiScreenBackup.func_110370_e(this.field_111249_a).get(par1); ++ this.field_111249_a.drawString(GuiScreenBackup.func_130032_i(this.field_111249_a), "Backup (" + this.func_111248_a(Long.valueOf(MinecraftServer.getSystemTimeMillis() - var6.field_110725_b.getTime())) + ")", par2 + 2, par3 + 1, 16777215); ++ this.field_111249_a.drawString(GuiScreenBackup.func_130033_j(this.field_111249_a), this.func_111247_a(var6.field_110725_b), par2 + 2, par3 + 12, 7105644); ++ } ++ ++ private String func_111247_a(Date par1Date) ++ { ++ return DateFormat.getDateTimeInstance(3, 3).format(par1Date); ++ } ++ ++ private String func_111248_a(Long par1) ++ { ++ if (par1.longValue() < 0L) ++ { ++ return "right now"; ++ } ++ else ++ { ++ long var2 = par1.longValue() / 1000L; ++ ++ if (var2 < 60L) ++ { ++ return (var2 == 1L ? "1 second" : var2 + " seconds") + " ago"; ++ } ++ else ++ { ++ long var4; ++ ++ if (var2 < 3600L) ++ { ++ var4 = var2 / 60L; ++ return (var4 == 1L ? "1 minute" : var4 + " minutes") + " ago"; ++ } ++ else if (var2 < 86400L) ++ { ++ var4 = var2 / 3600L; ++ return (var4 == 1L ? "1 hour" : var4 + " hours") + " ago"; ++ } ++ else ++ { ++ var4 = var2 / 86400L; ++ return (var4 == 1L ? "1 day" : var4 + " days") + " ago"; ++ } ++ } ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenBook.java Sat Feb 5 04:12:34 2022 +*************** +*** 0 **** +--- 1,451 ---- ++ package net.minecraft.src; ++ ++ import java.io.ByteArrayOutputStream; ++ import java.io.DataOutputStream; ++ import org.lwjgl.input.Keyboard; ++ import org.lwjgl.opengl.GL11; ++ ++ public class GuiScreenBook extends GuiScreen ++ { ++ private static final ResourceLocation bookGuiTextures = new ResourceLocation("textures/gui/book.png"); ++ ++ /** The player editing the book */ ++ private final EntityPlayer editingPlayer; ++ private final ItemStack itemstackBook; ++ ++ /** Whether the book is signed or can still be edited */ ++ private final boolean bookIsUnsigned; ++ private boolean bookModified; ++ private boolean editingTitle; ++ ++ /** Update ticks since the gui was opened */ ++ private int updateCount; ++ private int bookImageWidth = 192; ++ private int bookImageHeight = 192; ++ private int bookTotalPages = 1; ++ private int currPage; ++ private NBTTagList bookPages; ++ private String bookTitle = ""; ++ private GuiButtonNextPage buttonNextPage; ++ private GuiButtonNextPage buttonPreviousPage; ++ private GuiButton buttonDone; ++ ++ /** The GuiButton to sign this book. */ ++ private GuiButton buttonSign; ++ private GuiButton buttonFinalize; ++ private GuiButton buttonCancel; ++ ++ public GuiScreenBook(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack, boolean par3) ++ { ++ this.editingPlayer = par1EntityPlayer; ++ this.itemstackBook = par2ItemStack; ++ this.bookIsUnsigned = par3; ++ ++ if (par2ItemStack.hasTagCompound()) ++ { ++ NBTTagCompound var4 = par2ItemStack.getTagCompound(); ++ this.bookPages = var4.getTagList("pages"); ++ ++ if (this.bookPages != null) ++ { ++ this.bookPages = (NBTTagList)this.bookPages.copy(); ++ this.bookTotalPages = this.bookPages.tagCount(); ++ ++ if (this.bookTotalPages < 1) ++ { ++ this.bookTotalPages = 1; ++ } ++ } ++ } ++ ++ if (this.bookPages == null && par3) ++ { ++ this.bookPages = new NBTTagList("pages"); ++ this.bookPages.appendTag(new NBTTagString("1", "")); ++ this.bookTotalPages = 1; ++ } ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ super.updateScreen(); ++ ++this.updateCount; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.buttonList.clear(); ++ Keyboard.enableRepeatEvents(true); ++ ++ if (this.bookIsUnsigned) ++ { ++ this.buttonList.add(this.buttonSign = new GuiButton(3, this.width / 2 - 100, 4 + this.bookImageHeight, 98, 20, I18n.getString("book.signButton"))); ++ this.buttonList.add(this.buttonDone = new GuiButton(0, this.width / 2 + 2, 4 + this.bookImageHeight, 98, 20, I18n.getString("gui.done"))); ++ this.buttonList.add(this.buttonFinalize = new GuiButton(5, this.width / 2 - 100, 4 + this.bookImageHeight, 98, 20, I18n.getString("book.finalizeButton"))); ++ this.buttonList.add(this.buttonCancel = new GuiButton(4, this.width / 2 + 2, 4 + this.bookImageHeight, 98, 20, I18n.getString("gui.cancel"))); ++ } ++ else ++ { ++ this.buttonList.add(this.buttonDone = new GuiButton(0, this.width / 2 - 100, 4 + this.bookImageHeight, 200, 20, I18n.getString("gui.done"))); ++ } ++ ++ int var1 = (this.width - this.bookImageWidth) / 2; ++ byte var2 = 2; ++ this.buttonList.add(this.buttonNextPage = new GuiButtonNextPage(1, var1 + 120, var2 + 154, true)); ++ this.buttonList.add(this.buttonPreviousPage = new GuiButtonNextPage(2, var1 + 38, var2 + 154, false)); ++ this.updateButtons(); ++ } ++ ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ ++ public void onGuiClosed() ++ { ++ Keyboard.enableRepeatEvents(false); ++ } ++ ++ private void updateButtons() ++ { ++ this.buttonNextPage.drawButton = !this.editingTitle && (this.currPage < this.bookTotalPages - 1 || this.bookIsUnsigned); ++ this.buttonPreviousPage.drawButton = !this.editingTitle && this.currPage > 0; ++ this.buttonDone.drawButton = !this.bookIsUnsigned || !this.editingTitle; ++ ++ if (this.bookIsUnsigned) ++ { ++ this.buttonSign.drawButton = !this.editingTitle; ++ this.buttonCancel.drawButton = this.editingTitle; ++ this.buttonFinalize.drawButton = this.editingTitle; ++ this.buttonFinalize.enabled = this.bookTitle.trim().length() > 0; ++ } ++ } ++ ++ private void sendBookToServer(boolean par1) ++ { ++ if (this.bookIsUnsigned && this.bookModified) ++ { ++ if (this.bookPages != null) ++ { ++ while (this.bookPages.tagCount() > 1) ++ { ++ NBTTagString var2 = (NBTTagString)this.bookPages.tagAt(this.bookPages.tagCount() - 1); ++ ++ if (var2.data != null && var2.data.length() != 0) ++ { ++ break; ++ } ++ ++ this.bookPages.removeTag(this.bookPages.tagCount() - 1); ++ } ++ ++ if (this.itemstackBook.hasTagCompound()) ++ { ++ NBTTagCompound var7 = this.itemstackBook.getTagCompound(); ++ var7.setTag("pages", this.bookPages); ++ } ++ else ++ { ++ this.itemstackBook.setTagInfo("pages", this.bookPages); ++ } ++ ++ String var8 = "MC|BEdit"; ++ ++ if (par1) ++ { ++ var8 = "MC|BSign"; ++ this.itemstackBook.setTagInfo("author", new NBTTagString("author", this.editingPlayer.getCommandSenderName())); ++ this.itemstackBook.setTagInfo("title", new NBTTagString("title", this.bookTitle.trim())); ++ this.itemstackBook.itemID = Item.writtenBook.itemID; ++ } ++ ++ ByteArrayOutputStream var3 = new ByteArrayOutputStream(); ++ DataOutputStream var4 = new DataOutputStream(var3); ++ ++ try ++ { ++ Packet.writeItemStack(this.itemstackBook, var4); ++ this.mc.getNetHandler().addToSendQueue(new Packet250CustomPayload(var8, var3.toByteArray())); ++ } ++ catch (Exception var6) ++ { ++ var6.printStackTrace(); ++ } ++ } ++ } ++ } ++ ++ /** ++ * 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 == 0) ++ { ++ this.mc.displayGuiScreen((GuiScreen)null); ++ this.sendBookToServer(false); ++ } ++ else if (par1GuiButton.id == 3 && this.bookIsUnsigned) ++ { ++ this.editingTitle = true; ++ } ++ else if (par1GuiButton.id == 1) ++ { ++ if (this.currPage < this.bookTotalPages - 1) ++ { ++ ++this.currPage; ++ } ++ else if (this.bookIsUnsigned) ++ { ++ this.addNewPage(); ++ ++ if (this.currPage < this.bookTotalPages - 1) ++ { ++ ++this.currPage; ++ } ++ } ++ } ++ else if (par1GuiButton.id == 2) ++ { ++ if (this.currPage > 0) ++ { ++ --this.currPage; ++ } ++ } ++ else if (par1GuiButton.id == 5 && this.editingTitle) ++ { ++ this.sendBookToServer(true); ++ this.mc.displayGuiScreen((GuiScreen)null); ++ } ++ else if (par1GuiButton.id == 4 && this.editingTitle) ++ { ++ this.editingTitle = false; ++ } ++ ++ this.updateButtons(); ++ } ++ } ++ ++ private void addNewPage() ++ { ++ if (this.bookPages != null && this.bookPages.tagCount() < 50) ++ { ++ this.bookPages.appendTag(new NBTTagString("" + (this.bookTotalPages + 1), "")); ++ ++this.bookTotalPages; ++ this.bookModified = true; ++ } ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) ++ { ++ super.keyTyped(par1, par2); ++ ++ if (this.bookIsUnsigned) ++ { ++ if (this.editingTitle) ++ { ++ this.func_74162_c(par1, par2); ++ } ++ else ++ { ++ this.keyTypedInBook(par1, par2); ++ } ++ } ++ } ++ ++ /** ++ * Processes keystrokes when editing the text of a book ++ */ ++ private void keyTypedInBook(char par1, int par2) ++ { ++ switch (par1) ++ { ++ case 22: ++ this.func_74160_b(GuiScreen.getClipboardString()); ++ return; ++ ++ default: ++ switch (par2) ++ { ++ case 14: ++ String var3 = this.func_74158_i(); ++ ++ if (var3.length() > 0) ++ { ++ this.func_74159_a(var3.substring(0, var3.length() - 1)); ++ } ++ ++ return; ++ ++ case 28: ++ case 156: ++ this.func_74160_b("\n"); ++ return; ++ ++ default: ++ if (ChatAllowedCharacters.isAllowedCharacter(par1)) ++ { ++ this.func_74160_b(Character.toString(par1)); ++ } ++ } ++ } ++ } ++ ++ private void func_74162_c(char par1, int par2) ++ { ++ switch (par2) ++ { ++ case 14: ++ if (!this.bookTitle.isEmpty()) ++ { ++ this.bookTitle = this.bookTitle.substring(0, this.bookTitle.length() - 1); ++ this.updateButtons(); ++ } ++ ++ return; ++ ++ case 28: ++ case 156: ++ if (!this.bookTitle.isEmpty()) ++ { ++ this.sendBookToServer(true); ++ this.mc.displayGuiScreen((GuiScreen)null); ++ } ++ ++ return; ++ ++ default: ++ if (this.bookTitle.length() < 16 && ChatAllowedCharacters.isAllowedCharacter(par1)) ++ { ++ this.bookTitle = this.bookTitle + Character.toString(par1); ++ this.updateButtons(); ++ this.bookModified = true; ++ } ++ } ++ } ++ ++ private String func_74158_i() ++ { ++ if (this.bookPages != null && this.currPage >= 0 && this.currPage < this.bookPages.tagCount()) ++ { ++ NBTTagString var1 = (NBTTagString)this.bookPages.tagAt(this.currPage); ++ return var1.toString(); ++ } ++ else ++ { ++ return ""; ++ } ++ } ++ ++ private void func_74159_a(String par1Str) ++ { ++ if (this.bookPages != null && this.currPage >= 0 && this.currPage < this.bookPages.tagCount()) ++ { ++ NBTTagString var2 = (NBTTagString)this.bookPages.tagAt(this.currPage); ++ var2.data = par1Str; ++ this.bookModified = true; ++ } ++ } ++ ++ private void func_74160_b(String par1Str) ++ { ++ String var2 = this.func_74158_i(); ++ String var3 = var2 + par1Str; ++ int var4 = this.fontRenderer.splitStringWidth(var3 + "" + EnumChatFormatting.BLACK + "_", 118); ++ ++ if (var4 <= 118 && var3.length() < 256) ++ { ++ this.func_74159_a(var3); ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.mc.getTextureManager().bindTexture(bookGuiTextures); ++ int var4 = (this.width - this.bookImageWidth) / 2; ++ byte var5 = 2; ++ this.drawTexturedModalRect(var4, var5, 0, 0, this.bookImageWidth, this.bookImageHeight); ++ String var6; ++ String var7; ++ int var8; ++ ++ if (this.editingTitle) ++ { ++ var6 = this.bookTitle; ++ ++ if (this.bookIsUnsigned) ++ { ++ if (this.updateCount / 6 % 2 == 0) ++ { ++ var6 = var6 + "" + EnumChatFormatting.BLACK + "_"; ++ } ++ else ++ { ++ var6 = var6 + "" + EnumChatFormatting.GRAY + "_"; ++ } ++ } ++ ++ var7 = I18n.getString("book.editTitle"); ++ var8 = this.fontRenderer.getStringWidth(var7); ++ this.fontRenderer.drawString(var7, var4 + 36 + (116 - var8) / 2, var5 + 16 + 16, 0); ++ int var9 = this.fontRenderer.getStringWidth(var6); ++ this.fontRenderer.drawString(var6, var4 + 36 + (116 - var9) / 2, var5 + 48, 0); ++ String var10 = String.format(I18n.getString("book.byAuthor"), new Object[] {this.editingPlayer.getCommandSenderName()}); ++ int var11 = this.fontRenderer.getStringWidth(var10); ++ this.fontRenderer.drawString(EnumChatFormatting.DARK_GRAY + var10, var4 + 36 + (116 - var11) / 2, var5 + 48 + 10, 0); ++ String var12 = I18n.getString("book.finalizeWarning"); ++ this.fontRenderer.drawSplitString(var12, var4 + 36, var5 + 80, 116, 0); ++ } ++ else ++ { ++ var6 = String.format(I18n.getString("book.pageIndicator"), new Object[] {Integer.valueOf(this.currPage + 1), Integer.valueOf(this.bookTotalPages)}); ++ var7 = ""; ++ ++ if (this.bookPages != null && this.currPage >= 0 && this.currPage < this.bookPages.tagCount()) ++ { ++ NBTTagString var13 = (NBTTagString)this.bookPages.tagAt(this.currPage); ++ var7 = var13.toString(); ++ } ++ ++ if (this.bookIsUnsigned) ++ { ++ if (this.fontRenderer.getBidiFlag()) ++ { ++ var7 = var7 + "_"; ++ } ++ else if (this.updateCount / 6 % 2 == 0) ++ { ++ var7 = var7 + "" + EnumChatFormatting.BLACK + "_"; ++ } ++ else ++ { ++ var7 = var7 + "" + EnumChatFormatting.GRAY + "_"; ++ } ++ } ++ ++ var8 = this.fontRenderer.getStringWidth(var6); ++ this.fontRenderer.drawString(var6, var4 - var8 + this.bookImageWidth - 44, var5 + 16, 0); ++ this.fontRenderer.drawSplitString(var7, var4 + 36, var5 + 16 + 16, 116, 0); ++ } ++ ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ static ResourceLocation func_110404_g() ++ { ++ return bookGuiTextures; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenClientOutdated.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,55 ---- ++ package net.minecraft.src; ++ ++ public class GuiScreenClientOutdated extends GuiScreen ++ { ++ private final GuiScreen previousScreen; ++ ++ public GuiScreenClientOutdated(GuiScreen par1GuiScreen) ++ { ++ this.previousScreen = par1GuiScreen; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, "Back")); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ String var4 = I18n.getString("mco.client.outdated.title"); ++ String var5 = I18n.getString("mco.client.outdated.msg"); ++ this.drawCenteredString(this.fontRenderer, var4, this.width / 2, this.height / 2 - 50, 16711680); ++ this.drawCenteredString(this.fontRenderer, var5, this.width / 2, this.height / 2 - 30, 16777215); ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ if (par1GuiButton.id == 0) ++ { ++ this.mc.displayGuiScreen(this.previousScreen); ++ } ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) ++ { ++ if (par2 == 28 || par2 == 156) ++ { ++ this.mc.displayGuiScreen(this.previousScreen); ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenConfigureWorld.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,322 ---- ++ package net.minecraft.src; ++ ++ import java.io.IOException; ++ import org.lwjgl.input.Keyboard; ++ ++ public class GuiScreenConfigureWorld extends GuiScreen ++ { ++ private final GuiScreen field_96285_a; ++ private McoServer field_96280_b; ++ private SelectionListInvited field_96282_c; ++ private int field_96277_d; ++ private int field_96286_n; ++ private int field_96287_o; ++ private int field_96284_p = -1; ++ private String field_96283_q; ++ private GuiButton field_96281_r; ++ private GuiButton field_96279_s; ++ private GuiButton field_96278_t; ++ private GuiButton field_96276_u; ++ private GuiButton field_98128_v; ++ private GuiButton field_98127_w; ++ private GuiButton field_98129_x; ++ private GuiButton field_110381_z; ++ private boolean field_102020_y; ++ ++ public GuiScreenConfigureWorld(GuiScreen par1GuiScreen, McoServer par2McoServer) ++ { ++ this.field_96285_a = par1GuiScreen; ++ this.field_96280_b = par2McoServer; ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() {} ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.field_96277_d = this.width / 2 - 200; ++ this.field_96286_n = 180; ++ this.field_96287_o = this.width / 2; ++ Keyboard.enableRepeatEvents(true); ++ this.buttonList.clear(); ++ ++ if (this.field_96280_b.field_96404_d.equals("CLOSED")) ++ { ++ this.buttonList.add(this.field_96281_r = new GuiButton(0, this.field_96277_d, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.open"))); ++ this.field_96281_r.enabled = !this.field_96280_b.field_98166_h; ++ } ++ else ++ { ++ this.buttonList.add(this.field_96279_s = new GuiButton(1, this.field_96277_d, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.close"))); ++ this.field_96279_s.enabled = !this.field_96280_b.field_98166_h; ++ } ++ ++ this.buttonList.add(this.field_98129_x = new GuiButton(7, this.field_96277_d + this.field_96286_n / 2 + 2, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.subscription"))); ++ this.buttonList.add(this.field_96278_t = new GuiButton(5, this.field_96277_d, this.func_96264_a(10), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.edit"))); ++ this.buttonList.add(this.field_96276_u = new GuiButton(6, this.field_96277_d + this.field_96286_n / 2 + 2, this.func_96264_a(10), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.reset"))); ++ this.buttonList.add(this.field_98128_v = new GuiButton(4, this.field_96287_o, this.func_96264_a(10), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.invite"))); ++ this.buttonList.add(this.field_98127_w = new GuiButton(3, this.field_96287_o + this.field_96286_n / 2 + 2, this.func_96264_a(10), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.uninvite"))); ++ this.buttonList.add(this.field_110381_z = new GuiButton(8, this.field_96287_o, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.backup"))); ++ this.buttonList.add(new GuiButton(10, this.field_96287_o + this.field_96286_n / 2 + 2, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("gui.back"))); ++ this.field_96282_c = new SelectionListInvited(this); ++ this.field_96278_t.enabled = !this.field_96280_b.field_98166_h; ++ this.field_96276_u.enabled = !this.field_96280_b.field_98166_h; ++ this.field_98128_v.enabled = !this.field_96280_b.field_98166_h; ++ this.field_98127_w.enabled = !this.field_96280_b.field_98166_h; ++ this.field_110381_z.enabled = !this.field_96280_b.field_98166_h; ++ } ++ ++ private int func_96264_a(int par1) ++ { ++ return 40 + par1 * 13; ++ } ++ ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ ++ public void onGuiClosed() ++ { ++ Keyboard.enableRepeatEvents(false); ++ } ++ ++ /** ++ * 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 == 10) ++ { ++ if (this.field_102020_y) ++ { ++ ((GuiScreenOnlineServers)this.field_96285_a).func_102018_a(this.field_96280_b.field_96408_a); ++ } ++ ++ this.mc.displayGuiScreen(this.field_96285_a); ++ } ++ else if (par1GuiButton.id == 5) ++ { ++ this.mc.displayGuiScreen(new GuiScreenEditOnlineWorld(this, this.field_96285_a, this.field_96280_b)); ++ } ++ else if (par1GuiButton.id == 1) ++ { ++ String var2 = I18n.getString("mco.configure.world.close.question.line1"); ++ String var3 = I18n.getString("mco.configure.world.close.question.line2"); ++ this.mc.displayGuiScreen(new GuiScreenConfirmation(this, GuiScreenConfirmationType.Info, var2, var3, 1)); ++ } ++ else if (par1GuiButton.id == 0) ++ { ++ this.func_96268_g(); ++ } ++ else if (par1GuiButton.id == 4) ++ { ++ this.mc.displayGuiScreen(new GuiScreenInvite(this.field_96285_a, this, this.field_96280_b)); ++ } ++ else if (par1GuiButton.id == 3) ++ { ++ this.func_96272_i(); ++ } ++ else if (par1GuiButton.id == 6) ++ { ++ this.mc.displayGuiScreen(new GuiScreenResetWorld(this, this.field_96280_b)); ++ } ++ else if (par1GuiButton.id == 7) ++ { ++ this.mc.displayGuiScreen(new GuiScreenSubscription(this, this.field_96280_b)); ++ } ++ else if (par1GuiButton.id == 8) ++ { ++ this.mc.displayGuiScreen(new GuiScreenBackup(this, this.field_96280_b.field_96408_a)); ++ } ++ } ++ } ++ ++ private void func_96268_g() ++ { ++ McoClient var1 = new McoClient(this.mc.getSession()); ++ ++ try ++ { ++ Boolean var2 = var1.func_96383_b(this.field_96280_b.field_96408_a); ++ ++ if (var2.booleanValue()) ++ { ++ this.field_102020_y = true; ++ this.field_96280_b.field_96404_d = "OPEN"; ++ this.initGui(); ++ } ++ } ++ catch (ExceptionMcoService var3) ++ { ++ this.mc.getLogAgent().logSevere(var3.toString()); ++ } ++ catch (IOException var4) ++ { ++ this.mc.getLogAgent().logWarning("Realms: could not parse response"); ++ } ++ } ++ ++ private void func_96275_h() ++ { ++ McoClient var1 = new McoClient(this.mc.getSession()); ++ ++ try ++ { ++ boolean var2 = var1.func_96378_c(this.field_96280_b.field_96408_a).booleanValue(); ++ ++ if (var2) ++ { ++ this.field_102020_y = true; ++ this.field_96280_b.field_96404_d = "CLOSED"; ++ this.initGui(); ++ } ++ } ++ catch (ExceptionMcoService var3) ++ { ++ this.mc.getLogAgent().logSevere(var3.toString()); ++ } ++ catch (IOException var4) ++ { ++ this.mc.getLogAgent().logWarning("Realms: could not parse response"); ++ } ++ } ++ ++ private void func_96272_i() ++ { ++ if (this.field_96284_p >= 0 && this.field_96284_p < this.field_96280_b.field_96402_f.size()) ++ { ++ this.field_96283_q = (String)this.field_96280_b.field_96402_f.get(this.field_96284_p); ++ GuiYesNo var1 = new GuiYesNo(this, "Warning!", I18n.getString("mco.configure.world.uninvite.question") + " \'" + this.field_96283_q + "\'", 3); ++ this.mc.displayGuiScreen(var1); ++ } ++ } ++ ++ public void confirmClicked(boolean par1, int par2) ++ { ++ if (par2 == 3) ++ { ++ if (par1) ++ { ++ McoClient var3 = new McoClient(this.mc.getSession()); ++ ++ try ++ { ++ var3.func_96381_a(this.field_96280_b.field_96408_a, this.field_96283_q); ++ } ++ catch (ExceptionMcoService var5) ++ { ++ this.mc.getLogAgent().logSevere(var5.toString()); ++ } ++ ++ this.func_96267_d(this.field_96284_p); ++ } ++ ++ this.mc.displayGuiScreen(new GuiScreenConfigureWorld(this.field_96285_a, this.field_96280_b)); ++ } ++ ++ if (par2 == 1) ++ { ++ if (par1) ++ { ++ this.func_96275_h(); ++ } ++ ++ this.mc.displayGuiScreen(this); ++ } ++ } ++ ++ private void func_96267_d(int par1) ++ { ++ this.field_96280_b.field_96402_f.remove(par1); ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) {} ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) ++ { ++ super.mouseClicked(par1, par2, par3); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.field_96282_c.func_96612_a(par1, par2, par3); ++ this.drawCenteredString(this.fontRenderer, I18n.getString("mco.configure.world.title"), this.width / 2, 17, 16777215); ++ this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.name"), this.field_96277_d, this.func_96264_a(1), 10526880); ++ this.drawString(this.fontRenderer, this.field_96280_b.func_96398_b(), this.field_96277_d, this.func_96264_a(2), 16777215); ++ this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.description"), this.field_96277_d, this.func_96264_a(4), 10526880); ++ this.drawString(this.fontRenderer, this.field_96280_b.func_96397_a(), this.field_96277_d, this.func_96264_a(5), 16777215); ++ this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.status"), this.field_96277_d, this.func_96264_a(7), 10526880); ++ this.drawString(this.fontRenderer, this.func_104045_j(), this.field_96277_d, this.func_96264_a(8), 16777215); ++ this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.invited"), this.field_96287_o, this.func_96264_a(1), 10526880); ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ private String func_104045_j() ++ { ++ if (this.field_96280_b.field_98166_h) ++ { ++ return "Expired"; ++ } ++ else ++ { ++ String var1 = this.field_96280_b.field_96404_d.toLowerCase(); ++ return Character.toUpperCase(var1.charAt(0)) + var1.substring(1); ++ } ++ } ++ ++ static Minecraft getMinecraft(GuiScreenConfigureWorld par0GuiScreenConfigureWorld) ++ { ++ return par0GuiScreenConfigureWorld.mc; ++ } ++ ++ static int func_96271_b(GuiScreenConfigureWorld par0GuiScreenConfigureWorld) ++ { ++ return par0GuiScreenConfigureWorld.field_96287_o; ++ } ++ ++ static int func_96274_a(GuiScreenConfigureWorld par0GuiScreenConfigureWorld, int par1) ++ { ++ return par0GuiScreenConfigureWorld.func_96264_a(par1); ++ } ++ ++ static int func_96269_c(GuiScreenConfigureWorld par0GuiScreenConfigureWorld) ++ { ++ return par0GuiScreenConfigureWorld.field_96286_n; ++ } ++ ++ static McoServer func_96266_d(GuiScreenConfigureWorld par0GuiScreenConfigureWorld) ++ { ++ return par0GuiScreenConfigureWorld.field_96280_b; ++ } ++ ++ static int func_96270_b(GuiScreenConfigureWorld par0GuiScreenConfigureWorld, int par1) ++ { ++ return par0GuiScreenConfigureWorld.field_96284_p = par1; ++ } ++ ++ static int func_96263_e(GuiScreenConfigureWorld par0GuiScreenConfigureWorld) ++ { ++ return par0GuiScreenConfigureWorld.field_96284_p; ++ } ++ ++ static FontRenderer func_96273_f(GuiScreenConfigureWorld par0GuiScreenConfigureWorld) ++ { ++ return par0GuiScreenConfigureWorld.fontRenderer; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenConfirmation.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,52 ---- ++ package net.minecraft.src; ++ ++ public class GuiScreenConfirmation extends GuiScreen ++ { ++ private final GuiScreenConfirmationType field_140045_e; ++ private final String field_140049_p; ++ private final String field_96288_n; ++ protected final GuiScreen field_140048_a; ++ protected final String field_140046_b; ++ protected final String field_140047_c; ++ protected final int field_140044_d; ++ ++ public GuiScreenConfirmation(GuiScreen par1GuiScreen, GuiScreenConfirmationType par2GuiScreenConfirmationType, String par3Str, String par4Str, int par5) ++ { ++ this.field_140048_a = par1GuiScreen; ++ this.field_140044_d = par5; ++ this.field_140045_e = par2GuiScreenConfirmationType; ++ this.field_140049_p = par3Str; ++ this.field_96288_n = par4Str; ++ this.field_140046_b = I18n.getString("gui.yes"); ++ this.field_140047_c = I18n.getString("gui.no"); ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.buttonList.add(new GuiSmallButton(0, this.width / 2 - 155, this.height / 6 + 112, this.field_140046_b)); ++ this.buttonList.add(new GuiSmallButton(1, this.width / 2 - 155 + 160, this.height / 6 + 112, this.field_140047_c)); ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ this.field_140048_a.confirmClicked(par1GuiButton.id == 0, this.field_140044_d); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.drawCenteredString(this.fontRenderer, this.field_140045_e.field_140072_d, this.width / 2, 70, this.field_140045_e.field_140075_c); ++ this.drawCenteredString(this.fontRenderer, this.field_140049_p, this.width / 2, 90, 16777215); ++ this.drawCenteredString(this.fontRenderer, this.field_96288_n, this.width / 2, 110, 16777215); ++ super.drawScreen(par1, par2, par3); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenConfirmationType.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,15 ---- ++ package net.minecraft.src; ++ ++ public enum GuiScreenConfirmationType ++ { ++ Warning("Warning!", 16711680), ++ Info("Info!", 8226750); ++ public final int field_140075_c; ++ public final String field_140072_d; ++ ++ private GuiScreenConfirmationType(String par3Str, int par4) ++ { ++ this.field_140072_d = par3Str; ++ this.field_140075_c = par4; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenCreateOnlineWorld.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,211 ---- ++ package net.minecraft.src; ++ ++ import java.util.ArrayList; ++ import java.util.Collections; ++ import org.lwjgl.input.Keyboard; ++ ++ public class GuiScreenCreateOnlineWorld extends ScreenWithCallback ++ { ++ private GuiScreen field_96260_a; ++ private GuiTextField field_96257_c; ++ private GuiTextField field_96255_b; ++ private String field_98108_c; ++ private String field_98109_n; ++ private static int field_96253_d; ++ private static int field_96261_n = 1; ++ private static int field_110357_r = 2; ++ private boolean field_96256_r; ++ private String field_96254_s = "You must enter a name!"; ++ private WorldTemplate field_110356_u; ++ ++ public GuiScreenCreateOnlineWorld(GuiScreen par1GuiScreen) ++ { ++ super.buttonList = Collections.synchronizedList(new ArrayList()); ++ this.field_96260_a = par1GuiScreen; ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ this.field_96257_c.updateCursorCounter(); ++ this.field_98108_c = this.field_96257_c.getText(); ++ this.field_96255_b.updateCursorCounter(); ++ this.field_98109_n = this.field_96255_b.getText(); ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ Keyboard.enableRepeatEvents(true); ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(field_96253_d, this.width / 2 - 100, this.height / 4 + 120 + 17, 97, 20, I18n.getString("mco.create.world"))); ++ this.buttonList.add(new GuiButton(field_96261_n, this.width / 2 + 5, this.height / 4 + 120 + 17, 95, 20, I18n.getString("gui.cancel"))); ++ this.field_96257_c = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 65, 200, 20); ++ this.field_96257_c.setFocused(true); ++ ++ if (this.field_98108_c != null) ++ { ++ this.field_96257_c.setText(this.field_98108_c); ++ } ++ ++ this.field_96255_b = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 111, 200, 20); ++ ++ if (this.field_98109_n != null) ++ { ++ this.field_96255_b.setText(this.field_98109_n); ++ } ++ ++ if (this.field_110356_u == null) ++ { ++ this.buttonList.add(new GuiButton(field_110357_r, this.width / 2 - 100, 147, 200, 20, I18n.getString("mco.template.default.name"))); ++ } ++ else ++ { ++ this.field_96255_b.setText(""); ++ this.field_96255_b.setEnabled(false); ++ this.field_96255_b.setFocused(false); ++ this.buttonList.add(new GuiButton(field_110357_r, this.width / 2 - 100, 147, 200, 20, I18n.getString("mco.template.name") + ": " + this.field_110356_u.field_110732_b)); ++ } ++ } ++ ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ ++ public void onGuiClosed() ++ { ++ Keyboard.enableRepeatEvents(false); ++ } ++ ++ /** ++ * 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 == field_96261_n) ++ { ++ this.mc.displayGuiScreen(this.field_96260_a); ++ } ++ else if (par1GuiButton.id == field_96253_d) ++ { ++ this.func_96252_h(); ++ } ++ else if (par1GuiButton.id == field_110357_r) ++ { ++ this.mc.displayGuiScreen(new GuiScreenMcoWorldTemplate(this, this.field_110356_u)); ++ } ++ } ++ } ++ ++ private void func_96252_h() ++ { ++ if (this.func_96249_i()) ++ { ++ TaskWorldCreation var1 = new TaskWorldCreation(this, this.field_96257_c.getText(), "Minecraft Realms Server", this.field_98109_n, this.field_110356_u); ++ GuiScreenLongRunningTask var2 = new GuiScreenLongRunningTask(this.mc, this.field_96260_a, var1); ++ var2.func_98117_g(); ++ this.mc.displayGuiScreen(var2); ++ } ++ } ++ ++ private boolean func_96249_i() ++ { ++ this.field_96256_r = this.field_96257_c.getText() == null || this.field_96257_c.getText().trim().equals(""); ++ return !this.field_96256_r; ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) ++ { ++ this.field_96257_c.textboxKeyTyped(par1, par2); ++ this.field_96255_b.textboxKeyTyped(par1, par2); ++ ++ if (par2 == 15) ++ { ++ this.field_96257_c.setFocused(!this.field_96257_c.isFocused()); ++ this.field_96255_b.setFocused(!this.field_96255_b.isFocused()); ++ } ++ ++ if (par2 == 28 || par2 == 156) ++ { ++ this.actionPerformed((GuiButton)this.buttonList.get(0)); ++ } ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) ++ { ++ super.mouseClicked(par1, par2, par3); ++ this.field_96257_c.mouseClicked(par1, par2, par3); ++ this.field_96255_b.mouseClicked(par1, par2, par3); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.drawCenteredString(this.fontRenderer, I18n.getString("mco.selectServer.create"), this.width / 2, 11, 16777215); ++ this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.name"), this.width / 2 - 100, 52, 10526880); ++ this.drawString(this.fontRenderer, I18n.getString("mco.create.world.seed"), this.width / 2 - 100, 98, 10526880); ++ ++ if (this.field_96256_r) ++ { ++ this.drawCenteredString(this.fontRenderer, this.field_96254_s, this.width / 2, 167, 16711680); ++ } ++ ++ this.field_96257_c.drawTextBox(); ++ this.field_96255_b.drawTextBox(); ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ public void func_110355_a(WorldTemplate par1WorldTemplate) ++ { ++ this.field_110356_u = par1WorldTemplate; ++ } ++ ++ public void func_110354_a(Object par1Obj) ++ { ++ this.func_110355_a((WorldTemplate)par1Obj); ++ } ++ ++ static Minecraft func_96248_a(GuiScreenCreateOnlineWorld par0GuiScreenCreateOnlineWorld) ++ { ++ return par0GuiScreenCreateOnlineWorld.mc; ++ } ++ ++ static GuiScreen func_96247_b(GuiScreenCreateOnlineWorld par0GuiScreenCreateOnlineWorld) ++ { ++ return par0GuiScreenCreateOnlineWorld.field_96260_a; ++ } ++ ++ static Minecraft func_96246_c(GuiScreenCreateOnlineWorld par0GuiScreenCreateOnlineWorld) ++ { ++ return par0GuiScreenCreateOnlineWorld.mc; ++ } ++ ++ static Minecraft func_130026_d(GuiScreenCreateOnlineWorld par0GuiScreenCreateOnlineWorld) ++ { ++ return par0GuiScreenCreateOnlineWorld.mc; ++ } ++ ++ static Minecraft func_130027_e(GuiScreenCreateOnlineWorld par0GuiScreenCreateOnlineWorld) ++ { ++ return par0GuiScreenCreateOnlineWorld.mc; ++ } ++ ++ static Minecraft func_130028_f(GuiScreenCreateOnlineWorld par0GuiScreenCreateOnlineWorld) ++ { ++ return par0GuiScreenCreateOnlineWorld.mc; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenDemo.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,89 ---- ++ package net.minecraft.src; ++ ++ import java.net.URI; ++ import org.lwjgl.opengl.GL11; ++ ++ public class GuiScreenDemo extends GuiScreen ++ { ++ private static final ResourceLocation field_110407_a = new ResourceLocation("textures/gui/demo_background.png"); ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.buttonList.clear(); ++ byte var1 = -16; ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 116, this.height / 2 + 62 + var1, 114, 20, I18n.getString("demo.help.buy"))); ++ this.buttonList.add(new GuiButton(2, this.width / 2 + 2, this.height / 2 + 62 + var1, 114, 20, I18n.getString("demo.help.later"))); ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ switch (par1GuiButton.id) ++ { ++ case 1: ++ par1GuiButton.enabled = false; ++ ++ try ++ { ++ Class var2 = Class.forName("java.awt.Desktop"); ++ Object var3 = var2.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); ++ var2.getMethod("browse", new Class[] {URI.class}).invoke(var3, new Object[] {new URI("http://www.minecraft.net/store?source=demo")}); ++ } ++ catch (Throwable var4) ++ { ++ var4.printStackTrace(); ++ } ++ ++ break; ++ ++ case 2: ++ this.mc.displayGuiScreen((GuiScreen)null); ++ this.mc.setIngameFocus(); ++ } ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ super.updateScreen(); ++ } ++ ++ /** ++ * Draws either a gradient over the background screen (when it exists) or a flat gradient over background.png ++ */ ++ public void drawDefaultBackground() ++ { ++ super.drawDefaultBackground(); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.mc.getTextureManager().bindTexture(field_110407_a); ++ int var1 = (this.width - 248) / 2; ++ int var2 = (this.height - 166) / 2; ++ this.drawTexturedModalRect(var1, var2, 0, 0, 248, 166); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ int var4 = (this.width - 248) / 2 + 10; ++ int var5 = (this.height - 166) / 2 + 8; ++ this.fontRenderer.drawString(I18n.getString("demo.help.title"), var4, var5, 2039583); ++ var5 += 12; ++ GameSettings var6 = this.mc.gameSettings; ++ this.fontRenderer.drawString(I18n.getStringParams("demo.help.movementShort", new Object[] {GameSettings.getKeyDisplayString(var6.keyBindForward.keyCode), GameSettings.getKeyDisplayString(var6.keyBindLeft.keyCode), GameSettings.getKeyDisplayString(var6.keyBindBack.keyCode), GameSettings.getKeyDisplayString(var6.keyBindRight.keyCode)}), var4, var5, 5197647); ++ this.fontRenderer.drawString(I18n.getString("demo.help.movementMouse"), var4, var5 + 12, 5197647); ++ this.fontRenderer.drawString(I18n.getStringParams("demo.help.jump", new Object[] {GameSettings.getKeyDisplayString(var6.keyBindJump.keyCode)}), var4, var5 + 24, 5197647); ++ this.fontRenderer.drawString(I18n.getStringParams("demo.help.inventory", new Object[] {GameSettings.getKeyDisplayString(var6.keyBindInventory.keyCode)}), var4, var5 + 36, 5197647); ++ this.fontRenderer.drawSplitString(I18n.getString("demo.help.fullWrapped"), var4, var5 + 68, 218, 2039583); ++ super.drawScreen(par1, par2, par3); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenDisconnectedOnline.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,76 ---- ++ package net.minecraft.src; ++ ++ import java.util.Iterator; ++ import java.util.List; ++ ++ public class GuiScreenDisconnectedOnline extends GuiScreen ++ { ++ private String field_98113_a; ++ private String field_98111_b; ++ private Object[] field_98112_c; ++ private List field_98110_d; ++ private final GuiScreen field_98114_n; ++ ++ public GuiScreenDisconnectedOnline(GuiScreen par1GuiScreen, String par2Str, String par3Str, Object ... par4ArrayOfObj) ++ { ++ this.field_98114_n = par1GuiScreen; ++ this.field_98113_a = I18n.getString(par2Str); ++ this.field_98111_b = par3Str; ++ this.field_98112_c = par4ArrayOfObj; ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) {} ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.back"))); ++ ++ if (this.field_98112_c != null) ++ { ++ this.field_98110_d = this.fontRenderer.listFormattedStringToWidth(I18n.getStringParams(this.field_98111_b, this.field_98112_c), this.width - 50); ++ } ++ else ++ { ++ this.field_98110_d = this.fontRenderer.listFormattedStringToWidth(I18n.getString(this.field_98111_b), this.width - 50); ++ } ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ if (par1GuiButton.id == 0) ++ { ++ this.mc.displayGuiScreen(this.field_98114_n); ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.drawCenteredString(this.fontRenderer, this.field_98113_a, this.width / 2, this.height / 2 - 50, 11184810); ++ int var4 = this.height / 2 - 30; ++ ++ if (this.field_98110_d != null) ++ { ++ for (Iterator var5 = this.field_98110_d.iterator(); var5.hasNext(); var4 += this.fontRenderer.FONT_HEIGHT) ++ { ++ String var6 = (String)var5.next(); ++ this.drawCenteredString(this.fontRenderer, var6, this.width / 2, var4, 16777215); ++ } ++ } ++ ++ super.drawScreen(par1, par2, par3); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenEditOnlineWorld.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,162 ---- ++ package net.minecraft.src; ++ ++ import java.io.UnsupportedEncodingException; ++ import org.lwjgl.input.Keyboard; ++ ++ public class GuiScreenEditOnlineWorld extends GuiScreen ++ { ++ private GuiScreen field_96204_a; ++ private GuiScreen field_96202_b; ++ private GuiTextField field_96203_c; ++ private GuiTextField field_96201_d; ++ private McoServer field_96205_n; ++ private GuiButton field_96206_o; ++ private int field_104054_p; ++ private int field_104053_q; ++ private int field_104052_r; ++ private GuiScreenOnlineServersSubscreen field_104051_s; ++ ++ public GuiScreenEditOnlineWorld(GuiScreen par1GuiScreen, GuiScreen par2GuiScreen, McoServer par3McoServer) ++ { ++ this.field_96204_a = par1GuiScreen; ++ this.field_96202_b = par2GuiScreen; ++ this.field_96205_n = par3McoServer; ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ this.field_96201_d.updateCursorCounter(); ++ this.field_96203_c.updateCursorCounter(); ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.field_104054_p = this.width / 4; ++ this.field_104053_q = this.width / 4 - 2; ++ this.field_104052_r = this.width / 2 + 4; ++ Keyboard.enableRepeatEvents(true); ++ this.buttonList.clear(); ++ this.buttonList.add(this.field_96206_o = new GuiButton(0, this.field_104054_p, this.height / 4 + 120 + 22, this.field_104053_q, 20, I18n.getString("mco.configure.world.buttons.done"))); ++ this.buttonList.add(new GuiButton(1, this.field_104052_r, this.height / 4 + 120 + 22, this.field_104053_q, 20, I18n.getString("gui.cancel"))); ++ this.field_96201_d = new GuiTextField(this.fontRenderer, this.field_104054_p, 56, 212, 20); ++ this.field_96201_d.setFocused(true); ++ this.field_96201_d.setMaxStringLength(32); ++ this.field_96201_d.setText(this.field_96205_n.func_96398_b()); ++ this.field_96203_c = new GuiTextField(this.fontRenderer, this.field_104054_p, 96, 212, 20); ++ this.field_96203_c.setMaxStringLength(32); ++ this.field_96203_c.setText(this.field_96205_n.func_96397_a()); ++ this.field_104051_s = new GuiScreenOnlineServersSubscreen(this.width, this.height, this.field_104054_p, 122, this.field_96205_n.field_110729_i, this.field_96205_n.field_110728_j); ++ this.buttonList.addAll(this.field_104051_s.field_104079_a); ++ } ++ ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ ++ public void onGuiClosed() ++ { ++ Keyboard.enableRepeatEvents(false); ++ } ++ ++ /** ++ * 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 == 1) ++ { ++ this.mc.displayGuiScreen(this.field_96204_a); ++ } ++ else if (par1GuiButton.id == 0) ++ { ++ this.func_96200_g(); ++ } ++ else if (par1GuiButton.id == 2) ++ { ++ this.mc.displayGuiScreen(new GuiScreenResetWorld(this, this.field_96205_n)); ++ } ++ else ++ { ++ this.field_104051_s.func_104069_a(par1GuiButton); ++ } ++ } ++ } ++ ++ private void func_96200_g() ++ { ++ McoClient var1 = new McoClient(this.mc.getSession()); ++ ++ try ++ { ++ String var2 = this.field_96203_c.getText() != null && !this.field_96203_c.getText().trim().equals("") ? this.field_96203_c.getText() : null; ++ var1.func_96384_a(this.field_96205_n.field_96408_a, this.field_96201_d.getText(), var2, this.field_104051_s.field_104076_e, this.field_104051_s.field_104073_f); ++ this.field_96205_n.func_96399_a(this.field_96201_d.getText()); ++ this.field_96205_n.func_96400_b(this.field_96203_c.getText()); ++ this.field_96205_n.field_110729_i = this.field_104051_s.field_104076_e; ++ this.field_96205_n.field_110728_j = this.field_104051_s.field_104073_f; ++ this.mc.displayGuiScreen(new GuiScreenConfigureWorld(this.field_96202_b, this.field_96205_n)); ++ } ++ catch (ExceptionMcoService var3) ++ { ++ this.mc.getLogAgent().logSevere(var3.toString()); ++ } ++ catch (UnsupportedEncodingException var4) ++ { ++ this.mc.getLogAgent().logWarning("Realms: " + var4.getLocalizedMessage()); ++ } ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) ++ { ++ this.field_96201_d.textboxKeyTyped(par1, par2); ++ this.field_96203_c.textboxKeyTyped(par1, par2); ++ ++ if (par2 == 15) ++ { ++ this.field_96201_d.setFocused(!this.field_96201_d.isFocused()); ++ this.field_96203_c.setFocused(!this.field_96203_c.isFocused()); ++ } ++ ++ if (par2 == 28 || par2 == 156) ++ { ++ this.func_96200_g(); ++ } ++ ++ this.field_96206_o.enabled = this.field_96201_d.getText() != null && !this.field_96201_d.getText().trim().equals(""); ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) ++ { ++ super.mouseClicked(par1, par2, par3); ++ this.field_96203_c.mouseClicked(par1, par2, par3); ++ this.field_96201_d.mouseClicked(par1, par2, par3); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.drawCenteredString(this.fontRenderer, I18n.getString("mco.configure.world.edit.title"), this.width / 2, 17, 16777215); ++ this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.name"), this.field_104054_p, 43, 10526880); ++ this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.description"), this.field_104054_p, 84, 10526880); ++ this.field_96201_d.drawTextBox(); ++ this.field_96203_c.drawTextBox(); ++ this.field_104051_s.func_104071_a(this, this.fontRenderer); ++ super.drawScreen(par1, par2, par3); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenHorseInventory.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,65 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class GuiScreenHorseInventory extends GuiContainer ++ { ++ private static final ResourceLocation horseGuiTextures = new ResourceLocation("textures/gui/container/horse.png"); ++ private IInventory field_110413_u; ++ private IInventory field_110412_v; ++ private EntityHorse field_110411_w; ++ private float field_110416_x; ++ private float field_110415_y; ++ ++ public GuiScreenHorseInventory(IInventory par1IInventory, IInventory par2IInventory, EntityHorse par3EntityHorse) ++ { ++ super(new ContainerHorseInventory(par1IInventory, par2IInventory, par3EntityHorse)); ++ this.field_110413_u = par1IInventory; ++ this.field_110412_v = par2IInventory; ++ this.field_110411_w = par3EntityHorse; ++ this.allowUserInput = false; ++ } ++ ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) ++ { ++ this.fontRenderer.drawString(this.field_110412_v.isInvNameLocalized() ? this.field_110412_v.getInvName() : I18n.getString(this.field_110412_v.getInvName()), 8, 6, 4210752); ++ this.fontRenderer.drawString(this.field_110413_u.isInvNameLocalized() ? this.field_110413_u.getInvName() : I18n.getString(this.field_110413_u.getInvName()), 8, this.ySize - 96 + 2, 4210752); ++ } ++ ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) ++ { ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.mc.getTextureManager().bindTexture(horseGuiTextures); ++ int var4 = (this.width - this.xSize) / 2; ++ int var5 = (this.height - this.ySize) / 2; ++ this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); ++ ++ if (this.field_110411_w.isChested()) ++ { ++ this.drawTexturedModalRect(var4 + 79, var5 + 17, 0, this.ySize, 90, 54); ++ } ++ ++ if (this.field_110411_w.func_110259_cr()) ++ { ++ this.drawTexturedModalRect(var4 + 7, var5 + 35, 0, this.ySize + 54, 18, 18); ++ } ++ ++ GuiInventory.func_110423_a(var4 + 51, var5 + 60, 17, (float)(var4 + 51) - this.field_110416_x, (float)(var5 + 75 - 50) - this.field_110415_y, this.field_110411_w); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.field_110416_x = (float)par1; ++ this.field_110415_y = (float)par2; ++ super.drawScreen(par1, par2, par3); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenInvite.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,158 ---- ++ package net.minecraft.src; ++ ++ import java.io.IOException; ++ import org.lwjgl.input.Keyboard; ++ ++ public class GuiScreenInvite extends GuiScreen ++ { ++ private GuiTextField field_96227_a; ++ private McoServer field_96223_b; ++ private final GuiScreen field_96224_c; ++ private final GuiScreenConfigureWorld field_96222_d; ++ private final int field_96228_n = 0; ++ private final int field_96229_o = 1; ++ private String field_101016_p = "Could not invite the provided name"; ++ private String field_96226_p; ++ private boolean field_96225_q; ++ ++ public GuiScreenInvite(GuiScreen par1GuiScreen, GuiScreenConfigureWorld par2GuiScreenConfigureWorld, McoServer par3McoServer) ++ { ++ this.field_96224_c = par1GuiScreen; ++ this.field_96222_d = par2GuiScreenConfigureWorld; ++ this.field_96223_b = par3McoServer; ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ this.field_96227_a.updateCursorCounter(); ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ Keyboard.enableRepeatEvents(true); ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("mco.configure.world.buttons.invite"))); ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); ++ this.field_96227_a = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 66, 200, 20); ++ this.field_96227_a.setFocused(true); ++ } ++ ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ ++ public void onGuiClosed() ++ { ++ Keyboard.enableRepeatEvents(false); ++ } ++ ++ /** ++ * 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 == 1) ++ { ++ this.mc.displayGuiScreen(this.field_96222_d); ++ } ++ else if (par1GuiButton.id == 0) ++ { ++ McoClient var2 = new McoClient(this.mc.getSession()); ++ ++ if (this.field_96227_a.getText() == null || this.field_96227_a.getText().isEmpty()) ++ { ++ return; ++ } ++ ++ try ++ { ++ McoServer var3 = var2.func_96387_b(this.field_96223_b.field_96408_a, this.field_96227_a.getText()); ++ ++ if (var3 != null) ++ { ++ this.field_96223_b.field_96402_f = var3.field_96402_f; ++ this.mc.displayGuiScreen(new GuiScreenConfigureWorld(this.field_96224_c, this.field_96223_b)); ++ } ++ else ++ { ++ this.func_101015_a(this.field_101016_p); ++ } ++ } ++ catch (ExceptionMcoService var4) ++ { ++ this.mc.getLogAgent().logSevere(var4.toString()); ++ this.func_101015_a(var4.field_96391_b); ++ } ++ catch (IOException var5) ++ { ++ this.mc.getLogAgent().logWarning("Realms: could not parse response"); ++ this.func_101015_a(this.field_101016_p); ++ } ++ } ++ } ++ } ++ ++ private void func_101015_a(String par1Str) ++ { ++ this.field_96225_q = true; ++ this.field_96226_p = par1Str; ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) ++ { ++ this.field_96227_a.textboxKeyTyped(par1, par2); ++ ++ if (par2 == 15) ++ { ++ if (this.field_96227_a.isFocused()) ++ { ++ this.field_96227_a.setFocused(false); ++ } ++ else ++ { ++ this.field_96227_a.setFocused(true); ++ } ++ } ++ ++ if (par2 == 28 || par2 == 156) ++ { ++ this.actionPerformed((GuiButton)this.buttonList.get(0)); ++ } ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) ++ { ++ super.mouseClicked(par1, par2, par3); ++ this.field_96227_a.mouseClicked(par1, par2, par3); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.invite.profile.name"), this.width / 2 - 100, 53, 10526880); ++ ++ if (this.field_96225_q) ++ { ++ this.drawCenteredString(this.fontRenderer, this.field_96226_p, this.width / 2, 100, 16711680); ++ } ++ ++ this.field_96227_a.drawTextBox(); ++ super.drawScreen(par1, par2, par3); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenLongRunningTask.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,126 ---- ++ package net.minecraft.src; ++ ++ import java.util.ArrayList; ++ import java.util.Collections; ++ ++ public class GuiScreenLongRunningTask extends GuiScreen ++ { ++ private final int field_96213_b = 666; ++ private final GuiScreen previousScreen; ++ private final Thread taskThread; ++ private volatile String message = ""; ++ private volatile boolean taskFailed; ++ private volatile String failedMessage; ++ ++ /** ++ * Set to true when back button is clicked, or any other button with ID 666 ++ */ ++ private volatile boolean screenWasClosed; ++ ++ /** Incremented every tick, used to display progress indicator. */ ++ private int progressCounter; ++ ++ /** The long running task this GUI is showing the progress of. */ ++ private TaskLongRunning task; ++ public static final String[] PROGRESS_TEXT = new String[] {"\u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192", "_ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e", "_ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026", "_ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020", "_ _ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021", "_ _ _ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6", "_ _ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021", "_ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020", "_ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026", "_ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e", "\u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192", "\u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _", "\u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _", "\u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _", "\u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _ _", "\u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _ _ _", "\u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _ _", "\u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _", "\u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _", "\u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _"}; ++ ++ public GuiScreenLongRunningTask(Minecraft par1Minecraft, GuiScreen par2GuiScreen, TaskLongRunning par3TaskLongRunning) ++ { ++ super.buttonList = Collections.synchronizedList(new ArrayList()); ++ this.mc = par1Minecraft; ++ this.previousScreen = par2GuiScreen; ++ this.task = par3TaskLongRunning; ++ par3TaskLongRunning.setGUI(this); ++ this.taskThread = new Thread(par3TaskLongRunning); ++ } ++ ++ public void func_98117_g() ++ { ++ this.taskThread.start(); ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ super.updateScreen(); ++ ++this.progressCounter; ++ this.task.updateScreen(); ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) {} ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.task.initGUI(); ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ if (par1GuiButton.id == 666) ++ { ++ this.screenWasClosed = true; ++ this.mc.displayGuiScreen(this.previousScreen); ++ } ++ ++ this.task.buttonClicked(par1GuiButton); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.drawCenteredString(this.fontRenderer, this.message, this.width / 2, this.height / 2 - 50, 16777215); ++ this.drawCenteredString(this.fontRenderer, "", this.width / 2, this.height / 2 - 10, 16777215); ++ ++ if (!this.taskFailed) ++ { ++ this.drawCenteredString(this.fontRenderer, PROGRESS_TEXT[this.progressCounter % PROGRESS_TEXT.length], this.width / 2, this.height / 2 + 15, 8421504); ++ } ++ ++ if (this.taskFailed) ++ { ++ this.drawCenteredString(this.fontRenderer, this.failedMessage, this.width / 2, this.height / 2 + 15, 16711680); ++ } ++ ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ public void setFailedMessage(String par1Str) ++ { ++ this.taskFailed = true; ++ this.failedMessage = par1Str; ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(666, this.width / 2 - 100, this.height / 4 + 120 + 12, "Back")); ++ } ++ ++ public Minecraft func_96208_g() ++ { ++ return this.mc; ++ } ++ ++ public void setMessage(String par1Str) ++ { ++ this.message = par1Str; ++ } ++ ++ /** ++ * Returns the value of screenWasClosed ++ */ ++ public boolean wasScreenClosed() ++ { ++ return this.screenWasClosed; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenMcoWorldTemplate.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,155 ---- ++ package net.minecraft.src; ++ ++ import java.util.Collections; ++ import java.util.List; ++ import org.lwjgl.input.Keyboard; ++ ++ public class GuiScreenMcoWorldTemplate extends GuiScreen ++ { ++ private final ScreenWithCallback field_110401_a; ++ private WorldTemplate field_110398_b; ++ private List field_110399_c = Collections.emptyList(); ++ private GuiScreenMcoWorldTemplateSelectionList field_110396_d; ++ private int field_110397_e = -1; ++ private GuiButton field_110400_p; ++ ++ public GuiScreenMcoWorldTemplate(ScreenWithCallback par1ScreenWithCallback, WorldTemplate par2WorldTemplate) ++ { ++ this.field_110401_a = par1ScreenWithCallback; ++ this.field_110398_b = par2WorldTemplate; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ Keyboard.enableRepeatEvents(true); ++ this.buttonList.clear(); ++ this.field_110396_d = new GuiScreenMcoWorldTemplateSelectionList(this); ++ (new GuiScreenMcoWorldTemplateDownloadThread(this)).start(); ++ this.func_110385_g(); ++ } ++ ++ private void func_110385_g() ++ { ++ this.buttonList.add(new GuiButton(0, this.width / 2 + 6, this.height - 52, 153, 20, I18n.getString("gui.cancel"))); ++ this.buttonList.add(this.field_110400_p = new GuiButton(1, this.width / 2 - 154, this.height - 52, 153, 20, I18n.getString("mco.template.button.select"))); ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ super.updateScreen(); ++ } ++ ++ /** ++ * 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 == 1) ++ { ++ this.func_110394_h(); ++ } ++ else if (par1GuiButton.id == 0) ++ { ++ this.field_110401_a.func_110354_a((Object)null); ++ this.mc.displayGuiScreen(this.field_110401_a); ++ } ++ else ++ { ++ this.field_110396_d.actionPerformed(par1GuiButton); ++ } ++ } ++ } ++ ++ private void func_110394_h() ++ { ++ if (this.field_110397_e >= 0 && this.field_110397_e < this.field_110399_c.size()) ++ { ++ this.field_110401_a.func_110354_a(this.field_110399_c.get(this.field_110397_e)); ++ this.mc.displayGuiScreen(this.field_110401_a); ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.field_110396_d.drawScreen(par1, par2, par3); ++ this.drawCenteredString(this.fontRenderer, I18n.getString("mco.template.title"), this.width / 2, 20, 16777215); ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ static Minecraft func_110382_a(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) ++ { ++ return par0GuiScreenMcoWorldTemplate.mc; ++ } ++ ++ static List func_110388_a(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate, List par1List) ++ { ++ return par0GuiScreenMcoWorldTemplate.field_110399_c = par1List; ++ } ++ ++ static Minecraft func_110392_b(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) ++ { ++ return par0GuiScreenMcoWorldTemplate.mc; ++ } ++ ++ static Minecraft func_130066_c(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) ++ { ++ return par0GuiScreenMcoWorldTemplate.mc; ++ } ++ ++ static List func_110395_c(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) ++ { ++ return par0GuiScreenMcoWorldTemplate.field_110399_c; ++ } ++ ++ static int func_130064_a(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate, int par1) ++ { ++ return par0GuiScreenMcoWorldTemplate.field_110397_e = par1; ++ } ++ ++ static WorldTemplate func_130065_a(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate, WorldTemplate par1WorldTemplate) ++ { ++ return par0GuiScreenMcoWorldTemplate.field_110398_b = par1WorldTemplate; ++ } ++ ++ static WorldTemplate func_130067_e(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) ++ { ++ return par0GuiScreenMcoWorldTemplate.field_110398_b; ++ } ++ ++ static int func_130062_f(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) ++ { ++ return par0GuiScreenMcoWorldTemplate.field_110397_e; ++ } ++ ++ static FontRenderer func_110389_g(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) ++ { ++ return par0GuiScreenMcoWorldTemplate.fontRenderer; ++ } ++ ++ static FontRenderer func_110387_h(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) ++ { ++ return par0GuiScreenMcoWorldTemplate.fontRenderer; ++ } ++ ++ static FontRenderer func_110384_i(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) ++ { ++ return par0GuiScreenMcoWorldTemplate.fontRenderer; ++ } ++ ++ static FontRenderer func_130063_j(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) ++ { ++ return par0GuiScreenMcoWorldTemplate.fontRenderer; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenMcoWorldTemplateDownloadThread.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,25 ---- ++ package net.minecraft.src; ++ ++ class GuiScreenMcoWorldTemplateDownloadThread extends Thread ++ { ++ final GuiScreenMcoWorldTemplate field_111256_a; ++ ++ GuiScreenMcoWorldTemplateDownloadThread(GuiScreenMcoWorldTemplate par1GuiScreenMcoWorldTemplate) ++ { ++ this.field_111256_a = par1GuiScreenMcoWorldTemplate; ++ } ++ ++ public void run() ++ { ++ McoClient var1 = new McoClient(GuiScreenMcoWorldTemplate.func_110382_a(this.field_111256_a).getSession()); ++ ++ try ++ { ++ GuiScreenMcoWorldTemplate.func_110388_a(this.field_111256_a, var1.func_111231_d().field_110736_a); ++ } ++ catch (ExceptionMcoService var3) ++ { ++ GuiScreenMcoWorldTemplate.func_110392_b(this.field_111256_a).getLogAgent().logSevere(var3.toString()); ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenMcoWorldTemplateSelectionList.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,71 ---- ++ package net.minecraft.src; ++ ++ class GuiScreenMcoWorldTemplateSelectionList extends GuiScreenSelectLocation ++ { ++ final GuiScreenMcoWorldTemplate field_111245_a; ++ ++ public GuiScreenMcoWorldTemplateSelectionList(GuiScreenMcoWorldTemplate par1GuiScreenMcoWorldTemplate) ++ { ++ super(GuiScreenMcoWorldTemplate.func_130066_c(par1GuiScreenMcoWorldTemplate), par1GuiScreenMcoWorldTemplate.width, par1GuiScreenMcoWorldTemplate.height, 32, par1GuiScreenMcoWorldTemplate.height - 64, 36); ++ this.field_111245_a = par1GuiScreenMcoWorldTemplate; ++ } ++ ++ /** ++ * Gets the size of the current slot list. ++ */ ++ protected int getSize() ++ { ++ return GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).size() + 1; ++ } ++ ++ /** ++ * the element in the slot that was clicked, boolean for wether it was double clicked or not ++ */ ++ protected void elementClicked(int par1, boolean par2) ++ { ++ if (par1 < GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).size()) ++ { ++ GuiScreenMcoWorldTemplate.func_130064_a(this.field_111245_a, par1); ++ GuiScreenMcoWorldTemplate.func_130065_a(this.field_111245_a, (WorldTemplate)null); ++ } ++ } ++ ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) ++ { ++ return GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).size() == 0 ? false : (par1 >= GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).size() ? false : (GuiScreenMcoWorldTemplate.func_130067_e(this.field_111245_a) != null ? GuiScreenMcoWorldTemplate.func_130067_e(this.field_111245_a).field_110732_b.equals(((WorldTemplate)GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).get(par1)).field_110732_b) : par1 == GuiScreenMcoWorldTemplate.func_130062_f(this.field_111245_a))); ++ } ++ ++ protected boolean func_104086_b(int par1) ++ { ++ return false; ++ } ++ ++ protected int func_130003_b() ++ { ++ return this.getSize() * 36; ++ } ++ ++ protected void func_130004_c() ++ { ++ this.field_111245_a.drawDefaultBackground(); ++ } ++ ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) ++ { ++ if (par1 < GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).size()) ++ { ++ this.func_111244_b(par1, par2, par3, par4, par5Tessellator); ++ } ++ } ++ ++ private void func_111244_b(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) ++ { ++ WorldTemplate var6 = (WorldTemplate)GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).get(par1); ++ this.field_111245_a.drawString(GuiScreenMcoWorldTemplate.func_110389_g(this.field_111245_a), var6.field_110732_b, par2 + 2, par3 + 1, 16777215); ++ this.field_111245_a.drawString(GuiScreenMcoWorldTemplate.func_110387_h(this.field_111245_a), var6.field_110731_d, par2 + 2, par3 + 12, 7105644); ++ this.field_111245_a.drawString(GuiScreenMcoWorldTemplate.func_110384_i(this.field_111245_a), var6.field_110733_c, par2 + 2 + 207 - GuiScreenMcoWorldTemplate.func_130063_j(this.field_111245_a).getStringWidth(var6.field_110733_c), par3 + 1, 5000268); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenOnlineServers.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,774 ---- ++ package net.minecraft.src; ++ ++ import com.google.common.collect.Lists; ++ import java.io.DataInputStream; ++ import java.io.DataOutputStream; ++ import java.io.IOException; ++ import java.net.InetSocketAddress; ++ import java.net.Socket; ++ import java.util.Iterator; ++ import java.util.List; ++ import org.lwjgl.input.Keyboard; ++ import org.lwjgl.opengl.GL11; ++ ++ public class GuiScreenOnlineServers extends GuiScreen ++ { ++ private static final ResourceLocation field_130039_a = new ResourceLocation("textures/gui/widgets.png"); ++ private GuiScreen field_96188_a; ++ private GuiSlotOnlineServerList field_96186_b; ++ private static int field_96187_c; ++ private static final Object field_96185_d = new Object(); ++ private long field_96189_n = -1L; ++ private GuiButton field_96190_o; ++ private GuiButton field_96198_p; ++ private GuiButtonLink field_96197_q; ++ private GuiButton field_96196_r; ++ private String field_96195_s; ++ private static McoServerList field_96194_t = new McoServerList(); ++ private boolean field_96193_u; ++ private List field_96192_v = Lists.newArrayList(); ++ private volatile int field_96199_x = 0; ++ private Long field_102019_y; ++ private int field_104044_y; ++ ++ public GuiScreenOnlineServers(GuiScreen par1GuiScreen) ++ { ++ this.field_96188_a = par1GuiScreen; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ Keyboard.enableRepeatEvents(true); ++ this.buttonList.clear(); ++ field_96194_t.func_130129_a(this.mc.getSession()); ++ ++ if (!this.field_96193_u) ++ { ++ this.field_96193_u = true; ++ this.field_96186_b = new GuiSlotOnlineServerList(this); ++ } ++ else ++ { ++ this.field_96186_b.func_104084_a(this.width, this.height, 32, this.height - 64); ++ } ++ ++ this.func_96178_g(); ++ } ++ ++ public void func_96178_g() ++ { ++ this.buttonList.add(this.field_96196_r = new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, I18n.getString("mco.selectServer.play"))); ++ this.buttonList.add(this.field_96198_p = new GuiButton(2, this.width / 2 - 48, this.height - 52, 100, 20, I18n.getString("mco.selectServer.create"))); ++ this.buttonList.add(this.field_96190_o = new GuiButton(3, this.width / 2 + 58, this.height - 52, 100, 20, I18n.getString("mco.selectServer.configure"))); ++ this.buttonList.add(this.field_96197_q = new GuiButtonLink(4, this.width / 2 - 154, this.height - 28, 154, 20, I18n.getString("mco.selectServer.moreinfo"))); ++ this.buttonList.add(new GuiButton(0, this.width / 2 + 6, this.height - 28, 153, 20, I18n.getString("gui.cancel"))); ++ McoServer var1 = this.func_140030_b(this.field_96189_n); ++ this.field_96196_r.enabled = var1 != null && var1.field_96404_d.equals("OPEN") && !var1.field_98166_h; ++ this.field_96198_p.enabled = this.field_96199_x > 0; ++ ++ if (var1 != null && !var1.field_96405_e.equals(this.mc.getSession().getUsername())) ++ { ++ this.field_96190_o.displayString = I18n.getString("mco.selectServer.leave"); ++ } ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ super.updateScreen(); ++ ++this.field_104044_y; ++ ++ if (field_96194_t.func_130127_a()) ++ { ++ List var1 = field_96194_t.func_98252_c(); ++ Iterator var2 = var1.iterator(); ++ ++ while (var2.hasNext()) ++ { ++ McoServer var3 = (McoServer)var2.next(); ++ Iterator var4 = this.field_96192_v.iterator(); ++ ++ while (var4.hasNext()) ++ { ++ McoServer var5 = (McoServer)var4.next(); ++ ++ if (var3.field_96408_a == var5.field_96408_a) ++ { ++ var3.func_96401_a(var5); ++ ++ if (this.field_102019_y != null && this.field_102019_y.longValue() == var3.field_96408_a) ++ { ++ this.field_102019_y = null; ++ var3.field_96411_l = false; ++ } ++ ++ break; ++ } ++ } ++ } ++ ++ this.field_96199_x = field_96194_t.func_140056_e(); ++ this.field_96192_v = var1; ++ field_96194_t.func_98250_b(); ++ } ++ ++ this.field_96198_p.enabled = this.field_96199_x > 0; ++ } ++ ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ ++ public void onGuiClosed() ++ { ++ Keyboard.enableRepeatEvents(false); ++ } ++ ++ /** ++ * 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 == 1) ++ { ++ this.func_140032_e(this.field_96189_n); ++ } ++ else if (par1GuiButton.id == 3) ++ { ++ this.func_140019_s(); ++ } ++ else if (par1GuiButton.id == 0) ++ { ++ field_96194_t.func_98248_d(); ++ this.mc.displayGuiScreen(this.field_96188_a); ++ } ++ else if (par1GuiButton.id == 2) ++ { ++ field_96194_t.func_98248_d(); ++ this.mc.displayGuiScreen(new GuiScreenCreateOnlineWorld(this)); ++ } ++ else if (par1GuiButton.id == 4) ++ { ++ this.field_96197_q.func_96135_a("http://realms.minecraft.net/"); ++ } ++ else ++ { ++ this.field_96186_b.actionPerformed(par1GuiButton); ++ } ++ } ++ } ++ ++ private void func_140019_s() ++ { ++ McoServer var1 = this.func_140030_b(this.field_96189_n); ++ ++ if (var1 != null) ++ { ++ if (this.mc.getSession().getUsername().equals(var1.field_96405_e)) ++ { ++ McoServer var2 = this.func_98086_a(var1.field_96408_a); ++ ++ if (var2 != null) ++ { ++ field_96194_t.func_98248_d(); ++ this.mc.displayGuiScreen(new GuiScreenConfigureWorld(this, var2)); ++ } ++ } ++ else ++ { ++ String var4 = I18n.getString("mco.configure.world.leave.question.line1"); ++ String var3 = I18n.getString("mco.configure.world.leave.question.line2"); ++ this.mc.displayGuiScreen(new GuiScreenConfirmation(this, GuiScreenConfirmationType.Info, var4, var3, 3)); ++ } ++ } ++ } ++ ++ private McoServer func_140030_b(long par1) ++ { ++ Iterator var3 = this.field_96192_v.iterator(); ++ McoServer var4; ++ ++ do ++ { ++ if (!var3.hasNext()) ++ { ++ return null; ++ } ++ ++ var4 = (McoServer)var3.next(); ++ } ++ while (var4.field_96408_a != par1); ++ ++ return var4; ++ } ++ ++ private int func_140009_c(long par1) ++ { ++ for (int var3 = 0; var3 < this.field_96192_v.size(); ++var3) ++ { ++ if (((McoServer)this.field_96192_v.get(var3)).field_96408_a == par1) ++ { ++ return var3; ++ } ++ } ++ ++ return -1; ++ } ++ ++ public void confirmClicked(boolean par1, int par2) ++ { ++ if (par2 == 3 && par1) ++ { ++ (new ThreadOnlineScreen(this)).start(); ++ } ++ ++ this.mc.displayGuiScreen(this); ++ } ++ ++ private void func_140012_t() ++ { ++ int var1 = this.func_140009_c(this.field_96189_n); ++ ++ if (this.field_96192_v.size() - 1 == var1) ++ { ++ --var1; ++ } ++ ++ if (this.field_96192_v.size() == 0) ++ { ++ var1 = -1; ++ } ++ ++ if (var1 >= 0 && var1 < this.field_96192_v.size()) ++ { ++ this.field_96189_n = ((McoServer)this.field_96192_v.get(var1)).field_96408_a; ++ } ++ } ++ ++ public void func_102018_a(long par1) ++ { ++ this.field_96189_n = -1L; ++ this.field_102019_y = Long.valueOf(par1); ++ } ++ ++ private McoServer func_98086_a(long par1) ++ { ++ McoClient var3 = new McoClient(this.mc.getSession()); ++ ++ try ++ { ++ return var3.func_98176_a(par1); ++ } ++ catch (ExceptionMcoService var5) ++ { ++ this.mc.getLogAgent().logSevere(var5.toString()); ++ } ++ catch (IOException var6) ++ { ++ this.mc.getLogAgent().logWarning("Realms: could not parse response"); ++ } ++ ++ return null; ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) ++ { ++ if (par2 == 59) ++ { ++ this.mc.gameSettings.hideServerAddress = !this.mc.gameSettings.hideServerAddress; ++ this.mc.gameSettings.saveOptions(); ++ } ++ else ++ { ++ if (par2 != 28 && par2 != 156) ++ { ++ super.keyTyped(par1, par2); ++ } ++ else ++ { ++ this.actionPerformed((GuiButton)this.buttonList.get(0)); ++ } ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.field_96195_s = null; ++ this.drawDefaultBackground(); ++ this.field_96186_b.drawScreen(par1, par2, par3); ++ this.drawCenteredString(this.fontRenderer, I18n.getString("mco.title"), this.width / 2, 20, 16777215); ++ super.drawScreen(par1, par2, par3); ++ ++ if (this.field_96195_s != null) ++ { ++ this.func_96165_a(this.field_96195_s, par1, par2); ++ } ++ ++ this.func_130038_b(par1, par2); ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) ++ { ++ super.mouseClicked(par1, par2, par3); ++ ++ if (this.func_130037_c(par1, par2) && field_96194_t.func_130124_d() != 0) ++ { ++ GuiScreenPendingInvitation var4 = new GuiScreenPendingInvitation(this); ++ this.mc.displayGuiScreen(var4); ++ } ++ } ++ ++ private void func_130038_b(int par1, int par2) ++ { ++ int var3 = field_96194_t.func_130124_d(); ++ boolean var4 = this.func_130037_c(par1, par2); ++ this.mc.getTextureManager().bindTexture(field_130039_a); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glPushMatrix(); ++ this.drawTexturedModalRect(this.width / 2 + 58, 15, var4 ? 166 : 182, 22, 16, 16); ++ GL11.glPopMatrix(); ++ int var5; ++ int var6; ++ ++ if (var3 != 0) ++ { ++ var5 = 198 + (Math.min(var3, 6) - 1) * 8; ++ var6 = (int)(Math.max(0.0F, Math.max(MathHelper.sin((float)(10 + this.field_104044_y) * 0.57F), MathHelper.cos((float)this.field_104044_y * 0.35F))) * -6.0F); ++ this.mc.getTextureManager().bindTexture(field_130039_a); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glPushMatrix(); ++ this.drawTexturedModalRect(this.width / 2 + 58 + 4, 19 + var6, var5, 22, 8, 8); ++ GL11.glPopMatrix(); ++ } ++ ++ if (var4 && var3 != 0) ++ { ++ var5 = par1 + 12; ++ var6 = par2 - 12; ++ String var7 = I18n.getString("mco.invites.pending"); ++ int var8 = this.fontRenderer.getStringWidth(var7); ++ this.drawGradientRect(var5 - 3, var6 - 3, var5 + var8 + 3, var6 + 8 + 3, -1073741824, -1073741824); ++ this.fontRenderer.drawStringWithShadow(var7, var5, var6, -1); ++ } ++ } ++ ++ private boolean func_130037_c(int par1, int par2) ++ { ++ int var3 = this.width / 2 + 56; ++ int var4 = this.width / 2 + 78; ++ byte var5 = 13; ++ byte var6 = 27; ++ return var3 <= par1 && par1 <= var4 && var5 <= par2 && par2 <= var6; ++ } ++ ++ private void func_140032_e(long par1) ++ { ++ McoServer var3 = this.func_140030_b(par1); ++ ++ if (var3 != null) ++ { ++ field_96194_t.func_98248_d(); ++ GuiScreenLongRunningTask var4 = new GuiScreenLongRunningTask(this.mc, this, new TaskOnlineConnect(this, var3)); ++ var4.func_98117_g(); ++ this.mc.displayGuiScreen(var4); ++ } ++ } ++ ++ private void func_101008_c(int par1, int par2, int par3, int par4) ++ { ++ this.mc.getTextureManager().bindTexture(field_130039_a); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glPushMatrix(); ++ GL11.glScalef(0.5F, 0.5F, 0.5F); ++ this.drawTexturedModalRect(par1 * 2, par2 * 2, 191, 0, 16, 15); ++ GL11.glPopMatrix(); ++ ++ if (par3 >= par1 && par3 <= par1 + 9 && par4 >= par2 && par4 <= par2 + 9) ++ { ++ this.field_96195_s = I18n.getString("mco.selectServer.expired"); ++ } ++ } ++ ++ private void func_104039_b(int par1, int par2, int par3, int par4, int par5) ++ { ++ if (this.field_104044_y % 20 < 10) ++ { ++ this.mc.getTextureManager().bindTexture(field_130039_a); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glPushMatrix(); ++ GL11.glScalef(0.5F, 0.5F, 0.5F); ++ this.drawTexturedModalRect(par1 * 2, par2 * 2, 207, 0, 16, 15); ++ GL11.glPopMatrix(); ++ } ++ ++ if (par3 >= par1 && par3 <= par1 + 9 && par4 >= par2 && par4 <= par2 + 9) ++ { ++ if (par5 == 0) ++ { ++ this.field_96195_s = I18n.getString("mco.selectServer.expires.soon"); ++ } ++ else if (par5 == 1) ++ { ++ this.field_96195_s = I18n.getString("mco.selectServer.expires.day"); ++ } ++ else ++ { ++ this.field_96195_s = I18n.getStringParams("mco.selectServer.expires.days", new Object[] {Integer.valueOf(par5)}); ++ } ++ } ++ } ++ ++ private void func_101006_d(int par1, int par2, int par3, int par4) ++ { ++ this.mc.getTextureManager().bindTexture(field_130039_a); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glPushMatrix(); ++ GL11.glScalef(0.5F, 0.5F, 0.5F); ++ this.drawTexturedModalRect(par1 * 2, par2 * 2, 207, 0, 16, 15); ++ GL11.glPopMatrix(); ++ ++ if (par3 >= par1 && par3 <= par1 + 9 && par4 >= par2 && par4 <= par2 + 9) ++ { ++ this.field_96195_s = I18n.getString("mco.selectServer.open"); ++ } ++ } ++ ++ private void func_101001_e(int par1, int par2, int par3, int par4) ++ { ++ this.mc.getTextureManager().bindTexture(field_130039_a); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glPushMatrix(); ++ GL11.glScalef(0.5F, 0.5F, 0.5F); ++ this.drawTexturedModalRect(par1 * 2, par2 * 2, 223, 0, 16, 15); ++ GL11.glPopMatrix(); ++ ++ if (par3 >= par1 && par3 <= par1 + 9 && par4 >= par2 && par4 <= par2 + 9) ++ { ++ this.field_96195_s = I18n.getString("mco.selectServer.closed"); ++ } ++ } ++ ++ protected void func_96165_a(String par1Str, int par2, int par3) ++ { ++ if (par1Str != null) ++ { ++ int var4 = par2 + 12; ++ int var5 = par3 - 12; ++ int var6 = this.fontRenderer.getStringWidth(par1Str); ++ this.drawGradientRect(var4 - 3, var5 - 3, var4 + var6 + 3, var5 + 8 + 3, -1073741824, -1073741824); ++ this.fontRenderer.drawStringWithShadow(par1Str, var4, var5, -1); ++ } ++ } ++ ++ private void func_96174_a(McoServer par1McoServer) throws IOException ++ { ++ if (par1McoServer.field_96414_k.equals("")) ++ { ++ par1McoServer.field_96414_k = EnumChatFormatting.GRAY + "" + 0; ++ } ++ ++ par1McoServer.field_96415_h = 78; ++ ServerAddress var2 = ServerAddress.func_78860_a(par1McoServer.field_96403_g); ++ Socket var3 = null; ++ DataInputStream var4 = null; ++ DataOutputStream var5 = null; ++ ++ try ++ { ++ var3 = new Socket(); ++ var3.setSoTimeout(3000); ++ var3.setTcpNoDelay(true); ++ var3.setTrafficClass(18); ++ var3.connect(new InetSocketAddress(var2.getIP(), var2.getPort()), 3000); ++ var4 = new DataInputStream(var3.getInputStream()); ++ var5 = new DataOutputStream(var3.getOutputStream()); ++ var5.write(254); ++ var5.write(1); ++ ++ if (var4.read() != 255) ++ { ++ throw new IOException("Bad message"); ++ } ++ ++ String var6 = Packet.readString(var4, 256); ++ char[] var7 = var6.toCharArray(); ++ ++ for (int var8 = 0; var8 < var7.length; ++var8) ++ { ++ if (var7[var8] != 167 && var7[var8] != 0 && ChatAllowedCharacters.allowedCharacters.indexOf(var7[var8]) < 0) ++ { ++ var7[var8] = 63; ++ } ++ } ++ ++ var6 = new String(var7); ++ int var9; ++ int var10; ++ String[] var27; ++ ++ if (var6.startsWith("\u00a7") && var6.length() > 1) ++ { ++ var27 = var6.substring(1).split("\u0000"); ++ ++ if (MathHelper.parseIntWithDefault(var27[0], 0) == 1) ++ { ++ par1McoServer.field_96415_h = MathHelper.parseIntWithDefault(var27[1], par1McoServer.field_96415_h); ++ var9 = MathHelper.parseIntWithDefault(var27[4], 0); ++ var10 = MathHelper.parseIntWithDefault(var27[5], 0); ++ ++ if (var9 >= 0 && var10 >= 0) ++ { ++ par1McoServer.field_96414_k = EnumChatFormatting.GRAY + "" + var9; ++ } ++ else ++ { ++ par1McoServer.field_96414_k = "" + EnumChatFormatting.DARK_GRAY + "???"; ++ } ++ } ++ else ++ { ++ par1McoServer.field_96415_h = 79; ++ par1McoServer.field_96414_k = "" + EnumChatFormatting.DARK_GRAY + "???"; ++ } ++ } ++ else ++ { ++ var27 = var6.split("\u00a7"); ++ var6 = var27[0]; ++ var9 = -1; ++ var10 = -1; ++ ++ try ++ { ++ var9 = Integer.parseInt(var27[1]); ++ var10 = Integer.parseInt(var27[2]); ++ } ++ catch (Exception var25) ++ { ++ ; ++ } ++ ++ par1McoServer.field_96407_c = EnumChatFormatting.GRAY + var6; ++ ++ if (var9 >= 0 && var10 > 0) ++ { ++ par1McoServer.field_96414_k = EnumChatFormatting.GRAY + "" + var9; ++ } ++ else ++ { ++ par1McoServer.field_96414_k = "" + EnumChatFormatting.DARK_GRAY + "???"; ++ } ++ ++ par1McoServer.field_96415_h = 77; ++ } ++ } ++ finally ++ { ++ try ++ { ++ if (var4 != null) ++ { ++ var4.close(); ++ } ++ } ++ catch (Throwable var24) ++ { ++ ; ++ } ++ ++ try ++ { ++ if (var5 != null) ++ { ++ var5.close(); ++ } ++ } ++ catch (Throwable var23) ++ { ++ ; ++ } ++ ++ try ++ { ++ if (var3 != null) ++ { ++ var3.close(); ++ } ++ } ++ catch (Throwable var22) ++ { ++ ; ++ } ++ } ++ } ++ ++ static long func_140041_a(GuiScreenOnlineServers par0GuiScreenOnlineServers) ++ { ++ return par0GuiScreenOnlineServers.field_96189_n; ++ } ++ ++ static McoServer func_140011_a(GuiScreenOnlineServers par0GuiScreenOnlineServers, long par1) ++ { ++ return par0GuiScreenOnlineServers.func_140030_b(par1); ++ } ++ ++ static Minecraft func_98075_b(GuiScreenOnlineServers par0GuiScreenOnlineServers) ++ { ++ return par0GuiScreenOnlineServers.mc; ++ } ++ ++ static McoServerList func_140040_h() ++ { ++ return field_96194_t; ++ } ++ ++ static List func_140013_c(GuiScreenOnlineServers par0GuiScreenOnlineServers) ++ { ++ return par0GuiScreenOnlineServers.field_96192_v; ++ } ++ ++ static void func_140017_d(GuiScreenOnlineServers par0GuiScreenOnlineServers) ++ { ++ par0GuiScreenOnlineServers.func_140012_t(); ++ } ++ ++ static Minecraft func_98076_f(GuiScreenOnlineServers par0GuiScreenOnlineServers) ++ { ++ return par0GuiScreenOnlineServers.mc; ++ } ++ ++ static Minecraft func_140037_f(GuiScreenOnlineServers par0GuiScreenOnlineServers) ++ { ++ return par0GuiScreenOnlineServers.mc; ++ } ++ ++ static long func_140036_b(GuiScreenOnlineServers par0GuiScreenOnlineServers, long par1) ++ { ++ return par0GuiScreenOnlineServers.field_96189_n = par1; ++ } ++ ++ static Minecraft func_140015_g(GuiScreenOnlineServers par0GuiScreenOnlineServers) ++ { ++ return par0GuiScreenOnlineServers.mc; ++ } ++ ++ static GuiButton func_140038_h(GuiScreenOnlineServers par0GuiScreenOnlineServers) ++ { ++ return par0GuiScreenOnlineServers.field_96190_o; ++ } ++ ++ static GuiButton func_140033_i(GuiScreenOnlineServers par0GuiScreenOnlineServers) ++ { ++ return par0GuiScreenOnlineServers.field_96196_r; ++ } ++ ++ static void func_140008_c(GuiScreenOnlineServers par0GuiScreenOnlineServers, long par1) ++ { ++ par0GuiScreenOnlineServers.func_140032_e(par1); ++ } ++ ++ static int func_140027_d(GuiScreenOnlineServers par0GuiScreenOnlineServers, long par1) ++ { ++ return par0GuiScreenOnlineServers.func_140009_c(par1); ++ } ++ ++ static Minecraft func_104032_j(GuiScreenOnlineServers par0GuiScreenOnlineServers) ++ { ++ return par0GuiScreenOnlineServers.mc; ++ } ++ ++ static FontRenderer func_140023_k(GuiScreenOnlineServers par0GuiScreenOnlineServers) ++ { ++ return par0GuiScreenOnlineServers.fontRenderer; ++ } ++ ++ static void func_104031_c(GuiScreenOnlineServers par0GuiScreenOnlineServers, int par1, int par2, int par3, int par4) ++ { ++ par0GuiScreenOnlineServers.func_101008_c(par1, par2, par3, par4); ++ } ++ ++ static void func_140035_b(GuiScreenOnlineServers par0GuiScreenOnlineServers, int par1, int par2, int par3, int par4) ++ { ++ par0GuiScreenOnlineServers.func_101001_e(par1, par2, par3, par4); ++ } ++ ++ static Minecraft func_140014_l(GuiScreenOnlineServers par0GuiScreenOnlineServers) ++ { ++ return par0GuiScreenOnlineServers.mc; ++ } ++ ++ static void func_140031_a(GuiScreenOnlineServers par0GuiScreenOnlineServers, int par1, int par2, int par3, int par4, int par5) ++ { ++ par0GuiScreenOnlineServers.func_104039_b(par1, par2, par3, par4, par5); ++ } ++ ++ static void func_140020_c(GuiScreenOnlineServers par0GuiScreenOnlineServers, int par1, int par2, int par3, int par4) ++ { ++ par0GuiScreenOnlineServers.func_101006_d(par1, par2, par3, par4); ++ } ++ ++ static FontRenderer func_140039_m(GuiScreenOnlineServers par0GuiScreenOnlineServers) ++ { ++ return par0GuiScreenOnlineServers.fontRenderer; ++ } ++ ++ static FontRenderer func_98079_k(GuiScreenOnlineServers par0GuiScreenOnlineServers) ++ { ++ return par0GuiScreenOnlineServers.fontRenderer; ++ } ++ ++ static Object func_140029_i() ++ { ++ return field_96185_d; ++ } ++ ++ static int func_140018_j() ++ { ++ return field_96187_c; ++ } ++ ++ static int func_140016_k() ++ { ++ return field_96187_c++; ++ } ++ ++ static void func_140024_a(GuiScreenOnlineServers par0GuiScreenOnlineServers, McoServer par1McoServer) throws IOException ++ { ++ par0GuiScreenOnlineServers.func_96174_a(par1McoServer); ++ } ++ ++ static int func_140021_r() ++ { ++ return field_96187_c--; ++ } ++ ++ static FontRenderer func_110402_q(GuiScreenOnlineServers par0GuiScreenOnlineServers) ++ { ++ return par0GuiScreenOnlineServers.fontRenderer; ++ } ++ ++ static FontRenderer func_140010_p(GuiScreenOnlineServers par0GuiScreenOnlineServers) ++ { ++ return par0GuiScreenOnlineServers.fontRenderer; ++ } ++ ++ static Minecraft func_142023_q(GuiScreenOnlineServers par0GuiScreenOnlineServers) ++ { ++ return par0GuiScreenOnlineServers.mc; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenOnlineServersSubscreen.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,78 ---- ++ package net.minecraft.src; ++ ++ import java.util.ArrayList; ++ import java.util.List; ++ ++ public class GuiScreenOnlineServersSubscreen ++ { ++ private final int field_104074_g; ++ private final int field_104081_h; ++ private final int field_104082_i; ++ private final int field_104080_j; ++ List field_104079_a = new ArrayList(); ++ String[] field_104077_b; ++ String[] field_104078_c; ++ String[][] field_104075_d; ++ int field_104076_e; ++ int field_104073_f; ++ ++ public GuiScreenOnlineServersSubscreen(int par1, int par2, int par3, int par4, int par5, int par6) ++ { ++ this.field_104074_g = par1; ++ this.field_104081_h = par2; ++ this.field_104082_i = par3; ++ this.field_104080_j = par4; ++ this.field_104076_e = par5; ++ this.field_104073_f = par6; ++ this.func_104068_a(); ++ } ++ ++ private void func_104068_a() ++ { ++ this.func_104070_b(); ++ this.field_104079_a.add(new GuiButton(5005, this.field_104082_i, this.field_104080_j + 1, 212, 20, this.func_104072_c())); ++ this.field_104079_a.add(new GuiButton(5006, this.field_104082_i, this.field_104080_j + 25, 212, 20, this.func_104067_d())); ++ } ++ ++ private void func_104070_b() ++ { ++ this.field_104077_b = new String[] {I18n.getString("options.difficulty.peaceful"), I18n.getString("options.difficulty.easy"), I18n.getString("options.difficulty.normal"), I18n.getString("options.difficulty.hard")}; ++ this.field_104078_c = new String[] {I18n.getString("selectWorld.gameMode.survival"), I18n.getString("selectWorld.gameMode.creative"), I18n.getString("selectWorld.gameMode.adventure")}; ++ this.field_104075_d = new String[][] {{I18n.getString("selectWorld.gameMode.survival.line1"), I18n.getString("selectWorld.gameMode.survival.line2")}, {I18n.getString("selectWorld.gameMode.creative.line1"), I18n.getString("selectWorld.gameMode.creative.line2")}, {I18n.getString("selectWorld.gameMode.adventure.line1"), I18n.getString("selectWorld.gameMode.adventure.line2")}}; ++ } ++ ++ private String func_104072_c() ++ { ++ String var1 = I18n.getString("options.difficulty"); ++ return var1 + ": " + this.field_104077_b[this.field_104076_e]; ++ } ++ ++ private String func_104067_d() ++ { ++ String var1 = I18n.getString("selectWorld.gameMode"); ++ return var1 + ": " + this.field_104078_c[this.field_104073_f]; ++ } ++ ++ void func_104069_a(GuiButton par1GuiButton) ++ { ++ if (par1GuiButton.enabled) ++ { ++ if (par1GuiButton.id == 5005) ++ { ++ this.field_104076_e = (this.field_104076_e + 1) % this.field_104077_b.length; ++ par1GuiButton.displayString = this.func_104072_c(); ++ } ++ else if (par1GuiButton.id == 5006) ++ { ++ this.field_104073_f = (this.field_104073_f + 1) % this.field_104078_c.length; ++ par1GuiButton.displayString = this.func_104067_d(); ++ } ++ } ++ } ++ ++ public void func_104071_a(GuiScreen par1GuiScreen, FontRenderer par2FontRenderer) ++ { ++ par1GuiScreen.drawString(par2FontRenderer, this.field_104075_d[this.field_104073_f][0], this.field_104082_i, this.field_104080_j + 50, 10526880); ++ par1GuiScreen.drawString(par2FontRenderer, this.field_104075_d[this.field_104073_f][1], this.field_104082_i, this.field_104080_j + 60, 10526880); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenPendingInvitation.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,185 ---- ++ package net.minecraft.src; ++ ++ import com.google.common.collect.Lists; ++ import java.util.List; ++ import org.lwjgl.input.Keyboard; ++ ++ public class GuiScreenPendingInvitation extends GuiScreen ++ { ++ private final GuiScreen field_130061_a; ++ private GuiScreenPendingInvitationList field_130059_b; ++ private List field_130060_c = Lists.newArrayList(); ++ private int field_130058_d = -1; ++ ++ public GuiScreenPendingInvitation(GuiScreen par1GuiScreen) ++ { ++ this.field_130061_a = par1GuiScreen; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ Keyboard.enableRepeatEvents(true); ++ this.buttonList.clear(); ++ this.field_130059_b = new GuiScreenPendingInvitationList(this); ++ (new GuiScreenPendingInvitationINNER1(this)).start(); ++ this.func_130050_g(); ++ } ++ ++ private void func_130050_g() ++ { ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 154, this.height - 52, 153, 20, I18n.getString("mco.invites.button.accept"))); ++ this.buttonList.add(new GuiButton(2, this.width / 2 + 6, this.height - 52, 153, 20, I18n.getString("mco.invites.button.reject"))); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 75, this.height - 28, 153, 20, I18n.getString("gui.back"))); ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ super.updateScreen(); ++ } ++ ++ /** ++ * 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 == 1) ++ { ++ this.func_130051_i(); ++ } ++ else if (par1GuiButton.id == 0) ++ { ++ this.mc.displayGuiScreen(this.field_130061_a); ++ } ++ else if (par1GuiButton.id == 2) ++ { ++ this.func_130057_h(); ++ } ++ else ++ { ++ this.field_130059_b.actionPerformed(par1GuiButton); ++ } ++ } ++ } ++ ++ private void func_130057_h() ++ { ++ if (this.field_130058_d >= 0 && this.field_130058_d < this.field_130060_c.size()) ++ { ++ (new GuiScreenPendingInvitationINNER2(this)).start(); ++ } ++ } ++ ++ private void func_130051_i() ++ { ++ if (this.field_130058_d >= 0 && this.field_130058_d < this.field_130060_c.size()) ++ { ++ (new GuiScreenPendingInvitationINNER3(this)).start(); ++ } ++ } ++ ++ private void func_130047_j() ++ { ++ int var1 = this.field_130058_d; ++ ++ if (this.field_130060_c.size() - 1 == this.field_130058_d) ++ { ++ --this.field_130058_d; ++ } ++ ++ this.field_130060_c.remove(var1); ++ ++ if (this.field_130060_c.size() == 0) ++ { ++ this.field_130058_d = -1; ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.field_130059_b.drawScreen(par1, par2, par3); ++ this.drawCenteredString(this.fontRenderer, I18n.getString("mco.invites.title"), this.width / 2, 20, 16777215); ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ static Minecraft func_130048_a(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) ++ { ++ return par0GuiScreenPendingInvitation.mc; ++ } ++ ++ static List func_130043_a(GuiScreenPendingInvitation par0GuiScreenPendingInvitation, List par1List) ++ { ++ return par0GuiScreenPendingInvitation.field_130060_c = par1List; ++ } ++ ++ static Minecraft func_130044_b(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) ++ { ++ return par0GuiScreenPendingInvitation.mc; ++ } ++ ++ static Minecraft func_130041_c(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) ++ { ++ return par0GuiScreenPendingInvitation.mc; ++ } ++ ++ static int func_130049_d(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) ++ { ++ return par0GuiScreenPendingInvitation.field_130058_d; ++ } ++ ++ static List func_130042_e(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) ++ { ++ return par0GuiScreenPendingInvitation.field_130060_c; ++ } ++ ++ static void func_130040_f(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) ++ { ++ par0GuiScreenPendingInvitation.func_130047_j(); ++ } ++ ++ static Minecraft func_130056_g(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) ++ { ++ return par0GuiScreenPendingInvitation.mc; ++ } ++ ++ static Minecraft func_130046_h(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) ++ { ++ return par0GuiScreenPendingInvitation.mc; ++ } ++ ++ static Minecraft func_130055_i(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) ++ { ++ return par0GuiScreenPendingInvitation.mc; ++ } ++ ++ static Minecraft func_130054_j(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) ++ { ++ return par0GuiScreenPendingInvitation.mc; ++ } ++ ++ static int func_130053_a(GuiScreenPendingInvitation par0GuiScreenPendingInvitation, int par1) ++ { ++ return par0GuiScreenPendingInvitation.field_130058_d = par1; ++ } ++ ++ static FontRenderer func_130045_k(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) ++ { ++ return par0GuiScreenPendingInvitation.fontRenderer; ++ } ++ ++ static FontRenderer func_130052_l(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) ++ { ++ return par0GuiScreenPendingInvitation.fontRenderer; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenPendingInvitationINNER1.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,25 ---- ++ package net.minecraft.src; ++ ++ class GuiScreenPendingInvitationINNER1 extends Thread ++ { ++ final GuiScreenPendingInvitation field_130121_a; ++ ++ GuiScreenPendingInvitationINNER1(GuiScreenPendingInvitation par1GuiScreenPendingInvitation) ++ { ++ this.field_130121_a = par1GuiScreenPendingInvitation; ++ } ++ ++ public void run() ++ { ++ McoClient var1 = new McoClient(GuiScreenPendingInvitation.func_130048_a(this.field_130121_a).getSession()); ++ ++ try ++ { ++ GuiScreenPendingInvitation.func_130043_a(this.field_130121_a, var1.func_130108_f().field_130096_a); ++ } ++ catch (ExceptionMcoService var3) ++ { ++ GuiScreenPendingInvitation.func_130044_b(this.field_130121_a).getLogAgent().logSevere(var3.toString()); ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenPendingInvitationINNER2.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,25 ---- ++ package net.minecraft.src; ++ ++ class GuiScreenPendingInvitationINNER2 extends Thread ++ { ++ final GuiScreenPendingInvitation field_130132_a; ++ ++ GuiScreenPendingInvitationINNER2(GuiScreenPendingInvitation par1GuiScreenPendingInvitation) ++ { ++ this.field_130132_a = par1GuiScreenPendingInvitation; ++ } ++ ++ public void run() ++ { ++ try ++ { ++ McoClient var1 = new McoClient(GuiScreenPendingInvitation.func_130041_c(this.field_130132_a).getSession()); ++ var1.func_130109_b(((PendingInvite)GuiScreenPendingInvitation.func_130042_e(this.field_130132_a).get(GuiScreenPendingInvitation.func_130049_d(this.field_130132_a))).field_130094_a); ++ GuiScreenPendingInvitation.func_130040_f(this.field_130132_a); ++ } ++ catch (ExceptionMcoService var2) ++ { ++ GuiScreenPendingInvitation.func_130056_g(this.field_130132_a).getLogAgent().logSevere(var2.toString()); ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenPendingInvitationINNER3.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,25 ---- ++ package net.minecraft.src; ++ ++ class GuiScreenPendingInvitationINNER3 extends Thread ++ { ++ final GuiScreenPendingInvitation field_130131_a; ++ ++ GuiScreenPendingInvitationINNER3(GuiScreenPendingInvitation par1GuiScreenPendingInvitation) ++ { ++ this.field_130131_a = par1GuiScreenPendingInvitation; ++ } ++ ++ public void run() ++ { ++ try ++ { ++ McoClient var1 = new McoClient(GuiScreenPendingInvitation.func_130046_h(this.field_130131_a).getSession()); ++ var1.func_130107_a(((PendingInvite)GuiScreenPendingInvitation.func_130042_e(this.field_130131_a).get(GuiScreenPendingInvitation.func_130049_d(this.field_130131_a))).field_130094_a); ++ GuiScreenPendingInvitation.func_130040_f(this.field_130131_a); ++ } ++ catch (ExceptionMcoService var2) ++ { ++ GuiScreenPendingInvitation.func_130055_i(this.field_130131_a).getLogAgent().logSevere(var2.toString()); ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenPendingInvitationList.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,69 ---- ++ package net.minecraft.src; ++ ++ class GuiScreenPendingInvitationList extends GuiScreenSelectLocation ++ { ++ final GuiScreenPendingInvitation field_130120_a; ++ ++ public GuiScreenPendingInvitationList(GuiScreenPendingInvitation par1GuiScreenPendingInvitation) ++ { ++ super(GuiScreenPendingInvitation.func_130054_j(par1GuiScreenPendingInvitation), par1GuiScreenPendingInvitation.width, par1GuiScreenPendingInvitation.height, 32, par1GuiScreenPendingInvitation.height - 64, 36); ++ this.field_130120_a = par1GuiScreenPendingInvitation; ++ } ++ ++ /** ++ * Gets the size of the current slot list. ++ */ ++ protected int getSize() ++ { ++ return GuiScreenPendingInvitation.func_130042_e(this.field_130120_a).size() + 1; ++ } ++ ++ /** ++ * the element in the slot that was clicked, boolean for wether it was double clicked or not ++ */ ++ protected void elementClicked(int par1, boolean par2) ++ { ++ if (par1 < GuiScreenPendingInvitation.func_130042_e(this.field_130120_a).size()) ++ { ++ GuiScreenPendingInvitation.func_130053_a(this.field_130120_a, par1); ++ } ++ } ++ ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) ++ { ++ return par1 == GuiScreenPendingInvitation.func_130049_d(this.field_130120_a); ++ } ++ ++ protected boolean func_104086_b(int par1) ++ { ++ return false; ++ } ++ ++ protected int func_130003_b() ++ { ++ return this.getSize() * 36; ++ } ++ ++ protected void func_130004_c() ++ { ++ this.field_130120_a.drawDefaultBackground(); ++ } ++ ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) ++ { ++ if (par1 < GuiScreenPendingInvitation.func_130042_e(this.field_130120_a).size()) ++ { ++ this.func_130119_b(par1, par2, par3, par4, par5Tessellator); ++ } ++ } ++ ++ private void func_130119_b(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) ++ { ++ PendingInvite var6 = (PendingInvite)GuiScreenPendingInvitation.func_130042_e(this.field_130120_a).get(par1); ++ this.field_130120_a.drawString(GuiScreenPendingInvitation.func_130045_k(this.field_130120_a), var6.field_130092_b, par2 + 2, par3 + 1, 16777215); ++ this.field_130120_a.drawString(GuiScreenPendingInvitation.func_130052_l(this.field_130120_a), var6.field_130093_c, par2 + 2, par3 + 12, 7105644); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenResetWorld.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,173 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.input.Keyboard; ++ ++ public class GuiScreenResetWorld extends ScreenWithCallback ++ { ++ private GuiScreen field_96152_a; ++ private McoServer field_96150_b; ++ private GuiTextField field_96151_c; ++ private final int field_96149_d = 1; ++ private final int field_96153_n = 2; ++ private static int field_110360_p = 3; ++ private WorldTemplate field_110359_q; ++ private GuiButton field_96154_o; ++ ++ public GuiScreenResetWorld(GuiScreen par1GuiScreen, McoServer par2McoServer) ++ { ++ this.field_96152_a = par1GuiScreen; ++ this.field_96150_b = par2McoServer; ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ this.field_96151_c.updateCursorCounter(); ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ Keyboard.enableRepeatEvents(true); ++ this.buttonList.clear(); ++ this.buttonList.add(this.field_96154_o = new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, 97, 20, I18n.getString("mco.configure.world.buttons.reset"))); ++ this.buttonList.add(new GuiButton(2, this.width / 2 + 5, this.height / 4 + 120 + 12, 97, 20, I18n.getString("gui.cancel"))); ++ this.field_96151_c = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 99, 200, 20); ++ this.field_96151_c.setFocused(true); ++ this.field_96151_c.setMaxStringLength(32); ++ this.field_96151_c.setText(""); ++ ++ if (this.field_110359_q == null) ++ { ++ this.buttonList.add(new GuiButton(field_110360_p, this.width / 2 - 100, 125, 200, 20, I18n.getString("mco.template.default.name"))); ++ } ++ else ++ { ++ this.field_96151_c.setText(""); ++ this.field_96151_c.setEnabled(false); ++ this.field_96151_c.setFocused(false); ++ this.buttonList.add(new GuiButton(field_110360_p, this.width / 2 - 100, 125, 200, 20, I18n.getString("mco.template.name") + ": " + this.field_110359_q.field_110732_b)); ++ } ++ } ++ ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ ++ public void onGuiClosed() ++ { ++ Keyboard.enableRepeatEvents(false); ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) ++ { ++ this.field_96151_c.textboxKeyTyped(par1, par2); ++ ++ if (par2 == 28 || par2 == 156) ++ { ++ this.actionPerformed(this.field_96154_o); ++ } ++ } ++ ++ /** ++ * 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 == 2) ++ { ++ this.mc.displayGuiScreen(this.field_96152_a); ++ } ++ else if (par1GuiButton.id == 1) ++ { ++ String var2 = I18n.getString("mco.configure.world.reset.question.line1"); ++ String var3 = I18n.getString("mco.configure.world.reset.question.line2"); ++ this.mc.displayGuiScreen(new GuiScreenConfirmation(this, GuiScreenConfirmationType.Warning, var2, var3, 1)); ++ } ++ else if (par1GuiButton.id == field_110360_p) ++ { ++ this.mc.displayGuiScreen(new GuiScreenMcoWorldTemplate(this, this.field_110359_q)); ++ } ++ } ++ } ++ ++ public void confirmClicked(boolean par1, int par2) ++ { ++ if (par1 && par2 == 1) ++ { ++ this.func_140006_g(); ++ } ++ else ++ { ++ this.mc.displayGuiScreen(this); ++ } ++ } ++ ++ private void func_140006_g() ++ { ++ TaskResetWorld var1 = new TaskResetWorld(this, this.field_96150_b.field_96408_a, this.field_96151_c.getText(), this.field_110359_q); ++ GuiScreenLongRunningTask var2 = new GuiScreenLongRunningTask(this.mc, this.field_96152_a, var1); ++ var2.func_98117_g(); ++ this.mc.displayGuiScreen(var2); ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) ++ { ++ super.mouseClicked(par1, par2, par3); ++ this.field_96151_c.mouseClicked(par1, par2, par3); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.drawCenteredString(this.fontRenderer, I18n.getString("mco.reset.world.title"), this.width / 2, 17, 16777215); ++ this.drawCenteredString(this.fontRenderer, I18n.getString("mco.reset.world.warning"), this.width / 2, 56, 16711680); ++ this.drawString(this.fontRenderer, I18n.getString("mco.reset.world.seed"), this.width / 2 - 100, 86, 10526880); ++ this.field_96151_c.drawTextBox(); ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ void func_110358_a(WorldTemplate par1WorldTemplate) ++ { ++ this.field_110359_q = par1WorldTemplate; ++ } ++ ++ void func_110354_a(Object par1Obj) ++ { ++ this.func_110358_a((WorldTemplate)par1Obj); ++ } ++ ++ static GuiScreen func_96148_a(GuiScreenResetWorld par0GuiScreenResetWorld) ++ { ++ return par0GuiScreenResetWorld.field_96152_a; ++ } ++ ++ static Minecraft func_96147_b(GuiScreenResetWorld par0GuiScreenResetWorld) ++ { ++ return par0GuiScreenResetWorld.mc; ++ } ++ ++ static Minecraft func_130025_c(GuiScreenResetWorld par0GuiScreenResetWorld) ++ { ++ return par0GuiScreenResetWorld.mc; ++ } ++ ++ static Minecraft func_130024_d(GuiScreenResetWorld par0GuiScreenResetWorld) ++ { ++ return par0GuiScreenResetWorld.mc; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenSelectLocation.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,418 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.input.Mouse; ++ import org.lwjgl.opengl.GL11; ++ ++ public abstract class GuiScreenSelectLocation ++ { ++ private final Minecraft field_104092_f; ++ private int field_104093_g; ++ private int field_104105_h; ++ protected int field_104098_a; ++ protected int field_104096_b; ++ private int field_104106_i; ++ private int field_104103_j; ++ protected final int field_104097_c; ++ private int field_104104_k; ++ private int field_104101_l; ++ protected int field_104094_d; ++ protected int field_104095_e; ++ private float field_104102_m = -2.0F; ++ private float field_104099_n; ++ private float field_104100_o; ++ private int field_104111_p = -1; ++ private long field_104110_q; ++ private boolean field_104109_r = true; ++ private boolean field_104108_s; ++ private int field_104107_t; ++ ++ public GuiScreenSelectLocation(Minecraft par1Minecraft, int par2, int par3, int par4, int par5, int par6) ++ { ++ this.field_104092_f = par1Minecraft; ++ this.field_104093_g = par2; ++ this.field_104105_h = par3; ++ this.field_104098_a = par4; ++ this.field_104096_b = par5; ++ this.field_104097_c = par6; ++ this.field_104103_j = 0; ++ this.field_104106_i = par2; ++ } ++ ++ public void func_104084_a(int par1, int par2, int par3, int par4) ++ { ++ this.field_104093_g = par1; ++ this.field_104105_h = par2; ++ this.field_104098_a = par3; ++ this.field_104096_b = par4; ++ this.field_104103_j = 0; ++ this.field_104106_i = par1; ++ } ++ ++ /** ++ * Gets the size of the current slot list. ++ */ ++ protected abstract int getSize(); ++ ++ /** ++ * the element in the slot that was clicked, boolean for wether it was double clicked or not ++ */ ++ protected abstract void elementClicked(int var1, boolean var2); ++ ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected abstract boolean isSelected(int var1); ++ ++ protected abstract boolean func_104086_b(int var1); ++ ++ protected int func_130003_b() ++ { ++ return this.getSize() * this.field_104097_c + this.field_104107_t; ++ } ++ ++ protected abstract void func_130004_c(); ++ ++ protected abstract void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5); ++ ++ protected void func_104088_a(int par1, int par2, Tessellator par3Tessellator) {} ++ ++ protected void func_104089_a(int par1, int par2) {} ++ ++ protected void func_104087_b(int par1, int par2) {} ++ ++ private void func_104091_h() ++ { ++ int var1 = this.func_104085_d(); ++ ++ if (var1 < 0) ++ { ++ var1 /= 2; ++ } ++ ++ if (this.field_104100_o < 0.0F) ++ { ++ this.field_104100_o = 0.0F; ++ } ++ ++ if (this.field_104100_o > (float)var1) ++ { ++ this.field_104100_o = (float)var1; ++ } ++ } ++ ++ public int func_104085_d() ++ { ++ return this.func_130003_b() - (this.field_104096_b - this.field_104098_a - 4); ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ public void actionPerformed(GuiButton par1GuiButton) ++ { ++ if (par1GuiButton.enabled) ++ { ++ if (par1GuiButton.id == this.field_104104_k) ++ { ++ this.field_104100_o -= (float)(this.field_104097_c * 2 / 3); ++ this.field_104102_m = -2.0F; ++ this.func_104091_h(); ++ } ++ else if (par1GuiButton.id == this.field_104101_l) ++ { ++ this.field_104100_o += (float)(this.field_104097_c * 2 / 3); ++ this.field_104102_m = -2.0F; ++ this.func_104091_h(); ++ } ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.field_104094_d = par1; ++ this.field_104095_e = par2; ++ this.func_130004_c(); ++ int var4 = this.getSize(); ++ int var5 = this.func_104090_g(); ++ int var6 = var5 + 6; ++ int var9; ++ int var10; ++ int var11; ++ int var13; ++ int var20; ++ ++ if (Mouse.isButtonDown(0)) ++ { ++ if (this.field_104102_m == -1.0F) ++ { ++ boolean var7 = true; ++ ++ if (par2 >= this.field_104098_a && par2 <= this.field_104096_b) ++ { ++ int var8 = this.field_104093_g / 2 - 110; ++ var9 = this.field_104093_g / 2 + 110; ++ var10 = par2 - this.field_104098_a - this.field_104107_t + (int)this.field_104100_o - 4; ++ var11 = var10 / this.field_104097_c; ++ ++ if (par1 >= var8 && par1 <= var9 && var11 >= 0 && var10 >= 0 && var11 < var4) ++ { ++ boolean var12 = var11 == this.field_104111_p && Minecraft.getSystemTime() - this.field_104110_q < 250L; ++ this.elementClicked(var11, var12); ++ this.field_104111_p = var11; ++ this.field_104110_q = Minecraft.getSystemTime(); ++ } ++ else if (par1 >= var8 && par1 <= var9 && var10 < 0) ++ { ++ this.func_104089_a(par1 - var8, par2 - this.field_104098_a + (int)this.field_104100_o - 4); ++ var7 = false; ++ } ++ ++ if (par1 >= var5 && par1 <= var6) ++ { ++ this.field_104099_n = -1.0F; ++ var20 = this.func_104085_d(); ++ ++ if (var20 < 1) ++ { ++ var20 = 1; ++ } ++ ++ var13 = (int)((float)((this.field_104096_b - this.field_104098_a) * (this.field_104096_b - this.field_104098_a)) / (float)this.func_130003_b()); ++ ++ if (var13 < 32) ++ { ++ var13 = 32; ++ } ++ ++ if (var13 > this.field_104096_b - this.field_104098_a - 8) ++ { ++ var13 = this.field_104096_b - this.field_104098_a - 8; ++ } ++ ++ this.field_104099_n /= (float)(this.field_104096_b - this.field_104098_a - var13) / (float)var20; ++ } ++ else ++ { ++ this.field_104099_n = 1.0F; ++ } ++ ++ if (var7) ++ { ++ this.field_104102_m = (float)par2; ++ } ++ else ++ { ++ this.field_104102_m = -2.0F; ++ } ++ } ++ else ++ { ++ this.field_104102_m = -2.0F; ++ } ++ } ++ else if (this.field_104102_m >= 0.0F) ++ { ++ this.field_104100_o -= ((float)par2 - this.field_104102_m) * this.field_104099_n; ++ this.field_104102_m = (float)par2; ++ } ++ } ++ else ++ { ++ while (!this.field_104092_f.gameSettings.touchscreen && Mouse.next()) ++ { ++ int var16 = Mouse.getEventDWheel(); ++ ++ if (var16 != 0) ++ { ++ if (var16 > 0) ++ { ++ var16 = -1; ++ } ++ else if (var16 < 0) ++ { ++ var16 = 1; ++ } ++ ++ this.field_104100_o += (float)(var16 * this.field_104097_c / 2); ++ } ++ } ++ ++ this.field_104102_m = -1.0F; ++ } ++ ++ this.func_104091_h(); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glDisable(GL11.GL_FOG); ++ Tessellator var18 = Tessellator.instance; ++ this.field_104092_f.getTextureManager().bindTexture(Gui.optionsBackground); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ float var17 = 32.0F; ++ var18.startDrawingQuads(); ++ var18.setColorOpaque_I(2105376); ++ var18.addVertexWithUV((double)this.field_104103_j, (double)this.field_104096_b, 0.0D, (double)((float)this.field_104103_j / var17), (double)((float)(this.field_104096_b + (int)this.field_104100_o) / var17)); ++ var18.addVertexWithUV((double)this.field_104106_i, (double)this.field_104096_b, 0.0D, (double)((float)this.field_104106_i / var17), (double)((float)(this.field_104096_b + (int)this.field_104100_o) / var17)); ++ var18.addVertexWithUV((double)this.field_104106_i, (double)this.field_104098_a, 0.0D, (double)((float)this.field_104106_i / var17), (double)((float)(this.field_104098_a + (int)this.field_104100_o) / var17)); ++ var18.addVertexWithUV((double)this.field_104103_j, (double)this.field_104098_a, 0.0D, (double)((float)this.field_104103_j / var17), (double)((float)(this.field_104098_a + (int)this.field_104100_o) / var17)); ++ var18.draw(); ++ var9 = this.field_104093_g / 2 - 92 - 16; ++ var10 = this.field_104098_a + 4 - (int)this.field_104100_o; ++ ++ if (this.field_104108_s) ++ { ++ this.func_104088_a(var9, var10, var18); ++ } ++ ++ int var14; ++ ++ for (var11 = 0; var11 < var4; ++var11) ++ { ++ var20 = var10 + var11 * this.field_104097_c + this.field_104107_t; ++ var13 = this.field_104097_c - 4; ++ ++ if (var20 <= this.field_104096_b && var20 + var13 >= this.field_104098_a) ++ { ++ int var15; ++ ++ if (this.field_104109_r && this.func_104086_b(var11)) ++ { ++ var14 = this.field_104093_g / 2 - 110; ++ var15 = this.field_104093_g / 2 + 110; ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ var18.startDrawingQuads(); ++ var18.setColorOpaque_I(0); ++ var18.addVertexWithUV((double)var14, (double)(var20 + var13 + 2), 0.0D, 0.0D, 1.0D); ++ var18.addVertexWithUV((double)var15, (double)(var20 + var13 + 2), 0.0D, 1.0D, 1.0D); ++ var18.addVertexWithUV((double)var15, (double)(var20 - 2), 0.0D, 1.0D, 0.0D); ++ var18.addVertexWithUV((double)var14, (double)(var20 - 2), 0.0D, 0.0D, 0.0D); ++ var18.draw(); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ } ++ ++ if (this.field_104109_r && this.isSelected(var11)) ++ { ++ var14 = this.field_104093_g / 2 - 110; ++ var15 = this.field_104093_g / 2 + 110; ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ var18.startDrawingQuads(); ++ var18.setColorOpaque_I(8421504); ++ var18.addVertexWithUV((double)var14, (double)(var20 + var13 + 2), 0.0D, 0.0D, 1.0D); ++ var18.addVertexWithUV((double)var15, (double)(var20 + var13 + 2), 0.0D, 1.0D, 1.0D); ++ var18.addVertexWithUV((double)var15, (double)(var20 - 2), 0.0D, 1.0D, 0.0D); ++ var18.addVertexWithUV((double)var14, (double)(var20 - 2), 0.0D, 0.0D, 0.0D); ++ var18.setColorOpaque_I(0); ++ var18.addVertexWithUV((double)(var14 + 1), (double)(var20 + var13 + 1), 0.0D, 0.0D, 1.0D); ++ var18.addVertexWithUV((double)(var15 - 1), (double)(var20 + var13 + 1), 0.0D, 1.0D, 1.0D); ++ var18.addVertexWithUV((double)(var15 - 1), (double)(var20 - 1), 0.0D, 1.0D, 0.0D); ++ var18.addVertexWithUV((double)(var14 + 1), (double)(var20 - 1), 0.0D, 0.0D, 0.0D); ++ var18.draw(); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ } ++ ++ this.drawSlot(var11, var9, var20, var13, var18); ++ } ++ } ++ ++ GL11.glDisable(GL11.GL_DEPTH_TEST); ++ byte var19 = 4; ++ this.func_104083_b(0, this.field_104098_a, 255, 255); ++ this.func_104083_b(this.field_104096_b, this.field_104105_h, 255, 255); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ GL11.glDisable(GL11.GL_ALPHA_TEST); ++ GL11.glShadeModel(GL11.GL_SMOOTH); ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ var18.startDrawingQuads(); ++ var18.setColorRGBA_I(0, 0); ++ var18.addVertexWithUV((double)this.field_104103_j, (double)(this.field_104098_a + var19), 0.0D, 0.0D, 1.0D); ++ var18.addVertexWithUV((double)this.field_104106_i, (double)(this.field_104098_a + var19), 0.0D, 1.0D, 1.0D); ++ var18.setColorRGBA_I(0, 255); ++ var18.addVertexWithUV((double)this.field_104106_i, (double)this.field_104098_a, 0.0D, 1.0D, 0.0D); ++ var18.addVertexWithUV((double)this.field_104103_j, (double)this.field_104098_a, 0.0D, 0.0D, 0.0D); ++ var18.draw(); ++ var18.startDrawingQuads(); ++ var18.setColorRGBA_I(0, 255); ++ var18.addVertexWithUV((double)this.field_104103_j, (double)this.field_104096_b, 0.0D, 0.0D, 1.0D); ++ var18.addVertexWithUV((double)this.field_104106_i, (double)this.field_104096_b, 0.0D, 1.0D, 1.0D); ++ var18.setColorRGBA_I(0, 0); ++ var18.addVertexWithUV((double)this.field_104106_i, (double)(this.field_104096_b - var19), 0.0D, 1.0D, 0.0D); ++ var18.addVertexWithUV((double)this.field_104103_j, (double)(this.field_104096_b - var19), 0.0D, 0.0D, 0.0D); ++ var18.draw(); ++ var20 = this.func_104085_d(); ++ ++ if (var20 > 0) ++ { ++ var13 = (this.field_104096_b - this.field_104098_a) * (this.field_104096_b - this.field_104098_a) / this.func_130003_b(); ++ ++ if (var13 < 32) ++ { ++ var13 = 32; ++ } ++ ++ if (var13 > this.field_104096_b - this.field_104098_a - 8) ++ { ++ var13 = this.field_104096_b - this.field_104098_a - 8; ++ } ++ ++ var14 = (int)this.field_104100_o * (this.field_104096_b - this.field_104098_a - var13) / var20 + this.field_104098_a; ++ ++ if (var14 < this.field_104098_a) ++ { ++ var14 = this.field_104098_a; ++ } ++ ++ var18.startDrawingQuads(); ++ var18.setColorRGBA_I(0, 255); ++ var18.addVertexWithUV((double)var5, (double)this.field_104096_b, 0.0D, 0.0D, 1.0D); ++ var18.addVertexWithUV((double)var6, (double)this.field_104096_b, 0.0D, 1.0D, 1.0D); ++ var18.addVertexWithUV((double)var6, (double)this.field_104098_a, 0.0D, 1.0D, 0.0D); ++ var18.addVertexWithUV((double)var5, (double)this.field_104098_a, 0.0D, 0.0D, 0.0D); ++ var18.draw(); ++ var18.startDrawingQuads(); ++ var18.setColorRGBA_I(8421504, 255); ++ var18.addVertexWithUV((double)var5, (double)(var14 + var13), 0.0D, 0.0D, 1.0D); ++ var18.addVertexWithUV((double)var6, (double)(var14 + var13), 0.0D, 1.0D, 1.0D); ++ var18.addVertexWithUV((double)var6, (double)var14, 0.0D, 1.0D, 0.0D); ++ var18.addVertexWithUV((double)var5, (double)var14, 0.0D, 0.0D, 0.0D); ++ var18.draw(); ++ var18.startDrawingQuads(); ++ var18.setColorRGBA_I(12632256, 255); ++ var18.addVertexWithUV((double)var5, (double)(var14 + var13 - 1), 0.0D, 0.0D, 1.0D); ++ var18.addVertexWithUV((double)(var6 - 1), (double)(var14 + var13 - 1), 0.0D, 1.0D, 1.0D); ++ var18.addVertexWithUV((double)(var6 - 1), (double)var14, 0.0D, 1.0D, 0.0D); ++ var18.addVertexWithUV((double)var5, (double)var14, 0.0D, 0.0D, 0.0D); ++ var18.draw(); ++ } ++ ++ this.func_104087_b(par1, par2); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ GL11.glShadeModel(GL11.GL_FLAT); ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ GL11.glDisable(GL11.GL_BLEND); ++ } ++ ++ protected int func_104090_g() ++ { ++ return this.field_104093_g / 2 + 124; ++ } ++ ++ private void func_104083_b(int par1, int par2, int par3, int par4) ++ { ++ Tessellator var5 = Tessellator.instance; ++ this.field_104092_f.getTextureManager().bindTexture(Gui.optionsBackground); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ float var6 = 32.0F; ++ var5.startDrawingQuads(); ++ var5.setColorRGBA_I(4210752, par4); ++ var5.addVertexWithUV(0.0D, (double)par2, 0.0D, 0.0D, (double)((float)par2 / var6)); ++ var5.addVertexWithUV((double)this.field_104093_g, (double)par2, 0.0D, (double)((float)this.field_104093_g / var6), (double)((float)par2 / var6)); ++ var5.setColorRGBA_I(4210752, par3); ++ var5.addVertexWithUV((double)this.field_104093_g, (double)par1, 0.0D, (double)((float)this.field_104093_g / var6), (double)((float)par1 / var6)); ++ var5.addVertexWithUV(0.0D, (double)par1, 0.0D, 0.0D, (double)((float)par1 / var6)); ++ var5.draw(); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenServerList.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,108 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.input.Keyboard; ++ ++ public class GuiScreenServerList extends GuiScreen ++ { ++ /** Needed a change as a local variable was conflicting on construct */ ++ private final GuiScreen guiScreen; ++ ++ /** Instance of ServerData. */ ++ private final ServerData theServerData; ++ private GuiTextField serverTextField; ++ ++ public GuiScreenServerList(GuiScreen par1GuiScreen, ServerData par2ServerData) ++ { ++ this.guiScreen = par1GuiScreen; ++ this.theServerData = par2ServerData; ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ this.serverTextField.updateCursorCounter(); ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ Keyboard.enableRepeatEvents(true); ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("selectServer.select"))); ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); ++ this.serverTextField = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 116, 200, 20); ++ this.serverTextField.setMaxStringLength(128); ++ this.serverTextField.setFocused(true); ++ this.serverTextField.setText(this.mc.gameSettings.lastServer); ++ ((GuiButton)this.buttonList.get(0)).enabled = this.serverTextField.getText().length() > 0 && this.serverTextField.getText().split(":").length > 0; ++ } ++ ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ ++ public void onGuiClosed() ++ { ++ Keyboard.enableRepeatEvents(false); ++ this.mc.gameSettings.lastServer = this.serverTextField.getText(); ++ this.mc.gameSettings.saveOptions(); ++ } ++ ++ /** ++ * 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 == 1) ++ { ++ this.guiScreen.confirmClicked(false, 0); ++ } ++ else if (par1GuiButton.id == 0) ++ { ++ this.theServerData.serverIP = this.serverTextField.getText(); ++ this.guiScreen.confirmClicked(true, 0); ++ } ++ } ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) ++ { ++ if (this.serverTextField.textboxKeyTyped(par1, par2)) ++ { ++ ((GuiButton)this.buttonList.get(0)).enabled = this.serverTextField.getText().length() > 0 && this.serverTextField.getText().split(":").length > 0; ++ } ++ else if (par2 == 28 || par2 == 156) ++ { ++ this.actionPerformed((GuiButton)this.buttonList.get(0)); ++ } ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) ++ { ++ super.mouseClicked(par1, par2, par3); ++ this.serverTextField.mouseClicked(par1, par2, par3); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.drawCenteredString(this.fontRenderer, I18n.getString("selectServer.direct"), this.width / 2, 20, 16777215); ++ this.drawString(this.fontRenderer, I18n.getString("addServer.enterIp"), this.width / 2 - 100, 100, 10526880); ++ this.serverTextField.drawTextBox(); ++ super.drawScreen(par1, par2, par3); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenSubscription.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,118 ---- ++ package net.minecraft.src; ++ ++ import java.io.IOException; ++ import java.text.SimpleDateFormat; ++ import java.util.GregorianCalendar; ++ import java.util.TimeZone; ++ import org.lwjgl.input.Keyboard; ++ ++ public class GuiScreenSubscription extends GuiScreen ++ { ++ private final GuiScreen field_98067_a; ++ private final McoServer field_98065_b; ++ private final int field_98066_c = 0; ++ private final int field_98064_d = 1; ++ private int field_98068_n; ++ private String field_98069_o; ++ ++ public GuiScreenSubscription(GuiScreen par1GuiScreen, McoServer par2McoServer) ++ { ++ this.field_98067_a = par1GuiScreen; ++ this.field_98065_b = par2McoServer; ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() {} ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.func_98063_a(this.field_98065_b.field_96408_a); ++ Keyboard.enableRepeatEvents(true); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); ++ } ++ ++ private void func_98063_a(long par1) ++ { ++ McoClient var3 = new McoClient(this.mc.getSession()); ++ ++ try ++ { ++ ValueObjectSubscription var4 = var3.func_98177_f(par1); ++ this.field_98068_n = var4.field_98170_b; ++ this.field_98069_o = this.func_98062_b(var4.field_98171_a); ++ } ++ catch (ExceptionMcoService var5) ++ { ++ Minecraft.getMinecraft().getLogAgent().logSevere(var5.toString()); ++ } ++ catch (IOException var6) ++ { ++ Minecraft.getMinecraft().getLogAgent().logWarning("Realms: could not parse response"); ++ } ++ } ++ ++ private String func_98062_b(long par1) ++ { ++ GregorianCalendar var3 = new GregorianCalendar(TimeZone.getDefault()); ++ var3.setTimeInMillis(par1); ++ return SimpleDateFormat.getDateTimeInstance().format(var3.getTime()); ++ } ++ ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ ++ public void onGuiClosed() ++ { ++ Keyboard.enableRepeatEvents(false); ++ } ++ ++ /** ++ * 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 == 0) ++ { ++ this.mc.displayGuiScreen(this.field_98067_a); ++ } ++ else if (par1GuiButton.id == 1) ++ { ++ ; ++ } ++ } ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) {} ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) ++ { ++ super.mouseClicked(par1, par2, par3); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.drawCenteredString(this.fontRenderer, I18n.getString("mco.configure.world.subscription.title"), this.width / 2, 17, 16777215); ++ this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.subscription.start"), this.width / 2 - 100, 53, 10526880); ++ this.drawString(this.fontRenderer, this.field_98069_o, this.width / 2 - 100, 66, 16777215); ++ this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.subscription.daysleft"), this.width / 2 - 100, 85, 10526880); ++ this.drawString(this.fontRenderer, String.valueOf(this.field_98068_n), this.width / 2 - 100, 98, 16777215); ++ super.drawScreen(par1, par2, par3); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenTemporaryResourcePackSelect.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,201 ---- ++ 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; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiScreenTemporaryResourcePackSelectSelectionList.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,145 ---- ++ package net.minecraft.src; ++ ++ import java.io.IOException; ++ import java.util.List; ++ import org.lwjgl.opengl.GL11; ++ ++ class GuiScreenTemporaryResourcePackSelectSelectionList extends GuiSlot ++ { ++ private final ResourcePackRepository field_110511_b; ++ private ResourceLocation 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) ++ { ++ TextureManager 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())); ++ } ++ ++ var6.bindTexture(this.field_110513_h); ++ 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; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiSelectWorld.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,337 ---- ++ package net.minecraft.src; ++ ++ import java.text.DateFormat; ++ import java.text.SimpleDateFormat; ++ import java.util.Collections; ++ import java.util.List; ++ ++ public class GuiSelectWorld extends GuiScreen ++ { ++ /** simple date formater */ ++ private final DateFormat dateFormatter = new SimpleDateFormat(); ++ ++ /** ++ * A reference to the screen object that created this. Used for navigating between screens. ++ */ ++ protected GuiScreen parentScreen; ++ ++ /** The title string that is displayed in the top-center of the screen. */ ++ protected String screenTitle = "Select world"; ++ ++ /** True if a world has been selected. */ ++ private boolean selected; ++ ++ /** the currently selected world */ ++ private int selectedWorld; ++ ++ /** The save list for the world selection screen */ ++ private List saveList; ++ private GuiWorldSlot worldSlotContainer; ++ ++ /** E.g. World, Welt, Monde, Mundo */ ++ private String localizedWorldText; ++ private String localizedMustConvertText; ++ ++ /** ++ * The game mode text that is displayed with each world on the world selection list. ++ */ ++ private String[] localizedGameModeText = new String[3]; ++ ++ /** set to true if you arein the process of deleteing a world/save */ ++ private boolean deleting; ++ ++ /** The delete button in the world selection GUI */ ++ private GuiButton buttonDelete; ++ ++ /** the select button in the world selection gui */ ++ private GuiButton buttonSelect; ++ ++ /** The rename button in the world selection GUI */ ++ private GuiButton buttonRename; ++ private GuiButton buttonRecreate; ++ ++ public GuiSelectWorld(GuiScreen par1GuiScreen) ++ { ++ this.parentScreen = par1GuiScreen; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.screenTitle = I18n.getString("selectWorld.title"); ++ ++ try ++ { ++ this.loadSaves(); ++ } ++ catch (AnvilConverterException var2) ++ { ++ var2.printStackTrace(); ++ this.mc.displayGuiScreen(new GuiErrorScreen("Unable to load words", var2.getMessage())); ++ return; ++ } ++ ++ this.localizedWorldText = I18n.getString("selectWorld.world"); ++ this.localizedMustConvertText = I18n.getString("selectWorld.conversion"); ++ this.localizedGameModeText[EnumGameType.SURVIVAL.getID()] = I18n.getString("gameMode.survival"); ++ this.localizedGameModeText[EnumGameType.CREATIVE.getID()] = I18n.getString("gameMode.creative"); ++ this.localizedGameModeText[EnumGameType.ADVENTURE.getID()] = I18n.getString("gameMode.adventure"); ++ this.worldSlotContainer = new GuiWorldSlot(this); ++ this.worldSlotContainer.registerScrollButtons(4, 5); ++ this.initButtons(); ++ } ++ ++ /** ++ * loads the saves ++ */ ++ private void loadSaves() throws AnvilConverterException ++ { ++ ISaveFormat var1 = this.mc.getSaveLoader(); ++ this.saveList = var1.getSaveList(); ++ Collections.sort(this.saveList); ++ this.selectedWorld = -1; ++ } ++ ++ /** ++ * returns the file name of the specified save number ++ */ ++ protected String getSaveFileName(int par1) ++ { ++ return ((SaveFormatComparator)this.saveList.get(par1)).getFileName(); ++ } ++ ++ /** ++ * returns the name of the saved game ++ */ ++ protected String getSaveName(int par1) ++ { ++ String var2 = ((SaveFormatComparator)this.saveList.get(par1)).getDisplayName(); ++ ++ if (var2 == null || MathHelper.stringNullOrLengthZero(var2)) ++ { ++ var2 = I18n.getString("selectWorld.world") + " " + (par1 + 1); ++ } ++ ++ return var2; ++ } ++ ++ /** ++ * intilize the buttons for this GUI ++ */ ++ public void initButtons() ++ { ++ this.buttonList.add(this.buttonSelect = new GuiButton(1, this.width / 2 - 154, this.height - 52, 150, 20, I18n.getString("selectWorld.select"))); ++ this.buttonList.add(new GuiButton(3, this.width / 2 + 4, this.height - 52, 150, 20, I18n.getString("selectWorld.create"))); ++ this.buttonList.add(this.buttonRename = new GuiButton(6, this.width / 2 - 154, this.height - 28, 72, 20, I18n.getString("selectWorld.rename"))); ++ this.buttonList.add(this.buttonDelete = new GuiButton(2, this.width / 2 - 76, this.height - 28, 72, 20, I18n.getString("selectWorld.delete"))); ++ this.buttonList.add(this.buttonRecreate = new GuiButton(7, this.width / 2 + 4, this.height - 28, 72, 20, I18n.getString("selectWorld.recreate"))); ++ this.buttonList.add(new GuiButton(0, this.width / 2 + 82, this.height - 28, 72, 20, I18n.getString("gui.cancel"))); ++ this.buttonSelect.enabled = false; ++ this.buttonDelete.enabled = false; ++ this.buttonRename.enabled = false; ++ this.buttonRecreate.enabled = false; ++ } ++ ++ /** ++ * 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 == 2) ++ { ++ String var2 = this.getSaveName(this.selectedWorld); ++ ++ if (var2 != null) ++ { ++ this.deleting = true; ++ GuiYesNo var3 = getDeleteWorldScreen(this, var2, this.selectedWorld); ++ this.mc.displayGuiScreen(var3); ++ } ++ } ++ else if (par1GuiButton.id == 1) ++ { ++ this.selectWorld(this.selectedWorld); ++ } ++ else if (par1GuiButton.id == 3) ++ { ++ this.mc.displayGuiScreen(new GuiCreateWorld(this)); ++ } ++ else if (par1GuiButton.id == 6) ++ { ++ this.mc.displayGuiScreen(new GuiRenameWorld(this, this.getSaveFileName(this.selectedWorld))); ++ } ++ else if (par1GuiButton.id == 0) ++ { ++ this.mc.displayGuiScreen(this.parentScreen); ++ } ++ else if (par1GuiButton.id == 7) ++ { ++ GuiCreateWorld var5 = new GuiCreateWorld(this); ++ ISaveHandler var6 = this.mc.getSaveLoader().getSaveLoader(this.getSaveFileName(this.selectedWorld), false); ++ WorldInfo var4 = var6.loadWorldInfo(); ++ var6.flush(); ++ var5.func_82286_a(var4); ++ this.mc.displayGuiScreen(var5); ++ } ++ else ++ { ++ this.worldSlotContainer.actionPerformed(par1GuiButton); ++ } ++ } ++ } ++ ++ /** ++ * Gets the selected world. ++ */ ++ public void selectWorld(int par1) ++ { ++ this.mc.displayGuiScreen((GuiScreen)null); ++ ++ if (!this.selected) ++ { ++ this.selected = true; ++ String var2 = this.getSaveFileName(par1); ++ ++ if (var2 == null) ++ { ++ var2 = "World" + par1; ++ } ++ ++ String var3 = this.getSaveName(par1); ++ ++ if (var3 == null) ++ { ++ var3 = "World" + par1; ++ } ++ ++ if (this.mc.getSaveLoader().canLoadWorld(var2)) ++ { ++ this.mc.launchIntegratedServer(var2, var3, (WorldSettings)null); ++ this.mc.statFileWriter.readStat(StatList.loadWorldStat, 1); ++ } ++ } ++ } ++ ++ public void confirmClicked(boolean par1, int par2) ++ { ++ if (this.deleting) ++ { ++ this.deleting = false; ++ ++ if (par1) ++ { ++ ISaveFormat var3 = this.mc.getSaveLoader(); ++ var3.flushCache(); ++ var3.deleteWorldDirectory(this.getSaveFileName(par2)); ++ ++ try ++ { ++ this.loadSaves(); ++ } ++ catch (AnvilConverterException var5) ++ { ++ var5.printStackTrace(); ++ } ++ } ++ ++ this.mc.displayGuiScreen(this); ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.worldSlotContainer.drawScreen(par1, par2, par3); ++ this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 20, 16777215); ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ /** ++ * Gets a GuiYesNo screen with the warning, buttons, etc. ++ */ ++ public static GuiYesNo getDeleteWorldScreen(GuiScreen par0GuiScreen, String par1Str, int par2) ++ { ++ String var3 = I18n.getString("selectWorld.deleteQuestion"); ++ String var4 = "\'" + par1Str + "\' " + I18n.getString("selectWorld.deleteWarning"); ++ String var5 = I18n.getString("selectWorld.deleteButton"); ++ String var6 = I18n.getString("gui.cancel"); ++ GuiYesNo var7 = new GuiYesNo(par0GuiScreen, var3, var4, var5, var6, par2); ++ return var7; ++ } ++ ++ static List getSize(GuiSelectWorld par0GuiSelectWorld) ++ { ++ return par0GuiSelectWorld.saveList; ++ } ++ ++ /** ++ * called whenever an element in this gui is selected ++ */ ++ static int onElementSelected(GuiSelectWorld par0GuiSelectWorld, int par1) ++ { ++ return par0GuiSelectWorld.selectedWorld = par1; ++ } ++ ++ /** ++ * returns the world currently selected ++ */ ++ static int getSelectedWorld(GuiSelectWorld par0GuiSelectWorld) ++ { ++ return par0GuiSelectWorld.selectedWorld; ++ } ++ ++ /** ++ * returns the select button ++ */ ++ static GuiButton getSelectButton(GuiSelectWorld par0GuiSelectWorld) ++ { ++ return par0GuiSelectWorld.buttonSelect; ++ } ++ ++ /** ++ * returns the rename button ++ */ ++ static GuiButton getRenameButton(GuiSelectWorld par0GuiSelectWorld) ++ { ++ return par0GuiSelectWorld.buttonDelete; ++ } ++ ++ /** ++ * returns the delete button ++ */ ++ static GuiButton getDeleteButton(GuiSelectWorld par0GuiSelectWorld) ++ { ++ return par0GuiSelectWorld.buttonRename; ++ } ++ ++ static GuiButton func_82312_f(GuiSelectWorld par0GuiSelectWorld) ++ { ++ return par0GuiSelectWorld.buttonRecreate; ++ } ++ ++ static String func_82313_g(GuiSelectWorld par0GuiSelectWorld) ++ { ++ return par0GuiSelectWorld.localizedWorldText; ++ } ++ ++ static DateFormat func_82315_h(GuiSelectWorld par0GuiSelectWorld) ++ { ++ return par0GuiSelectWorld.dateFormatter; ++ } ++ ++ static String func_82311_i(GuiSelectWorld par0GuiSelectWorld) ++ { ++ return par0GuiSelectWorld.localizedMustConvertText; ++ } ++ ++ static String[] func_82314_j(GuiSelectWorld par0GuiSelectWorld) ++ { ++ return par0GuiSelectWorld.localizedGameModeText; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiShareToLan.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,113 ---- ++ package net.minecraft.src; ++ ++ public class GuiShareToLan extends GuiScreen ++ { ++ /** ++ * A reference to the screen object that created this. Used for navigating between screens. ++ */ ++ private final GuiScreen parentScreen; ++ private GuiButton buttonAllowCommandsToggle; ++ private GuiButton buttonGameMode; ++ ++ /** ++ * The currently selected game mode. One of 'survival', 'creative', or 'adventure' ++ */ ++ private String gameMode = "survival"; ++ ++ /** True if 'Allow Cheats' is currently enabled */ ++ private boolean allowCommands; ++ ++ public GuiShareToLan(GuiScreen par1GuiScreen) ++ { ++ this.parentScreen = par1GuiScreen; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(101, this.width / 2 - 155, this.height - 28, 150, 20, I18n.getString("lanServer.start"))); ++ this.buttonList.add(new GuiButton(102, this.width / 2 + 5, this.height - 28, 150, 20, I18n.getString("gui.cancel"))); ++ this.buttonList.add(this.buttonGameMode = new GuiButton(104, this.width / 2 - 155, 100, 150, 20, I18n.getString("selectWorld.gameMode"))); ++ this.buttonList.add(this.buttonAllowCommandsToggle = new GuiButton(103, this.width / 2 + 5, 100, 150, 20, I18n.getString("selectWorld.allowCommands"))); ++ this.func_74088_g(); ++ } ++ ++ private void func_74088_g() ++ { ++ this.buttonGameMode.displayString = I18n.getString("selectWorld.gameMode") + " " + I18n.getString("selectWorld.gameMode." + this.gameMode); ++ this.buttonAllowCommandsToggle.displayString = I18n.getString("selectWorld.allowCommands") + " "; ++ ++ if (this.allowCommands) ++ { ++ this.buttonAllowCommandsToggle.displayString = this.buttonAllowCommandsToggle.displayString + I18n.getString("options.on"); ++ } ++ else ++ { ++ this.buttonAllowCommandsToggle.displayString = this.buttonAllowCommandsToggle.displayString + I18n.getString("options.off"); ++ } ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ if (par1GuiButton.id == 102) ++ { ++ this.mc.displayGuiScreen(this.parentScreen); ++ } ++ else if (par1GuiButton.id == 104) ++ { ++ if (this.gameMode.equals("survival")) ++ { ++ this.gameMode = "creative"; ++ } ++ else if (this.gameMode.equals("creative")) ++ { ++ this.gameMode = "adventure"; ++ } ++ else ++ { ++ this.gameMode = "survival"; ++ } ++ ++ this.func_74088_g(); ++ } ++ else if (par1GuiButton.id == 103) ++ { ++ this.allowCommands = !this.allowCommands; ++ this.func_74088_g(); ++ } ++ else if (par1GuiButton.id == 101) ++ { ++ this.mc.displayGuiScreen((GuiScreen)null); ++ String var2 = this.mc.getIntegratedServer().shareToLAN(EnumGameType.getByName(this.gameMode), this.allowCommands); ++ ChatMessageComponent var3; ++ ++ if (var2 != null) ++ { ++ var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("commands.publish.started", new Object[] {var2}); ++ } ++ else ++ { ++ var3 = ChatMessageComponent.createFromText("commands.publish.failed"); ++ } ++ ++ this.mc.ingameGUI.getChatGUI().printChatMessage(var3.toStringWithFormatting(true)); ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.drawCenteredString(this.fontRenderer, I18n.getString("lanServer.title"), this.width / 2, 50, 16777215); ++ this.drawCenteredString(this.fontRenderer, I18n.getString("lanServer.otherPlayers"), this.width / 2, 82, 16777215); ++ super.drawScreen(par1, par2, par3); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiSleepMP.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,64 ---- ++ package net.minecraft.src; ++ ++ public class GuiSleepMP extends GuiChat ++ { ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ super.initGui(); ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height - 40, I18n.getString("multiplayer.stopSleeping"))); ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) ++ { ++ if (par2 == 1) ++ { ++ this.wakeEntity(); ++ } ++ else if (par2 != 28 && par2 != 156) ++ { ++ super.keyTyped(par1, par2); ++ } ++ else ++ { ++ String var3 = this.inputField.getText().trim(); ++ ++ if (var3.length() > 0) ++ { ++ this.mc.thePlayer.sendChatMessage(var3); ++ } ++ ++ this.inputField.setText(""); ++ this.mc.ingameGUI.getChatGUI().resetScroll(); ++ } ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ if (par1GuiButton.id == 1) ++ { ++ this.wakeEntity(); ++ } ++ else ++ { ++ super.actionPerformed(par1GuiButton); ++ } ++ } ++ ++ /** ++ * Wakes the entity from the bed ++ */ ++ private void wakeEntity() ++ { ++ NetClientHandler var1 = this.mc.thePlayer.sendQueue; ++ var1.addToSendQueue(new Packet19EntityAction(this.mc.thePlayer, 3)); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiSlider.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,101 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class GuiSlider extends GuiButton ++ { ++ /** The value of this slider control. */ ++ public float sliderValue = 1.0F; ++ ++ /** Is this slider control being dragged. */ ++ public boolean dragging; ++ ++ /** Additional ID for this slider control. */ ++ private EnumOptions idFloat; ++ ++ public GuiSlider(int par1, int par2, int par3, EnumOptions par4EnumOptions, String par5Str, float par6) ++ { ++ super(par1, par2, par3, 150, 20, par5Str); ++ this.idFloat = par4EnumOptions; ++ this.sliderValue = par6; ++ } ++ ++ /** ++ * Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over ++ * this button. ++ */ ++ protected int getHoverState(boolean par1) ++ { ++ return 0; ++ } ++ ++ /** ++ * Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e). ++ */ ++ protected void mouseDragged(Minecraft par1Minecraft, int par2, int par3) ++ { ++ if (this.drawButton) ++ { ++ if (this.dragging) ++ { ++ this.sliderValue = (float)(par2 - (this.xPosition + 4)) / (float)(this.width - 8); ++ ++ if (this.sliderValue < 0.0F) ++ { ++ this.sliderValue = 0.0F; ++ } ++ ++ if (this.sliderValue > 1.0F) ++ { ++ this.sliderValue = 1.0F; ++ } ++ ++ par1Minecraft.gameSettings.setOptionFloatValue(this.idFloat, this.sliderValue); ++ this.displayString = par1Minecraft.gameSettings.getKeyBinding(this.idFloat); ++ } ++ ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.drawTexturedModalRect(this.xPosition + (int)(this.sliderValue * (float)(this.width - 8)), this.yPosition, 0, 66, 4, 20); ++ this.drawTexturedModalRect(this.xPosition + (int)(this.sliderValue * (float)(this.width - 8)) + 4, this.yPosition, 196, 66, 4, 20); ++ } ++ } ++ ++ /** ++ * Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent ++ * e). ++ */ ++ public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3) ++ { ++ if (super.mousePressed(par1Minecraft, par2, par3)) ++ { ++ this.sliderValue = (float)(par2 - (this.xPosition + 4)) / (float)(this.width - 8); ++ ++ if (this.sliderValue < 0.0F) ++ { ++ this.sliderValue = 0.0F; ++ } ++ ++ if (this.sliderValue > 1.0F) ++ { ++ this.sliderValue = 1.0F; ++ } ++ ++ par1Minecraft.gameSettings.setOptionFloatValue(this.idFloat, this.sliderValue); ++ this.displayString = par1Minecraft.gameSettings.getKeyBinding(this.idFloat); ++ this.dragging = true; ++ return true; ++ } ++ else ++ { ++ return false; ++ } ++ } ++ ++ /** ++ * Fired when the mouse button is released. Equivalent of MouseListener.mouseReleased(MouseEvent e). ++ */ ++ public void mouseReleased(int par1, int par2) ++ { ++ this.dragging = false; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiSlot.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,482 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.input.Mouse; ++ import org.lwjgl.opengl.GL11; ++ ++ public abstract class GuiSlot ++ { ++ private final Minecraft mc; ++ ++ /** ++ * The width of the GuiScreen. Affects the container rendering, but not the overlays. ++ */ ++ private int width; ++ ++ /** ++ * The height of the GuiScreen. Affects the container rendering, but not the overlays or the scrolling. ++ */ ++ private int height; ++ ++ /** The top of the slot container. Affects the overlays and scrolling. */ ++ protected int top; ++ ++ /** The bottom of the slot container. Affects the overlays and scrolling. */ ++ protected int bottom; ++ private int right; ++ private int left; ++ ++ /** The height of a slot. */ ++ protected final int slotHeight; ++ ++ /** button id of the button used to scroll up */ ++ private int scrollUpButtonID; ++ ++ /** the buttonID of the button used to scroll down */ ++ private int scrollDownButtonID; ++ ++ /** X axis position of the mouse */ ++ protected int mouseX; ++ ++ /** Y axis position of the mouse */ ++ protected int mouseY; ++ ++ /** where the mouse was in the window when you first clicked to scroll */ ++ private float initialClickY = -2.0F; ++ ++ /** ++ * what to multiply the amount you moved your mouse by(used for slowing down scrolling when over the items and no on ++ * scroll bar) ++ */ ++ private float scrollMultiplier; ++ ++ /** how far down this slot has been scrolled */ ++ private float amountScrolled; ++ ++ /** the element in the list that was selected */ ++ private int selectedElement = -1; ++ ++ /** the time when this button was last clicked. */ ++ private long lastClicked; ++ ++ /** true if a selected element in this gui will show an outline box */ ++ private boolean showSelectionBox = true; ++ private boolean field_77243_s; ++ private int field_77242_t; ++ ++ public GuiSlot(Minecraft par1Minecraft, int par2, int par3, int par4, int par5, int par6) ++ { ++ this.mc = par1Minecraft; ++ this.width = par2; ++ this.height = par3; ++ this.top = par4; ++ this.bottom = par5; ++ this.slotHeight = par6; ++ this.left = 0; ++ this.right = par2; ++ } ++ ++ public void func_77207_a(int par1, int par2, int par3, int par4) ++ { ++ this.width = par1; ++ this.height = par2; ++ this.top = par3; ++ this.bottom = par4; ++ this.left = 0; ++ this.right = par1; ++ } ++ ++ public void setShowSelectionBox(boolean par1) ++ { ++ this.showSelectionBox = par1; ++ } ++ ++ protected void func_77223_a(boolean par1, int par2) ++ { ++ this.field_77243_s = par1; ++ this.field_77242_t = par2; ++ ++ if (!par1) ++ { ++ this.field_77242_t = 0; ++ } ++ } ++ ++ /** ++ * Gets the size of the current slot list. ++ */ ++ protected abstract int getSize(); ++ ++ /** ++ * the element in the slot that was clicked, boolean for wether it was double clicked or not ++ */ ++ protected abstract void elementClicked(int var1, boolean var2); ++ ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected abstract boolean isSelected(int var1); ++ ++ /** ++ * return the height of the content being scrolled ++ */ ++ protected int getContentHeight() ++ { ++ return this.getSize() * this.slotHeight + this.field_77242_t; ++ } ++ ++ protected abstract void drawBackground(); ++ ++ protected abstract void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5); ++ ++ protected void func_77222_a(int par1, int par2, Tessellator par3Tessellator) {} ++ ++ protected void func_77224_a(int par1, int par2) {} ++ ++ protected void func_77215_b(int par1, int par2) {} ++ ++ public int func_77210_c(int par1, int par2) ++ { ++ int var3 = this.width / 2 - 110; ++ int var4 = this.width / 2 + 110; ++ int var5 = par2 - this.top - this.field_77242_t + (int)this.amountScrolled - 4; ++ int var6 = var5 / this.slotHeight; ++ return par1 >= var3 && par1 <= var4 && var6 >= 0 && var5 >= 0 && var6 < this.getSize() ? var6 : -1; ++ } ++ ++ /** ++ * Registers the IDs that can be used for the scrollbar's buttons. ++ */ ++ public void registerScrollButtons(int par1, int par2) ++ { ++ this.scrollUpButtonID = par1; ++ this.scrollDownButtonID = par2; ++ } ++ ++ /** ++ * stop the thing from scrolling out of bounds ++ */ ++ private void bindAmountScrolled() ++ { ++ int var1 = this.func_77209_d(); ++ ++ if (var1 < 0) ++ { ++ var1 /= 2; ++ } ++ ++ if (this.amountScrolled < 0.0F) ++ { ++ this.amountScrolled = 0.0F; ++ } ++ ++ if (this.amountScrolled > (float)var1) ++ { ++ this.amountScrolled = (float)var1; ++ } ++ } ++ ++ public int func_77209_d() ++ { ++ return this.getContentHeight() - (this.bottom - this.top - 4); ++ } ++ ++ public void func_77208_b(int par1) ++ { ++ this.amountScrolled += (float)par1; ++ this.bindAmountScrolled(); ++ this.initialClickY = -2.0F; ++ } ++ ++ public void actionPerformed(GuiButton par1GuiButton) ++ { ++ if (par1GuiButton.enabled) ++ { ++ if (par1GuiButton.id == this.scrollUpButtonID) ++ { ++ this.amountScrolled -= (float)(this.slotHeight * 2 / 3); ++ this.initialClickY = -2.0F; ++ this.bindAmountScrolled(); ++ } ++ else if (par1GuiButton.id == this.scrollDownButtonID) ++ { ++ this.amountScrolled += (float)(this.slotHeight * 2 / 3); ++ this.initialClickY = -2.0F; ++ this.bindAmountScrolled(); ++ } ++ } ++ } ++ ++ /** ++ * draws the slot to the screen, pass in mouse's current x and y and partial ticks ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.mouseX = par1; ++ this.mouseY = par2; ++ this.drawBackground(); ++ int var4 = this.getSize(); ++ int var5 = this.getScrollBarX(); ++ int var6 = var5 + 6; ++ int var9; ++ int var10; ++ int var11; ++ int var13; ++ int var20; ++ ++ if (Mouse.isButtonDown(0)) ++ { ++ if (this.initialClickY == -1.0F) ++ { ++ boolean var7 = true; ++ ++ if (par2 >= this.top && par2 <= this.bottom) ++ { ++ int var8 = this.width / 2 - 110; ++ var9 = this.width / 2 + 110; ++ var10 = par2 - this.top - this.field_77242_t + (int)this.amountScrolled - 4; ++ var11 = var10 / this.slotHeight; ++ ++ if (par1 >= var8 && par1 <= var9 && var11 >= 0 && var10 >= 0 && var11 < var4) ++ { ++ boolean var12 = var11 == this.selectedElement && Minecraft.getSystemTime() - this.lastClicked < 250L; ++ this.elementClicked(var11, var12); ++ this.selectedElement = var11; ++ this.lastClicked = Minecraft.getSystemTime(); ++ } ++ else if (par1 >= var8 && par1 <= var9 && var10 < 0) ++ { ++ this.func_77224_a(par1 - var8, par2 - this.top + (int)this.amountScrolled - 4); ++ var7 = false; ++ } ++ ++ if (par1 >= var5 && par1 <= var6) ++ { ++ this.scrollMultiplier = -1.0F; ++ var20 = this.func_77209_d(); ++ ++ if (var20 < 1) ++ { ++ var20 = 1; ++ } ++ ++ var13 = (int)((float)((this.bottom - this.top) * (this.bottom - this.top)) / (float)this.getContentHeight()); ++ ++ if (var13 < 32) ++ { ++ var13 = 32; ++ } ++ ++ if (var13 > this.bottom - this.top - 8) ++ { ++ var13 = this.bottom - this.top - 8; ++ } ++ ++ this.scrollMultiplier /= (float)(this.bottom - this.top - var13) / (float)var20; ++ } ++ else ++ { ++ this.scrollMultiplier = 1.0F; ++ } ++ ++ if (var7) ++ { ++ this.initialClickY = (float)par2; ++ } ++ else ++ { ++ this.initialClickY = -2.0F; ++ } ++ } ++ else ++ { ++ this.initialClickY = -2.0F; ++ } ++ } ++ else if (this.initialClickY >= 0.0F) ++ { ++ this.amountScrolled -= ((float)par2 - this.initialClickY) * this.scrollMultiplier; ++ this.initialClickY = (float)par2; ++ } ++ } ++ else ++ { ++ while (!this.mc.gameSettings.touchscreen && Mouse.next()) ++ { ++ int var16 = Mouse.getEventDWheel(); ++ ++ if (var16 != 0) ++ { ++ if (var16 > 0) ++ { ++ var16 = -1; ++ } ++ else if (var16 < 0) ++ { ++ var16 = 1; ++ } ++ ++ this.amountScrolled += (float)(var16 * this.slotHeight / 2); ++ } ++ } ++ ++ this.initialClickY = -1.0F; ++ } ++ ++ this.bindAmountScrolled(); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glDisable(GL11.GL_FOG); ++ Tessellator var18 = Tessellator.instance; ++ this.mc.getTextureManager().bindTexture(Gui.optionsBackground); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ float var17 = 32.0F; ++ var18.startDrawingQuads(); ++ var18.setColorOpaque_I(2105376); ++ var18.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / var17), (double)((float)(this.bottom + (int)this.amountScrolled) / var17)); ++ var18.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / var17), (double)((float)(this.bottom + (int)this.amountScrolled) / var17)); ++ var18.addVertexWithUV((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / var17), (double)((float)(this.top + (int)this.amountScrolled) / var17)); ++ var18.addVertexWithUV((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / var17), (double)((float)(this.top + (int)this.amountScrolled) / var17)); ++ var18.draw(); ++ var9 = this.width / 2 - 92 - 16; ++ var10 = this.top + 4 - (int)this.amountScrolled; ++ ++ if (this.field_77243_s) ++ { ++ this.func_77222_a(var9, var10, var18); ++ } ++ ++ int var14; ++ ++ for (var11 = 0; var11 < var4; ++var11) ++ { ++ var20 = var10 + var11 * this.slotHeight + this.field_77242_t; ++ var13 = this.slotHeight - 4; ++ ++ if (var20 <= this.bottom && var20 + var13 >= this.top) ++ { ++ if (this.showSelectionBox && this.isSelected(var11)) ++ { ++ var14 = this.width / 2 - 110; ++ int var15 = this.width / 2 + 110; ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ var18.startDrawingQuads(); ++ var18.setColorOpaque_I(8421504); ++ var18.addVertexWithUV((double)var14, (double)(var20 + var13 + 2), 0.0D, 0.0D, 1.0D); ++ var18.addVertexWithUV((double)var15, (double)(var20 + var13 + 2), 0.0D, 1.0D, 1.0D); ++ var18.addVertexWithUV((double)var15, (double)(var20 - 2), 0.0D, 1.0D, 0.0D); ++ var18.addVertexWithUV((double)var14, (double)(var20 - 2), 0.0D, 0.0D, 0.0D); ++ var18.setColorOpaque_I(0); ++ var18.addVertexWithUV((double)(var14 + 1), (double)(var20 + var13 + 1), 0.0D, 0.0D, 1.0D); ++ var18.addVertexWithUV((double)(var15 - 1), (double)(var20 + var13 + 1), 0.0D, 1.0D, 1.0D); ++ var18.addVertexWithUV((double)(var15 - 1), (double)(var20 - 1), 0.0D, 1.0D, 0.0D); ++ var18.addVertexWithUV((double)(var14 + 1), (double)(var20 - 1), 0.0D, 0.0D, 0.0D); ++ var18.draw(); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ } ++ ++ this.drawSlot(var11, var9, var20, var13, var18); ++ } ++ } ++ ++ GL11.glDisable(GL11.GL_DEPTH_TEST); ++ byte var19 = 4; ++ this.overlayBackground(0, this.top, 255, 255); ++ this.overlayBackground(this.bottom, this.height, 255, 255); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ GL11.glDisable(GL11.GL_ALPHA_TEST); ++ GL11.glShadeModel(GL11.GL_SMOOTH); ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ var18.startDrawingQuads(); ++ var18.setColorRGBA_I(0, 0); ++ var18.addVertexWithUV((double)this.left, (double)(this.top + var19), 0.0D, 0.0D, 1.0D); ++ var18.addVertexWithUV((double)this.right, (double)(this.top + var19), 0.0D, 1.0D, 1.0D); ++ var18.setColorRGBA_I(0, 255); ++ var18.addVertexWithUV((double)this.right, (double)this.top, 0.0D, 1.0D, 0.0D); ++ var18.addVertexWithUV((double)this.left, (double)this.top, 0.0D, 0.0D, 0.0D); ++ var18.draw(); ++ var18.startDrawingQuads(); ++ var18.setColorRGBA_I(0, 255); ++ var18.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, 0.0D, 1.0D); ++ var18.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, 1.0D, 1.0D); ++ var18.setColorRGBA_I(0, 0); ++ var18.addVertexWithUV((double)this.right, (double)(this.bottom - var19), 0.0D, 1.0D, 0.0D); ++ var18.addVertexWithUV((double)this.left, (double)(this.bottom - var19), 0.0D, 0.0D, 0.0D); ++ var18.draw(); ++ var20 = this.func_77209_d(); ++ ++ if (var20 > 0) ++ { ++ var13 = (this.bottom - this.top) * (this.bottom - this.top) / this.getContentHeight(); ++ ++ if (var13 < 32) ++ { ++ var13 = 32; ++ } ++ ++ if (var13 > this.bottom - this.top - 8) ++ { ++ var13 = this.bottom - this.top - 8; ++ } ++ ++ var14 = (int)this.amountScrolled * (this.bottom - this.top - var13) / var20 + this.top; ++ ++ if (var14 < this.top) ++ { ++ var14 = this.top; ++ } ++ ++ var18.startDrawingQuads(); ++ var18.setColorRGBA_I(0, 255); ++ var18.addVertexWithUV((double)var5, (double)this.bottom, 0.0D, 0.0D, 1.0D); ++ var18.addVertexWithUV((double)var6, (double)this.bottom, 0.0D, 1.0D, 1.0D); ++ var18.addVertexWithUV((double)var6, (double)this.top, 0.0D, 1.0D, 0.0D); ++ var18.addVertexWithUV((double)var5, (double)this.top, 0.0D, 0.0D, 0.0D); ++ var18.draw(); ++ var18.startDrawingQuads(); ++ var18.setColorRGBA_I(8421504, 255); ++ var18.addVertexWithUV((double)var5, (double)(var14 + var13), 0.0D, 0.0D, 1.0D); ++ var18.addVertexWithUV((double)var6, (double)(var14 + var13), 0.0D, 1.0D, 1.0D); ++ var18.addVertexWithUV((double)var6, (double)var14, 0.0D, 1.0D, 0.0D); ++ var18.addVertexWithUV((double)var5, (double)var14, 0.0D, 0.0D, 0.0D); ++ var18.draw(); ++ var18.startDrawingQuads(); ++ var18.setColorRGBA_I(12632256, 255); ++ var18.addVertexWithUV((double)var5, (double)(var14 + var13 - 1), 0.0D, 0.0D, 1.0D); ++ var18.addVertexWithUV((double)(var6 - 1), (double)(var14 + var13 - 1), 0.0D, 1.0D, 1.0D); ++ var18.addVertexWithUV((double)(var6 - 1), (double)var14, 0.0D, 1.0D, 0.0D); ++ var18.addVertexWithUV((double)var5, (double)var14, 0.0D, 0.0D, 0.0D); ++ var18.draw(); ++ } ++ ++ this.func_77215_b(par1, par2); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ GL11.glShadeModel(GL11.GL_FLAT); ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ GL11.glDisable(GL11.GL_BLEND); ++ } ++ ++ protected int getScrollBarX() ++ { ++ return this.width / 2 + 124; ++ } ++ ++ /** ++ * Overlays the background to hide scrolled items ++ */ ++ private void overlayBackground(int par1, int par2, int par3, int par4) ++ { ++ Tessellator var5 = Tessellator.instance; ++ this.mc.getTextureManager().bindTexture(Gui.optionsBackground); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ float var6 = 32.0F; ++ var5.startDrawingQuads(); ++ var5.setColorRGBA_I(4210752, par4); ++ var5.addVertexWithUV(0.0D, (double)par2, 0.0D, 0.0D, (double)((float)par2 / var6)); ++ var5.addVertexWithUV((double)this.width, (double)par2, 0.0D, (double)((float)this.width / var6), (double)((float)par2 / var6)); ++ var5.setColorRGBA_I(4210752, par3); ++ var5.addVertexWithUV((double)this.width, (double)par1, 0.0D, (double)((float)this.width / var6), (double)((float)par1 / var6)); ++ var5.addVertexWithUV(0.0D, (double)par1, 0.0D, 0.0D, (double)((float)par1 / var6)); ++ var5.draw(); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiSlotLanguage.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,82 ---- ++ package net.minecraft.src; ++ ++ import com.google.common.collect.Lists; ++ import com.google.common.collect.Maps; ++ import java.util.Iterator; ++ import java.util.List; ++ import java.util.Map; ++ ++ class GuiSlotLanguage extends GuiSlot ++ { ++ private final List field_77251_g; ++ private final Map field_77253_h; ++ ++ final GuiLanguage languageGui; ++ ++ public GuiSlotLanguage(GuiLanguage par1GuiLanguage) ++ { ++ super(par1GuiLanguage.mc, par1GuiLanguage.width, par1GuiLanguage.height, 32, par1GuiLanguage.height - 65 + 4, 18); ++ this.languageGui = par1GuiLanguage; ++ this.field_77251_g = Lists.newArrayList(); ++ this.field_77253_h = Maps.newHashMap(); ++ Iterator var2 = GuiLanguage.func_135011_a(par1GuiLanguage).getLanguages().iterator(); ++ ++ while (var2.hasNext()) ++ { ++ Language var3 = (Language)var2.next(); ++ this.field_77253_h.put(var3.getLanguageCode(), var3); ++ this.field_77251_g.add(var3.getLanguageCode()); ++ } ++ } ++ ++ /** ++ * Gets the size of the current slot list. ++ */ ++ protected int getSize() ++ { ++ return this.field_77251_g.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) ++ { ++ Language var3 = (Language)this.field_77253_h.get(this.field_77251_g.get(par1)); ++ GuiLanguage.func_135011_a(this.languageGui).setCurrentLanguage(var3); ++ GuiLanguage.getGameSettings(this.languageGui).language = var3.getLanguageCode(); ++ this.languageGui.mc.refreshResources(); ++ this.languageGui.fontRenderer.setUnicodeFlag(GuiLanguage.func_135011_a(this.languageGui).isCurrentLocaleUnicode()); ++ this.languageGui.fontRenderer.setBidiFlag(GuiLanguage.func_135011_a(this.languageGui).isCurrentLanguageBidirectional()); ++ GuiLanguage.getDoneButton(this.languageGui).displayString = I18n.getString("gui.done"); ++ GuiLanguage.getGameSettings(this.languageGui).saveOptions(); ++ } ++ ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) ++ { ++ return ((String)this.field_77251_g.get(par1)).equals(GuiLanguage.func_135011_a(this.languageGui).getCurrentLanguage().getLanguageCode()); ++ } ++ ++ /** ++ * return the height of the content being scrolled ++ */ ++ protected int getContentHeight() ++ { ++ return this.getSize() * 18; ++ } ++ ++ protected void drawBackground() ++ { ++ this.languageGui.drawDefaultBackground(); ++ } ++ ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) ++ { ++ this.languageGui.fontRenderer.setBidiFlag(true); ++ this.languageGui.drawCenteredString(this.languageGui.fontRenderer, ((Language)this.field_77253_h.get(this.field_77251_g.get(par1))).toString(), this.languageGui.width / 2, par3 + 1, 16777215); ++ this.languageGui.fontRenderer.setBidiFlag(GuiLanguage.func_135011_a(this.languageGui).getCurrentLanguage().isBidirectional()); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiSlotOnlineServerList.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,140 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ class GuiSlotOnlineServerList extends GuiScreenSelectLocation ++ { ++ final GuiScreenOnlineServers field_96294_a; ++ ++ public GuiSlotOnlineServerList(GuiScreenOnlineServers par1GuiScreenOnlineServers) ++ { ++ super(GuiScreenOnlineServers.func_140037_f(par1GuiScreenOnlineServers), par1GuiScreenOnlineServers.width, par1GuiScreenOnlineServers.height, 32, par1GuiScreenOnlineServers.height - 64, 36); ++ this.field_96294_a = par1GuiScreenOnlineServers; ++ } ++ ++ /** ++ * Gets the size of the current slot list. ++ */ ++ protected int getSize() ++ { ++ return GuiScreenOnlineServers.func_140013_c(this.field_96294_a).size() + 1; ++ } ++ ++ /** ++ * the element in the slot that was clicked, boolean for wether it was double clicked or not ++ */ ++ protected void elementClicked(int par1, boolean par2) ++ { ++ if (par1 < GuiScreenOnlineServers.func_140013_c(this.field_96294_a).size()) ++ { ++ McoServer var3 = (McoServer)GuiScreenOnlineServers.func_140013_c(this.field_96294_a).get(par1); ++ GuiScreenOnlineServers.func_140036_b(this.field_96294_a, var3.field_96408_a); ++ ++ if (!GuiScreenOnlineServers.func_140015_g(this.field_96294_a).getSession().getUsername().equals(var3.field_96405_e)) ++ { ++ GuiScreenOnlineServers.func_140038_h(this.field_96294_a).displayString = I18n.getString("mco.selectServer.leave"); ++ } ++ else ++ { ++ GuiScreenOnlineServers.func_140038_h(this.field_96294_a).displayString = I18n.getString("mco.selectServer.configure"); ++ } ++ ++ GuiScreenOnlineServers.func_140033_i(this.field_96294_a).enabled = var3.field_96404_d.equals("OPEN") && !var3.field_98166_h; ++ ++ if (par2 && GuiScreenOnlineServers.func_140033_i(this.field_96294_a).enabled) ++ { ++ GuiScreenOnlineServers.func_140008_c(this.field_96294_a, GuiScreenOnlineServers.func_140041_a(this.field_96294_a)); ++ } ++ } ++ } ++ ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) ++ { ++ return par1 == GuiScreenOnlineServers.func_140027_d(this.field_96294_a, GuiScreenOnlineServers.func_140041_a(this.field_96294_a)); ++ } ++ ++ protected boolean func_104086_b(int par1) ++ { ++ try ++ { ++ return par1 >= 0 && par1 < GuiScreenOnlineServers.func_140013_c(this.field_96294_a).size() && ((McoServer)GuiScreenOnlineServers.func_140013_c(this.field_96294_a).get(par1)).field_96405_e.toLowerCase().equals(GuiScreenOnlineServers.func_104032_j(this.field_96294_a).getSession().getUsername()); ++ } ++ catch (Exception var3) ++ { ++ return false; ++ } ++ } ++ ++ protected int func_130003_b() ++ { ++ return this.getSize() * 36; ++ } ++ ++ protected void func_130004_c() ++ { ++ this.field_96294_a.drawDefaultBackground(); ++ } ++ ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) ++ { ++ if (par1 < GuiScreenOnlineServers.func_140013_c(this.field_96294_a).size()) ++ { ++ this.func_96292_b(par1, par2, par3, par4, par5Tessellator); ++ } ++ } ++ ++ private void func_96292_b(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) ++ { ++ McoServer var6 = (McoServer)GuiScreenOnlineServers.func_140013_c(this.field_96294_a).get(par1); ++ this.field_96294_a.drawString(GuiScreenOnlineServers.func_140023_k(this.field_96294_a), var6.func_96398_b(), par2 + 2, par3 + 1, 16777215); ++ short var7 = 207; ++ byte var8 = 1; ++ ++ if (var6.field_98166_h) ++ { ++ GuiScreenOnlineServers.func_104031_c(this.field_96294_a, par2 + var7, par3 + var8, this.field_104094_d, this.field_104095_e); ++ } ++ else if (var6.field_96404_d.equals("CLOSED")) ++ { ++ GuiScreenOnlineServers.func_140035_b(this.field_96294_a, par2 + var7, par3 + var8, this.field_104094_d, this.field_104095_e); ++ } ++ else if (var6.field_96405_e.equals(GuiScreenOnlineServers.func_140014_l(this.field_96294_a).getSession().getUsername()) && var6.field_104063_i < 7) ++ { ++ this.func_96293_a(par1, par2 - 14, par3, var6); ++ GuiScreenOnlineServers.func_140031_a(this.field_96294_a, par2 + var7, par3 + var8, this.field_104094_d, this.field_104095_e, var6.field_104063_i); ++ } ++ else if (var6.field_96404_d.equals("OPEN")) ++ { ++ GuiScreenOnlineServers.func_140020_c(this.field_96294_a, par2 + var7, par3 + var8, this.field_104094_d, this.field_104095_e); ++ this.func_96293_a(par1, par2 - 14, par3, var6); ++ } ++ ++ this.field_96294_a.drawString(GuiScreenOnlineServers.func_140039_m(this.field_96294_a), var6.func_96397_a(), par2 + 2, par3 + 12, 7105644); ++ this.field_96294_a.drawString(GuiScreenOnlineServers.func_98079_k(this.field_96294_a), var6.field_96405_e, par2 + 2, par3 + 12 + 11, 5000268); ++ } ++ ++ private void func_96293_a(int par1, int par2, int par3, McoServer par4McoServer) ++ { ++ if (par4McoServer.field_96403_g != null) ++ { ++ synchronized (GuiScreenOnlineServers.func_140029_i()) ++ { ++ if (GuiScreenOnlineServers.func_140018_j() < 5 && (!par4McoServer.field_96411_l || par4McoServer.field_102022_m)) ++ { ++ (new ThreadConnectToOnlineServer(this, par4McoServer)).start(); ++ } ++ } ++ ++ if (par4McoServer.field_96414_k != null) ++ { ++ this.field_96294_a.drawString(GuiScreenOnlineServers.func_110402_q(this.field_96294_a), par4McoServer.field_96414_k, par2 + 215 - GuiScreenOnlineServers.func_140010_p(this.field_96294_a).getStringWidth(par4McoServer.field_96414_k), par3 + 1, 8421504); ++ } ++ ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GuiScreenOnlineServers.func_142023_q(this.field_96294_a).getTextureManager().bindTexture(Gui.icons); ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiSlotServer.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,236 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ class GuiSlotServer extends GuiSlot ++ { ++ /** Instance to the GUI this list is on. */ ++ final GuiMultiplayer parentGui; ++ ++ public GuiSlotServer(GuiMultiplayer par1GuiMultiplayer) ++ { ++ super(par1GuiMultiplayer.mc, par1GuiMultiplayer.width, par1GuiMultiplayer.height, 32, par1GuiMultiplayer.height - 64, 36); ++ this.parentGui = par1GuiMultiplayer; ++ } ++ ++ /** ++ * Gets the size of the current slot list. ++ */ ++ protected int getSize() ++ { ++ return GuiMultiplayer.getInternetServerList(this.parentGui).countServers() + GuiMultiplayer.getListOfLanServers(this.parentGui).size() + 1; ++ } ++ ++ /** ++ * the element in the slot that was clicked, boolean for wether it was double clicked or not ++ */ ++ protected void elementClicked(int par1, boolean par2) ++ { ++ if (par1 < GuiMultiplayer.getInternetServerList(this.parentGui).countServers() + GuiMultiplayer.getListOfLanServers(this.parentGui).size()) ++ { ++ int var3 = GuiMultiplayer.getSelectedServer(this.parentGui); ++ GuiMultiplayer.getAndSetSelectedServer(this.parentGui, par1); ++ ServerData var4 = GuiMultiplayer.getInternetServerList(this.parentGui).countServers() > par1 ? GuiMultiplayer.getInternetServerList(this.parentGui).getServerData(par1) : null; ++ boolean var5 = GuiMultiplayer.getSelectedServer(this.parentGui) >= 0 && GuiMultiplayer.getSelectedServer(this.parentGui) < this.getSize() && (var4 == null || var4.field_82821_f == 78); ++ boolean var6 = GuiMultiplayer.getSelectedServer(this.parentGui) < GuiMultiplayer.getInternetServerList(this.parentGui).countServers(); ++ GuiMultiplayer.getButtonSelect(this.parentGui).enabled = var5; ++ GuiMultiplayer.getButtonEdit(this.parentGui).enabled = var6; ++ GuiMultiplayer.getButtonDelete(this.parentGui).enabled = var6; ++ ++ if (par2 && var5) ++ { ++ GuiMultiplayer.func_74008_b(this.parentGui, par1); ++ } ++ else if (var6 && GuiScreen.isShiftKeyDown() && var3 >= 0 && var3 < GuiMultiplayer.getInternetServerList(this.parentGui).countServers()) ++ { ++ GuiMultiplayer.getInternetServerList(this.parentGui).swapServers(var3, GuiMultiplayer.getSelectedServer(this.parentGui)); ++ } ++ } ++ } ++ ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) ++ { ++ return par1 == GuiMultiplayer.getSelectedServer(this.parentGui); ++ } ++ ++ /** ++ * return the height of the content being scrolled ++ */ ++ protected int getContentHeight() ++ { ++ return this.getSize() * 36; ++ } ++ ++ protected void drawBackground() ++ { ++ this.parentGui.drawDefaultBackground(); ++ } ++ ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) ++ { ++ if (par1 < GuiMultiplayer.getInternetServerList(this.parentGui).countServers()) ++ { ++ this.func_77247_d(par1, par2, par3, par4, par5Tessellator); ++ } ++ else if (par1 < GuiMultiplayer.getInternetServerList(this.parentGui).countServers() + GuiMultiplayer.getListOfLanServers(this.parentGui).size()) ++ { ++ this.func_77248_b(par1, par2, par3, par4, par5Tessellator); ++ } ++ else ++ { ++ this.func_77249_c(par1, par2, par3, par4, par5Tessellator); ++ } ++ } ++ ++ private void func_77248_b(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) ++ { ++ LanServer var6 = (LanServer)GuiMultiplayer.getListOfLanServers(this.parentGui).get(par1 - GuiMultiplayer.getInternetServerList(this.parentGui).countServers()); ++ this.parentGui.drawString(this.parentGui.fontRenderer, I18n.getString("lanServer.title"), par2 + 2, par3 + 1, 16777215); ++ this.parentGui.drawString(this.parentGui.fontRenderer, var6.getServerMotd(), par2 + 2, par3 + 12, 8421504); ++ ++ if (this.parentGui.mc.gameSettings.hideServerAddress) ++ { ++ this.parentGui.drawString(this.parentGui.fontRenderer, I18n.getString("selectServer.hiddenAddress"), par2 + 2, par3 + 12 + 11, 3158064); ++ } ++ else ++ { ++ this.parentGui.drawString(this.parentGui.fontRenderer, var6.getServerIpPort(), par2 + 2, par3 + 12 + 11, 3158064); ++ } ++ } ++ ++ private void func_77249_c(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) ++ { ++ this.parentGui.drawCenteredString(this.parentGui.fontRenderer, I18n.getString("lanServer.scanning"), this.parentGui.width / 2, par3 + 1, 16777215); ++ String var6; ++ ++ switch (GuiMultiplayer.getTicksOpened(this.parentGui) / 3 % 4) ++ { ++ case 0: ++ default: ++ var6 = "O o o"; ++ break; ++ ++ case 1: ++ case 3: ++ var6 = "o O o"; ++ break; ++ ++ case 2: ++ var6 = "o o O"; ++ } ++ ++ this.parentGui.drawCenteredString(this.parentGui.fontRenderer, var6, this.parentGui.width / 2, par3 + 12, 8421504); ++ } ++ ++ private void func_77247_d(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) ++ { ++ ServerData var6 = GuiMultiplayer.getInternetServerList(this.parentGui).getServerData(par1); ++ ++ synchronized (GuiMultiplayer.getLock()) ++ { ++ if (GuiMultiplayer.getThreadsPending() < 5 && !var6.field_78841_f) ++ { ++ var6.field_78841_f = true; ++ var6.pingToServer = -2L; ++ var6.serverMOTD = ""; ++ var6.populationInfo = ""; ++ GuiMultiplayer.increaseThreadsPending(); ++ (new ThreadPollServers(this, var6)).start(); ++ } ++ } ++ ++ boolean var7 = var6.field_82821_f > 78; ++ boolean var8 = var6.field_82821_f < 78; ++ boolean var9 = var7 || var8; ++ this.parentGui.drawString(this.parentGui.fontRenderer, var6.serverName, par2 + 2, par3 + 1, 16777215); ++ this.parentGui.drawString(this.parentGui.fontRenderer, var6.serverMOTD, par2 + 2, par3 + 12, 8421504); ++ this.parentGui.drawString(this.parentGui.fontRenderer, var6.populationInfo, par2 + 215 - this.parentGui.fontRenderer.getStringWidth(var6.populationInfo), par3 + 12, 8421504); ++ ++ if (var9) ++ { ++ String var10 = EnumChatFormatting.DARK_RED + var6.gameVersion; ++ this.parentGui.drawString(this.parentGui.fontRenderer, var10, par2 + 200 - this.parentGui.fontRenderer.getStringWidth(var10), par3 + 1, 8421504); ++ } ++ ++ if (!this.parentGui.mc.gameSettings.hideServerAddress && !var6.isHidingAddress()) ++ { ++ this.parentGui.drawString(this.parentGui.fontRenderer, var6.serverIP, par2 + 2, par3 + 12 + 11, 3158064); ++ } ++ else ++ { ++ this.parentGui.drawString(this.parentGui.fontRenderer, I18n.getString("selectServer.hiddenAddress"), par2 + 2, par3 + 12 + 11, 3158064); ++ } ++ ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.parentGui.mc.getTextureManager().bindTexture(Gui.icons); ++ byte var15 = 0; ++ boolean var11 = false; ++ String var12 = ""; ++ int var16; ++ ++ if (var9) ++ { ++ var12 = var7 ? "Client out of date!" : "Server out of date!"; ++ var16 = 5; ++ } ++ else if (var6.field_78841_f && var6.pingToServer != -2L) ++ { ++ if (var6.pingToServer < 0L) ++ { ++ var16 = 5; ++ } ++ else if (var6.pingToServer < 150L) ++ { ++ var16 = 0; ++ } ++ else if (var6.pingToServer < 300L) ++ { ++ var16 = 1; ++ } ++ else if (var6.pingToServer < 600L) ++ { ++ var16 = 2; ++ } ++ else if (var6.pingToServer < 1000L) ++ { ++ var16 = 3; ++ } ++ else ++ { ++ var16 = 4; ++ } ++ ++ if (var6.pingToServer < 0L) ++ { ++ var12 = "(no connection)"; ++ } ++ else ++ { ++ var12 = var6.pingToServer + "ms"; ++ } ++ } ++ else ++ { ++ var15 = 1; ++ var16 = (int)(Minecraft.getSystemTime() / 100L + (long)(par1 * 2) & 7L); ++ ++ if (var16 > 4) ++ { ++ var16 = 8 - var16; ++ } ++ ++ var12 = "Polling.."; ++ } ++ ++ this.parentGui.drawTexturedModalRect(par2 + 205, par3, 0 + var15 * 10, 176 + var16 * 8, 10, 8); ++ byte var13 = 4; ++ ++ if (this.mouseX >= par2 + 205 - var13 && this.mouseY >= par3 - var13 && this.mouseX <= par2 + 205 + 10 + var13 && this.mouseY <= par3 + 8 + var13) ++ { ++ GuiMultiplayer.getAndSetLagTooltip(this.parentGui, var12); ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiSlotStats.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,248 ---- ++ package net.minecraft.src; ++ ++ import java.util.Collections; ++ import java.util.Comparator; ++ import java.util.List; ++ import org.lwjgl.input.Mouse; ++ ++ abstract class GuiSlotStats extends GuiSlot ++ { ++ protected int field_77262_g; ++ protected List field_77266_h; ++ protected Comparator field_77267_i; ++ protected int field_77264_j; ++ protected int field_77265_k; ++ ++ final GuiStats statsGui; ++ ++ protected GuiSlotStats(GuiStats par1GuiStats) ++ { ++ super(GuiStats.getMinecraft1(par1GuiStats), par1GuiStats.width, par1GuiStats.height, 32, par1GuiStats.height - 64, 20); ++ this.statsGui = par1GuiStats; ++ this.field_77262_g = -1; ++ this.field_77264_j = -1; ++ this.setShowSelectionBox(false); ++ this.func_77223_a(true, 20); ++ } ++ ++ /** ++ * the element in the slot that was clicked, boolean for wether it was double clicked or not ++ */ ++ protected void elementClicked(int par1, boolean par2) {} ++ ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) ++ { ++ return false; ++ } ++ ++ protected void drawBackground() ++ { ++ this.statsGui.drawDefaultBackground(); ++ } ++ ++ protected void func_77222_a(int par1, int par2, Tessellator par3Tessellator) ++ { ++ if (!Mouse.isButtonDown(0)) ++ { ++ this.field_77262_g = -1; ++ } ++ ++ if (this.field_77262_g == 0) ++ { ++ GuiStats.drawSprite(this.statsGui, par1 + 115 - 18, par2 + 1, 0, 0); ++ } ++ else ++ { ++ GuiStats.drawSprite(this.statsGui, par1 + 115 - 18, par2 + 1, 0, 18); ++ } ++ ++ if (this.field_77262_g == 1) ++ { ++ GuiStats.drawSprite(this.statsGui, par1 + 165 - 18, par2 + 1, 0, 0); ++ } ++ else ++ { ++ GuiStats.drawSprite(this.statsGui, par1 + 165 - 18, par2 + 1, 0, 18); ++ } ++ ++ if (this.field_77262_g == 2) ++ { ++ GuiStats.drawSprite(this.statsGui, par1 + 215 - 18, par2 + 1, 0, 0); ++ } ++ else ++ { ++ GuiStats.drawSprite(this.statsGui, par1 + 215 - 18, par2 + 1, 0, 18); ++ } ++ ++ if (this.field_77264_j != -1) ++ { ++ short var4 = 79; ++ byte var5 = 18; ++ ++ if (this.field_77264_j == 1) ++ { ++ var4 = 129; ++ } ++ else if (this.field_77264_j == 2) ++ { ++ var4 = 179; ++ } ++ ++ if (this.field_77265_k == 1) ++ { ++ var5 = 36; ++ } ++ ++ GuiStats.drawSprite(this.statsGui, par1 + var4, par2 + 1, var5, 0); ++ } ++ } ++ ++ protected void func_77224_a(int par1, int par2) ++ { ++ this.field_77262_g = -1; ++ ++ if (par1 >= 79 && par1 < 115) ++ { ++ this.field_77262_g = 0; ++ } ++ else if (par1 >= 129 && par1 < 165) ++ { ++ this.field_77262_g = 1; ++ } ++ else if (par1 >= 179 && par1 < 215) ++ { ++ this.field_77262_g = 2; ++ } ++ ++ if (this.field_77262_g >= 0) ++ { ++ this.func_77261_e(this.field_77262_g); ++ GuiStats.getMinecraft2(this.statsGui).sndManager.playSoundFX("random.click", 1.0F, 1.0F); ++ } ++ } ++ ++ /** ++ * Gets the size of the current slot list. ++ */ ++ protected final int getSize() ++ { ++ return this.field_77266_h.size(); ++ } ++ ++ protected final StatCrafting func_77257_d(int par1) ++ { ++ return (StatCrafting)this.field_77266_h.get(par1); ++ } ++ ++ protected abstract String func_77258_c(int var1); ++ ++ protected void func_77260_a(StatCrafting par1StatCrafting, int par2, int par3, boolean par4) ++ { ++ String var5; ++ ++ if (par1StatCrafting != null) ++ { ++ var5 = par1StatCrafting.func_75968_a(GuiStats.getStatsFileWriter(this.statsGui).writeStat(par1StatCrafting)); ++ this.statsGui.drawString(GuiStats.getFontRenderer4(this.statsGui), var5, par2 - GuiStats.getFontRenderer5(this.statsGui).getStringWidth(var5), par3 + 5, par4 ? 16777215 : 9474192); ++ } ++ else ++ { ++ var5 = "-"; ++ this.statsGui.drawString(GuiStats.getFontRenderer6(this.statsGui), var5, par2 - GuiStats.getFontRenderer7(this.statsGui).getStringWidth(var5), par3 + 5, par4 ? 16777215 : 9474192); ++ } ++ } ++ ++ protected void func_77215_b(int par1, int par2) ++ { ++ if (par2 >= this.top && par2 <= this.bottom) ++ { ++ int var3 = this.func_77210_c(par1, par2); ++ int var4 = this.statsGui.width / 2 - 92 - 16; ++ ++ if (var3 >= 0) ++ { ++ if (par1 < var4 + 40 || par1 > var4 + 40 + 20) ++ { ++ return; ++ } ++ ++ StatCrafting var5 = this.func_77257_d(var3); ++ this.func_77259_a(var5, par1, par2); ++ } ++ else ++ { ++ String var9 = ""; ++ ++ if (par1 >= var4 + 115 - 18 && par1 <= var4 + 115) ++ { ++ var9 = this.func_77258_c(0); ++ } ++ else if (par1 >= var4 + 165 - 18 && par1 <= var4 + 165) ++ { ++ var9 = this.func_77258_c(1); ++ } ++ else ++ { ++ if (par1 < var4 + 215 - 18 || par1 > var4 + 215) ++ { ++ return; ++ } ++ ++ var9 = this.func_77258_c(2); ++ } ++ ++ var9 = ("" + I18n.getString(var9)).trim(); ++ ++ if (var9.length() > 0) ++ { ++ int var6 = par1 + 12; ++ int var7 = par2 - 12; ++ int var8 = GuiStats.getFontRenderer8(this.statsGui).getStringWidth(var9); ++ GuiStats.drawGradientRect(this.statsGui, var6 - 3, var7 - 3, var6 + var8 + 3, var7 + 8 + 3, -1073741824, -1073741824); ++ GuiStats.getFontRenderer9(this.statsGui).drawStringWithShadow(var9, var6, var7, -1); ++ } ++ } ++ } ++ } ++ ++ protected void func_77259_a(StatCrafting par1StatCrafting, int par2, int par3) ++ { ++ if (par1StatCrafting != null) ++ { ++ Item var4 = Item.itemsList[par1StatCrafting.getItemID()]; ++ String var5 = ("" + I18n.getString(var4.getUnlocalizedName() + ".name")).trim(); ++ ++ if (var5.length() > 0) ++ { ++ int var6 = par2 + 12; ++ int var7 = par3 - 12; ++ int var8 = GuiStats.getFontRenderer10(this.statsGui).getStringWidth(var5); ++ GuiStats.drawGradientRect1(this.statsGui, var6 - 3, var7 - 3, var6 + var8 + 3, var7 + 8 + 3, -1073741824, -1073741824); ++ GuiStats.getFontRenderer11(this.statsGui).drawStringWithShadow(var5, var6, var7, -1); ++ } ++ } ++ } ++ ++ protected void func_77261_e(int par1) ++ { ++ if (par1 != this.field_77264_j) ++ { ++ this.field_77264_j = par1; ++ this.field_77265_k = -1; ++ } ++ else if (this.field_77265_k == -1) ++ { ++ this.field_77265_k = 1; ++ } ++ else ++ { ++ this.field_77264_j = -1; ++ this.field_77265_k = 0; ++ } ++ ++ Collections.sort(this.field_77266_h, this.field_77267_i); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiSlotStatsBlock.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,92 ---- ++ package net.minecraft.src; ++ ++ import java.util.ArrayList; ++ import java.util.Iterator; ++ ++ class GuiSlotStatsBlock extends GuiSlotStats ++ { ++ /** Instance of GuiStats. */ ++ final GuiStats theStats; ++ ++ public GuiSlotStatsBlock(GuiStats par1GuiStats) ++ { ++ super(par1GuiStats); ++ this.theStats = par1GuiStats; ++ this.field_77266_h = new ArrayList(); ++ Iterator var2 = StatList.objectMineStats.iterator(); ++ ++ while (var2.hasNext()) ++ { ++ StatCrafting var3 = (StatCrafting)var2.next(); ++ boolean var4 = false; ++ int var5 = var3.getItemID(); ++ ++ if (GuiStats.getStatsFileWriter(par1GuiStats).writeStat(var3) > 0) ++ { ++ var4 = true; ++ } ++ else if (StatList.objectUseStats[var5] != null && GuiStats.getStatsFileWriter(par1GuiStats).writeStat(StatList.objectUseStats[var5]) > 0) ++ { ++ var4 = true; ++ } ++ else if (StatList.objectCraftStats[var5] != null && GuiStats.getStatsFileWriter(par1GuiStats).writeStat(StatList.objectCraftStats[var5]) > 0) ++ { ++ var4 = true; ++ } ++ ++ if (var4) ++ { ++ this.field_77266_h.add(var3); ++ } ++ } ++ ++ this.field_77267_i = new SorterStatsBlock(this, par1GuiStats); ++ } ++ ++ protected void func_77222_a(int par1, int par2, Tessellator par3Tessellator) ++ { ++ super.func_77222_a(par1, par2, par3Tessellator); ++ ++ if (this.field_77262_g == 0) ++ { ++ GuiStats.drawSprite(this.theStats, par1 + 115 - 18 + 1, par2 + 1 + 1, 18, 18); ++ } ++ else ++ { ++ GuiStats.drawSprite(this.theStats, par1 + 115 - 18, par2 + 1, 18, 18); ++ } ++ ++ if (this.field_77262_g == 1) ++ { ++ GuiStats.drawSprite(this.theStats, par1 + 165 - 18 + 1, par2 + 1 + 1, 36, 18); ++ } ++ else ++ { ++ GuiStats.drawSprite(this.theStats, par1 + 165 - 18, par2 + 1, 36, 18); ++ } ++ ++ if (this.field_77262_g == 2) ++ { ++ GuiStats.drawSprite(this.theStats, par1 + 215 - 18 + 1, par2 + 1 + 1, 54, 18); ++ } ++ else ++ { ++ GuiStats.drawSprite(this.theStats, par1 + 215 - 18, par2 + 1, 54, 18); ++ } ++ } ++ ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) ++ { ++ StatCrafting var6 = this.func_77257_d(par1); ++ int var7 = var6.getItemID(); ++ GuiStats.drawItemSprite(this.theStats, par2 + 40, par3, var7); ++ this.func_77260_a((StatCrafting)StatList.objectCraftStats[var7], par2 + 115, par3, par1 % 2 == 0); ++ this.func_77260_a((StatCrafting)StatList.objectUseStats[var7], par2 + 165, par3, par1 % 2 == 0); ++ this.func_77260_a(var6, par2 + 215, par3, par1 % 2 == 0); ++ } ++ ++ protected String func_77258_c(int par1) ++ { ++ return par1 == 0 ? "stat.crafted" : (par1 == 1 ? "stat.used" : "stat.mined"); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiSlotStatsGeneral.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,55 ---- ++ package net.minecraft.src; ++ ++ class GuiSlotStatsGeneral extends GuiSlot ++ { ++ final GuiStats statsGui; ++ ++ public GuiSlotStatsGeneral(GuiStats par1GuiStats) ++ { ++ super(GuiStats.getMinecraft(par1GuiStats), par1GuiStats.width, par1GuiStats.height, 32, par1GuiStats.height - 64, 10); ++ this.statsGui = par1GuiStats; ++ this.setShowSelectionBox(false); ++ } ++ ++ /** ++ * Gets the size of the current slot list. ++ */ ++ protected int getSize() ++ { ++ return StatList.generalStats.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) {} ++ ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) ++ { ++ return false; ++ } ++ ++ /** ++ * return the height of the content being scrolled ++ */ ++ protected int getContentHeight() ++ { ++ return this.getSize() * 10; ++ } ++ ++ protected void drawBackground() ++ { ++ this.statsGui.drawDefaultBackground(); ++ } ++ ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) ++ { ++ StatBase var6 = (StatBase)StatList.generalStats.get(par1); ++ this.statsGui.drawString(GuiStats.getFontRenderer1(this.statsGui), I18n.getString(var6.getName()), par2 + 2, par3 + 1, par1 % 2 == 0 ? 16777215 : 9474192); ++ String var7 = var6.func_75968_a(GuiStats.getStatsFileWriter(this.statsGui).writeStat(var6)); ++ this.statsGui.drawString(GuiStats.getFontRenderer2(this.statsGui), var7, par2 + 2 + 213 - GuiStats.getFontRenderer3(this.statsGui).getStringWidth(var7), par3 + 1, par1 % 2 == 0 ? 16777215 : 9474192); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiSlotStatsItem.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,92 ---- ++ package net.minecraft.src; ++ ++ import java.util.ArrayList; ++ import java.util.Iterator; ++ ++ class GuiSlotStatsItem extends GuiSlotStats ++ { ++ /** Instance of GuiStats. */ ++ final GuiStats slotGuiStats; ++ ++ public GuiSlotStatsItem(GuiStats par1GuiStats) ++ { ++ super(par1GuiStats); ++ this.slotGuiStats = par1GuiStats; ++ this.field_77266_h = new ArrayList(); ++ Iterator var2 = StatList.itemStats.iterator(); ++ ++ while (var2.hasNext()) ++ { ++ StatCrafting var3 = (StatCrafting)var2.next(); ++ boolean var4 = false; ++ int var5 = var3.getItemID(); ++ ++ if (GuiStats.getStatsFileWriter(par1GuiStats).writeStat(var3) > 0) ++ { ++ var4 = true; ++ } ++ else if (StatList.objectBreakStats[var5] != null && GuiStats.getStatsFileWriter(par1GuiStats).writeStat(StatList.objectBreakStats[var5]) > 0) ++ { ++ var4 = true; ++ } ++ else if (StatList.objectCraftStats[var5] != null && GuiStats.getStatsFileWriter(par1GuiStats).writeStat(StatList.objectCraftStats[var5]) > 0) ++ { ++ var4 = true; ++ } ++ ++ if (var4) ++ { ++ this.field_77266_h.add(var3); ++ } ++ } ++ ++ this.field_77267_i = new SorterStatsItem(this, par1GuiStats); ++ } ++ ++ protected void func_77222_a(int par1, int par2, Tessellator par3Tessellator) ++ { ++ super.func_77222_a(par1, par2, par3Tessellator); ++ ++ if (this.field_77262_g == 0) ++ { ++ GuiStats.drawSprite(this.slotGuiStats, par1 + 115 - 18 + 1, par2 + 1 + 1, 72, 18); ++ } ++ else ++ { ++ GuiStats.drawSprite(this.slotGuiStats, par1 + 115 - 18, par2 + 1, 72, 18); ++ } ++ ++ if (this.field_77262_g == 1) ++ { ++ GuiStats.drawSprite(this.slotGuiStats, par1 + 165 - 18 + 1, par2 + 1 + 1, 18, 18); ++ } ++ else ++ { ++ GuiStats.drawSprite(this.slotGuiStats, par1 + 165 - 18, par2 + 1, 18, 18); ++ } ++ ++ if (this.field_77262_g == 2) ++ { ++ GuiStats.drawSprite(this.slotGuiStats, par1 + 215 - 18 + 1, par2 + 1 + 1, 36, 18); ++ } ++ else ++ { ++ GuiStats.drawSprite(this.slotGuiStats, par1 + 215 - 18, par2 + 1, 36, 18); ++ } ++ } ++ ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) ++ { ++ StatCrafting var6 = this.func_77257_d(par1); ++ int var7 = var6.getItemID(); ++ GuiStats.drawItemSprite(this.slotGuiStats, par2 + 40, par3, var7); ++ this.func_77260_a((StatCrafting)StatList.objectBreakStats[var7], par2 + 115, par3, par1 % 2 == 0); ++ this.func_77260_a((StatCrafting)StatList.objectCraftStats[var7], par2 + 165, par3, par1 % 2 == 0); ++ this.func_77260_a(var6, par2 + 215, par3, par1 % 2 == 0); ++ } ++ ++ protected String func_77258_c(int par1) ++ { ++ return par1 == 1 ? "stat.crafted" : (par1 == 2 ? "stat.used" : "stat.depleted"); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiSmallButton.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,28 ---- ++ package net.minecraft.src; ++ ++ public class GuiSmallButton extends GuiButton ++ { ++ private final EnumOptions enumOptions; ++ ++ public GuiSmallButton(int par1, int par2, int par3, String par4Str) ++ { ++ this(par1, par2, par3, (EnumOptions)null, par4Str); ++ } ++ ++ public GuiSmallButton(int par1, int par2, int par3, int par4, int par5, String par6Str) ++ { ++ super(par1, par2, par3, par4, par5, par6Str); ++ this.enumOptions = null; ++ } ++ ++ public GuiSmallButton(int par1, int par2, int par3, EnumOptions par4EnumOptions, String par5Str) ++ { ++ super(par1, par2, par3, 150, 20, par5Str); ++ this.enumOptions = par4EnumOptions; ++ } ++ ++ public EnumOptions returnEnumOptions() ++ { ++ return this.enumOptions; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiSnooper.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,131 ---- ++ package net.minecraft.src; ++ ++ import java.util.ArrayList; ++ import java.util.Iterator; ++ import java.util.List; ++ import java.util.TreeMap; ++ import java.util.Map.Entry; ++ ++ public class GuiSnooper extends GuiScreen ++ { ++ /** Instance of GuiScreen. */ ++ private final GuiScreen snooperGuiScreen; ++ ++ /** Instance of GameSettings. */ ++ private final GameSettings snooperGameSettings; ++ private final List field_74098_c = new ArrayList(); ++ private final List field_74096_d = new ArrayList(); ++ ++ /** The Snooper title. */ ++ private String snooperTitle; ++ private String[] field_74101_n; ++ private GuiSnooperList snooperList; ++ private GuiButton buttonAllowSnooping; ++ ++ public GuiSnooper(GuiScreen par1GuiScreen, GameSettings par2GameSettings) ++ { ++ this.snooperGuiScreen = par1GuiScreen; ++ this.snooperGameSettings = par2GameSettings; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.snooperTitle = I18n.getString("options.snooper.title"); ++ String var1 = I18n.getString("options.snooper.desc"); ++ ArrayList var2 = new ArrayList(); ++ Iterator var3 = this.fontRenderer.listFormattedStringToWidth(var1, this.width - 30).iterator(); ++ ++ while (var3.hasNext()) ++ { ++ String var4 = (String)var3.next(); ++ var2.add(var4); ++ } ++ ++ this.field_74101_n = (String[])var2.toArray(new String[0]); ++ this.field_74098_c.clear(); ++ this.field_74096_d.clear(); ++ this.buttonList.add(this.buttonAllowSnooping = new GuiButton(1, this.width / 2 - 152, this.height - 30, 150, 20, this.snooperGameSettings.getKeyBinding(EnumOptions.SNOOPER_ENABLED))); ++ this.buttonList.add(new GuiButton(2, this.width / 2 + 2, this.height - 30, 150, 20, I18n.getString("gui.done"))); ++ boolean var6 = this.mc.getIntegratedServer() != null && this.mc.getIntegratedServer().getPlayerUsageSnooper() != null; ++ Iterator var7 = (new TreeMap(this.mc.getPlayerUsageSnooper().getCurrentStats())).entrySet().iterator(); ++ Entry var5; ++ ++ while (var7.hasNext()) ++ { ++ var5 = (Entry)var7.next(); ++ this.field_74098_c.add((var6 ? "C " : "") + (String)var5.getKey()); ++ this.field_74096_d.add(this.fontRenderer.trimStringToWidth((String)var5.getValue(), this.width - 220)); ++ } ++ ++ if (var6) ++ { ++ var7 = (new TreeMap(this.mc.getIntegratedServer().getPlayerUsageSnooper().getCurrentStats())).entrySet().iterator(); ++ ++ while (var7.hasNext()) ++ { ++ var5 = (Entry)var7.next(); ++ this.field_74098_c.add("S " + (String)var5.getKey()); ++ this.field_74096_d.add(this.fontRenderer.trimStringToWidth((String)var5.getValue(), this.width - 220)); ++ } ++ } ++ ++ this.snooperList = new GuiSnooperList(this); ++ } ++ ++ /** ++ * 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 == 2) ++ { ++ this.snooperGameSettings.saveOptions(); ++ this.snooperGameSettings.saveOptions(); ++ this.mc.displayGuiScreen(this.snooperGuiScreen); ++ } ++ ++ if (par1GuiButton.id == 1) ++ { ++ this.snooperGameSettings.setOptionValue(EnumOptions.SNOOPER_ENABLED, 1); ++ this.buttonAllowSnooping.displayString = this.snooperGameSettings.getKeyBinding(EnumOptions.SNOOPER_ENABLED); ++ } ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.snooperList.drawScreen(par1, par2, par3); ++ this.drawCenteredString(this.fontRenderer, this.snooperTitle, this.width / 2, 8, 16777215); ++ int var4 = 22; ++ String[] var5 = this.field_74101_n; ++ int var6 = var5.length; ++ ++ for (int var7 = 0; var7 < var6; ++var7) ++ { ++ String var8 = var5[var7]; ++ this.drawCenteredString(this.fontRenderer, var8, this.width / 2, var4, 8421504); ++ var4 += this.fontRenderer.FONT_HEIGHT; ++ } ++ ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ static List func_74095_a(GuiSnooper par0GuiSnooper) ++ { ++ return par0GuiSnooper.field_74098_c; ++ } ++ ++ static List func_74094_b(GuiSnooper par0GuiSnooper) ++ { ++ return par0GuiSnooper.field_74096_d; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiSnooperList.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,46 ---- ++ package net.minecraft.src; ++ ++ class GuiSnooperList extends GuiSlot ++ { ++ final GuiSnooper snooperGui; ++ ++ public GuiSnooperList(GuiSnooper par1GuiSnooper) ++ { ++ super(par1GuiSnooper.mc, par1GuiSnooper.width, par1GuiSnooper.height, 80, par1GuiSnooper.height - 40, par1GuiSnooper.fontRenderer.FONT_HEIGHT + 1); ++ this.snooperGui = par1GuiSnooper; ++ } ++ ++ /** ++ * Gets the size of the current slot list. ++ */ ++ protected int getSize() ++ { ++ return GuiSnooper.func_74095_a(this.snooperGui).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) {} ++ ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) ++ { ++ return false; ++ } ++ ++ protected void drawBackground() {} ++ ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) ++ { ++ this.snooperGui.fontRenderer.drawString((String)GuiSnooper.func_74095_a(this.snooperGui).get(par1), 10, par3, 16777215); ++ this.snooperGui.fontRenderer.drawString((String)GuiSnooper.func_74094_b(this.snooperGui).get(par1), 230, par3, 16777215); ++ } ++ ++ protected int getScrollBarX() ++ { ++ return this.snooperGui.width - 10; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiStats.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,295 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ import org.lwjgl.opengl.GL12; ++ ++ public class GuiStats extends GuiScreen ++ { ++ private static RenderItem renderItem = new RenderItem(); ++ protected GuiScreen parentGui; ++ ++ /** The title of the stats screen. */ ++ protected String statsTitle = "Select world"; ++ ++ /** The slot for general stats. */ ++ private GuiSlotStatsGeneral slotGeneral; ++ ++ /** The slot for item stats. */ ++ private GuiSlotStatsItem slotItem; ++ ++ /** The slot for block stats. */ ++ private GuiSlotStatsBlock slotBlock; ++ private StatFileWriter statFileWriter; ++ ++ /** The currently-selected slot. */ ++ private GuiSlot selectedSlot; ++ ++ public GuiStats(GuiScreen par1GuiScreen, StatFileWriter par2StatFileWriter) ++ { ++ this.parentGui = par1GuiScreen; ++ this.statFileWriter = par2StatFileWriter; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.statsTitle = I18n.getString("gui.stats"); ++ this.slotGeneral = new GuiSlotStatsGeneral(this); ++ this.slotGeneral.registerScrollButtons(1, 1); ++ this.slotItem = new GuiSlotStatsItem(this); ++ this.slotItem.registerScrollButtons(1, 1); ++ this.slotBlock = new GuiSlotStatsBlock(this); ++ this.slotBlock.registerScrollButtons(1, 1); ++ this.selectedSlot = this.slotGeneral; ++ this.addHeaderButtons(); ++ } ++ ++ /** ++ * Creates the buttons that appear at the top of the Stats GUI. ++ */ ++ public void addHeaderButtons() ++ { ++ this.buttonList.add(new GuiButton(0, this.width / 2 + 4, this.height - 28, 150, 20, I18n.getString("gui.done"))); ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, I18n.getString("stat.generalButton"))); ++ GuiButton var1; ++ this.buttonList.add(var1 = new GuiButton(2, this.width / 2 - 46, this.height - 52, 100, 20, I18n.getString("stat.blocksButton"))); ++ GuiButton var2; ++ this.buttonList.add(var2 = new GuiButton(3, this.width / 2 + 62, this.height - 52, 100, 20, I18n.getString("stat.itemsButton"))); ++ ++ if (this.slotBlock.getSize() == 0) ++ { ++ var1.enabled = false; ++ } ++ ++ if (this.slotItem.getSize() == 0) ++ { ++ var2.enabled = false; ++ } ++ } ++ ++ /** ++ * 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 == 0) ++ { ++ this.mc.displayGuiScreen(this.parentGui); ++ } ++ else if (par1GuiButton.id == 1) ++ { ++ this.selectedSlot = this.slotGeneral; ++ } ++ else if (par1GuiButton.id == 3) ++ { ++ this.selectedSlot = this.slotItem; ++ } ++ else if (par1GuiButton.id == 2) ++ { ++ this.selectedSlot = this.slotBlock; ++ } ++ else ++ { ++ this.selectedSlot.actionPerformed(par1GuiButton); ++ } ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.selectedSlot.drawScreen(par1, par2, par3); ++ this.drawCenteredString(this.fontRenderer, this.statsTitle, this.width / 2, 20, 16777215); ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ /** ++ * Draws the item sprite on top of the background sprite. ++ */ ++ private void drawItemSprite(int par1, int par2, int par3) ++ { ++ this.drawButtonBackground(par1 + 1, par2 + 1); ++ GL11.glEnable(GL12.GL_RESCALE_NORMAL); ++ RenderHelper.enableGUIStandardItemLighting(); ++ renderItem.renderItemIntoGUI(this.fontRenderer, this.mc.getTextureManager(), new ItemStack(par3, 1, 0), par1 + 2, par2 + 2); ++ RenderHelper.disableStandardItemLighting(); ++ GL11.glDisable(GL12.GL_RESCALE_NORMAL); ++ } ++ ++ /** ++ * Draws a gray box that serves as a button background. ++ */ ++ private void drawButtonBackground(int par1, int par2) ++ { ++ this.drawSprite(par1, par2, 0, 0); ++ } ++ ++ /** ++ * "Draws a sprite from assets/textures/gui/container/stats_icons.png" ++ */ ++ private void drawSprite(int par1, int par2, int par3, int par4) ++ { ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.mc.getTextureManager().bindTexture(statIcons); ++ float var5 = 0.0078125F; ++ float var6 = 0.0078125F; ++ boolean var7 = true; ++ boolean var8 = true; ++ Tessellator var9 = Tessellator.instance; ++ var9.startDrawingQuads(); ++ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 18), (double)this.zLevel, (double)((float)(par3 + 0) * 0.0078125F), (double)((float)(par4 + 18) * 0.0078125F)); ++ var9.addVertexWithUV((double)(par1 + 18), (double)(par2 + 18), (double)this.zLevel, (double)((float)(par3 + 18) * 0.0078125F), (double)((float)(par4 + 18) * 0.0078125F)); ++ var9.addVertexWithUV((double)(par1 + 18), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + 18) * 0.0078125F), (double)((float)(par4 + 0) * 0.0078125F)); ++ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + 0) * 0.0078125F), (double)((float)(par4 + 0) * 0.0078125F)); ++ var9.draw(); ++ } ++ ++ static Minecraft getMinecraft(GuiStats par0GuiStats) ++ { ++ return par0GuiStats.mc; ++ } ++ ++ /** ++ * there are 11 identical methods like this ++ */ ++ static FontRenderer getFontRenderer1(GuiStats par0GuiStats) ++ { ++ return par0GuiStats.fontRenderer; ++ } ++ ++ static StatFileWriter getStatsFileWriter(GuiStats par0GuiStats) ++ { ++ return par0GuiStats.statFileWriter; ++ } ++ ++ /** ++ * there are 11 identical methods like this ++ */ ++ static FontRenderer getFontRenderer2(GuiStats par0GuiStats) ++ { ++ return par0GuiStats.fontRenderer; ++ } ++ ++ /** ++ * there are 11 identical methods like this ++ */ ++ static FontRenderer getFontRenderer3(GuiStats par0GuiStats) ++ { ++ return par0GuiStats.fontRenderer; ++ } ++ ++ /** ++ * exactly the same as 27141 ++ */ ++ static Minecraft getMinecraft1(GuiStats par0GuiStats) ++ { ++ return par0GuiStats.mc; ++ } ++ ++ /** ++ * Draws a sprite from /gui/slot.png. ++ */ ++ static void drawSprite(GuiStats par0GuiStats, int par1, int par2, int par3, int par4) ++ { ++ par0GuiStats.drawSprite(par1, par2, par3, par4); ++ } ++ ++ /** ++ * exactly the same as 27141 and 27143 ++ */ ++ static Minecraft getMinecraft2(GuiStats par0GuiStats) ++ { ++ return par0GuiStats.mc; ++ } ++ ++ /** ++ * there are 11 identical methods like this ++ */ ++ static FontRenderer getFontRenderer4(GuiStats par0GuiStats) ++ { ++ return par0GuiStats.fontRenderer; ++ } ++ ++ /** ++ * there are 11 identical methods like this ++ */ ++ static FontRenderer getFontRenderer5(GuiStats par0GuiStats) ++ { ++ return par0GuiStats.fontRenderer; ++ } ++ ++ /** ++ * there are 11 identical methods like this ++ */ ++ static FontRenderer getFontRenderer6(GuiStats par0GuiStats) ++ { ++ return par0GuiStats.fontRenderer; ++ } ++ ++ /** ++ * there are 11 identical methods like this ++ */ ++ static FontRenderer getFontRenderer7(GuiStats par0GuiStats) ++ { ++ return par0GuiStats.fontRenderer; ++ } ++ ++ /** ++ * there are 11 identical methods like this ++ */ ++ static FontRenderer getFontRenderer8(GuiStats par0GuiStats) ++ { ++ return par0GuiStats.fontRenderer; ++ } ++ ++ static void drawGradientRect(GuiStats par0GuiStats, int par1, int par2, int par3, int par4, int par5, int par6) ++ { ++ par0GuiStats.drawGradientRect(par1, par2, par3, par4, par5, par6); ++ } ++ ++ /** ++ * there are 11 identical methods like this ++ */ ++ static FontRenderer getFontRenderer9(GuiStats par0GuiStats) ++ { ++ return par0GuiStats.fontRenderer; ++ } ++ ++ /** ++ * there are 11 identical methods like this ++ */ ++ static FontRenderer getFontRenderer10(GuiStats par0GuiStats) ++ { ++ return par0GuiStats.fontRenderer; ++ } ++ ++ /** ++ * exactly the same as 27129 ++ */ ++ static void drawGradientRect1(GuiStats par0GuiStats, int par1, int par2, int par3, int par4, int par5, int par6) ++ { ++ par0GuiStats.drawGradientRect(par1, par2, par3, par4, par5, par6); ++ } ++ ++ /** ++ * there are 11 identical methods like this ++ */ ++ static FontRenderer getFontRenderer11(GuiStats par0GuiStats) ++ { ++ return par0GuiStats.fontRenderer; ++ } ++ ++ /** ++ * Draws the item sprite on top of the background sprite. ++ */ ++ static void drawItemSprite(GuiStats par0GuiStats, int par1, int par2, int par3) ++ { ++ par0GuiStats.drawItemSprite(par1, par2, par3); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiTextField.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,757 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class GuiTextField extends Gui ++ { ++ /** ++ * Have the font renderer from GuiScreen to render the textbox text into the screen. ++ */ ++ private final FontRenderer fontRenderer; ++ private final int xPos; ++ private final int yPos; ++ ++ /** The width of this text field. */ ++ private final int width; ++ private final int height; ++ ++ /** Have the current text beign edited on the textbox. */ ++ private String text = ""; ++ private int maxStringLength = 32; ++ private int cursorCounter; ++ private boolean enableBackgroundDrawing = true; ++ ++ /** ++ * if true the textbox can lose focus by clicking elsewhere on the screen ++ */ ++ private boolean canLoseFocus = true; ++ ++ /** ++ * If this value is true along isEnabled, keyTyped will process the keys. ++ */ ++ private boolean isFocused; ++ ++ /** ++ * If this value is true along isFocused, keyTyped will process the keys. ++ */ ++ private boolean isEnabled = true; ++ ++ /** ++ * The current character index that should be used as start of the rendered text. ++ */ ++ private int lineScrollOffset; ++ private int cursorPosition; ++ ++ /** other selection position, maybe the same as the cursor */ ++ private int selectionEnd; ++ private int enabledColor = 14737632; ++ private int disabledColor = 7368816; ++ ++ /** True if this textbox is visible */ ++ private boolean visible = true; ++ ++ public GuiTextField(FontRenderer par1FontRenderer, int par2, int par3, int par4, int par5) ++ { ++ this.fontRenderer = par1FontRenderer; ++ this.xPos = par2; ++ this.yPos = par3; ++ this.width = par4; ++ this.height = par5; ++ } ++ ++ /** ++ * Increments the cursor counter ++ */ ++ public void updateCursorCounter() ++ { ++ ++this.cursorCounter; ++ } ++ ++ /** ++ * Sets the text of the textbox. ++ */ ++ public void setText(String par1Str) ++ { ++ if (par1Str.length() > this.maxStringLength) ++ { ++ this.text = par1Str.substring(0, this.maxStringLength); ++ } ++ else ++ { ++ this.text = par1Str; ++ } ++ ++ this.setCursorPositionEnd(); ++ } ++ ++ /** ++ * Returns the text beign edited on the textbox. ++ */ ++ public String getText() ++ { ++ return this.text; ++ } ++ ++ /** ++ * @return returns the text between the cursor and selectionEnd ++ */ ++ public String getSelectedtext() ++ { ++ int var1 = this.cursorPosition < this.selectionEnd ? this.cursorPosition : this.selectionEnd; ++ int var2 = this.cursorPosition < this.selectionEnd ? this.selectionEnd : this.cursorPosition; ++ return this.text.substring(var1, var2); ++ } ++ ++ /** ++ * replaces selected text, or inserts text at the position on the cursor ++ */ ++ public void writeText(String par1Str) ++ { ++ String var2 = ""; ++ String var3 = ChatAllowedCharacters.filerAllowedCharacters(par1Str); ++ int var4 = this.cursorPosition < this.selectionEnd ? this.cursorPosition : this.selectionEnd; ++ int var5 = this.cursorPosition < this.selectionEnd ? this.selectionEnd : this.cursorPosition; ++ int var6 = this.maxStringLength - this.text.length() - (var4 - this.selectionEnd); ++ boolean var7 = false; ++ ++ if (this.text.length() > 0) ++ { ++ var2 = var2 + this.text.substring(0, var4); ++ } ++ ++ int var8; ++ ++ if (var6 < var3.length()) ++ { ++ var2 = var2 + var3.substring(0, var6); ++ var8 = var6; ++ } ++ else ++ { ++ var2 = var2 + var3; ++ var8 = var3.length(); ++ } ++ ++ if (this.text.length() > 0 && var5 < this.text.length()) ++ { ++ var2 = var2 + this.text.substring(var5); ++ } ++ ++ this.text = var2; ++ this.moveCursorBy(var4 - this.selectionEnd + var8); ++ } ++ ++ /** ++ * Deletes the specified number of words starting at the cursor position. Negative numbers will delete words left of ++ * the cursor. ++ */ ++ public void deleteWords(int par1) ++ { ++ if (this.text.length() != 0) ++ { ++ if (this.selectionEnd != this.cursorPosition) ++ { ++ this.writeText(""); ++ } ++ else ++ { ++ this.deleteFromCursor(this.getNthWordFromCursor(par1) - this.cursorPosition); ++ } ++ } ++ } ++ ++ /** ++ * delete the selected text, otherwsie deletes characters from either side of the cursor. params: delete num ++ */ ++ public void deleteFromCursor(int par1) ++ { ++ if (this.text.length() != 0) ++ { ++ if (this.selectionEnd != this.cursorPosition) ++ { ++ this.writeText(""); ++ } ++ else ++ { ++ boolean var2 = par1 < 0; ++ int var3 = var2 ? this.cursorPosition + par1 : this.cursorPosition; ++ int var4 = var2 ? this.cursorPosition : this.cursorPosition + par1; ++ String var5 = ""; ++ ++ if (var3 >= 0) ++ { ++ var5 = this.text.substring(0, var3); ++ } ++ ++ if (var4 < this.text.length()) ++ { ++ var5 = var5 + this.text.substring(var4); ++ } ++ ++ this.text = var5; ++ ++ if (var2) ++ { ++ this.moveCursorBy(par1); ++ } ++ } ++ } ++ } ++ ++ /** ++ * see @getNthNextWordFromPos() params: N, position ++ */ ++ public int getNthWordFromCursor(int par1) ++ { ++ return this.getNthWordFromPos(par1, this.getCursorPosition()); ++ } ++ ++ /** ++ * gets the position of the nth word. N may be negative, then it looks backwards. params: N, position ++ */ ++ public int getNthWordFromPos(int par1, int par2) ++ { ++ return this.func_73798_a(par1, this.getCursorPosition(), true); ++ } ++ ++ public int func_73798_a(int par1, int par2, boolean par3) ++ { ++ int var4 = par2; ++ boolean var5 = par1 < 0; ++ int var6 = Math.abs(par1); ++ ++ for (int var7 = 0; var7 < var6; ++var7) ++ { ++ if (var5) ++ { ++ while (par3 && var4 > 0 && this.text.charAt(var4 - 1) == 32) ++ { ++ --var4; ++ } ++ ++ while (var4 > 0 && this.text.charAt(var4 - 1) != 32) ++ { ++ --var4; ++ } ++ } ++ else ++ { ++ int var8 = this.text.length(); ++ var4 = this.text.indexOf(32, var4); ++ ++ if (var4 == -1) ++ { ++ var4 = var8; ++ } ++ else ++ { ++ while (par3 && var4 < var8 && this.text.charAt(var4) == 32) ++ { ++ ++var4; ++ } ++ } ++ } ++ } ++ ++ return var4; ++ } ++ ++ /** ++ * Moves the text cursor by a specified number of characters and clears the selection ++ */ ++ public void moveCursorBy(int par1) ++ { ++ this.setCursorPosition(this.selectionEnd + par1); ++ } ++ ++ /** ++ * sets the position of the cursor to the provided index ++ */ ++ public void setCursorPosition(int par1) ++ { ++ this.cursorPosition = par1; ++ int var2 = this.text.length(); ++ ++ if (this.cursorPosition < 0) ++ { ++ this.cursorPosition = 0; ++ } ++ ++ if (this.cursorPosition > var2) ++ { ++ this.cursorPosition = var2; ++ } ++ ++ this.setSelectionPos(this.cursorPosition); ++ } ++ ++ /** ++ * sets the cursors position to the beginning ++ */ ++ public void setCursorPositionZero() ++ { ++ this.setCursorPosition(0); ++ } ++ ++ /** ++ * sets the cursors position to after the text ++ */ ++ public void setCursorPositionEnd() ++ { ++ this.setCursorPosition(this.text.length()); ++ } ++ ++ /** ++ * Call this method from you GuiScreen to process the keys into textbox. ++ */ ++ public boolean textboxKeyTyped(char par1, int par2) ++ { ++ if (this.isEnabled && this.isFocused) ++ { ++ switch (par1) ++ { ++ case 1: ++ this.setCursorPositionEnd(); ++ this.setSelectionPos(0); ++ return true; ++ ++ case 3: ++ GuiScreen.setClipboardString(this.getSelectedtext()); ++ return true; ++ ++ case 22: ++ this.writeText(GuiScreen.getClipboardString()); ++ return true; ++ ++ case 24: ++ GuiScreen.setClipboardString(this.getSelectedtext()); ++ this.writeText(""); ++ return true; ++ ++ default: ++ switch (par2) ++ { ++ case 14: ++ if (GuiScreen.isCtrlKeyDown()) ++ { ++ this.deleteWords(-1); ++ } ++ else ++ { ++ this.deleteFromCursor(-1); ++ } ++ ++ return true; ++ ++ case 199: ++ if (GuiScreen.isShiftKeyDown()) ++ { ++ this.setSelectionPos(0); ++ } ++ else ++ { ++ this.setCursorPositionZero(); ++ } ++ ++ return true; ++ ++ case 203: ++ if (GuiScreen.isShiftKeyDown()) ++ { ++ if (GuiScreen.isCtrlKeyDown()) ++ { ++ this.setSelectionPos(this.getNthWordFromPos(-1, this.getSelectionEnd())); ++ } ++ else ++ { ++ this.setSelectionPos(this.getSelectionEnd() - 1); ++ } ++ } ++ else if (GuiScreen.isCtrlKeyDown()) ++ { ++ this.setCursorPosition(this.getNthWordFromCursor(-1)); ++ } ++ else ++ { ++ this.moveCursorBy(-1); ++ } ++ ++ return true; ++ ++ case 205: ++ if (GuiScreen.isShiftKeyDown()) ++ { ++ if (GuiScreen.isCtrlKeyDown()) ++ { ++ this.setSelectionPos(this.getNthWordFromPos(1, this.getSelectionEnd())); ++ } ++ else ++ { ++ this.setSelectionPos(this.getSelectionEnd() + 1); ++ } ++ } ++ else if (GuiScreen.isCtrlKeyDown()) ++ { ++ this.setCursorPosition(this.getNthWordFromCursor(1)); ++ } ++ else ++ { ++ this.moveCursorBy(1); ++ } ++ ++ return true; ++ ++ case 207: ++ if (GuiScreen.isShiftKeyDown()) ++ { ++ this.setSelectionPos(this.text.length()); ++ } ++ else ++ { ++ this.setCursorPositionEnd(); ++ } ++ ++ return true; ++ ++ case 211: ++ if (GuiScreen.isCtrlKeyDown()) ++ { ++ this.deleteWords(1); ++ } ++ else ++ { ++ this.deleteFromCursor(1); ++ } ++ ++ return true; ++ ++ default: ++ if (ChatAllowedCharacters.isAllowedCharacter(par1)) ++ { ++ this.writeText(Character.toString(par1)); ++ return true; ++ } ++ else ++ { ++ return false; ++ } ++ } ++ } ++ } ++ else ++ { ++ return false; ++ } ++ } ++ ++ /** ++ * Args: x, y, buttonClicked ++ */ ++ public void mouseClicked(int par1, int par2, int par3) ++ { ++ boolean var4 = par1 >= this.xPos && par1 < this.xPos + this.width && par2 >= this.yPos && par2 < this.yPos + this.height; ++ ++ if (this.canLoseFocus) ++ { ++ this.setFocused(this.isEnabled && var4); ++ } ++ ++ if (this.isFocused && par3 == 0) ++ { ++ int var5 = par1 - this.xPos; ++ ++ if (this.enableBackgroundDrawing) ++ { ++ var5 -= 4; ++ } ++ ++ String var6 = this.fontRenderer.trimStringToWidth(this.text.substring(this.lineScrollOffset), this.getWidth()); ++ this.setCursorPosition(this.fontRenderer.trimStringToWidth(var6, var5).length() + this.lineScrollOffset); ++ } ++ } ++ ++ /** ++ * Draws the textbox ++ */ ++ public void drawTextBox() ++ { ++ if (this.getVisible()) ++ { ++ if (this.getEnableBackgroundDrawing()) ++ { ++ drawRect(this.xPos - 1, this.yPos - 1, this.xPos + this.width + 1, this.yPos + this.height + 1, -6250336); ++ drawRect(this.xPos, this.yPos, this.xPos + this.width, this.yPos + this.height, -16777216); ++ } ++ ++ int var1 = this.isEnabled ? this.enabledColor : this.disabledColor; ++ int var2 = this.cursorPosition - this.lineScrollOffset; ++ int var3 = this.selectionEnd - this.lineScrollOffset; ++ String var4 = this.fontRenderer.trimStringToWidth(this.text.substring(this.lineScrollOffset), this.getWidth()); ++ boolean var5 = var2 >= 0 && var2 <= var4.length(); ++ boolean var6 = this.isFocused && this.cursorCounter / 6 % 2 == 0 && var5; ++ int var7 = this.enableBackgroundDrawing ? this.xPos + 4 : this.xPos; ++ int var8 = this.enableBackgroundDrawing ? this.yPos + (this.height - 8) / 2 : this.yPos; ++ int var9 = var7; ++ ++ if (var3 > var4.length()) ++ { ++ var3 = var4.length(); ++ } ++ ++ if (var4.length() > 0) ++ { ++ String var10 = var5 ? var4.substring(0, var2) : var4; ++ var9 = this.fontRenderer.drawStringWithShadow(var10, var7, var8, var1); ++ } ++ ++ boolean var13 = this.cursorPosition < this.text.length() || this.text.length() >= this.getMaxStringLength(); ++ int var11 = var9; ++ ++ if (!var5) ++ { ++ var11 = var2 > 0 ? var7 + this.width : var7; ++ } ++ else if (var13) ++ { ++ var11 = var9 - 1; ++ --var9; ++ } ++ ++ if (var4.length() > 0 && var5 && var2 < var4.length()) ++ { ++ this.fontRenderer.drawStringWithShadow(var4.substring(var2), var9, var8, var1); ++ } ++ ++ if (var6) ++ { ++ if (var13) ++ { ++ Gui.drawRect(var11, var8 - 1, var11 + 1, var8 + 1 + this.fontRenderer.FONT_HEIGHT, -3092272); ++ } ++ else ++ { ++ this.fontRenderer.drawStringWithShadow("_", var11, var8, var1); ++ } ++ } ++ ++ if (var3 != var2) ++ { ++ int var12 = var7 + this.fontRenderer.getStringWidth(var4.substring(0, var3)); ++ this.drawCursorVertical(var11, var8 - 1, var12 - 1, var8 + 1 + this.fontRenderer.FONT_HEIGHT); ++ } ++ } ++ } ++ ++ /** ++ * draws the vertical line cursor in the textbox ++ */ ++ private void drawCursorVertical(int par1, int par2, int par3, int par4) ++ { ++ int var5; ++ ++ if (par1 < par3) ++ { ++ var5 = par1; ++ par1 = par3; ++ par3 = var5; ++ } ++ ++ if (par2 < par4) ++ { ++ var5 = par2; ++ par2 = par4; ++ par4 = var5; ++ } ++ ++ Tessellator var6 = Tessellator.instance; ++ GL11.glColor4f(0.0F, 0.0F, 255.0F, 255.0F); ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ GL11.glEnable(GL11.GL_COLOR_LOGIC_OP); ++ GL11.glLogicOp(GL11.GL_OR_REVERSE); ++ var6.startDrawingQuads(); ++ var6.addVertex((double)par1, (double)par4, 0.0D); ++ var6.addVertex((double)par3, (double)par4, 0.0D); ++ var6.addVertex((double)par3, (double)par2, 0.0D); ++ var6.addVertex((double)par1, (double)par2, 0.0D); ++ var6.draw(); ++ GL11.glDisable(GL11.GL_COLOR_LOGIC_OP); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ } ++ ++ public void setMaxStringLength(int par1) ++ { ++ this.maxStringLength = par1; ++ ++ if (this.text.length() > par1) ++ { ++ this.text = this.text.substring(0, par1); ++ } ++ } ++ ++ /** ++ * returns the maximum number of character that can be contained in this textbox ++ */ ++ public int getMaxStringLength() ++ { ++ return this.maxStringLength; ++ } ++ ++ /** ++ * returns the current position of the cursor ++ */ ++ public int getCursorPosition() ++ { ++ return this.cursorPosition; ++ } ++ ++ /** ++ * get enable drawing background and outline ++ */ ++ public boolean getEnableBackgroundDrawing() ++ { ++ return this.enableBackgroundDrawing; ++ } ++ ++ /** ++ * enable drawing background and outline ++ */ ++ public void setEnableBackgroundDrawing(boolean par1) ++ { ++ this.enableBackgroundDrawing = par1; ++ } ++ ++ /** ++ * Sets the text colour for this textbox (disabled text will not use this colour) ++ */ ++ public void setTextColor(int par1) ++ { ++ this.enabledColor = par1; ++ } ++ ++ public void setDisabledTextColour(int par1) ++ { ++ this.disabledColor = par1; ++ } ++ ++ /** ++ * setter for the focused field ++ */ ++ public void setFocused(boolean par1) ++ { ++ if (par1 && !this.isFocused) ++ { ++ this.cursorCounter = 0; ++ } ++ ++ this.isFocused = par1; ++ } ++ ++ /** ++ * getter for the focused field ++ */ ++ public boolean isFocused() ++ { ++ return this.isFocused; ++ } ++ ++ public void setEnabled(boolean par1) ++ { ++ this.isEnabled = par1; ++ } ++ ++ /** ++ * the side of the selection that is not the cursor, maye be the same as the cursor ++ */ ++ public int getSelectionEnd() ++ { ++ return this.selectionEnd; ++ } ++ ++ /** ++ * returns the width of the textbox depending on if the the box is enabled ++ */ ++ public int getWidth() ++ { ++ return this.getEnableBackgroundDrawing() ? this.width - 8 : this.width; ++ } ++ ++ /** ++ * Sets the position of the selection anchor (i.e. position the selection was started at) ++ */ ++ public void setSelectionPos(int par1) ++ { ++ int var2 = this.text.length(); ++ ++ if (par1 > var2) ++ { ++ par1 = var2; ++ } ++ ++ if (par1 < 0) ++ { ++ par1 = 0; ++ } ++ ++ this.selectionEnd = par1; ++ ++ if (this.fontRenderer != null) ++ { ++ if (this.lineScrollOffset > var2) ++ { ++ this.lineScrollOffset = var2; ++ } ++ ++ int var3 = this.getWidth(); ++ String var4 = this.fontRenderer.trimStringToWidth(this.text.substring(this.lineScrollOffset), var3); ++ int var5 = var4.length() + this.lineScrollOffset; ++ ++ if (par1 == this.lineScrollOffset) ++ { ++ this.lineScrollOffset -= this.fontRenderer.trimStringToWidth(this.text, var3, true).length(); ++ } ++ ++ if (par1 > var5) ++ { ++ this.lineScrollOffset += par1 - var5; ++ } ++ else if (par1 <= this.lineScrollOffset) ++ { ++ this.lineScrollOffset -= this.lineScrollOffset - par1; ++ } ++ ++ if (this.lineScrollOffset < 0) ++ { ++ this.lineScrollOffset = 0; ++ } ++ ++ if (this.lineScrollOffset > var2) ++ { ++ this.lineScrollOffset = var2; ++ } ++ } ++ } ++ ++ /** ++ * if true the textbox can lose focus by clicking elsewhere on the screen ++ */ ++ public void setCanLoseFocus(boolean par1) ++ { ++ this.canLoseFocus = par1; ++ } ++ ++ /** ++ * @return {@code true} if this textbox is visible ++ */ ++ public boolean getVisible() ++ { ++ return this.visible; ++ } ++ ++ /** ++ * Sets whether or not this textbox is visible ++ */ ++ public void setVisible(boolean par1) ++ { ++ this.visible = par1; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiVideoSettings.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,121 ---- ++ package net.minecraft.src; ++ ++ public class GuiVideoSettings extends GuiScreen ++ { ++ private GuiScreen parentGuiScreen; ++ ++ /** The title string that is displayed in the top-center of the screen. */ ++ protected String screenTitle = "Video Settings"; ++ ++ /** GUI game settings */ ++ private GameSettings guiGameSettings; ++ ++ /** ++ * True if the system is 64-bit (using a simple indexOf test on a system property) ++ */ ++ private boolean is64bit; ++ ++ /** An array of all of EnumOption's video options. */ ++ private static EnumOptions[] videoOptions = new EnumOptions[] {EnumOptions.GRAPHICS, EnumOptions.RENDER_DISTANCE, EnumOptions.AMBIENT_OCCLUSION, EnumOptions.FRAMERATE_LIMIT, EnumOptions.ANAGLYPH, EnumOptions.VIEW_BOBBING, EnumOptions.GUI_SCALE, EnumOptions.ADVANCED_OPENGL, EnumOptions.GAMMA, EnumOptions.RENDER_CLOUDS, EnumOptions.PARTICLES, EnumOptions.USE_SERVER_TEXTURES, EnumOptions.USE_FULLSCREEN, EnumOptions.ENABLE_VSYNC}; ++ ++ public GuiVideoSettings(GuiScreen par1GuiScreen, GameSettings par2GameSettings) ++ { ++ this.parentGuiScreen = par1GuiScreen; ++ this.guiGameSettings = par2GameSettings; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.screenTitle = I18n.getString("options.videoTitle"); ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done"))); ++ this.is64bit = false; ++ String[] var1 = new String[] {"sun.arch.data.model", "com.ibm.vm.bitmode", "os.arch"}; ++ String[] var2 = var1; ++ int var3 = var1.length; ++ ++ for (int var4 = 0; var4 < var3; ++var4) ++ { ++ String var5 = var2[var4]; ++ String var6 = System.getProperty(var5); ++ ++ if (var6 != null && var6.contains("64")) ++ { ++ this.is64bit = true; ++ break; ++ } ++ } ++ ++ int var8 = 0; ++ var3 = this.is64bit ? 0 : -15; ++ EnumOptions[] var9 = videoOptions; ++ int var10 = var9.length; ++ ++ for (int var11 = 0; var11 < var10; ++var11) ++ { ++ EnumOptions var7 = var9[var11]; ++ ++ if (var7.getEnumFloat()) ++ { ++ this.buttonList.add(new GuiSlider(var7.returnEnumOrdinal(), this.width / 2 - 155 + var8 % 2 * 160, this.height / 7 + var3 + 24 * (var8 >> 1), var7, this.guiGameSettings.getKeyBinding(var7), this.guiGameSettings.getOptionFloatValue(var7))); ++ } ++ else ++ { ++ this.buttonList.add(new GuiSmallButton(var7.returnEnumOrdinal(), this.width / 2 - 155 + var8 % 2 * 160, this.height / 7 + var3 + 24 * (var8 >> 1), var7, this.guiGameSettings.getKeyBinding(var7))); ++ } ++ ++ ++var8; ++ } ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ if (par1GuiButton.enabled) ++ { ++ int var2 = this.guiGameSettings.guiScale; ++ ++ if (par1GuiButton.id < 100 && par1GuiButton instanceof GuiSmallButton) ++ { ++ this.guiGameSettings.setOptionValue(((GuiSmallButton)par1GuiButton).returnEnumOptions(), 1); ++ par1GuiButton.displayString = this.guiGameSettings.getKeyBinding(EnumOptions.getEnumOptions(par1GuiButton.id)); ++ } ++ ++ if (par1GuiButton.id == 200) ++ { ++ this.mc.gameSettings.saveOptions(); ++ this.mc.displayGuiScreen(this.parentGuiScreen); ++ } ++ ++ if (this.guiGameSettings.guiScale != var2) ++ { ++ ScaledResolution var3 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); ++ int var4 = var3.getScaledWidth(); ++ int var5 = var3.getScaledHeight(); ++ this.setWorldAndResolution(this.mc, var4, var5); ++ } ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, this.is64bit ? 20 : 5, 16777215); ++ ++ if (!this.is64bit && this.guiGameSettings.renderDistance == 0) ++ { ++ this.drawCenteredString(this.fontRenderer, I18n.getString("options.farWarning1"), this.width / 2, this.height / 6 + 144 + 1, 11468800); ++ this.drawCenteredString(this.fontRenderer, I18n.getString("options.farWarning2"), this.width / 2, this.height / 6 + 144 + 13, 11468800); ++ } ++ ++ super.drawScreen(par1, par2, par3); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiWinGame.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,225 ---- ++ package net.minecraft.src; ++ ++ import java.io.BufferedReader; ++ import java.io.InputStreamReader; ++ import java.util.ArrayList; ++ import java.util.List; ++ import java.util.Random; ++ import org.apache.commons.io.Charsets; ++ import org.lwjgl.opengl.GL11; ++ ++ public class GuiWinGame extends GuiScreen ++ { ++ private static final ResourceLocation minecraftLogoTexture = new ResourceLocation("textures/gui/title/minecraft.png"); ++ private static final ResourceLocation field_110361_b = new ResourceLocation("textures/misc/vignette.png"); ++ ++ /** Counts the number of screen updates. */ ++ private int updateCounter; ++ ++ /** List of lines on the ending poem and credits. */ ++ private List lines; ++ private int field_73989_c; ++ private float field_73987_d = 0.5F; ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() ++ { ++ ++this.updateCounter; ++ float var1 = (float)(this.field_73989_c + this.height + this.height + 24) / this.field_73987_d; ++ ++ if ((float)this.updateCounter > var1) ++ { ++ this.respawnPlayer(); ++ } ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) ++ { ++ if (par2 == 1) ++ { ++ this.respawnPlayer(); ++ } ++ } ++ ++ /** ++ * Respawns the player. ++ */ ++ private void respawnPlayer() ++ { ++ this.mc.thePlayer.sendQueue.addToSendQueue(new Packet205ClientCommand(1)); ++ this.mc.displayGuiScreen((GuiScreen)null); ++ } ++ ++ /** ++ * Returns true if this GUI should pause the game when it is displayed in single-player ++ */ ++ public boolean doesGuiPauseGame() ++ { ++ return true; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ if (this.lines == null) ++ { ++ this.lines = new ArrayList(); ++ ++ 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 ResourceLocation("texts/end.txt")).getInputStream(), Charsets.UTF_8)); ++ Random var5 = new Random(8124371L); ++ int var6; ++ ++ while ((var1 = var4.readLine()) != null) ++ { ++ 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) ++ { ++ var6 = var1.indexOf(var2); ++ var7 = var1.substring(0, var6); ++ var8 = var1.substring(var6 + var2.length()); ++ } ++ ++ this.lines.addAll(this.mc.fontRenderer.listFormattedStringToWidth(var1, var3)); ++ this.lines.add(""); ++ } ++ ++ for (var6 = 0; var6 < 8; ++var6) ++ { ++ this.lines.add(""); ++ } ++ ++ var4 = new BufferedReader(new InputStreamReader(this.mc.getResourceManager().getResource(new ResourceLocation("texts/credits.txt")).getInputStream(), Charsets.UTF_8)); ++ ++ while ((var1 = var4.readLine()) != null) ++ { ++ var1 = var1.replaceAll("PLAYERNAME", this.mc.getSession().getUsername()); ++ 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) ++ { ++ var9.printStackTrace(); ++ } ++ } ++ } ++ ++ private void func_73986_b(int par1, int par2, float par3) ++ { ++ Tessellator var4 = Tessellator.instance; ++ this.mc.getTextureManager().bindTexture(Gui.optionsBackground); ++ var4.startDrawingQuads(); ++ var4.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F); ++ int var5 = this.width; ++ float var6 = 0.0F - ((float)this.updateCounter + par3) * 0.5F * this.field_73987_d; ++ float var7 = (float)this.height - ((float)this.updateCounter + par3) * 0.5F * this.field_73987_d; ++ float var8 = 0.015625F; ++ float var9 = ((float)this.updateCounter + par3 - 0.0F) * 0.02F; ++ float var10 = (float)(this.field_73989_c + this.height + this.height + 24) / this.field_73987_d; ++ float var11 = (var10 - 20.0F - ((float)this.updateCounter + par3)) * 0.005F; ++ ++ if (var11 < var9) ++ { ++ var9 = var11; ++ } ++ ++ if (var9 > 1.0F) ++ { ++ var9 = 1.0F; ++ } ++ ++ var9 *= var9; ++ var9 = var9 * 96.0F / 255.0F; ++ var4.setColorOpaque_F(var9, var9, var9); ++ var4.addVertexWithUV(0.0D, (double)this.height, (double)this.zLevel, 0.0D, (double)(var6 * var8)); ++ var4.addVertexWithUV((double)var5, (double)this.height, (double)this.zLevel, (double)((float)var5 * var8), (double)(var6 * var8)); ++ var4.addVertexWithUV((double)var5, 0.0D, (double)this.zLevel, (double)((float)var5 * var8), (double)(var7 * var8)); ++ var4.addVertexWithUV(0.0D, 0.0D, (double)this.zLevel, 0.0D, (double)(var7 * var8)); ++ var4.draw(); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.func_73986_b(par1, par2, par3); ++ Tessellator var4 = Tessellator.instance; ++ short var5 = 274; ++ int var6 = this.width / 2 - var5 / 2; ++ int var7 = this.height + 50; ++ float var8 = -((float)this.updateCounter + par3) * this.field_73987_d; ++ GL11.glPushMatrix(); ++ GL11.glTranslatef(0.0F, var8, 0.0F); ++ this.mc.getTextureManager().bindTexture(minecraftLogoTexture); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.drawTexturedModalRect(var6, var7, 0, 0, 155, 44); ++ this.drawTexturedModalRect(var6 + 155, var7, 0, 45, 155, 44); ++ var4.setColorOpaque_I(16777215); ++ int var9 = var7 + 200; ++ int var10; ++ ++ for (var10 = 0; var10 < this.lines.size(); ++var10) ++ { ++ if (var10 == this.lines.size() - 1) ++ { ++ float var11 = (float)var9 + var8 - (float)(this.height / 2 - 6); ++ ++ if (var11 < 0.0F) ++ { ++ GL11.glTranslatef(0.0F, -var11, 0.0F); ++ } ++ } ++ ++ if ((float)var9 + var8 + 12.0F + 8.0F > 0.0F && (float)var9 + var8 < (float)this.height) ++ { ++ String var12 = (String)this.lines.get(var10); ++ ++ if (var12.startsWith("[C]")) ++ { ++ this.fontRenderer.drawStringWithShadow(var12.substring(3), var6 + (var5 - this.fontRenderer.getStringWidth(var12.substring(3))) / 2, var9, 16777215); ++ } ++ else ++ { ++ this.fontRenderer.fontRandom.setSeed((long)var10 * 4238972211L + (long)(this.updateCounter / 4)); ++ this.fontRenderer.drawStringWithShadow(var12, var6, var9, 16777215); ++ } ++ } ++ ++ var9 += 12; ++ } ++ ++ GL11.glPopMatrix(); ++ this.mc.getTextureManager().bindTexture(field_110361_b); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_ZERO, GL11.GL_ONE_MINUS_SRC_COLOR); ++ var4.startDrawingQuads(); ++ var4.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F); ++ var10 = this.width; ++ int var13 = this.height; ++ var4.addVertexWithUV(0.0D, (double)var13, (double)this.zLevel, 0.0D, 1.0D); ++ var4.addVertexWithUV((double)var10, (double)var13, (double)this.zLevel, 1.0D, 1.0D); ++ var4.addVertexWithUV((double)var10, 0.0D, (double)this.zLevel, 1.0D, 0.0D); ++ var4.addVertexWithUV(0.0D, 0.0D, (double)this.zLevel, 0.0D, 0.0D); ++ var4.draw(); ++ GL11.glDisable(GL11.GL_BLEND); ++ super.drawScreen(par1, par2, par3); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiWorldSlot.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,100 ---- ++ package net.minecraft.src; ++ ++ import java.util.Date; ++ ++ class GuiWorldSlot extends GuiSlot ++ { ++ final GuiSelectWorld parentWorldGui; ++ ++ public GuiWorldSlot(GuiSelectWorld par1GuiSelectWorld) ++ { ++ super(par1GuiSelectWorld.mc, par1GuiSelectWorld.width, par1GuiSelectWorld.height, 32, par1GuiSelectWorld.height - 64, 36); ++ this.parentWorldGui = par1GuiSelectWorld; ++ } ++ ++ /** ++ * Gets the size of the current slot list. ++ */ ++ protected int getSize() ++ { ++ return GuiSelectWorld.getSize(this.parentWorldGui).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) ++ { ++ GuiSelectWorld.onElementSelected(this.parentWorldGui, par1); ++ boolean var3 = GuiSelectWorld.getSelectedWorld(this.parentWorldGui) >= 0 && GuiSelectWorld.getSelectedWorld(this.parentWorldGui) < this.getSize(); ++ GuiSelectWorld.getSelectButton(this.parentWorldGui).enabled = var3; ++ GuiSelectWorld.getRenameButton(this.parentWorldGui).enabled = var3; ++ GuiSelectWorld.getDeleteButton(this.parentWorldGui).enabled = var3; ++ GuiSelectWorld.func_82312_f(this.parentWorldGui).enabled = var3; ++ ++ if (par2 && var3) ++ { ++ this.parentWorldGui.selectWorld(par1); ++ } ++ } ++ ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) ++ { ++ return par1 == GuiSelectWorld.getSelectedWorld(this.parentWorldGui); ++ } ++ ++ /** ++ * return the height of the content being scrolled ++ */ ++ protected int getContentHeight() ++ { ++ return GuiSelectWorld.getSize(this.parentWorldGui).size() * 36; ++ } ++ ++ protected void drawBackground() ++ { ++ this.parentWorldGui.drawDefaultBackground(); ++ } ++ ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) ++ { ++ SaveFormatComparator var6 = (SaveFormatComparator)GuiSelectWorld.getSize(this.parentWorldGui).get(par1); ++ String var7 = var6.getDisplayName(); ++ ++ if (var7 == null || MathHelper.stringNullOrLengthZero(var7)) ++ { ++ var7 = GuiSelectWorld.func_82313_g(this.parentWorldGui) + " " + (par1 + 1); ++ } ++ ++ String var8 = var6.getFileName(); ++ var8 = var8 + " (" + GuiSelectWorld.func_82315_h(this.parentWorldGui).format(new Date(var6.getLastTimePlayed())); ++ var8 = var8 + ")"; ++ String var9 = ""; ++ ++ if (var6.requiresConversion()) ++ { ++ var9 = GuiSelectWorld.func_82311_i(this.parentWorldGui) + " " + var9; ++ } ++ else ++ { ++ var9 = GuiSelectWorld.func_82314_j(this.parentWorldGui)[var6.getEnumGameType().getID()]; ++ ++ if (var6.isHardcoreModeEnabled()) ++ { ++ var9 = EnumChatFormatting.DARK_RED + I18n.getString("gameMode.hardcore") + EnumChatFormatting.RESET; ++ } ++ ++ if (var6.getCheatsEnabled()) ++ { ++ var9 = var9 + ", " + I18n.getString("selectWorld.cheats"); ++ } ++ } ++ ++ this.parentWorldGui.drawString(this.parentWorldGui.fontRenderer, var7, par2 + 2, par3 + 1, 16777215); ++ this.parentWorldGui.drawString(this.parentWorldGui.fontRenderer, var8, par2 + 2, par3 + 12, 8421504); ++ this.parentWorldGui.drawString(this.parentWorldGui.fontRenderer, var9, par2 + 2, par3 + 12 + 10, 8421504); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- GuiYesNo.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,72 ---- ++ package net.minecraft.src; ++ ++ public class GuiYesNo extends GuiScreen ++ { ++ /** ++ * A reference to the screen object that created this. Used for navigating between screens. ++ */ ++ protected GuiScreen parentScreen; ++ ++ /** First line of text. */ ++ protected String message1; ++ ++ /** Second line of text. */ ++ private String message2; ++ ++ /** The text shown for the first button in GuiYesNo */ ++ protected String buttonText1; ++ ++ /** The text shown for the second button in GuiYesNo */ ++ protected String buttonText2; ++ ++ /** World number to be deleted. */ ++ protected int worldNumber; ++ ++ public GuiYesNo(GuiScreen par1GuiScreen, String par2Str, String par3Str, int par4) ++ { ++ this.parentScreen = par1GuiScreen; ++ this.message1 = par2Str; ++ this.message2 = par3Str; ++ this.worldNumber = par4; ++ this.buttonText1 = I18n.getString("gui.yes"); ++ this.buttonText2 = I18n.getString("gui.no"); ++ } ++ ++ public GuiYesNo(GuiScreen par1GuiScreen, String par2Str, String par3Str, String par4Str, String par5Str, int par6) ++ { ++ this.parentScreen = par1GuiScreen; ++ this.message1 = par2Str; ++ this.message2 = par3Str; ++ this.buttonText1 = par4Str; ++ this.buttonText2 = par5Str; ++ this.worldNumber = par6; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ this.buttonList.add(new GuiSmallButton(0, this.width / 2 - 155, this.height / 6 + 96, this.buttonText1)); ++ this.buttonList.add(new GuiSmallButton(1, this.width / 2 - 155 + 160, this.height / 6 + 96, this.buttonText2)); ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) ++ { ++ this.parentScreen.confirmClicked(par1GuiButton.id == 0, this.worldNumber); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ this.drawDefaultBackground(); ++ this.drawCenteredString(this.fontRenderer, this.message1, this.width / 2, 70, 16777215); ++ this.drawCenteredString(this.fontRenderer, this.message2, this.width / 2, 90, 16777215); ++ super.drawScreen(par1, par2, par3); ++ } ++ } +*** Hopper.java Sat Feb 5 04:13:13 2022 +--- Hopper.java Sat Feb 5 04:12:35 2022 +*** HttpUtil.java Sat Feb 5 04:13:13 2022 +--- HttpUtil.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,13 **** +--- 1,15 ---- + package net.minecraft.src; + + import java.io.BufferedReader; + import java.io.DataOutputStream; ++ import java.io.IOException; + import java.io.InputStreamReader; + import java.io.UnsupportedEncodingException; + import java.net.HttpURLConnection; + import java.net.Proxy; ++ import java.net.ServerSocket; + import java.net.URL; + import java.net.URLEncoder; + import java.util.Iterator; + import java.util.Map; + import java.util.Map.Entry; +*************** +*** 122,128 **** +--- 124,159 ---- + } + } + + return ""; + } ++ } ++ ++ public static int func_76181_a() throws IOException ++ { ++ ServerSocket var0 = null; ++ boolean var1 = true; ++ int var10; ++ ++ try ++ { ++ var0 = new ServerSocket(0); ++ var10 = var0.getLocalPort(); ++ } ++ finally ++ { ++ try ++ { ++ if (var0 != null) ++ { ++ var0.close(); ++ } ++ } ++ catch (IOException var8) ++ { ++ ; ++ } ++ } ++ ++ return var10; + } + } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- I18n.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,21 ---- ++ package net.minecraft.src; ++ ++ public class I18n ++ { ++ private static Locale i18nLocale; ++ ++ static void setLocale(Locale par0Locale) ++ { ++ i18nLocale = par0Locale; ++ } ++ ++ public static String getString(String par0Str) ++ { ++ return i18nLocale.translateKey(par0Str); ++ } ++ ++ public static String getStringParams(String par0Str, Object ... par1ArrayOfObj) ++ { ++ return i18nLocale.formatMessage(par0Str, par1ArrayOfObj); ++ } ++ } +*** IAdminCommand.java Sat Feb 5 04:13:13 2022 +--- IAdminCommand.java Sat Feb 5 04:12:35 2022 +*** IAnimals.java Sat Feb 5 04:13:13 2022 +--- IAnimals.java Sat Feb 5 04:12:35 2022 +*** IBehaviorDispenseItem.java Sat Feb 5 04:13:13 2022 +--- IBehaviorDispenseItem.java Sat Feb 5 04:12:35 2022 +*** IBlockAccess.java Sat Feb 5 04:13:13 2022 +--- IBlockAccess.java Sat Feb 5 04:12:35 2022 +*************** +*** 11,20 **** +--- 11,33 ---- + * Returns the TileEntity associated with a given block in X,Y,Z coordinates, or null if no TileEntity exists + */ + TileEntity getBlockTileEntity(int var1, int var2, int var3); + + /** ++ * Any Light rendered on a 1.8 Block goes through here ++ */ ++ int getLightBrightnessForSkyBlocks(int var1, int var2, int var3, int var4); ++ ++ float getBrightness(int var1, int var2, int var3, int var4); ++ ++ /** ++ * Returns how bright the block is shown as which is the block's light value looked up in a lookup table (light ++ * values aren't linear for brightness). Args: x, y, z ++ */ ++ float getLightBrightness(int var1, int var2, int var3); ++ ++ /** + * Returns the block metadata at coords x,y,z + */ + int getBlockMetadata(int var1, int var2, int var3); + + /** +*************** +*** 23,33 **** +--- 36,76 ---- + Material getBlockMaterial(int var1, int var2, int var3); + + /** + * Returns true if the block at the specified coordinates is an opaque cube. Args: x, y, z + */ ++ boolean isBlockOpaqueCube(int var1, int var2, int var3); ++ ++ /** ++ * Indicate if a material is a normal solid opaque cube. ++ */ + boolean isBlockNormalCube(int var1, int var2, int var3); ++ ++ /** ++ * Returns true if the block at the specified coordinates is empty ++ */ ++ boolean isAirBlock(int var1, int var2, int var3); ++ ++ /** ++ * Gets the biome for a given set of x/z coordinates ++ */ ++ BiomeGenBase getBiomeGenForCoords(int var1, int var2); ++ ++ /** ++ * Returns current world height. ++ */ ++ int getHeight(); ++ ++ /** ++ * set by !chunk.getAreLevelsEmpty ++ */ ++ boolean extendedLevelsInChunkCache(); ++ ++ /** ++ * Returns true if the block at the given coordinate has a solid (buildable) top surface. ++ */ ++ boolean doesBlockHaveSolidTopSurface(int var1, int var2, int var3); + + /** + * Return the Vec3Pool object for this world. + */ + Vec3Pool getWorldVec3Pool(); +*** IBlockSource.java Sat Feb 5 04:13:13 2022 +--- IBlockSource.java Sat Feb 5 04:12:35 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- IBossDisplayData.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,13 ---- ++ package net.minecraft.src; ++ ++ public interface IBossDisplayData ++ { ++ float getMaxHealth(); ++ ++ float getHealth(); ++ ++ /** ++ * Gets the username of the entity. ++ */ ++ String getEntityName(); ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ICamera.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,11 ---- ++ package net.minecraft.src; ++ ++ public interface ICamera ++ { ++ /** ++ * Returns true if the bounding box is inside all 6 clipping planes, otherwise returns false. ++ */ ++ boolean isBoundingBoxInFrustum(AxisAlignedBB var1); ++ ++ void setPosition(double var1, double var3, double var5); ++ } +*** IChunkLoader.java Sat Feb 5 04:13:13 2022 +--- IChunkLoader.java Sat Feb 5 04:12:35 2022 +*** IChunkProvider.java Sat Feb 5 04:13:13 2022 +--- IChunkProvider.java Sat Feb 5 04:12:35 2022 +*** ICommand.java Sat Feb 5 04:13:13 2022 +--- ICommand.java Sat Feb 5 04:12:35 2022 +*** ICommandManager.java Sat Feb 5 04:13:13 2022 +--- ICommandManager.java Sat Feb 5 04:12:35 2022 +*** ICommandSender.java Sat Feb 5 04:13:13 2022 +--- ICommandSender.java Sat Feb 5 04:12:35 2022 +*************** +*** 15,23 **** + boolean canCommandSenderUseCommand(int var1, String var2); + + /** + * Return the position for this command sender. + */ +! ChunkCoordinates getCommandSenderPosition(); + + World getEntityWorld(); + } +--- 15,23 ---- + boolean canCommandSenderUseCommand(int var1, String var2); + + /** + * Return the position for this command sender. + */ +! ChunkCoordinates getPlayerCoordinates(); + + World getEntityWorld(); + } +*** Icon.java Sat Feb 5 04:13:13 2022 +--- Icon.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,5 **** +--- 1,46 ---- + package net.minecraft.src; + + public interface Icon + { ++ /** ++ * Returns the width of the icon, in pixels. ++ */ ++ int getIconWidth(); ++ ++ /** ++ * Returns the height of the icon, in pixels. ++ */ ++ int getIconHeight(); ++ ++ /** ++ * Returns the minimum U coordinate to use when rendering with this icon. ++ */ ++ float getMinU(); ++ ++ /** ++ * Returns the maximum U coordinate to use when rendering with this icon. ++ */ ++ float getMaxU(); ++ ++ /** ++ * Gets a U coordinate on the icon. 0 returns uMin and 16 returns uMax. Other arguments return in-between values. ++ */ ++ float getInterpolatedU(double var1); ++ ++ /** ++ * Returns the minimum V coordinate to use when rendering with this icon. ++ */ ++ float getMinV(); ++ ++ /** ++ * Returns the maximum V coordinate to use when rendering with this icon. ++ */ ++ float getMaxV(); ++ ++ /** ++ * Gets a V coordinate on the icon. 0 returns vMin and 16 returns vMax. Other arguments return in-between values. ++ */ ++ float getInterpolatedV(double var1); ++ ++ String getIconName(); + } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- IconFlipped.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,86 ---- ++ package net.minecraft.src; ++ ++ public class IconFlipped implements Icon ++ { ++ private final Icon baseIcon; ++ private final boolean flipU; ++ private final boolean flipV; ++ ++ public IconFlipped(Icon par1Icon, boolean par2, boolean par3) ++ { ++ this.baseIcon = par1Icon; ++ this.flipU = par2; ++ this.flipV = par3; ++ } ++ ++ /** ++ * Returns the width of the icon, in pixels. ++ */ ++ public int getIconWidth() ++ { ++ return this.baseIcon.getIconWidth(); ++ } ++ ++ /** ++ * Returns the height of the icon, in pixels. ++ */ ++ public int getIconHeight() ++ { ++ return this.baseIcon.getIconHeight(); ++ } ++ ++ /** ++ * Returns the minimum U coordinate to use when rendering with this icon. ++ */ ++ public float getMinU() ++ { ++ return this.flipU ? this.baseIcon.getMaxU() : this.baseIcon.getMinU(); ++ } ++ ++ /** ++ * Returns the maximum U coordinate to use when rendering with this icon. ++ */ ++ public float getMaxU() ++ { ++ return this.flipU ? this.baseIcon.getMinU() : this.baseIcon.getMaxU(); ++ } ++ ++ /** ++ * Gets a U coordinate on the icon. 0 returns uMin and 16 returns uMax. Other arguments return in-between values. ++ */ ++ public float getInterpolatedU(double par1) ++ { ++ float var3 = this.getMaxU() - this.getMinU(); ++ return this.getMinU() + var3 * ((float)par1 / 16.0F); ++ } ++ ++ /** ++ * Returns the minimum V coordinate to use when rendering with this icon. ++ */ ++ public float getMinV() ++ { ++ return this.flipV ? this.baseIcon.getMinV() : this.baseIcon.getMinV(); ++ } ++ ++ /** ++ * Returns the maximum V coordinate to use when rendering with this icon. ++ */ ++ public float getMaxV() ++ { ++ return this.flipV ? this.baseIcon.getMinV() : this.baseIcon.getMaxV(); ++ } ++ ++ /** ++ * Gets a V coordinate on the icon. 0 returns vMin and 16 returns vMax. Other arguments return in-between values. ++ */ ++ public float getInterpolatedV(double par1) ++ { ++ float var3 = this.getMaxV() - this.getMinV(); ++ return this.getMinV() + var3 * ((float)par1 / 16.0F); ++ } ++ ++ public String getIconName() ++ { ++ return this.baseIcon.getIconName(); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- IconRegister.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,6 ---- ++ package net.minecraft.src; ++ ++ public interface IconRegister ++ { ++ Icon registerIcon(String var1); ++ } +*** ICrafting.java Sat Feb 5 04:13:13 2022 +--- ICrafting.java Sat Feb 5 04:12:35 2022 +*************** +*** 2,15 **** + + import java.util.List; + + public interface ICrafting + { +! /** +! * update the crafting window inventory with the items in the list +! */ +! void updateCraftingInventory(Container var1, List var2); + + /** + * Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual + * contents of that slot. Args: Container, slot number, slot contents + */ +--- 2,12 ---- + + import java.util.List; + + public interface ICrafting + { +! void sendContainerAndContentsToPlayer(Container var1, List var2); + + /** + * Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual + * contents of that slot. Args: Container, slot number, slot contents + */ +*** IEnchantmentModifier.java Sat Feb 5 04:13:13 2022 +--- IEnchantmentModifier.java Sat Feb 5 04:12:35 2022 +*** IEntityMultiPart.java Sat Feb 5 04:13:13 2022 +--- IEntityMultiPart.java Sat Feb 5 04:12:35 2022 +*** IEntitySelector.java Sat Feb 5 04:13:13 2022 +--- IEntitySelector.java Sat Feb 5 04:12:35 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- IImageBuffer.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,8 ---- ++ package net.minecraft.src; ++ ++ import java.awt.image.BufferedImage; ++ ++ public interface IImageBuffer ++ { ++ BufferedImage parseUserSkin(BufferedImage var1); ++ } +*** IInvBasic.java Sat Feb 5 04:13:13 2022 +--- IInvBasic.java Sat Feb 5 04:12:35 2022 +*** IInventory.java Sat Feb 5 04:13:13 2022 +--- IInventory.java Sat Feb 5 04:12:35 2022 +*** ILocatableSource.java Sat Feb 5 04:13:13 2022 +--- ILocatableSource.java Sat Feb 5 04:12:35 2022 +*** ILocation.java Sat Feb 5 04:13:13 2022 +--- ILocation.java Sat Feb 5 04:12:35 2022 +*** ILogAgent.java Sat Feb 5 04:13:13 2022 +--- ILogAgent.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,26 **** + package net.minecraft.src; + +- import java.util.logging.Logger; +- + public interface ILogAgent + { +- Logger func_120013_a(); +- +- /** +- * Logs plain text message. +- */ + void logInfo(String var1); + +- /** +- * Logs text as warning. +- */ + void logWarning(String var1); + + void logWarningFormatted(String var1, Object ... var2); + + void logWarningException(String var1, Throwable var2); + + void logSevere(String var1); + + void logSevereException(String var1, Throwable var2); + } +--- 1,18 ---- + package net.minecraft.src; + + public interface ILogAgent + { + void logInfo(String var1); + + void logWarning(String var1); + + void logWarningFormatted(String var1, Object ... var2); + + void logWarningException(String var1, Throwable var2); + + void logSevere(String var1); + + void logSevereException(String var1, Throwable var2); ++ ++ void logFine(String var1); + } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ImageBufferDownload.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,89 ---- ++ package net.minecraft.src; ++ ++ import java.awt.Graphics; ++ import java.awt.image.BufferedImage; ++ import java.awt.image.DataBufferInt; ++ import java.awt.image.ImageObserver; ++ ++ public class ImageBufferDownload implements IImageBuffer ++ { ++ private int[] imageData; ++ private int imageWidth; ++ private int imageHeight; ++ ++ public BufferedImage parseUserSkin(BufferedImage par1BufferedImage) ++ { ++ if (par1BufferedImage == null) ++ { ++ return null; ++ } ++ else ++ { ++ this.imageWidth = 64; ++ this.imageHeight = 32; ++ BufferedImage var2 = new BufferedImage(this.imageWidth, this.imageHeight, 2); ++ Graphics var3 = var2.getGraphics(); ++ var3.drawImage(par1BufferedImage, 0, 0, (ImageObserver)null); ++ var3.dispose(); ++ this.imageData = ((DataBufferInt)var2.getRaster().getDataBuffer()).getData(); ++ this.setAreaOpaque(0, 0, 32, 16); ++ this.setAreaTransparent(32, 0, 64, 32); ++ this.setAreaOpaque(0, 16, 64, 32); ++ return var2; ++ } ++ } ++ ++ /** ++ * Makes the given area of the image transparent if it was previously completely opaque (used to remove the outer ++ * layer of a skin around the head if it was saved all opaque; this would be redundant so it's assumed that the skin ++ * maker is just using an image editor without an alpha channel) ++ */ ++ private void setAreaTransparent(int par1, int par2, int par3, int par4) ++ { ++ if (!this.hasTransparency(par1, par2, par3, par4)) ++ { ++ for (int var5 = par1; var5 < par3; ++var5) ++ { ++ for (int var6 = par2; var6 < par4; ++var6) ++ { ++ this.imageData[var5 + var6 * this.imageWidth] &= 16777215; ++ } ++ } ++ } ++ } ++ ++ /** ++ * Makes the given area of the image opaque ++ */ ++ private void setAreaOpaque(int par1, int par2, int par3, int par4) ++ { ++ for (int var5 = par1; var5 < par3; ++var5) ++ { ++ for (int var6 = par2; var6 < par4; ++var6) ++ { ++ this.imageData[var5 + var6 * this.imageWidth] |= -16777216; ++ } ++ } ++ } ++ ++ /** ++ * Returns true if the given area of the image contains transparent pixels ++ */ ++ private boolean hasTransparency(int par1, int par2, int par3, int par4) ++ { ++ for (int var5 = par1; var5 < par3; ++var5) ++ { ++ for (int var6 = par2; var6 < par4; ++var6) ++ { ++ int var7 = this.imageData[var5 + var6 * this.imageWidth]; ++ ++ if ((var7 >> 24 & 255) < 128) ++ { ++ return true; ++ } ++ } ++ } ++ ++ return false; ++ } ++ } +*** IMerchant.java Sat Feb 5 04:13:13 2022 +--- IMerchant.java Sat Feb 5 04:12:35 2022 +*************** +*** 6,14 **** +--- 6,16 ---- + + EntityPlayer getCustomer(); + + MerchantRecipeList getRecipes(EntityPlayer var1); + ++ void setRecipes(MerchantRecipeList var1); ++ + void useRecipe(MerchantRecipe var1); + + void func_110297_a_(ItemStack var1); + } +*** IMob.java Sat Feb 5 04:13:13 2022 +--- IMob.java Sat Feb 5 04:12:35 2022 +*** INetworkManager.java Sat Feb 5 04:13:13 2022 +--- INetworkManager.java Sat Feb 5 04:12:35 2022 +*************** +*** 23,47 **** + * Checks timeouts and processes all pending read packets. + */ + void processReadPackets(); + + /** +! * Returns the socket address of the remote side. Server-only. + */ +! SocketAddress getRemoteAddress(); + + /** + * Shuts down the server. (Only actually used on the server) + */ + void serverShutdown(); + + /** +! * Returns the number of chunk data packets waiting to be sent. + */ +! int getNumChunkDataPackets(); + + /** + * Shuts down the network with the specified reason. Closes all streams and sockets, spawns NetworkMasterThread to + * stop reading and writing threads. + */ + void networkShutdown(String var1, Object ... var2); + } +--- 23,49 ---- + * Checks timeouts and processes all pending read packets. + */ + void processReadPackets(); + + /** +! * Return the InetSocketAddress of the remote endpoint + */ +! SocketAddress getSocketAddress(); + + /** + * Shuts down the server. (Only actually used on the server) + */ + void serverShutdown(); + + /** +! * returns 0 for memoryConnections + */ +! int packetSize(); + + /** + * Shuts down the network with the specified reason. Closes all streams and sockets, spawns NetworkMasterThread to + * stop reading and writing threads. + */ + void networkShutdown(String var1, Object ... var2); ++ ++ void closeConnections(); + } +*** INpc.java Sat Feb 5 04:13:13 2022 +--- INpc.java Sat Feb 5 04:12:35 2022 +*** IntCache.java Sat Feb 5 04:13:13 2022 +--- IntCache.java Sat Feb 5 04:12:35 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- IntegratedPlayerList.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,61 ---- ++ package net.minecraft.src; ++ ++ import java.net.SocketAddress; ++ import net.minecraft.server.MinecraftServer; ++ ++ public class IntegratedPlayerList extends ServerConfigurationManager ++ { ++ /** ++ * Holds the NBT data for the host player's save file, so this can be written to level.dat. ++ */ ++ private NBTTagCompound hostPlayerData; ++ ++ public IntegratedPlayerList(IntegratedServer par1IntegratedServer) ++ { ++ super(par1IntegratedServer); ++ this.viewDistance = 10; ++ } ++ ++ /** ++ * also stores the NBTTags if this is an intergratedPlayerList ++ */ ++ protected void writePlayerData(EntityPlayerMP par1EntityPlayerMP) ++ { ++ if (par1EntityPlayerMP.getCommandSenderName().equals(this.getIntegratedServer().getServerOwner())) ++ { ++ this.hostPlayerData = new NBTTagCompound(); ++ par1EntityPlayerMP.writeToNBT(this.hostPlayerData); ++ } ++ ++ super.writePlayerData(par1EntityPlayerMP); ++ } ++ ++ /** ++ * checks ban-lists, then white-lists, then space for the server. Returns null on success, or an error message ++ */ ++ public String allowUserToConnect(SocketAddress par1SocketAddress, String par2Str) ++ { ++ return par2Str.equalsIgnoreCase(this.getIntegratedServer().getServerOwner()) ? "That name is already taken." : super.allowUserToConnect(par1SocketAddress, par2Str); ++ } ++ ++ /** ++ * get the associated Integrated Server ++ */ ++ public IntegratedServer getIntegratedServer() ++ { ++ return (IntegratedServer)super.getServerInstance(); ++ } ++ ++ /** ++ * On integrated servers, returns the host's player data to be written to level.dat. ++ */ ++ public NBTTagCompound getHostPlayerData() ++ { ++ return this.hostPlayerData; ++ } ++ ++ public MinecraftServer getServerInstance() ++ { ++ return this.getIntegratedServer(); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- IntegratedServer.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,294 ---- ++ package net.minecraft.src; ++ ++ import java.io.File; ++ import java.io.IOException; ++ import net.minecraft.server.MinecraftServer; ++ ++ public class IntegratedServer extends MinecraftServer ++ { ++ /** The Minecraft instance. */ ++ private final Minecraft mc; ++ private final WorldSettings theWorldSettings; ++ private final ILogAgent serverLogAgent; ++ ++ /** Instance of IntegratedServerListenThread. */ ++ private IntegratedServerListenThread theServerListeningThread; ++ private boolean isGamePaused; ++ private boolean isPublic; ++ private ThreadLanServerPing lanServerPing; ++ ++ public IntegratedServer(Minecraft par1Minecraft, String par2Str, String par3Str, WorldSettings par4WorldSettings) ++ { ++ super(new File(par1Minecraft.mcDataDir, "saves")); ++ this.serverLogAgent = new LogAgent("Minecraft-Server", " [SERVER]", (new File(par1Minecraft.mcDataDir, "output-server.log")).getAbsolutePath()); ++ this.setServerOwner(par1Minecraft.getSession().getUsername()); ++ this.setFolderName(par2Str); ++ this.setWorldName(par3Str); ++ this.setDemo(par1Minecraft.isDemo()); ++ this.canCreateBonusChest(par4WorldSettings.isBonusChestEnabled()); ++ this.setBuildLimit(256); ++ this.setConfigurationManager(new IntegratedPlayerList(this)); ++ this.mc = par1Minecraft; ++ this.serverProxy = par1Minecraft.getProxy(); ++ this.theWorldSettings = par4WorldSettings; ++ ++ try ++ { ++ this.theServerListeningThread = new IntegratedServerListenThread(this); ++ } ++ catch (IOException var6) ++ { ++ throw new Error(); ++ } ++ } ++ ++ protected void loadAllWorlds(String par1Str, String par2Str, long par3, WorldType par5WorldType, String par6Str) ++ { ++ this.convertMapIfNeeded(par1Str); ++ this.worldServers = new WorldServer[3]; ++ this.timeOfLastDimensionTick = new long[this.worldServers.length][100]; ++ ISaveHandler var7 = this.getActiveAnvilConverter().getSaveLoader(par1Str, true); ++ ++ for (int var8 = 0; var8 < this.worldServers.length; ++var8) ++ { ++ byte var9 = 0; ++ ++ if (var8 == 1) ++ { ++ var9 = -1; ++ } ++ ++ if (var8 == 2) ++ { ++ var9 = 1; ++ } ++ ++ if (var8 == 0) ++ { ++ if (this.isDemo()) ++ { ++ this.worldServers[var8] = new DemoWorldServer(this, var7, par2Str, var9, this.theProfiler, this.getLogAgent()); ++ } ++ else ++ { ++ this.worldServers[var8] = new WorldServer(this, var7, par2Str, var9, this.theWorldSettings, this.theProfiler, this.getLogAgent()); ++ } ++ } ++ else ++ { ++ this.worldServers[var8] = new WorldServerMulti(this, var7, par2Str, var9, this.theWorldSettings, this.worldServers[0], this.theProfiler, this.getLogAgent()); ++ } ++ ++ this.worldServers[var8].addWorldAccess(new WorldManager(this, this.worldServers[var8])); ++ this.getConfigurationManager().setPlayerManager(this.worldServers); ++ } ++ ++ this.setDifficultyForAllWorlds(this.getDifficulty()); ++ this.initialWorldChunkLoad(); ++ } ++ ++ /** ++ * Initialises the server and starts it. ++ */ ++ protected boolean startServer() throws IOException ++ { ++ this.serverLogAgent.logInfo("Starting integrated minecraft server version 1.6.4"); ++ this.setOnlineMode(false); ++ this.setCanSpawnAnimals(true); ++ this.setCanSpawnNPCs(true); ++ this.setAllowPvp(true); ++ this.setAllowFlight(true); ++ this.serverLogAgent.logInfo("Generating keypair"); ++ this.setKeyPair(CryptManager.createNewKeyPair()); ++ this.loadAllWorlds(this.getFolderName(), this.getWorldName(), this.theWorldSettings.getSeed(), this.theWorldSettings.getTerrainType(), this.theWorldSettings.func_82749_j()); ++ this.setMOTD(this.getServerOwner() + " - " + this.worldServers[0].getWorldInfo().getWorldName()); ++ return true; ++ } ++ ++ /** ++ * Main function called by run() every loop. ++ */ ++ public void tick() ++ { ++ boolean var1 = this.isGamePaused; ++ this.isGamePaused = this.theServerListeningThread.isGamePaused(); ++ ++ if (!var1 && this.isGamePaused) ++ { ++ this.serverLogAgent.logInfo("Saving and pausing game..."); ++ this.getConfigurationManager().saveAllPlayerData(); ++ this.saveAllWorlds(false); ++ } ++ ++ if (!this.isGamePaused) ++ { ++ super.tick(); ++ } ++ } ++ ++ public boolean canStructuresSpawn() ++ { ++ return false; ++ } ++ ++ public EnumGameType getGameType() ++ { ++ return this.theWorldSettings.getGameType(); ++ } ++ ++ /** ++ * Defaults to "1" (Easy) for the dedicated server, defaults to "2" (Normal) on the client. ++ */ ++ public int getDifficulty() ++ { ++ return this.mc.gameSettings.difficulty; ++ } ++ ++ /** ++ * Defaults to false. ++ */ ++ public boolean isHardcore() ++ { ++ return this.theWorldSettings.getHardcoreEnabled(); ++ } ++ ++ protected File getDataDirectory() ++ { ++ return this.mc.mcDataDir; ++ } ++ ++ public boolean isDedicatedServer() ++ { ++ return false; ++ } ++ ++ /** ++ * Gets the IntergratedServerListenThread. ++ */ ++ public IntegratedServerListenThread getServerListeningThread() ++ { ++ return this.theServerListeningThread; ++ } ++ ++ /** ++ * Called on exit from the main run() loop. ++ */ ++ protected void finalTick(CrashReport par1CrashReport) ++ { ++ this.mc.crashed(par1CrashReport); ++ } ++ ++ /** ++ * Adds the server info, including from theWorldServer, to the crash report. ++ */ ++ public CrashReport addServerInfoToCrashReport(CrashReport par1CrashReport) ++ { ++ par1CrashReport = super.addServerInfoToCrashReport(par1CrashReport); ++ par1CrashReport.getCategory().addCrashSectionCallable("Type", new CallableType3(this)); ++ par1CrashReport.getCategory().addCrashSectionCallable("Is Modded", new CallableIsModded(this)); ++ return par1CrashReport; ++ } ++ ++ public void addServerStatsToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper) ++ { ++ super.addServerStatsToSnooper(par1PlayerUsageSnooper); ++ par1PlayerUsageSnooper.addData("snooper_partner", this.mc.getPlayerUsageSnooper().getUniqueID()); ++ } ++ ++ /** ++ * Returns whether snooping is enabled or not. ++ */ ++ public boolean isSnooperEnabled() ++ { ++ return Minecraft.getMinecraft().isSnooperEnabled(); ++ } ++ ++ /** ++ * On dedicated does nothing. On integrated, sets commandsAllowedForAll, gameType and allows external connections. ++ */ ++ public String shareToLAN(EnumGameType par1EnumGameType, boolean par2) ++ { ++ try ++ { ++ String var3 = this.theServerListeningThread.func_71755_c(); ++ this.getLogAgent().logInfo("Started on " + var3); ++ this.isPublic = true; ++ this.lanServerPing = new ThreadLanServerPing(this.getMOTD(), var3); ++ this.lanServerPing.start(); ++ this.getConfigurationManager().setGameType(par1EnumGameType); ++ this.getConfigurationManager().setCommandsAllowedForAll(par2); ++ return var3; ++ } ++ catch (IOException var4) ++ { ++ return null; ++ } ++ } ++ ++ public ILogAgent getLogAgent() ++ { ++ return this.serverLogAgent; ++ } ++ ++ /** ++ * Saves all necessary data as preparation for stopping the server. ++ */ ++ public void stopServer() ++ { ++ super.stopServer(); ++ ++ if (this.lanServerPing != null) ++ { ++ this.lanServerPing.interrupt(); ++ this.lanServerPing = null; ++ } ++ } ++ ++ /** ++ * Sets the serverRunning variable to false, in order to get the server to shut down. ++ */ ++ public void initiateShutdown() ++ { ++ super.initiateShutdown(); ++ ++ if (this.lanServerPing != null) ++ { ++ this.lanServerPing.interrupt(); ++ this.lanServerPing = null; ++ } ++ } ++ ++ /** ++ * Returns true if this integrated server is open to LAN ++ */ ++ public boolean getPublic() ++ { ++ return this.isPublic; ++ } ++ ++ /** ++ * Sets the game type for all worlds. ++ */ ++ public void setGameType(EnumGameType par1EnumGameType) ++ { ++ this.getConfigurationManager().setGameType(par1EnumGameType); ++ } ++ ++ /** ++ * Return whether command blocks are enabled. ++ */ ++ public boolean isCommandBlockEnabled() ++ { ++ return true; ++ } ++ ++ public int func_110455_j() ++ { ++ return 4; ++ } ++ ++ public NetworkListenThread getNetworkThread() ++ { ++ return this.getServerListeningThread(); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- IntegratedServerListenThread.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,119 ---- ++ package net.minecraft.src; ++ ++ import java.io.IOException; ++ import java.net.InetAddress; ++ import net.minecraft.server.MinecraftServer; ++ ++ public class IntegratedServerListenThread extends NetworkListenThread ++ { ++ private final MemoryConnection netMemoryConnection; ++ private MemoryConnection theMemoryConnection; ++ private String field_71759_e; ++ private boolean field_71756_f; ++ private ServerListenThread myServerListenThread; ++ ++ public IntegratedServerListenThread(IntegratedServer par1IntegratedServer) throws IOException ++ { ++ super(par1IntegratedServer); ++ this.netMemoryConnection = new MemoryConnection(par1IntegratedServer.getLogAgent(), (NetHandler)null); ++ } ++ ++ public void func_71754_a(MemoryConnection par1MemoryConnection, String par2Str) ++ { ++ this.theMemoryConnection = par1MemoryConnection; ++ this.field_71759_e = par2Str; ++ } ++ ++ public String func_71755_c() throws IOException ++ { ++ if (this.myServerListenThread == null) ++ { ++ int var1 = -1; ++ ++ try ++ { ++ var1 = HttpUtil.func_76181_a(); ++ } ++ catch (IOException var4) ++ { ++ ; ++ } ++ ++ if (var1 <= 0) ++ { ++ var1 = 25564; ++ } ++ ++ try ++ { ++ this.myServerListenThread = new ServerListenThread(this, (InetAddress)null, var1); ++ this.myServerListenThread.start(); ++ } ++ catch (IOException var3) ++ { ++ throw var3; ++ } ++ } ++ ++ return String.valueOf(this.myServerListenThread.getMyPort()); ++ } ++ ++ public void stopListening() ++ { ++ super.stopListening(); ++ ++ if (this.myServerListenThread != null) ++ { ++ this.getIntegratedServer().getLogAgent().logInfo("Stopping server connection"); ++ this.myServerListenThread.func_71768_b(); ++ this.myServerListenThread.interrupt(); ++ this.myServerListenThread = null; ++ } ++ } ++ ++ /** ++ * processes packets and pending connections ++ */ ++ public void networkTick() ++ { ++ if (this.theMemoryConnection != null) ++ { ++ EntityPlayerMP var1 = this.getIntegratedServer().getConfigurationManager().createPlayerForUser(this.field_71759_e); ++ ++ if (var1 != null) ++ { ++ this.netMemoryConnection.pairWith(this.theMemoryConnection); ++ this.field_71756_f = true; ++ this.getIntegratedServer().getConfigurationManager().initializeConnectionToPlayer(this.netMemoryConnection, var1); ++ } ++ ++ this.theMemoryConnection = null; ++ this.field_71759_e = null; ++ } ++ ++ if (this.myServerListenThread != null) ++ { ++ this.myServerListenThread.processPendingConnections(); ++ } ++ ++ super.networkTick(); ++ } ++ ++ /** ++ * Gets MinecraftServer instance. ++ */ ++ public IntegratedServer getIntegratedServer() ++ { ++ return (IntegratedServer)super.getServer(); ++ } ++ ++ public boolean isGamePaused() ++ { ++ return this.field_71756_f && this.netMemoryConnection.getPairedConnection().isConnectionActive() && this.netMemoryConnection.getPairedConnection().isGamePaused(); ++ } ++ ++ public MinecraftServer getServer() ++ { ++ return this.getIntegratedServer(); ++ } ++ } +*** IntHashMap.java Sat Feb 5 04:13:13 2022 +--- IntHashMap.java Sat Feb 5 04:12:35 2022 +*************** +*** 57,75 **** + + return null; + } + + /** +! * Returns true if this hash table contains the specified item. + */ + public boolean containsItem(int par1) + { + return this.lookupEntry(par1) != null; + } + + /** +! * Returns the internal entry for a key + */ + final IntHashMapEntry lookupEntry(int par1) + { + int var2 = computeHash(par1); + +--- 57,75 ---- + + return null; + } + + /** +! * Return true if an object is associated with the given key + */ + public boolean containsItem(int par1) + { + return this.lookupEntry(par1) != null; + } + + /** +! * Returns the key/object mapping for a given key as a MCHashEntry + */ + final IntHashMapEntry lookupEntry(int par1) + { + int var2 = computeHash(par1); + +*** IntHashMapEntry.java Sat Feb 5 04:13:13 2022 +--- IntHashMapEntry.java Sat Feb 5 04:12:35 2022 +*** InventoryBasic.java Sat Feb 5 04:13:13 2022 +--- InventoryBasic.java Sat Feb 5 04:12:35 2022 +*** InventoryCrafting.java Sat Feb 5 04:13:13 2022 +--- InventoryCrafting.java Sat Feb 5 04:12:35 2022 +*** InventoryCraftResult.java Sat Feb 5 04:13:13 2022 +--- InventoryCraftResult.java Sat Feb 5 04:12:35 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- InventoryEffectRenderer.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,99 ---- ++ package net.minecraft.src; ++ ++ import java.util.Collection; ++ import java.util.Iterator; ++ import org.lwjgl.opengl.GL11; ++ ++ public abstract class InventoryEffectRenderer extends GuiContainer ++ { ++ private boolean field_74222_o; ++ ++ public InventoryEffectRenderer(Container par1Container) ++ { ++ super(par1Container); ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() ++ { ++ super.initGui(); ++ ++ if (!this.mc.thePlayer.getActivePotionEffects().isEmpty()) ++ { ++ this.guiLeft = 160 + (this.width - this.xSize - 200) / 2; ++ this.field_74222_o = true; ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) ++ { ++ super.drawScreen(par1, par2, par3); ++ ++ if (this.field_74222_o) ++ { ++ this.displayDebuffEffects(); ++ } ++ } ++ ++ /** ++ * Displays debuff/potion effects that are currently being applied to the player ++ */ ++ private void displayDebuffEffects() ++ { ++ int var1 = this.guiLeft - 124; ++ int var2 = this.guiTop; ++ boolean var3 = true; ++ Collection var4 = this.mc.thePlayer.getActivePotionEffects(); ++ ++ if (!var4.isEmpty()) ++ { ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ int var5 = 33; ++ ++ if (var4.size() > 5) ++ { ++ var5 = 132 / (var4.size() - 1); ++ } ++ ++ for (Iterator var6 = this.mc.thePlayer.getActivePotionEffects().iterator(); var6.hasNext(); var2 += var5) ++ { ++ PotionEffect var7 = (PotionEffect)var6.next(); ++ Potion var8 = Potion.potionTypes[var7.getPotionID()]; ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.mc.getTextureManager().bindTexture(field_110408_a); ++ this.drawTexturedModalRect(var1, var2, 0, 166, 140, 32); ++ ++ if (var8.hasStatusIcon()) ++ { ++ int var9 = var8.getStatusIconIndex(); ++ this.drawTexturedModalRect(var1 + 6, var2 + 7, 0 + var9 % 8 * 18, 198 + var9 / 8 * 18, 18, 18); ++ } ++ ++ String var11 = I18n.getString(var8.getName()); ++ ++ if (var7.getAmplifier() == 1) ++ { ++ var11 = var11 + " II"; ++ } ++ else if (var7.getAmplifier() == 2) ++ { ++ var11 = var11 + " III"; ++ } ++ else if (var7.getAmplifier() == 3) ++ { ++ var11 = var11 + " IV"; ++ } ++ ++ this.fontRenderer.drawStringWithShadow(var11, var1 + 10 + 18, var2 + 6, 16777215); ++ String var10 = Potion.getDurationString(var7); ++ this.fontRenderer.drawStringWithShadow(var10, var1 + 10 + 18, var2 + 6 + 10, 8355711); ++ } ++ } ++ } ++ } +*** InventoryEnderChest.java Sat Feb 5 04:13:13 2022 +--- InventoryEnderChest.java Sat Feb 5 04:12:35 2022 +*** InventoryLargeChest.java Sat Feb 5 04:13:13 2022 +--- InventoryLargeChest.java Sat Feb 5 04:12:35 2022 +*** InventoryMerchant.java Sat Feb 5 04:13:13 2022 +--- InventoryMerchant.java Sat Feb 5 04:12:35 2022 +*** InventoryPlayer.java Sat Feb 5 04:13:13 2022 +--- InventoryPlayer.java Sat Feb 5 04:12:35 2022 +*************** +*** 11,20 **** +--- 11,23 ---- + public ItemStack[] armorInventory = new ItemStack[4]; + + /** The index of the currently held item (0-8). */ + public int currentItem; + ++ /** The current ItemStack. */ ++ private ItemStack currentItemStack; ++ + /** The player whose inventory this is. */ + public EntityPlayer player; + private ItemStack itemStack; + + /** +*************** +*** 58,67 **** +--- 61,83 ---- + } + + return -1; + } + ++ private int getInventorySlotContainItemAndDamage(int par1, int par2) ++ { ++ for (int var3 = 0; var3 < this.mainInventory.length; ++var3) ++ { ++ if (this.mainInventory[var3] != null && this.mainInventory[var3].itemID == par1 && this.mainInventory[var3].getItemDamage() == par2) ++ { ++ return var3; ++ } ++ } ++ ++ return -1; ++ } ++ + /** + * stores an itemstack in the users inventory + */ + private int storeItemStack(ItemStack par1ItemStack) + { +*************** +*** 91,100 **** +--- 107,180 ---- + + return -1; + } + + /** ++ * Sets a specific itemID as the current item being held (only if it exists on the hotbar) ++ */ ++ public void setCurrentItem(int par1, int par2, boolean par3, boolean par4) ++ { ++ boolean var5 = true; ++ this.currentItemStack = this.getCurrentItem(); ++ int var7; ++ ++ if (par3) ++ { ++ var7 = this.getInventorySlotContainItemAndDamage(par1, par2); ++ } ++ else ++ { ++ var7 = this.getInventorySlotContainItem(par1); ++ } ++ ++ if (var7 >= 0 && var7 < 9) ++ { ++ this.currentItem = var7; ++ } ++ else ++ { ++ if (par4 && par1 > 0) ++ { ++ int var6 = this.getFirstEmptyStack(); ++ ++ if (var6 >= 0 && var6 < 9) ++ { ++ this.currentItem = var6; ++ } ++ ++ this.func_70439_a(Item.itemsList[par1], par2); ++ } ++ } ++ } ++ ++ /** ++ * Switch the current item to the next one or the previous one ++ */ ++ public void changeCurrentItem(int par1) ++ { ++ if (par1 > 0) ++ { ++ par1 = 1; ++ } ++ ++ if (par1 < 0) ++ { ++ par1 = -1; ++ } ++ ++ for (this.currentItem -= par1; this.currentItem < 0; this.currentItem += 9) ++ { ++ ; ++ } ++ ++ while (this.currentItem >= 9) ++ { ++ this.currentItem -= 9; ++ } ++ } ++ ++ /** + * Clear this player's inventory, using the specified ID and metadata as filters or -1 for no filter. + */ + public int clearInventory(int par1, int par2) + { + int var3 = 0; +*************** +*** 138,147 **** +--- 218,251 ---- + var3 += this.itemStack.stackSize; + this.setItemStack((ItemStack)null); + } + + return var3; ++ } ++ ++ public void func_70439_a(Item par1Item, int par2) ++ { ++ if (par1Item != null) ++ { ++ if (this.currentItemStack != null && this.currentItemStack.isItemEnchantable() && this.getInventorySlotContainItemAndDamage(this.currentItemStack.itemID, this.currentItemStack.getItemDamageForDisplay()) == this.currentItem) ++ { ++ return; ++ } ++ ++ int var3 = this.getInventorySlotContainItemAndDamage(par1Item.itemID, par2); ++ ++ if (var3 >= 0) ++ { ++ int var4 = this.mainInventory[var3].stackSize; ++ this.mainInventory[var3] = this.mainInventory[this.currentItem]; ++ this.mainInventory[this.currentItem] = new ItemStack(Item.itemsList[par1Item.itemID], var4, par2); ++ } ++ else ++ { ++ this.mainInventory[this.currentItem] = new ItemStack(Item.itemsList[par1Item.itemID], 1, par2); ++ } ++ } + } + + /** + * This function stores as many items of an ItemStack as possible in a matching slot and returns the quantity of + * left over items. +*** IPlayerFileData.java Sat Feb 5 04:13:13 2022 +--- IPlayerFileData.java Sat Feb 5 04:12:35 2022 +*** IPlayerUsage.java Sat Feb 5 04:13:13 2022 +--- IPlayerUsage.java Sat Feb 5 04:12:35 2022 +*** IPosition.java Sat Feb 5 04:13:13 2022 +--- IPosition.java Sat Feb 5 04:12:35 2022 +*** IProgressUpdate.java Sat Feb 5 04:13:13 2022 +--- IProgressUpdate.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,18 **** + package net.minecraft.src; + + public interface IProgressUpdate + { + /** +! * Shows the 'Saving level' string. + */ +! void displaySavingString(String var1); + + /** +! * Displays a string on the loading screen supposed to indicate what is being done currently. + */ +! void displayLoadingString(String var1); + + /** + * Updates the progress bar on the loading screen to the specified amount. Args: loadProgress + */ + void setLoadingProgress(int var1); +--- 1,18 ---- + package net.minecraft.src; + + public interface IProgressUpdate + { + /** +! * "Saving level", or the loading,or downloading equivelent + */ +! void displayProgressMessage(String var1); + + /** +! * This is called with "Working..." by resetProgressAndMessage + */ +! void resetProgresAndWorkingMessage(String var1); + + /** + * Updates the progress bar on the loading screen to the specified amount. Args: loadProgress + */ + void setLoadingProgress(int var1); +*** IProjectile.java Sat Feb 5 04:13:13 2022 +--- IProjectile.java Sat Feb 5 04:12:35 2022 +*** IRangedAttackMob.java Sat Feb 5 04:13:13 2022 +--- IRangedAttackMob.java Sat Feb 5 04:12:35 2022 +*** IRecipe.java Sat Feb 5 04:13:13 2022 +--- IRecipe.java Sat Feb 5 04:12:35 2022 +*** IRegistry.java Sat Feb 5 04:13:13 2022 +--- IRegistry.java Sat Feb 5 04:12:35 2022 +*** ISaveFormat.java Sat Feb 5 04:13:14 2022 +--- ISaveFormat.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,27 **** + package net.minecraft.src; + + public interface ISaveFormat + { + /** + * Returns back a loader for the specified save directory + */ + ISaveHandler getSaveLoader(String var1, boolean var2); + + void flushCache(); + + /** + * @args: Takes one argument - the name of the directory of the world to delete. @desc: Delete the world by deleting + * the associated directory recursively. + */ + boolean deleteWorldDirectory(String var1); + + /** +! * gets if the map is old chunk saving (true) or McRegion (false) + */ + boolean isOldMapFormat(String var1); + + /** +! * converts the map to mcRegion + */ + boolean convertMapFormat(String var1, IProgressUpdate var2); + } +--- 1,48 ---- + package net.minecraft.src; + ++ import java.util.List; ++ + public interface ISaveFormat + { + /** + * Returns back a loader for the specified save directory + */ + ISaveHandler getSaveLoader(String var1, boolean var2); + ++ List getSaveList() throws AnvilConverterException; ++ + void flushCache(); + + /** ++ * gets the world info ++ */ ++ WorldInfo getWorldInfo(String var1); ++ ++ /** + * @args: Takes one argument - the name of the directory of the world to delete. @desc: Delete the world by deleting + * the associated directory recursively. + */ + boolean deleteWorldDirectory(String var1); + + /** +! * @args: Takes two arguments - first the name of the directory containing the world and second the new name for +! * that world. @desc: Renames the world by storing the new name in level.dat. It does *not* rename the directory +! * containing the world data. +! */ +! void renameWorld(String var1, String var2); +! +! /** +! * Checks if the save directory uses the old map format + */ + boolean isOldMapFormat(String var1); + + /** +! * Converts the specified map to the new map format. Args: worldName, loadingScreen + */ + boolean convertMapFormat(String var1, IProgressUpdate var2); ++ ++ /** ++ * Return whether the given world can be loaded. ++ */ ++ boolean canLoadWorld(String var1); + } +*** ISaveHandler.java Sat Feb 5 04:13:14 2022 +--- ISaveHandler.java Sat Feb 5 04:12:35 2022 +*************** +*** 13,37 **** + * Checks the session lock to prevent save collisions + */ + void checkSessionLock() throws MinecraftException; + + /** +! * initializes and returns the chunk loader for the specified world provider + */ + IChunkLoader getChunkLoader(WorldProvider var1); + + /** + * Saves the given World Info with the given NBTTagCompound as the Player. + */ + void saveWorldInfoWithPlayer(WorldInfo var1, NBTTagCompound var2); + + /** +! * used to update level.dat from old format to MCRegion format + */ + void saveWorldInfo(WorldInfo var1); + +! IPlayerFileData getPlayerNBTManager(); + + /** + * Called to flush all changes to disk, waiting for them to complete. + */ + void flush(); +--- 13,40 ---- + * Checks the session lock to prevent save collisions + */ + void checkSessionLock() throws MinecraftException; + + /** +! * Returns the chunk loader with the provided world provider + */ + IChunkLoader getChunkLoader(WorldProvider var1); + + /** + * Saves the given World Info with the given NBTTagCompound as the Player. + */ + void saveWorldInfoWithPlayer(WorldInfo var1, NBTTagCompound var2); + + /** +! * Saves the passed in world info. + */ + void saveWorldInfo(WorldInfo var1); + +! /** +! * returns null if no saveHandler is relevent (eg. SMP) +! */ +! IPlayerFileData getSaveHandler(); + + /** + * Called to flush all changes to disk, waiting for them to complete. + */ + void flush(); +*** IServer.java Sat Feb 5 04:13:14 2022 +--- IServer.java Sat Feb 5 04:12:35 2022 +*************** +*** 38,48 **** + int getPort(); + + /** + * Returns the server message of the day + */ +! String getMotd(); + + /** + * Returns the server's Minecraft version as string. + */ + String getMinecraftVersion(); +--- 38,48 ---- + int getPort(); + + /** + * Returns the server message of the day + */ +! String getServerMOTD(); + + /** + * Returns the server's Minecraft version as string. + */ + String getMinecraftVersion(); +*************** +*** 67,80 **** + /** + * Used by RCon's Query in the form of "MajorServerMod 1.2.3: MyPlugin 1.3; AnotherPlugin 2.1; AndSoForth 1.0". + */ + String getPlugins(); + +! /** +! * Handle a command received by an RCon instance +! */ +! String handleRConCommand(String var1); + + /** + * Returns true if debugging is enabled, false otherwise. + */ + boolean isDebuggingEnabled(); +--- 67,77 ---- + /** + * Used by RCon's Query in the form of "MajorServerMod 1.2.3: MyPlugin 1.3; AnotherPlugin 2.1; AndSoForth 1.0". + */ + String getPlugins(); + +! String executeCommand(String var1); + + /** + * Returns true if debugging is enabled, false otherwise. + */ + boolean isDebuggingEnabled(); +*** ISidedInventory.java Sat Feb 5 04:13:14 2022 +--- ISidedInventory.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,13 **** + package net.minecraft.src; + + public interface ISidedInventory extends IInventory + { + /** +! * param side + */ +! int[] getSlotsForFace(int var1); + + /** + * Returns true if automation can insert the given item in the given slot from the given side. Args: Slot, item, + * side + */ +--- 1,14 ---- + package net.minecraft.src; + + public interface ISidedInventory extends IInventory + { + /** +! * Returns an array containing the indices of the slots that can be accessed by automation on the given side of this +! * block. + */ +! int[] getAccessibleSlotsFromSide(int var1); + + /** + * Returns true if automation can insert the given item in the given slot from the given side. Args: Slot, item, + * side + */ +*** /dev/null Thu Jan 1 01:00:00 1970 +--- IStatStringFormat.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,9 ---- ++ package net.minecraft.src; ++ ++ public interface IStatStringFormat ++ { ++ /** ++ * Formats the strings based on 'IStatStringFormat' interface. ++ */ ++ String formatString(String var1); ++ } +*** IStatType.java Sat Feb 5 04:13:14 2022 +--- IStatType.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,5 **** +--- 1,9 ---- + package net.minecraft.src; + + public interface IStatType + { ++ /** ++ * Formats a given stat for human consumption. ++ */ ++ String format(int var1); + } +*** Item.java Sat Feb 5 04:13:14 2022 +--- Item.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,9 **** +--- 1,10 ---- + package net.minecraft.src; + + import com.google.common.collect.HashMultimap; + import com.google.common.collect.Multimap; ++ import java.util.List; + import java.util.Random; + import java.util.UUID; + + public class Item + { +*************** +*** 176,186 **** + public static Item fireworkCharge = (new ItemFireworkCharge(146)).setUnlocalizedName("fireworksCharge").setCreativeTab(CreativeTabs.tabMisc).setTextureName("fireworks_charge"); + public static ItemEnchantedBook enchantedBook = (ItemEnchantedBook)(new ItemEnchantedBook(147)).setMaxStackSize(1).setUnlocalizedName("enchantedBook").setTextureName("book_enchanted"); + public static Item comparator = (new ItemReed(148, Block.redstoneComparatorIdle)).setUnlocalizedName("comparator").setCreativeTab(CreativeTabs.tabRedstone).setTextureName("comparator"); + public static Item netherrackBrick = (new Item(149)).setUnlocalizedName("netherbrick").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("netherbrick"); + public static Item netherQuartz = (new Item(150)).setUnlocalizedName("netherquartz").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("quartz"); +! public static Item tntMinecart = (new ItemMinecart(151, 3)).setUnlocalizedName("minecartTnt").setTextureName("minecart_tnt"); + public static Item minecartHopper = (new ItemMinecart(152, 5)).setUnlocalizedName("minecartHopper").setTextureName("minecart_hopper"); + public static Item horseArmorIron = (new Item(161)).setUnlocalizedName("horsearmormetal").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("iron_horse_armor"); + public static Item horseArmorGold = (new Item(162)).setUnlocalizedName("horsearmorgold").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("gold_horse_armor"); + public static Item horseArmorDiamond = (new Item(163)).setUnlocalizedName("horsearmordiamond").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("diamond_horse_armor"); + public static Item leash = (new ItemLeash(164)).setUnlocalizedName("leash").setTextureName("lead"); +--- 177,187 ---- + public static Item fireworkCharge = (new ItemFireworkCharge(146)).setUnlocalizedName("fireworksCharge").setCreativeTab(CreativeTabs.tabMisc).setTextureName("fireworks_charge"); + public static ItemEnchantedBook enchantedBook = (ItemEnchantedBook)(new ItemEnchantedBook(147)).setMaxStackSize(1).setUnlocalizedName("enchantedBook").setTextureName("book_enchanted"); + public static Item comparator = (new ItemReed(148, Block.redstoneComparatorIdle)).setUnlocalizedName("comparator").setCreativeTab(CreativeTabs.tabRedstone).setTextureName("comparator"); + public static Item netherrackBrick = (new Item(149)).setUnlocalizedName("netherbrick").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("netherbrick"); + public static Item netherQuartz = (new Item(150)).setUnlocalizedName("netherquartz").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("quartz"); +! public static Item minecartTnt = (new ItemMinecart(151, 3)).setUnlocalizedName("minecartTnt").setTextureName("minecart_tnt"); + public static Item minecartHopper = (new ItemMinecart(152, 5)).setUnlocalizedName("minecartHopper").setTextureName("minecart_hopper"); + public static Item horseArmorIron = (new Item(161)).setUnlocalizedName("horsearmormetal").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("iron_horse_armor"); + public static Item horseArmorGold = (new Item(162)).setUnlocalizedName("horsearmorgold").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("gold_horse_armor"); + public static Item horseArmorDiamond = (new Item(163)).setUnlocalizedName("horsearmordiamond").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("diamond_horse_armor"); + public static Item leash = (new ItemLeash(164)).setUnlocalizedName("leash").setTextureName("lead"); +*************** +*** 213,231 **** + /** + * Some items (like dyes) have multiple subtypes on same item, this is field define this behavior + */ + protected boolean hasSubtypes; + private Item containerItem; +- +- /** +- * The string representing this item's effect on a potion when used as an ingredient. +- */ + private String potionEffect; + + /** The unlocalized name of this item. */ + private String unlocalizedName; + + /** The string associated with this Item's Icon. */ + protected String iconString; + + protected Item(int par1) + { +--- 214,231 ---- + /** + * Some items (like dyes) have multiple subtypes on same item, this is field define this behavior + */ + protected boolean hasSubtypes; + private Item containerItem; + private String potionEffect; + + /** The unlocalized name of this item. */ + private String unlocalizedName; + ++ /** Icon index in the icons table. */ ++ protected Icon itemIcon; ++ + /** The string associated with this Item's Icon. */ + protected String iconString; + + protected Item(int par1) + { +*************** +*** 244,253 **** +--- 244,277 ---- + this.maxStackSize = par1; + return this; + } + + /** ++ * Returns 0 for /terrain.png, 1 for /gui/items.png ++ */ ++ public int getSpriteNumber() ++ { ++ return 1; ++ } ++ ++ /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) ++ { ++ return this.itemIcon; ++ } ++ ++ /** ++ * Returns the icon index of the stack given as argument. ++ */ ++ public final Icon getIconIndex(ItemStack par1ItemStack) ++ { ++ return this.getIconFromDamage(par1ItemStack.getItemDamage()); ++ } ++ ++ /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) + { +*************** +*** 363,372 **** +--- 387,413 ---- + this.bFull3D = true; + return this; + } + + /** ++ * Returns True is the item is renderer in full 3D when hold. ++ */ ++ public boolean isFull3D() ++ { ++ return this.bFull3D; ++ } ++ ++ /** ++ * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities ++ * hands. ++ */ ++ public boolean shouldRotateAroundWhenRendering() ++ { ++ return false; ++ } ++ ++ /** + * Sets the unlocalized name of this item to the string passed as the parameter, prefixed by "item." + */ + public Item setUnlocalizedName(String par1Str) + { + this.unlocalizedName = par1Str; +*************** +*** 444,453 **** +--- 485,499 ---- + public String getItemStackDisplayName(ItemStack par1ItemStack) + { + return StatCollector.translateToLocal(this.getUnlocalizedName(par1ItemStack) + ".name"); + } + ++ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) ++ { ++ return 16777215; ++ } ++ + /** + * Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and + * update it's contents. + */ + public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {} +*************** +*** 509,523 **** +--- 555,587 ---- + public boolean isPotionIngredient() + { + return this.potionEffect != null; + } + ++ /** ++ * allows items to add custom lines of information to the mouseover description ++ */ ++ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {} ++ + public String getItemDisplayName(ItemStack par1ItemStack) + { + return ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(par1ItemStack) + ".name")).trim(); + } + ++ public boolean hasEffect(ItemStack par1ItemStack) ++ { ++ return par1ItemStack.isItemEnchanted(); ++ } ++ ++ /** ++ * Return an item rarity from EnumRarity ++ */ ++ public EnumRarity getRarity(ItemStack par1ItemStack) ++ { ++ return par1ItemStack.isItemEnchanted() ? EnumRarity.rare : EnumRarity.common; ++ } ++ + /** + * Checks isDamagable and if it cannot be stacked + */ + public boolean isItemTool(ItemStack par1ItemStack) + { +*************** +*** 539,559 **** + float var17 = MathHelper.sin(-var5 * 0.017453292F); + float var18 = var15 * var16; + float var20 = var14 * var16; + double var21 = 5.0D; + Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21); +! return par1World.rayTraceBlocks(var13, var23, par3, !par3); + } + + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + public int getItemEnchantability() + { + return 0; + } + + /** + * returns this; + */ + public Item setCreativeTab(CreativeTabs par1CreativeTabs) + { +--- 603,652 ---- + float var17 = MathHelper.sin(-var5 * 0.017453292F); + float var18 = var15 * var16; + float var20 = var14 * var16; + double var21 = 5.0D; + Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21); +! return par1World.rayTraceBlocks_do_do(var13, var23, par3, !par3); + } + + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + public int getItemEnchantability() + { + return 0; + } + ++ public boolean requiresMultipleRenderPasses() ++ { ++ return false; ++ } ++ ++ /** ++ * Gets an icon index based on an item's damage value and the given render pass ++ */ ++ public Icon getIconFromDamageForRenderPass(int par1, int par2) ++ { ++ return this.getIconFromDamage(par1); ++ } ++ ++ /** ++ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) ++ */ ++ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) ++ { ++ par3List.add(new ItemStack(par1, 1, 0)); ++ } ++ ++ /** ++ * gets the CreativeTab this item is displayed on ++ */ ++ public CreativeTabs getCreativeTab() ++ { ++ return this.tabToDisplayOn; ++ } ++ + /** + * returns this; + */ + public Item setCreativeTab(CreativeTabs par1CreativeTabs) + { +*************** +*** 576,585 **** +--- 669,683 ---- + public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) + { + return false; + } + ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.itemIcon = par1IconRegister.registerIcon(this.getIconString()); ++ } ++ + /** + * Gets a map of item attribute modifiers, used by ItemSword to increase hit damage. + */ + public Multimap getItemAttributeModifiers() + { +*************** +*** 588,597 **** +--- 686,703 ---- + + protected Item setTextureName(String par1Str) + { + this.iconString = par1Str; + return this; ++ } ++ ++ /** ++ * Returns the string associated with this Item's Icon. ++ */ ++ protected String getIconString() ++ { ++ return this.iconString == null ? "MISSING_ICON_ITEM_" + this.itemID + "_" + this.unlocalizedName : this.iconString; + } + + static + { + StatList.initStats(); +*** ItemAnvilBlock.java Sat Feb 5 04:13:14 2022 +--- ItemAnvilBlock.java Sat Feb 5 04:12:35 2022 +*** ItemAppleGold.java Sat Feb 5 04:13:14 2022 +--- ItemAppleGold.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,15 **** +--- 1,30 ---- + package net.minecraft.src; + ++ import java.util.List; ++ + public class ItemAppleGold extends ItemFood + { + public ItemAppleGold(int par1, int par2, float par3, boolean par4) + { + super(par1, par2, par3, par4); + this.setHasSubtypes(true); + } + ++ public boolean hasEffect(ItemStack par1ItemStack) ++ { ++ return par1ItemStack.getItemDamage() > 0; ++ } ++ ++ /** ++ * Return an item rarity from EnumRarity ++ */ ++ public EnumRarity getRarity(ItemStack par1ItemStack) ++ { ++ return par1ItemStack.getItemDamage() == 0 ? EnumRarity.rare : EnumRarity.epic; ++ } ++ + protected void onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + if (!par2World.isRemote) + { + par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2400, 0)); +*************** +*** 26,32 **** +--- 41,56 ---- + } + else + { + super.onFoodEaten(par1ItemStack, par2World, par3EntityPlayer); + } ++ } ++ ++ /** ++ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) ++ */ ++ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) ++ { ++ par3List.add(new ItemStack(par1, 1, 0)); ++ par3List.add(new ItemStack(par1, 1, 1)); + } + } +*** ItemArmor.java Sat Feb 5 04:13:14 2022 +--- ItemArmor.java Sat Feb 5 04:12:35 2022 +*************** +*** 22,31 **** +--- 22,33 ---- + */ + public final int renderIndex; + + /** The EnumArmorMaterial used for this ItemArmor */ + private final EnumArmorMaterial material; ++ private Icon field_94605_cw; ++ private Icon field_94604_cx; + + public ItemArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) + { + super(par1); + this.material = par2EnumArmorMaterial; +*************** +*** 36,45 **** +--- 38,71 ---- + this.maxStackSize = 1; + this.setCreativeTab(CreativeTabs.tabCombat); + BlockDispenser.dispenseBehaviorRegistry.putObject(this, field_96605_cw); + } + ++ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) ++ { ++ if (par2 > 0) ++ { ++ return 16777215; ++ } ++ else ++ { ++ int var3 = this.getColor(par1ItemStack); ++ ++ if (var3 < 0) ++ { ++ var3 = 16777215; ++ } ++ ++ return var3; ++ } ++ } ++ ++ public boolean requiresMultipleRenderPasses() ++ { ++ return this.material == EnumArmorMaterial.CLOTH; ++ } ++ + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + public int getItemEnchantability() + { +*************** +*** 86,95 **** +--- 112,129 ---- + } + } + } + + /** ++ * Gets an icon index based on an item's damage value and the given render pass ++ */ ++ public Icon getIconFromDamageForRenderPass(int par1, int par2) ++ { ++ return par2 == 1 ? this.field_94605_cw : super.getIconFromDamageForRenderPass(par1, par2); ++ } ++ ++ /** + * Remove the color from the specified armor ItemStack. + */ + public void removeColor(ItemStack par1ItemStack) + { + if (this.material == EnumArmorMaterial.CLOTH) +*************** +*** 141,150 **** +--- 175,196 ---- + public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) + { + return this.material.getArmorCraftingMaterial() == par2ItemStack.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); + } + ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ super.registerIcons(par1IconRegister); ++ ++ if (this.material == EnumArmorMaterial.CLOTH) ++ { ++ this.field_94605_cw = par1IconRegister.registerIcon(field_94606_cu[this.armorType]); ++ } ++ ++ this.field_94604_cx = par1IconRegister.registerIcon(field_94603_a[this.armorType]); ++ } ++ + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { +*************** +*** 156,165 **** +--- 202,232 ---- + par3EntityPlayer.setCurrentItemOrArmor(var4, par1ItemStack.copy()); + par1ItemStack.stackSize = 0; + } + + return par1ItemStack; ++ } ++ ++ public static Icon func_94602_b(int par0) ++ { ++ switch (par0) ++ { ++ case 0: ++ return Item.helmetDiamond.field_94604_cx; ++ ++ case 1: ++ return Item.plateDiamond.field_94604_cx; ++ ++ case 2: ++ return Item.legsDiamond.field_94604_cx; ++ ++ case 3: ++ return Item.bootsDiamond.field_94604_cx; ++ ++ default: ++ return null; ++ } + } + + /** + * Returns the 'max damage' factor array for the armor, each piece of armor have a durability factor (that gets + * multiplied by armor material factor) +*** ItemAxe.java Sat Feb 5 04:13:14 2022 +--- ItemAxe.java Sat Feb 5 04:12:35 2022 +*** ItemBed.java Sat Feb 5 04:13:14 2022 +--- ItemBed.java Sat Feb 5 04:12:35 2022 +*** ItemBlock.java Sat Feb 5 04:13:14 2022 +--- ItemBlock.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,11 **** +--- 1,14 ---- + package net.minecraft.src; + ++ import java.util.List; ++ + public class ItemBlock extends Item + { + /** The block ID of the Block associated with this ItemBlock */ + private int blockID; ++ private Icon field_94588_b; + + public ItemBlock(int par1) + { + super(par1); + this.blockID = par1 + 256; +*************** +*** 18,27 **** +--- 21,46 ---- + { + return this.blockID; + } + + /** ++ * Returns 0 for /terrain.png, 1 for /gui/items.png ++ */ ++ public int getSpriteNumber() ++ { ++ return Block.blocksList[this.blockID].getItemIconName() != null ? 1 : 0; ++ } ++ ++ /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) ++ { ++ return this.field_94588_b != null ? this.field_94588_b : Block.blocksList[this.blockID].getBlockTextureFromSide(1); ++ } ++ ++ /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) + { +*************** +*** 101,110 **** +--- 120,176 ---- + return false; + } + } + + /** ++ * Returns true if the given ItemBlock can be placed on the given side of the given block position. ++ */ ++ public boolean canPlaceItemBlockOnSide(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer, ItemStack par7ItemStack) ++ { ++ int var8 = par1World.getBlockId(par2, par3, par4); ++ ++ if (var8 == Block.snow.blockID) ++ { ++ par5 = 1; ++ } ++ else if (var8 != Block.vine.blockID && var8 != Block.tallGrass.blockID && var8 != Block.deadBush.blockID) ++ { ++ if (par5 == 0) ++ { ++ --par3; ++ } ++ ++ if (par5 == 1) ++ { ++ ++par3; ++ } ++ ++ if (par5 == 2) ++ { ++ --par4; ++ } ++ ++ if (par5 == 3) ++ { ++ ++par4; ++ } ++ ++ if (par5 == 4) ++ { ++ --par2; ++ } ++ ++ if (par5 == 5) ++ { ++ ++par2; ++ } ++ } ++ ++ return par1World.canPlaceEntityOnSide(this.getBlockID(), par2, par3, par4, false, par5, (Entity)null, par7ItemStack); ++ } ++ ++ /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack par1ItemStack) + { +*************** +*** 115,121 **** +--- 181,213 ---- + * Returns the unlocalized name of this item. + */ + public String getUnlocalizedName() + { + return Block.blocksList[this.blockID].getUnlocalizedName(); ++ } ++ ++ /** ++ * gets the CreativeTab this item is displayed on ++ */ ++ public CreativeTabs getCreativeTab() ++ { ++ return Block.blocksList[this.blockID].getCreativeTabToDisplayOn(); ++ } ++ ++ /** ++ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) ++ */ ++ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) ++ { ++ Block.blocksList[this.blockID].getSubBlocks(par1, par2CreativeTabs, par3List); ++ } ++ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ String var2 = Block.blocksList[this.blockID].getItemIconName(); ++ ++ if (var2 != null) ++ { ++ this.field_94588_b = par1IconRegister.registerIcon(var2); ++ } + } + } +*** ItemBlockWithMetadata.java Sat Feb 5 04:13:14 2022 +--- ItemBlockWithMetadata.java Sat Feb 5 04:12:35 2022 +*************** +*** 11,20 **** +--- 11,28 ---- + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) ++ { ++ return this.theBlock.getIcon(2, par1); ++ } ++ ++ /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int par1) + { + return par1; +*** ItemBoat.java Sat Feb 5 04:13:14 2022 +--- ItemBoat.java Sat Feb 5 04:12:35 2022 +*************** +*** 29,39 **** + float var17 = MathHelper.sin(-var5 * 0.017453292F); + float var18 = var15 * var16; + float var20 = var14 * var16; + double var21 = 5.0D; + Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21); +! MovingObjectPosition var24 = par2World.rayTraceBlocks(var13, var23, true); + + if (var24 == null) + { + return par1ItemStack; + } +--- 29,39 ---- + float var17 = MathHelper.sin(-var5 * 0.017453292F); + float var18 = var15 * var16; + float var20 = var14 * var16; + double var21 = 5.0D; + Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21); +! MovingObjectPosition var24 = par2World.clip(var13, var23, true); + + if (var24 == null) + { + return par1ItemStack; + } +*** ItemBook.java Sat Feb 5 04:13:14 2022 +--- ItemBook.java Sat Feb 5 04:12:35 2022 +*** ItemBow.java Sat Feb 5 04:13:14 2022 +--- ItemBow.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,10 **** +--- 1,11 ---- + package net.minecraft.src; + + public class ItemBow extends Item + { + public static final String[] bowPullIconNameArray = new String[] {"pulling_0", "pulling_1", "pulling_2"}; ++ private Icon[] iconArray; + + public ItemBow(int par1) + { + super(par1); + this.maxStackSize = 1; +*************** +*** 118,124 **** +--- 119,144 ---- + * Return the enchantability factor of the item, most of the time is based on material. + */ + public int getItemEnchantability() + { + return 1; ++ } ++ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.itemIcon = par1IconRegister.registerIcon(this.getIconString() + "_standby"); ++ this.iconArray = new Icon[bowPullIconNameArray.length]; ++ ++ for (int var2 = 0; var2 < this.iconArray.length; ++var2) ++ { ++ this.iconArray[var2] = par1IconRegister.registerIcon(this.getIconString() + "_" + bowPullIconNameArray[var2]); ++ } ++ } ++ ++ /** ++ * used to cycle through icons based on their used duration, i.e. for the bow ++ */ ++ public Icon getItemIconForUseDuration(int par1) ++ { ++ return this.iconArray[par1]; + } + } +*** ItemBucket.java Sat Feb 5 04:13:14 2022 +--- ItemBucket.java Sat Feb 5 04:12:35 2022 +*** ItemBucketMilk.java Sat Feb 5 04:13:14 2022 +--- ItemBucketMilk.java Sat Feb 5 04:12:35 2022 +*** ItemCarrotOnAStick.java Sat Feb 5 04:13:14 2022 +--- ItemCarrotOnAStick.java Sat Feb 5 04:12:35 2022 +*************** +*** 9,18 **** +--- 9,35 ---- + this.setMaxStackSize(1); + this.setMaxDamage(25); + } + + /** ++ * Returns True is the item is renderer in full 3D when hold. ++ */ ++ public boolean isFull3D() ++ { ++ return true; ++ } ++ ++ /** ++ * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities ++ * hands. ++ */ ++ public boolean shouldRotateAroundWhenRendering() ++ { ++ return true; ++ } ++ ++ /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + if (par3EntityPlayer.isRiding() && par3EntityPlayer.ridingEntity instanceof EntityPig) +*** ItemCloth.java Sat Feb 5 04:13:14 2022 +--- ItemCloth.java Sat Feb 5 04:12:35 2022 +*************** +*** 8,17 **** +--- 8,25 ---- + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) ++ { ++ return Block.cloth.getIcon(2, BlockColored.getBlockFromDye(par1)); ++ } ++ ++ /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int par1) + { + return par1; +*** ItemCoal.java Sat Feb 5 04:13:14 2022 +--- ItemCoal.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,9 **** +--- 1,13 ---- + package net.minecraft.src; + ++ import java.util.List; ++ + public class ItemCoal extends Item + { ++ private Icon field_111220_a; ++ + public ItemCoal(int par1) + { + super(par1); + this.setHasSubtypes(true); + this.setMaxDamage(0); +*************** +*** 15,21 **** +--- 19,48 ---- + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack par1ItemStack) + { + return par1ItemStack.getItemDamage() == 1 ? "item.charcoal" : "item.coal"; ++ } ++ ++ /** ++ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) ++ */ ++ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) ++ { ++ par3List.add(new ItemStack(par1, 1, 0)); ++ par3List.add(new ItemStack(par1, 1, 1)); ++ } ++ ++ /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) ++ { ++ return par1 == 1 ? this.field_111220_a : super.getIconFromDamage(par1); ++ } ++ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ super.registerIcons(par1IconRegister); ++ this.field_111220_a = par1IconRegister.registerIcon("charcoal"); + } + } +*** ItemColored.java Sat Feb 5 04:13:14 2022 +--- ItemColored.java Sat Feb 5 04:12:35 2022 +*************** +*** 15,24 **** +--- 15,37 ---- + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + } + ++ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) ++ { ++ return this.blockRef.getRenderColor(par1ItemStack.getItemDamage()); ++ } ++ ++ /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) ++ { ++ return this.blockRef.getIcon(0, par1); ++ } ++ + /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int par1) + { +*** ItemDoor.java Sat Feb 5 04:13:14 2022 +--- ItemDoor.java Sat Feb 5 04:12:35 2022 +*** ItemDye.java Sat Feb 5 04:13:14 2022 +--- ItemDye.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,23 **** +--- 1,35 ---- + package net.minecraft.src; + ++ import java.util.List; ++ + public class ItemDye extends Item + { + /** List of dye color names */ + public static final String[] dyeColorNames = new String[] {"black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "gray", "pink", "lime", "yellow", "lightBlue", "magenta", "orange", "white"}; + public static final String[] dyeItemNames = new String[] {"black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "gray", "pink", "lime", "yellow", "light_blue", "magenta", "orange", "white"}; + public static final int[] dyeColors = new int[] {1973019, 11743532, 3887386, 5320730, 2437522, 8073150, 2651799, 11250603, 4408131, 14188952, 4312372, 14602026, 6719955, 12801229, 15435844, 15790320}; ++ private Icon[] dyeIcons; + + public ItemDye(int par1) + { + super(par1); + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setCreativeTab(CreativeTabs.tabMaterials); + } + + /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) ++ { ++ int var2 = MathHelper.clamp_int(par1, 0, 15); ++ return this.dyeIcons[var2]; ++ } ++ ++ /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack par1ItemStack) + { +*************** +*** 163,173 **** + else + { + if (!par1World.isRemote) + { + ++var8; +! par1World.setBlockMetadata(par2, par3, par4, var8 << 2 | var7, 2); + --par0ItemStack.stackSize; + } + + return true; + } +--- 175,185 ---- + else + { + if (!par1World.isRemote) + { + ++var8; +! par1World.setBlockMetadataWithNotify(par2, par3, par4, var8 << 2 | var7, 2); + --par0ItemStack.stackSize; + } + + return true; + } +*************** +*** 258,267 **** +--- 270,304 ---- + + return true; + } + } + ++ public static void func_96603_a(World par0World, int par1, int par2, int par3, int par4) ++ { ++ int var5 = par0World.getBlockId(par1, par2, par3); ++ ++ if (par4 == 0) ++ { ++ par4 = 15; ++ } ++ ++ Block var6 = var5 > 0 && var5 < Block.blocksList.length ? Block.blocksList[var5] : null; ++ ++ if (var6 != null) ++ { ++ var6.setBlockBoundsBasedOnState(par0World, par1, par2, par3); ++ ++ for (int var7 = 0; var7 < par4; ++var7) ++ { ++ double var8 = itemRand.nextGaussian() * 0.02D; ++ double var10 = itemRand.nextGaussian() * 0.02D; ++ double var12 = itemRand.nextGaussian() * 0.02D; ++ par0World.spawnParticle("happyVillager", (double)((float)par1 + itemRand.nextFloat()), (double)par2 + (double)itemRand.nextFloat() * var6.getBlockBoundsMaxY(), (double)((float)par3 + itemRand.nextFloat()), var8, var10, var12); ++ } ++ } ++ } ++ + /** + * Returns true if the item can be used on the given entity, e.g. shears on sheep. + */ + public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase) + { +*************** +*** 279,286 **** +--- 316,344 ---- + return true; + } + else + { + return false; ++ } ++ } ++ ++ /** ++ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) ++ */ ++ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) ++ { ++ for (int var4 = 0; var4 < 16; ++var4) ++ { ++ par3List.add(new ItemStack(par1, 1, var4)); ++ } ++ } ++ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.dyeIcons = new Icon[dyeItemNames.length]; ++ ++ for (int var2 = 0; var2 < dyeItemNames.length; ++var2) ++ { ++ this.dyeIcons[var2] = par1IconRegister.registerIcon(this.getIconString() + "_" + dyeItemNames[var2]); + } + } + } +*** ItemEditableBook.java Sat Feb 5 04:13:14 2022 +--- ItemEditableBook.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,7 **** +--- 1,9 ---- + package net.minecraft.src; + ++ import java.util.List; ++ + public class ItemEditableBook extends Item + { + public ItemEditableBook(int par1) + { + super(par1); +*************** +*** 40,49 **** +--- 42,68 ---- + + return super.getItemDisplayName(par1ItemStack); + } + + /** ++ * allows items to add custom lines of information to the mouseover description ++ */ ++ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) ++ { ++ if (par1ItemStack.hasTagCompound()) ++ { ++ NBTTagCompound var5 = par1ItemStack.getTagCompound(); ++ NBTTagString var6 = (NBTTagString)var5.getTag("author"); ++ ++ if (var6 != null) ++ { ++ par3List.add(EnumChatFormatting.GRAY + String.format(StatCollector.translateToLocalFormatted("book.byAuthor", new Object[] {var6.data}), new Object[0])); ++ } ++ } ++ } ++ ++ /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + par3EntityPlayer.displayGUIBook(par1ItemStack); +*************** +*** 52,60 **** +--- 71,84 ---- + + /** + * If this function returns true (or the item is damageable), the ItemStack's NBT tag will be sent to the client. + */ + public boolean getShareTag() ++ { ++ return true; ++ } ++ ++ public boolean hasEffect(ItemStack par1ItemStack) + { + return true; + } + } +*** ItemEgg.java Sat Feb 5 04:13:14 2022 +--- ItemEgg.java Sat Feb 5 04:12:35 2022 +*** ItemEmptyMap.java Sat Feb 5 04:13:14 2022 +--- ItemEmptyMap.java Sat Feb 5 04:12:35 2022 +*** ItemEnchantedBook.java Sat Feb 5 04:13:14 2022 +--- ItemEnchantedBook.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,30 **** +--- 1,67 ---- + package net.minecraft.src; + ++ import java.util.List; + import java.util.Random; + + public class ItemEnchantedBook extends Item + { + public ItemEnchantedBook(int par1) + { + super(par1); + } + ++ public boolean hasEffect(ItemStack par1ItemStack) ++ { ++ return true; ++ } ++ + /** + * Checks isDamagable and if it cannot be stacked + */ + public boolean isItemTool(ItemStack par1ItemStack) + { + return false; + } + ++ /** ++ * Return an item rarity from EnumRarity ++ */ ++ public EnumRarity getRarity(ItemStack par1ItemStack) ++ { ++ return this.func_92110_g(par1ItemStack).tagCount() > 0 ? EnumRarity.uncommon : super.getRarity(par1ItemStack); ++ } ++ + public NBTTagList func_92110_g(ItemStack par1ItemStack) + { + return par1ItemStack.stackTagCompound != null && par1ItemStack.stackTagCompound.hasKey("StoredEnchantments") ? (NBTTagList)par1ItemStack.stackTagCompound.getTag("StoredEnchantments") : new NBTTagList(); + } + + /** ++ * allows items to add custom lines of information to the mouseover description ++ */ ++ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) ++ { ++ super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4); ++ NBTTagList var5 = this.func_92110_g(par1ItemStack); ++ ++ if (var5 != null) ++ { ++ for (int var6 = 0; var6 < var5.tagCount(); ++var6) ++ { ++ short var7 = ((NBTTagCompound)var5.tagAt(var6)).getShort("id"); ++ short var8 = ((NBTTagCompound)var5.tagAt(var6)).getShort("lvl"); ++ ++ if (Enchantment.enchantmentsList[var7] != null) ++ { ++ par3List.add(Enchantment.enchantmentsList[var7].getTranslatedName(var8)); ++ } ++ } ++ } ++ } ++ ++ /** + * Adds an stored enchantment to an enchanted book ItemStack + */ + public void addEnchantment(ItemStack par1ItemStack, EnchantmentData par2EnchantmentData) + { + NBTTagList var3 = this.func_92110_g(par1ItemStack); +*************** +*** 68,77 **** +--- 105,122 ---- + public ItemStack getEnchantedItemStack(EnchantmentData par1EnchantmentData) + { + ItemStack var2 = new ItemStack(this); + this.addEnchantment(var2, par1EnchantmentData); + return var2; ++ } ++ ++ public void func_92113_a(Enchantment par1Enchantment, List par2List) ++ { ++ for (int var3 = par1Enchantment.getMinLevel(); var3 <= par1Enchantment.getMaxLevel(); ++var3) ++ { ++ par2List.add(this.getEnchantedItemStack(new EnchantmentData(par1Enchantment, var3))); ++ } + } + + public WeightedRandomChestContent func_92114_b(Random par1Random) + { + return this.func_92112_a(par1Random, 1, 1, 1); +*** ItemEnderEye.java Sat Feb 5 04:13:14 2022 +--- ItemEnderEye.java Sat Feb 5 04:12:35 2022 +*************** +*** 23,33 **** + { + return true; + } + else + { +! par3World.setBlockMetadata(par4, par5, par6, var12 + 4, 2); + par3World.func_96440_m(par4, par5, par6, Block.endPortalFrame.blockID); + --par1ItemStack.stackSize; + int var13; + + for (var13 = 0; var13 < 16; ++var13) +--- 23,33 ---- + { + return true; + } + else + { +! par3World.setBlockMetadataWithNotify(par4, par5, par6, var12 + 4, 2); + par3World.func_96440_m(par4, par5, par6, Block.endPortalFrame.blockID); + --par1ItemStack.stackSize; + int var13; + + for (var13 = 0; var13 < 16; ++var13) +*************** +*** 44,54 **** + var13 = var12 & 3; + int var26 = 0; + int var15 = 0; + boolean var27 = false; + boolean var17 = true; +! int var28 = Direction.enderEyeMetaToDirection[var13]; + int var19; + int var21; + int var23; + int var29; + int var30; +--- 44,54 ---- + var13 = var12 & 3; + int var26 = 0; + int var15 = 0; + boolean var27 = false; + boolean var17 = true; +! int var28 = Direction.rotateRight[var13]; + int var19; + int var21; + int var23; + int var29; + int var30; +*** ItemEnderPearl.java Sat Feb 5 04:13:14 2022 +--- ItemEnderPearl.java Sat Feb 5 04:12:35 2022 +*** ItemExpBottle.java Sat Feb 5 04:13:14 2022 +--- ItemExpBottle.java Sat Feb 5 04:12:35 2022 +*************** +*** 6,15 **** +--- 6,20 ---- + { + super(par1); + this.setCreativeTab(CreativeTabs.tabMisc); + } + ++ public boolean hasEffect(ItemStack par1ItemStack) ++ { ++ return true; ++ } ++ + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { +*** ItemFireball.java Sat Feb 5 04:13:14 2022 +--- ItemFireball.java Sat Feb 5 04:12:35 2022 +*** ItemFirework.java Sat Feb 5 04:13:14 2022 +--- ItemFirework.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,7 **** +--- 1,10 ---- + package net.minecraft.src; + ++ import java.util.ArrayList; ++ import java.util.List; ++ + public class ItemFirework extends Item + { + public ItemFirework(int par1) + { + super(par1); +*************** +*** 26,33 **** +--- 29,77 ---- + return true; + } + else + { + return false; ++ } ++ } ++ ++ /** ++ * allows items to add custom lines of information to the mouseover description ++ */ ++ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) ++ { ++ if (par1ItemStack.hasTagCompound()) ++ { ++ NBTTagCompound var5 = par1ItemStack.getTagCompound().getCompoundTag("Fireworks"); ++ ++ if (var5 != null) ++ { ++ if (var5.hasKey("Flight")) ++ { ++ par3List.add(StatCollector.translateToLocal("item.fireworks.flight") + " " + var5.getByte("Flight")); ++ } ++ ++ NBTTagList var6 = var5.getTagList("Explosions"); ++ ++ if (var6 != null && var6.tagCount() > 0) ++ { ++ for (int var7 = 0; var7 < var6.tagCount(); ++var7) ++ { ++ NBTTagCompound var8 = (NBTTagCompound)var6.tagAt(var7); ++ ArrayList var9 = new ArrayList(); ++ ItemFireworkCharge.func_92107_a(var8, var9); ++ ++ if (var9.size() > 0) ++ { ++ for (int var10 = 1; var10 < var9.size(); ++var10) ++ { ++ var9.set(var10, " " + (String)var9.get(var10)); ++ } ++ ++ par3List.addAll(var9); ++ } ++ } ++ } ++ } + } + } + } +*** ItemFireworkCharge.java Sat Feb 5 04:13:14 2022 +--- ItemFireworkCharge.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,9 **** +--- 1,221 ---- + package net.minecraft.src; + ++ import java.util.List; ++ + public class ItemFireworkCharge extends Item + { ++ private Icon theIcon; ++ + public ItemFireworkCharge(int par1) + { + super(par1); ++ } ++ ++ /** ++ * Gets an icon index based on an item's damage value and the given render pass ++ */ ++ public Icon getIconFromDamageForRenderPass(int par1, int par2) ++ { ++ return par2 > 0 ? this.theIcon : super.getIconFromDamageForRenderPass(par1, par2); ++ } ++ ++ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) ++ { ++ if (par2 != 1) ++ { ++ return super.getColorFromItemStack(par1ItemStack, par2); ++ } ++ else ++ { ++ NBTBase var3 = func_92108_a(par1ItemStack, "Colors"); ++ ++ if (var3 == null) ++ { ++ return 9079434; ++ } ++ else ++ { ++ NBTTagIntArray var4 = (NBTTagIntArray)var3; ++ ++ if (var4.intArray.length == 1) ++ { ++ return var4.intArray[0]; ++ } ++ else ++ { ++ int var5 = 0; ++ int var6 = 0; ++ int var7 = 0; ++ int[] var8 = var4.intArray; ++ int var9 = var8.length; ++ ++ for (int var10 = 0; var10 < var9; ++var10) ++ { ++ int var11 = var8[var10]; ++ var5 += (var11 & 16711680) >> 16; ++ var6 += (var11 & 65280) >> 8; ++ var7 += (var11 & 255) >> 0; ++ } ++ ++ var5 /= var4.intArray.length; ++ var6 /= var4.intArray.length; ++ var7 /= var4.intArray.length; ++ return var5 << 16 | var6 << 8 | var7; ++ } ++ } ++ } ++ } ++ ++ public boolean requiresMultipleRenderPasses() ++ { ++ return true; ++ } ++ ++ public static NBTBase func_92108_a(ItemStack par0ItemStack, String par1Str) ++ { ++ if (par0ItemStack.hasTagCompound()) ++ { ++ NBTTagCompound var2 = par0ItemStack.getTagCompound().getCompoundTag("Explosion"); ++ ++ if (var2 != null) ++ { ++ return var2.getTag(par1Str); ++ } ++ } ++ ++ return null; ++ } ++ ++ /** ++ * allows items to add custom lines of information to the mouseover description ++ */ ++ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) ++ { ++ if (par1ItemStack.hasTagCompound()) ++ { ++ NBTTagCompound var5 = par1ItemStack.getTagCompound().getCompoundTag("Explosion"); ++ ++ if (var5 != null) ++ { ++ func_92107_a(var5, par3List); ++ } ++ } ++ } ++ ++ public static void func_92107_a(NBTTagCompound par0NBTTagCompound, List par1List) ++ { ++ byte var2 = par0NBTTagCompound.getByte("Type"); ++ ++ if (var2 >= 0 && var2 <= 4) ++ { ++ par1List.add(StatCollector.translateToLocal("item.fireworksCharge.type." + var2).trim()); ++ } ++ else ++ { ++ par1List.add(StatCollector.translateToLocal("item.fireworksCharge.type").trim()); ++ } ++ ++ int[] var3 = par0NBTTagCompound.getIntArray("Colors"); ++ int var8; ++ int var9; ++ ++ if (var3.length > 0) ++ { ++ boolean var4 = true; ++ String var5 = ""; ++ int[] var6 = var3; ++ int var7 = var3.length; ++ ++ for (var8 = 0; var8 < var7; ++var8) ++ { ++ var9 = var6[var8]; ++ ++ if (!var4) ++ { ++ var5 = var5 + ", "; ++ } ++ ++ var4 = false; ++ boolean var10 = false; ++ ++ for (int var11 = 0; var11 < 16; ++var11) ++ { ++ if (var9 == ItemDye.dyeColors[var11]) ++ { ++ var10 = true; ++ var5 = var5 + StatCollector.translateToLocal("item.fireworksCharge." + ItemDye.dyeColorNames[var11]); ++ break; ++ } ++ } ++ ++ if (!var10) ++ { ++ var5 = var5 + StatCollector.translateToLocal("item.fireworksCharge.customColor"); ++ } ++ } ++ ++ par1List.add(var5); ++ } ++ ++ int[] var13 = par0NBTTagCompound.getIntArray("FadeColors"); ++ boolean var15; ++ ++ if (var13.length > 0) ++ { ++ var15 = true; ++ String var14 = StatCollector.translateToLocal("item.fireworksCharge.fadeTo") + " "; ++ int[] var16 = var13; ++ var8 = var13.length; ++ ++ for (var9 = 0; var9 < var8; ++var9) ++ { ++ int var18 = var16[var9]; ++ ++ if (!var15) ++ { ++ var14 = var14 + ", "; ++ } ++ ++ var15 = false; ++ boolean var19 = false; ++ ++ for (int var12 = 0; var12 < 16; ++var12) ++ { ++ if (var18 == ItemDye.dyeColors[var12]) ++ { ++ var19 = true; ++ var14 = var14 + StatCollector.translateToLocal("item.fireworksCharge." + ItemDye.dyeColorNames[var12]); ++ break; ++ } ++ } ++ ++ if (!var19) ++ { ++ var14 = var14 + StatCollector.translateToLocal("item.fireworksCharge.customColor"); ++ } ++ } ++ ++ par1List.add(var14); ++ } ++ ++ var15 = par0NBTTagCompound.getBoolean("Trail"); ++ ++ if (var15) ++ { ++ par1List.add(StatCollector.translateToLocal("item.fireworksCharge.trail")); ++ } ++ ++ boolean var17 = par0NBTTagCompound.getBoolean("Flicker"); ++ ++ if (var17) ++ { ++ par1List.add(StatCollector.translateToLocal("item.fireworksCharge.flicker")); ++ } ++ } ++ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ super.registerIcons(par1IconRegister); ++ this.theIcon = par1IconRegister.registerIcon(this.getIconString() + "_overlay"); + } + } +*** ItemFishingRod.java Sat Feb 5 04:13:14 2022 +--- ItemFishingRod.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,18 **** +--- 1,37 ---- + package net.minecraft.src; + + public class ItemFishingRod extends Item + { ++ private Icon theIcon; ++ + public ItemFishingRod(int par1) + { + super(par1); + this.setMaxDamage(64); + this.setMaxStackSize(1); + this.setCreativeTab(CreativeTabs.tabTools); + } + + /** ++ * Returns True is the item is renderer in full 3D when hold. ++ */ ++ public boolean isFull3D() ++ { ++ return true; ++ } ++ ++ /** ++ * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities ++ * hands. ++ */ ++ public boolean shouldRotateAroundWhenRendering() ++ { ++ return true; ++ } ++ ++ /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + if (par3EntityPlayer.fishEntity != null) +*************** +*** 32,38 **** +--- 51,68 ---- + + par3EntityPlayer.swingItem(); + } + + return par1ItemStack; ++ } ++ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.itemIcon = par1IconRegister.registerIcon(this.getIconString() + "_uncast"); ++ this.theIcon = par1IconRegister.registerIcon(this.getIconString() + "_cast"); ++ } ++ ++ public Icon func_94597_g() ++ { ++ return this.theIcon; + } + } +*** ItemFlintAndSteel.java Sat Feb 5 04:13:14 2022 +--- ItemFlintAndSteel.java Sat Feb 5 04:12:35 2022 +*** ItemFood.java Sat Feb 5 04:13:14 2022 +--- ItemFood.java Sat Feb 5 04:12:35 2022 +*** ItemGlassBottle.java Sat Feb 5 04:13:14 2022 +--- ItemGlassBottle.java Sat Feb 5 04:12:35 2022 +*************** +*** 7,16 **** +--- 7,24 ---- + super(par1); + this.setCreativeTab(CreativeTabs.tabBrewing); + } + + /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) ++ { ++ return Item.potion.getIconFromDamage(0); ++ } ++ ++ /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true); +*************** +*** 54,59 **** +--- 62,69 ---- + } + + return par1ItemStack; + } + } ++ ++ public void registerIcons(IconRegister par1IconRegister) {} + } +*** ItemHangingEntity.java Sat Feb 5 04:13:14 2022 +--- ItemHangingEntity.java Sat Feb 5 04:12:35 2022 +*** ItemHoe.java Sat Feb 5 04:13:14 2022 +--- ItemHoe.java Sat Feb 5 04:12:35 2022 +*************** +*** 50,59 **** +--- 50,67 ---- + } + } + } + + /** ++ * Returns True is the item is renderer in full 3D when hold. ++ */ ++ public boolean isFull3D() ++ { ++ return true; ++ } ++ ++ /** + * Returns the name of the material this tool is made from as it is declared in EnumToolMaterial (meaning diamond + * would return "EMERALD") + */ + public String getMaterialName() + { +*** ItemInWorldManager.java Sat Feb 5 04:13:14 2022 +--- ItemInWorldManager.java Sat Feb 5 04:12:35 2022 +*************** +*** 10,22 **** + private EnumGameType gameType; + + /** True if the player is destroying a block */ + private boolean isDestroyingBlock; + private int initialDamage; +! private int curBlockX; +! private int curBlockY; +! private int curBlockZ; + private int curblockDamage; + + /** + * Set to true when the "finished destroying block" packet is received but the block wasn't fully damaged yet. The + * block will not be destroyed while this is false. +--- 10,22 ---- + private EnumGameType gameType; + + /** True if the player is destroying a block */ + private boolean isDestroyingBlock; + private int initialDamage; +! private int partiallyDestroyedBlockX; +! private int partiallyDestroyedBlockY; +! private int partiallyDestroyedBlockZ; + private int curblockDamage; + + /** + * Set to true when the "finished destroying block" packet is received but the block wasn't fully damaged yet. The + * block will not be destroyed while this is false. +*************** +*** 103,130 **** + } + } + } + else if (this.isDestroyingBlock) + { +! var1 = this.theWorld.getBlockId(this.curBlockX, this.curBlockY, this.curBlockZ); + Block var6 = Block.blocksList[var1]; + + if (var6 == null) + { +! this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.curBlockX, this.curBlockY, this.curBlockZ, -1); + this.durabilityRemainingOnBlock = -1; + this.isDestroyingBlock = false; + } + else + { + int var7 = this.curblockDamage - this.initialDamage; +! var4 = var6.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, this.curBlockX, this.curBlockY, this.curBlockZ) * (float)(var7 + 1); + var5 = (int)(var4 * 10.0F); + + if (var5 != this.durabilityRemainingOnBlock) + { +! this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.curBlockX, this.curBlockY, this.curBlockZ, var5); + this.durabilityRemainingOnBlock = var5; + } + } + } + } +--- 103,130 ---- + } + } + } + else if (this.isDestroyingBlock) + { +! var1 = this.theWorld.getBlockId(this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ); + Block var6 = Block.blocksList[var1]; + + if (var6 == null) + { +! this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ, -1); + this.durabilityRemainingOnBlock = -1; + this.isDestroyingBlock = false; + } + else + { + int var7 = this.curblockDamage - this.initialDamage; +! var4 = var6.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ) * (float)(var7 + 1); + var5 = (int)(var4 * 10.0F); + + if (var5 != this.durabilityRemainingOnBlock) + { +! this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ, var5); + this.durabilityRemainingOnBlock = var5; + } + } + } + } +*************** +*** 162,185 **** + this.tryHarvestBlock(par1, par2, par3); + } + else + { + this.isDestroyingBlock = true; +! this.curBlockX = par1; +! this.curBlockY = par2; +! this.curBlockZ = par3; + int var7 = (int)(var5 * 10.0F); + this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, par1, par2, par3, var7); + this.durabilityRemainingOnBlock = var7; + } + } + } + } + +! public void blockRemoving(int par1, int par2, int par3) + { +! if (par1 == this.curBlockX && par2 == this.curBlockY && par3 == this.curBlockZ) + { + int var4 = this.curblockDamage - this.initialDamage; + int var5 = this.theWorld.getBlockId(par1, par2, par3); + + if (var5 != 0) +--- 162,185 ---- + this.tryHarvestBlock(par1, par2, par3); + } + else + { + this.isDestroyingBlock = true; +! this.partiallyDestroyedBlockX = par1; +! this.partiallyDestroyedBlockY = par2; +! this.partiallyDestroyedBlockZ = par3; + int var7 = (int)(var5 * 10.0F); + this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, par1, par2, par3, var7); + this.durabilityRemainingOnBlock = var7; + } + } + } + } + +! public void uncheckedTryHarvestBlock(int par1, int par2, int par3) + { +! if (par1 == this.partiallyDestroyedBlockX && par2 == this.partiallyDestroyedBlockY && par3 == this.partiallyDestroyedBlockZ) + { + int var4 = this.curblockDamage - this.initialDamage; + int var5 = this.theWorld.getBlockId(par1, par2, par3); + + if (var5 != 0) +*************** +*** 210,220 **** + * note: this ignores the pars passed in and continues to destroy the onClickedBlock + */ + public void cancelDestroyingBlock(int par1, int par2, int par3) + { + this.isDestroyingBlock = false; +! this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.curBlockX, this.curBlockY, this.curBlockZ, -1); + } + + /** + * Removes a block and triggers the appropriate events + */ +--- 210,220 ---- + * note: this ignores the pars passed in and continues to destroy the onClickedBlock + */ + public void cancelDestroyingBlock(int par1, int par2, int par3) + { + this.isDestroyingBlock = false; +! this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ, -1); + } + + /** + * Removes a block and triggers the appropriate events + */ +*************** +*** 258,268 **** + this.theWorld.playAuxSFXAtEntity(this.thisPlayerMP, 2001, par1, par2, par3, var4 + (this.theWorld.getBlockMetadata(par1, par2, par3) << 12)); + boolean var6 = this.removeBlock(par1, par2, par3); + + if (this.isCreative()) + { +! this.thisPlayerMP.playerNetServerHandler.sendPacket(new Packet53BlockChange(par1, par2, par3, this.theWorld)); + } + else + { + ItemStack var7 = this.thisPlayerMP.getCurrentEquippedItem(); + boolean var8 = this.thisPlayerMP.canHarvestBlock(Block.blocksList[var4]); +--- 258,268 ---- + this.theWorld.playAuxSFXAtEntity(this.thisPlayerMP, 2001, par1, par2, par3, var4 + (this.theWorld.getBlockMetadata(par1, par2, par3) << 12)); + boolean var6 = this.removeBlock(par1, par2, par3); + + if (this.isCreative()) + { +! this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(par1, par2, par3, this.theWorld)); + } + else + { + ItemStack var7 = this.thisPlayerMP.getCurrentEquippedItem(); + boolean var8 = this.thisPlayerMP.canHarvestBlock(Block.blocksList[var4]); +*** ItemLeash.java Sat Feb 5 04:13:14 2022 +--- ItemLeash.java Sat Feb 5 04:12:35 2022 +*** ItemLeaves.java Sat Feb 5 04:13:14 2022 +--- ItemLeaves.java Sat Feb 5 04:12:35 2022 +*************** +*** 16,25 **** +--- 16,39 ---- + { + return par1 | 4; + } + + /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) ++ { ++ return Block.leaves.getIcon(0, par1); ++ } ++ ++ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) ++ { ++ int var3 = par1ItemStack.getItemDamage(); ++ return (var3 & 1) == 1 ? ColorizerFoliage.getFoliageColorPine() : ((var3 & 2) == 2 ? ColorizerFoliage.getFoliageColorBirch() : ColorizerFoliage.getFoliageColorBasic()); ++ } ++ ++ /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack par1ItemStack) + { +*** ItemLilyPad.java Sat Feb 5 04:13:14 2022 +--- ItemLilyPad.java Sat Feb 5 04:12:35 2022 +*************** +*** 48,53 **** +--- 48,58 ---- + } + + return par1ItemStack; + } + } ++ ++ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) ++ { ++ return Block.waterlily.getRenderColor(par1ItemStack.getItemDamage()); ++ } + } +*** ItemMap.java Sat Feb 5 04:13:14 2022 +--- ItemMap.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,15 **** +--- 1,31 ---- + package net.minecraft.src; + ++ import java.util.List; ++ + public class ItemMap extends ItemMapBase + { + protected ItemMap(int par1) + { + super(par1); + this.setHasSubtypes(true); + } + ++ public static MapData getMPMapData(short par0, World par1World) ++ { ++ String var2 = "map_" + par0; ++ MapData var3 = (MapData)par1World.loadItemData(MapData.class, var2); ++ ++ if (var3 == null) ++ { ++ var3 = new MapData(var2); ++ par1World.setItemData(var2, var3); ++ } ++ ++ return var3; ++ } ++ + public MapData getMapData(ItemStack par1ItemStack, World par2World) + { + String var3 = "map_" + par1ItemStack.getItemDamage(); + MapData var4 = (MapData)par2World.loadItemData(MapData.class, var3); + +*************** +*** 267,277 **** + this.updateMapData(par2World, par3Entity, var6); + } + } + } + +! public Packet getUpdatePacket(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + byte[] var4 = this.getMapData(par1ItemStack, par2World).getUpdatePacketData(par1ItemStack, par2World, par3EntityPlayer); + return var4 == null ? null : new Packet131MapData((short)Item.map.itemID, (short)par1ItemStack.getItemDamage(), var4); + } + +--- 283,296 ---- + this.updateMapData(par2World, par3Entity, var6); + } + } + } + +! /** +! * returns null if no update is to be sent +! */ +! public Packet createMapDataPacket(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + byte[] var4 = this.getMapData(par1ItemStack, par2World).getUpdatePacketData(par1ItemStack, par2World, par3EntityPlayer); + return var4 == null ? null : new Packet131MapData((short)Item.map.itemID, (short)par1ItemStack.getItemDamage(), var4); + } + +*************** +*** 295,302 **** +--- 314,342 ---- + var5.xCenter = var4.xCenter; + var5.zCenter = var4.zCenter; + var5.dimension = var4.dimension; + var5.markDirty(); + par2World.setItemData("map_" + par1ItemStack.getItemDamage(), var5); ++ } ++ } ++ ++ /** ++ * allows items to add custom lines of information to the mouseover description ++ */ ++ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) ++ { ++ MapData var5 = this.getMapData(par1ItemStack, par2EntityPlayer.worldObj); ++ ++ if (par4) ++ { ++ if (var5 == null) ++ { ++ par3List.add("Unknown map"); ++ } ++ else ++ { ++ par3List.add("Scaling at 1:" + (1 << var5.scale)); ++ par3List.add("(Level " + var5.scale + "/" + 4 + ")"); ++ } + } + } + } +*** ItemMapBase.java Sat Feb 5 04:13:14 2022 +--- ItemMapBase.java Sat Feb 5 04:12:35 2022 +*************** +*** 13,22 **** + public boolean isMap() + { + return true; + } + +! public Packet getUpdatePacket(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + return null; + } + } +--- 13,25 ---- + public boolean isMap() + { + return true; + } + +! /** +! * returns null if no update is to be sent +! */ +! public Packet createMapDataPacket(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + return null; + } + } +*** ItemMinecart.java Sat Feb 5 04:13:14 2022 +--- ItemMinecart.java Sat Feb 5 04:12:35 2022 +*** ItemMonsterPlacer.java Sat Feb 5 04:13:14 2022 +--- ItemMonsterPlacer.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,9 **** +--- 1,14 ---- + package net.minecraft.src; + ++ import java.util.Iterator; ++ import java.util.List; ++ + public class ItemMonsterPlacer extends Item + { ++ private Icon theIcon; ++ + public ItemMonsterPlacer(int par1) + { + super(par1); + this.setHasSubtypes(true); + this.setCreativeTab(CreativeTabs.tabMisc); +*************** +*** 20,29 **** +--- 25,53 ---- + } + + return var2; + } + ++ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) ++ { ++ EntityEggInfo var3 = (EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(par1ItemStack.getItemDamage())); ++ return var3 != null ? (par2 == 0 ? var3.primaryColor : var3.secondaryColor) : 16777215; ++ } ++ ++ public boolean requiresMultipleRenderPasses() ++ { ++ return true; ++ } ++ ++ /** ++ * Gets an icon index based on an item's damage value and the given render pass ++ */ ++ public Icon getIconFromDamageForRenderPass(int par1, int par2) ++ { ++ return par2 > 0 ? this.theIcon : super.getIconFromDamageForRenderPass(par1, par2); ++ } ++ + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) +*************** +*** 153,159 **** +--- 177,203 ---- + } + } + + return var8; + } ++ } ++ ++ /** ++ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) ++ */ ++ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) ++ { ++ Iterator var4 = EntityList.entityEggs.values().iterator(); ++ ++ while (var4.hasNext()) ++ { ++ EntityEggInfo var5 = (EntityEggInfo)var4.next(); ++ par3List.add(new ItemStack(par1, 1, var5.spawnedID)); ++ } ++ } ++ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ super.registerIcons(par1IconRegister); ++ this.theIcon = par1IconRegister.registerIcon(this.getIconString() + "_overlay"); + } + } +*** ItemMultiTextureTile.java Sat Feb 5 04:13:14 2022 +--- ItemMultiTextureTile.java Sat Feb 5 04:12:35 2022 +*************** +*** 13,22 **** +--- 13,30 ---- + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) ++ { ++ return this.theBlock.getIcon(2, par1); ++ } ++ ++ /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int par1) + { + return par1; +*** ItemNameTag.java Sat Feb 5 04:13:14 2022 +--- ItemNameTag.java Sat Feb 5 04:12:35 2022 +*** ItemPickaxe.java Sat Feb 5 04:13:14 2022 +--- ItemPickaxe.java Sat Feb 5 04:12:35 2022 +*** ItemPiston.java Sat Feb 5 04:13:14 2022 +--- ItemPiston.java Sat Feb 5 04:12:35 2022 +*** ItemPotion.java Sat Feb 5 04:13:14 2022 +--- ItemPotion.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,22 **** + package net.minecraft.src; + + import java.util.ArrayList; + import java.util.HashMap; + import java.util.Iterator; + import java.util.LinkedHashMap; + import java.util.List; + import java.util.Map; + + public class ItemPotion extends Item + { +! /** +! * Contains a map from integers to the list of potion effects that potions with that damage value confer (to prevent +! * recalculating it). +! */ + private HashMap effectCache = new HashMap(); + private static final Map field_77835_b = new LinkedHashMap(); + + public ItemPotion(int par1) + { + super(par1); + this.setMaxStackSize(1); +--- 1,24 ---- + package net.minecraft.src; + ++ import com.google.common.collect.HashMultimap; + import java.util.ArrayList; + import java.util.HashMap; + import java.util.Iterator; + import java.util.LinkedHashMap; + import java.util.List; + import java.util.Map; ++ import java.util.Map.Entry; + + public class ItemPotion extends Item + { +! /** maps potion damage values to lists of effect names */ + private HashMap effectCache = new HashMap(); + private static final Map field_77835_b = new LinkedHashMap(); ++ private Icon field_94591_c; ++ private Icon field_94590_d; ++ private Icon field_94592_ct; + + public ItemPotion(int par1) + { + super(par1); + this.setMaxStackSize(1); +*************** +*** 161,177 **** +--- 163,238 ---- + { + return false; + } + + /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) ++ { ++ return isSplash(par1) ? this.field_94591_c : this.field_94590_d; ++ } ++ ++ /** ++ * Gets an icon index based on an item's damage value and the given render pass ++ */ ++ public Icon getIconFromDamageForRenderPass(int par1, int par2) ++ { ++ return par2 == 0 ? this.field_94592_ct : super.getIconFromDamageForRenderPass(par1, par2); ++ } ++ ++ /** + * returns wether or not a potion is a throwable splash potion based on damage value + */ + public static boolean isSplash(int par0) + { + return (par0 & 16384) != 0; + } + ++ public int getColorFromDamage(int par1) ++ { ++ return PotionHelper.func_77915_a(par1, false); ++ } ++ ++ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) ++ { ++ return par2 > 0 ? 16777215 : this.getColorFromDamage(par1ItemStack.getItemDamage()); ++ } ++ ++ public boolean requiresMultipleRenderPasses() ++ { ++ return true; ++ } ++ ++ public boolean isEffectInstant(int par1) ++ { ++ List var2 = this.getEffects(par1); ++ ++ if (var2 != null && !var2.isEmpty()) ++ { ++ Iterator var3 = var2.iterator(); ++ PotionEffect var4; ++ ++ do ++ { ++ if (!var3.hasNext()) ++ { ++ return false; ++ } ++ ++ var4 = (PotionEffect)var3.next(); ++ } ++ while (!Potion.potionTypes[var4.getPotionID()].isInstant()); ++ ++ return true; ++ } ++ else ++ { ++ return false; ++ } ++ } ++ + public String getItemDisplayName(ItemStack par1ItemStack) + { + if (par1ItemStack.getItemDamage() == 0) + { + return StatCollector.translateToLocal("item.emptyPotion.name").trim(); +*************** +*** 198,204 **** +--- 259,441 ---- + { + var4 = PotionHelper.func_77905_c(par1ItemStack.getItemDamage()); + return StatCollector.translateToLocal(var4).trim() + " " + super.getItemDisplayName(par1ItemStack); + } + } ++ } ++ ++ /** ++ * allows items to add custom lines of information to the mouseover description ++ */ ++ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) ++ { ++ if (par1ItemStack.getItemDamage() != 0) ++ { ++ List var5 = Item.potion.getEffects(par1ItemStack); ++ HashMultimap var6 = HashMultimap.create(); ++ Iterator var16; ++ ++ if (var5 != null && !var5.isEmpty()) ++ { ++ var16 = var5.iterator(); ++ ++ while (var16.hasNext()) ++ { ++ PotionEffect var8 = (PotionEffect)var16.next(); ++ String var9 = StatCollector.translateToLocal(var8.getEffectName()).trim(); ++ Potion var10 = Potion.potionTypes[var8.getPotionID()]; ++ Map var11 = var10.func_111186_k(); ++ ++ if (var11 != null && var11.size() > 0) ++ { ++ Iterator var12 = var11.entrySet().iterator(); ++ ++ while (var12.hasNext()) ++ { ++ Entry var13 = (Entry)var12.next(); ++ AttributeModifier var14 = (AttributeModifier)var13.getValue(); ++ AttributeModifier var15 = new AttributeModifier(var14.getName(), var10.func_111183_a(var8.getAmplifier(), var14), var14.getOperation()); ++ var6.put(((Attribute)var13.getKey()).getAttributeUnlocalizedName(), var15); ++ } ++ } ++ ++ if (var8.getAmplifier() > 0) ++ { ++ var9 = var9 + " " + StatCollector.translateToLocal("potion.potency." + var8.getAmplifier()).trim(); ++ } ++ ++ if (var8.getDuration() > 20) ++ { ++ var9 = var9 + " (" + Potion.getDurationString(var8) + ")"; ++ } ++ ++ if (var10.isBadEffect()) ++ { ++ par3List.add(EnumChatFormatting.RED + var9); ++ } ++ else ++ { ++ par3List.add(EnumChatFormatting.GRAY + var9); ++ } ++ } ++ } ++ else ++ { ++ String var7 = StatCollector.translateToLocal("potion.empty").trim(); ++ par3List.add(EnumChatFormatting.GRAY + var7); ++ } ++ ++ if (!var6.isEmpty()) ++ { ++ par3List.add(""); ++ par3List.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("potion.effects.whenDrank")); ++ var16 = var6.entries().iterator(); ++ ++ while (var16.hasNext()) ++ { ++ Entry var17 = (Entry)var16.next(); ++ AttributeModifier var19 = (AttributeModifier)var17.getValue(); ++ double var18 = var19.getAmount(); ++ double var20; ++ ++ if (var19.getOperation() != 1 && var19.getOperation() != 2) ++ { ++ var20 = var19.getAmount(); ++ } ++ else ++ { ++ var20 = var19.getAmount() * 100.0D; ++ } ++ ++ if (var18 > 0.0D) ++ { ++ par3List.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + var19.getOperation(), new Object[] {ItemStack.field_111284_a.format(var20), StatCollector.translateToLocal("attribute.name." + (String)var17.getKey())})); ++ } ++ else if (var18 < 0.0D) ++ { ++ var20 *= -1.0D; ++ par3List.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + var19.getOperation(), new Object[] {ItemStack.field_111284_a.format(var20), StatCollector.translateToLocal("attribute.name." + (String)var17.getKey())})); ++ } ++ } ++ } ++ } ++ } ++ ++ public boolean hasEffect(ItemStack par1ItemStack) ++ { ++ List var2 = this.getEffects(par1ItemStack); ++ return var2 != null && !var2.isEmpty(); ++ } ++ ++ /** ++ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) ++ */ ++ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) ++ { ++ super.getSubItems(par1, par2CreativeTabs, par3List); ++ int var5; ++ ++ if (field_77835_b.isEmpty()) ++ { ++ for (int var4 = 0; var4 <= 15; ++var4) ++ { ++ for (var5 = 0; var5 <= 1; ++var5) ++ { ++ int var6; ++ ++ if (var5 == 0) ++ { ++ var6 = var4 | 8192; ++ } ++ else ++ { ++ var6 = var4 | 16384; ++ } ++ ++ for (int var7 = 0; var7 <= 2; ++var7) ++ { ++ int var8 = var6; ++ ++ if (var7 != 0) ++ { ++ if (var7 == 1) ++ { ++ var8 = var6 | 32; ++ } ++ else if (var7 == 2) ++ { ++ var8 = var6 | 64; ++ } ++ } ++ ++ List var9 = PotionHelper.getPotionEffects(var8, false); ++ ++ if (var9 != null && !var9.isEmpty()) ++ { ++ field_77835_b.put(var9, Integer.valueOf(var8)); ++ } ++ } ++ } ++ } ++ } ++ ++ Iterator var10 = field_77835_b.values().iterator(); ++ ++ while (var10.hasNext()) ++ { ++ var5 = ((Integer)var10.next()).intValue(); ++ par3List.add(new ItemStack(par1, 1, var5)); ++ } ++ } ++ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.field_94590_d = par1IconRegister.registerIcon(this.getIconString() + "_" + "bottle_drinkable"); ++ this.field_94591_c = par1IconRegister.registerIcon(this.getIconString() + "_" + "bottle_splash"); ++ this.field_94592_ct = par1IconRegister.registerIcon(this.getIconString() + "_" + "overlay"); ++ } ++ ++ public static Icon func_94589_d(String par0Str) ++ { ++ return par0Str.equals("bottle_drinkable") ? Item.potion.field_94590_d : (par0Str.equals("bottle_splash") ? Item.potion.field_94591_c : (par0Str.equals("overlay") ? Item.potion.field_94592_ct : null)); + } + } +*** ItemRecord.java Sat Feb 5 04:13:14 2022 +--- ItemRecord.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,8 **** +--- 1,9 ---- + package net.minecraft.src; + + import java.util.HashMap; ++ import java.util.List; + import java.util.Map; + + public class ItemRecord extends Item + { + /** List of all record items and their names. */ +*************** +*** 19,28 **** +--- 20,37 ---- + this.setCreativeTab(CreativeTabs.tabMisc); + records.put(par2Str, this); + } + + /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) ++ { ++ return this.itemIcon; ++ } ++ ++ /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) + { +*************** +*** 42,48 **** +--- 51,89 ---- + } + else + { + return false; + } ++ } ++ ++ /** ++ * allows items to add custom lines of information to the mouseover description ++ */ ++ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) ++ { ++ par3List.add(this.getRecordTitle()); ++ } ++ ++ /** ++ * Return the title for this record. ++ */ ++ public String getRecordTitle() ++ { ++ return "C418 - " + this.recordName; ++ } ++ ++ /** ++ * Return an item rarity from EnumRarity ++ */ ++ public EnumRarity getRarity(ItemStack par1ItemStack) ++ { ++ return EnumRarity.rare; ++ } ++ ++ /** ++ * Return the record item corresponding to the given name. ++ */ ++ public static ItemRecord getRecord(String par0Str) ++ { ++ return (ItemRecord)records.get(par0Str); + } + } +*** ItemRedstone.java Sat Feb 5 04:13:14 2022 +--- ItemRedstone.java Sat Feb 5 04:12:35 2022 +*** ItemReed.java Sat Feb 5 04:13:14 2022 +--- ItemReed.java Sat Feb 5 04:12:35 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ItemRenderer.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,682 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ import org.lwjgl.opengl.GL12; ++ ++ public class ItemRenderer ++ { ++ private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); ++ private static final ResourceLocation RES_MAP_BACKGROUND = new ResourceLocation("textures/map/map_background.png"); ++ private static final ResourceLocation RES_UNDERWATER_OVERLAY = new ResourceLocation("textures/misc/underwater.png"); ++ ++ /** A reference to the Minecraft object. */ ++ private Minecraft mc; ++ private ItemStack itemToRender; ++ ++ /** ++ * How far the current item has been equipped (0 disequipped and 1 fully up) ++ */ ++ private float equippedProgress; ++ private float prevEquippedProgress; ++ ++ /** Instance of RenderBlocks. */ ++ private RenderBlocks renderBlocksInstance = new RenderBlocks(); ++ public final MapItemRenderer mapItemRenderer; ++ ++ /** The index of the currently held item (0-8, or -1 if not yet updated) */ ++ private int equippedItemSlot = -1; ++ ++ public ItemRenderer(Minecraft par1Minecraft) ++ { ++ this.mc = par1Minecraft; ++ this.mapItemRenderer = new MapItemRenderer(par1Minecraft.gameSettings, par1Minecraft.getTextureManager()); ++ } ++ ++ /** ++ * Renders the item stack for being in an entity's hand Args: itemStack ++ */ ++ public void renderItem(EntityLivingBase par1EntityLivingBase, ItemStack par2ItemStack, int par3) ++ { ++ GL11.glPushMatrix(); ++ TextureManager var4 = this.mc.getTextureManager(); ++ ++ if (par2ItemStack.getItemSpriteNumber() == 0 && par2ItemStack.itemID < Block.blocksList.length && Block.blocksList[par2ItemStack.itemID] != null && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType())) ++ { ++ var4.bindTexture(var4.getResourceLocation(0)); ++ this.renderBlocksInstance.renderBlockAsItem(Block.blocksList[par2ItemStack.itemID], par2ItemStack.getItemDamage(), 1.0F); ++ } ++ else ++ { ++ Icon var5 = par1EntityLivingBase.getItemIcon(par2ItemStack, par3); ++ ++ if (var5 == null) ++ { ++ GL11.glPopMatrix(); ++ return; ++ } ++ ++ var4.bindTexture(var4.getResourceLocation(par2ItemStack.getItemSpriteNumber())); ++ Tessellator var6 = Tessellator.instance; ++ float var7 = var5.getMinU(); ++ float var8 = var5.getMaxU(); ++ float var9 = var5.getMinV(); ++ float var10 = var5.getMaxV(); ++ float var11 = 0.0F; ++ float var12 = 0.3F; ++ GL11.glEnable(GL12.GL_RESCALE_NORMAL); ++ GL11.glTranslatef(-var11, -var12, 0.0F); ++ float var13 = 1.5F; ++ GL11.glScalef(var13, var13, var13); ++ GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F); ++ GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F); ++ renderItemIn2D(var6, var8, var9, var7, var10, var5.getIconWidth(), var5.getIconHeight(), 0.0625F); ++ ++ if (par2ItemStack.hasEffect() && par3 == 0) ++ { ++ GL11.glDepthFunc(GL11.GL_EQUAL); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ var4.bindTexture(RES_ITEM_GLINT); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); ++ float var14 = 0.76F; ++ GL11.glColor4f(0.5F * var14, 0.25F * var14, 0.8F * var14, 1.0F); ++ GL11.glMatrixMode(GL11.GL_TEXTURE); ++ GL11.glPushMatrix(); ++ float var15 = 0.125F; ++ GL11.glScalef(var15, var15, var15); ++ float var16 = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F; ++ GL11.glTranslatef(var16, 0.0F, 0.0F); ++ GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); ++ renderItemIn2D(var6, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); ++ GL11.glPopMatrix(); ++ GL11.glPushMatrix(); ++ GL11.glScalef(var15, var15, var15); ++ var16 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F; ++ GL11.glTranslatef(-var16, 0.0F, 0.0F); ++ GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); ++ renderItemIn2D(var6, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); ++ GL11.glPopMatrix(); ++ GL11.glMatrixMode(GL11.GL_MODELVIEW); ++ GL11.glDisable(GL11.GL_BLEND); ++ GL11.glEnable(GL11.GL_LIGHTING); ++ GL11.glDepthFunc(GL11.GL_LEQUAL); ++ } ++ ++ GL11.glDisable(GL12.GL_RESCALE_NORMAL); ++ } ++ ++ GL11.glPopMatrix(); ++ } ++ ++ /** ++ * Renders an item held in hand as a 2D texture with thickness ++ */ ++ public static void renderItemIn2D(Tessellator par0Tessellator, float par1, float par2, float par3, float par4, int par5, int par6, float par7) ++ { ++ par0Tessellator.startDrawingQuads(); ++ par0Tessellator.setNormal(0.0F, 0.0F, 1.0F); ++ par0Tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, (double)par1, (double)par4); ++ par0Tessellator.addVertexWithUV(1.0D, 0.0D, 0.0D, (double)par3, (double)par4); ++ par0Tessellator.addVertexWithUV(1.0D, 1.0D, 0.0D, (double)par3, (double)par2); ++ par0Tessellator.addVertexWithUV(0.0D, 1.0D, 0.0D, (double)par1, (double)par2); ++ par0Tessellator.draw(); ++ par0Tessellator.startDrawingQuads(); ++ par0Tessellator.setNormal(0.0F, 0.0F, -1.0F); ++ par0Tessellator.addVertexWithUV(0.0D, 1.0D, (double)(0.0F - par7), (double)par1, (double)par2); ++ par0Tessellator.addVertexWithUV(1.0D, 1.0D, (double)(0.0F - par7), (double)par3, (double)par2); ++ par0Tessellator.addVertexWithUV(1.0D, 0.0D, (double)(0.0F - par7), (double)par3, (double)par4); ++ par0Tessellator.addVertexWithUV(0.0D, 0.0D, (double)(0.0F - par7), (double)par1, (double)par4); ++ par0Tessellator.draw(); ++ float var8 = 0.5F * (par1 - par3) / (float)par5; ++ float var9 = 0.5F * (par4 - par2) / (float)par6; ++ par0Tessellator.startDrawingQuads(); ++ par0Tessellator.setNormal(-1.0F, 0.0F, 0.0F); ++ int var10; ++ float var11; ++ float var12; ++ ++ for (var10 = 0; var10 < par5; ++var10) ++ { ++ var11 = (float)var10 / (float)par5; ++ var12 = par1 + (par3 - par1) * var11 - var8; ++ par0Tessellator.addVertexWithUV((double)var11, 0.0D, (double)(0.0F - par7), (double)var12, (double)par4); ++ par0Tessellator.addVertexWithUV((double)var11, 0.0D, 0.0D, (double)var12, (double)par4); ++ par0Tessellator.addVertexWithUV((double)var11, 1.0D, 0.0D, (double)var12, (double)par2); ++ par0Tessellator.addVertexWithUV((double)var11, 1.0D, (double)(0.0F - par7), (double)var12, (double)par2); ++ } ++ ++ par0Tessellator.draw(); ++ par0Tessellator.startDrawingQuads(); ++ par0Tessellator.setNormal(1.0F, 0.0F, 0.0F); ++ float var13; ++ ++ for (var10 = 0; var10 < par5; ++var10) ++ { ++ var11 = (float)var10 / (float)par5; ++ var12 = par1 + (par3 - par1) * var11 - var8; ++ var13 = var11 + 1.0F / (float)par5; ++ par0Tessellator.addVertexWithUV((double)var13, 1.0D, (double)(0.0F - par7), (double)var12, (double)par2); ++ par0Tessellator.addVertexWithUV((double)var13, 1.0D, 0.0D, (double)var12, (double)par2); ++ par0Tessellator.addVertexWithUV((double)var13, 0.0D, 0.0D, (double)var12, (double)par4); ++ par0Tessellator.addVertexWithUV((double)var13, 0.0D, (double)(0.0F - par7), (double)var12, (double)par4); ++ } ++ ++ par0Tessellator.draw(); ++ par0Tessellator.startDrawingQuads(); ++ par0Tessellator.setNormal(0.0F, 1.0F, 0.0F); ++ ++ for (var10 = 0; var10 < par6; ++var10) ++ { ++ var11 = (float)var10 / (float)par6; ++ var12 = par4 + (par2 - par4) * var11 - var9; ++ var13 = var11 + 1.0F / (float)par6; ++ par0Tessellator.addVertexWithUV(0.0D, (double)var13, 0.0D, (double)par1, (double)var12); ++ par0Tessellator.addVertexWithUV(1.0D, (double)var13, 0.0D, (double)par3, (double)var12); ++ par0Tessellator.addVertexWithUV(1.0D, (double)var13, (double)(0.0F - par7), (double)par3, (double)var12); ++ par0Tessellator.addVertexWithUV(0.0D, (double)var13, (double)(0.0F - par7), (double)par1, (double)var12); ++ } ++ ++ par0Tessellator.draw(); ++ par0Tessellator.startDrawingQuads(); ++ par0Tessellator.setNormal(0.0F, -1.0F, 0.0F); ++ ++ for (var10 = 0; var10 < par6; ++var10) ++ { ++ var11 = (float)var10 / (float)par6; ++ var12 = par4 + (par2 - par4) * var11 - var9; ++ par0Tessellator.addVertexWithUV(1.0D, (double)var11, 0.0D, (double)par3, (double)var12); ++ par0Tessellator.addVertexWithUV(0.0D, (double)var11, 0.0D, (double)par1, (double)var12); ++ par0Tessellator.addVertexWithUV(0.0D, (double)var11, (double)(0.0F - par7), (double)par1, (double)var12); ++ par0Tessellator.addVertexWithUV(1.0D, (double)var11, (double)(0.0F - par7), (double)par3, (double)var12); ++ } ++ ++ par0Tessellator.draw(); ++ } ++ ++ /** ++ * Renders the active item in the player's hand when in first person mode. Args: partialTickTime ++ */ ++ public void renderItemInFirstPerson(float par1) ++ { ++ float var2 = this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * par1; ++ EntityClientPlayerMP var3 = this.mc.thePlayer; ++ float var4 = var3.prevRotationPitch + (var3.rotationPitch - var3.prevRotationPitch) * par1; ++ GL11.glPushMatrix(); ++ GL11.glRotatef(var4, 1.0F, 0.0F, 0.0F); ++ GL11.glRotatef(var3.prevRotationYaw + (var3.rotationYaw - var3.prevRotationYaw) * par1, 0.0F, 1.0F, 0.0F); ++ RenderHelper.enableStandardItemLighting(); ++ GL11.glPopMatrix(); ++ EntityPlayerSP var5 = (EntityPlayerSP)var3; ++ float var6 = var5.prevRenderArmPitch + (var5.renderArmPitch - var5.prevRenderArmPitch) * par1; ++ float var7 = var5.prevRenderArmYaw + (var5.renderArmYaw - var5.prevRenderArmYaw) * par1; ++ GL11.glRotatef((var3.rotationPitch - var6) * 0.1F, 1.0F, 0.0F, 0.0F); ++ GL11.glRotatef((var3.rotationYaw - var7) * 0.1F, 0.0F, 1.0F, 0.0F); ++ ItemStack var8 = this.itemToRender; ++ float var9 = this.mc.theWorld.getLightBrightness(MathHelper.floor_double(var3.posX), MathHelper.floor_double(var3.posY), MathHelper.floor_double(var3.posZ)); ++ var9 = 1.0F; ++ int var10 = this.mc.theWorld.getLightBrightnessForSkyBlocks(MathHelper.floor_double(var3.posX), MathHelper.floor_double(var3.posY), MathHelper.floor_double(var3.posZ), 0); ++ int var11 = var10 % 65536; ++ int var12 = var10 / 65536; ++ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var11 / 1.0F, (float)var12 / 1.0F); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ float var13; ++ float var21; ++ float var23; ++ ++ if (var8 != null) ++ { ++ var10 = Item.itemsList[var8.itemID].getColorFromItemStack(var8, 0); ++ var21 = (float)(var10 >> 16 & 255) / 255.0F; ++ var23 = (float)(var10 >> 8 & 255) / 255.0F; ++ var13 = (float)(var10 & 255) / 255.0F; ++ GL11.glColor4f(var9 * var21, var9 * var23, var9 * var13, 1.0F); ++ } ++ else ++ { ++ GL11.glColor4f(var9, var9, var9, 1.0F); ++ } ++ ++ float var14; ++ float var15; ++ float var16; ++ float var20; ++ Render var26; ++ RenderPlayer var28; ++ ++ if (var8 != null && var8.itemID == Item.map.itemID) ++ { ++ GL11.glPushMatrix(); ++ var20 = 0.8F; ++ var21 = var3.getSwingProgress(par1); ++ var23 = MathHelper.sin(var21 * (float)Math.PI); ++ var13 = MathHelper.sin(MathHelper.sqrt_float(var21) * (float)Math.PI); ++ GL11.glTranslatef(-var13 * 0.4F, MathHelper.sin(MathHelper.sqrt_float(var21) * (float)Math.PI * 2.0F) * 0.2F, -var23 * 0.2F); ++ var21 = 1.0F - var4 / 45.0F + 0.1F; ++ ++ if (var21 < 0.0F) ++ { ++ var21 = 0.0F; ++ } ++ ++ if (var21 > 1.0F) ++ { ++ var21 = 1.0F; ++ } ++ ++ var21 = -MathHelper.cos(var21 * (float)Math.PI) * 0.5F + 0.5F; ++ GL11.glTranslatef(0.0F, 0.0F * var20 - (1.0F - var2) * 1.2F - var21 * 0.5F + 0.04F, -0.9F * var20); ++ GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(var21 * -85.0F, 0.0F, 0.0F, 1.0F); ++ GL11.glEnable(GL12.GL_RESCALE_NORMAL); ++ this.mc.getTextureManager().bindTexture(var3.getLocationSkin()); ++ ++ for (var12 = 0; var12 < 2; ++var12) ++ { ++ int var24 = var12 * 2 - 1; ++ GL11.glPushMatrix(); ++ GL11.glTranslatef(-0.0F, -0.6F, 1.1F * (float)var24); ++ GL11.glRotatef((float)(-45 * var24), 1.0F, 0.0F, 0.0F); ++ GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F); ++ GL11.glRotatef(59.0F, 0.0F, 0.0F, 1.0F); ++ GL11.glRotatef((float)(-65 * var24), 0.0F, 1.0F, 0.0F); ++ var26 = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer); ++ var28 = (RenderPlayer)var26; ++ var16 = 1.0F; ++ GL11.glScalef(var16, var16, var16); ++ var28.renderFirstPersonArm(this.mc.thePlayer); ++ GL11.glPopMatrix(); ++ } ++ ++ var23 = var3.getSwingProgress(par1); ++ var13 = MathHelper.sin(var23 * var23 * (float)Math.PI); ++ var14 = MathHelper.sin(MathHelper.sqrt_float(var23) * (float)Math.PI); ++ GL11.glRotatef(-var13 * 20.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(-var14 * 20.0F, 0.0F, 0.0F, 1.0F); ++ GL11.glRotatef(-var14 * 80.0F, 1.0F, 0.0F, 0.0F); ++ var15 = 0.38F; ++ GL11.glScalef(var15, var15, var15); ++ GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); ++ GL11.glTranslatef(-1.0F, -1.0F, 0.0F); ++ var16 = 0.015625F; ++ GL11.glScalef(var16, var16, var16); ++ this.mc.getTextureManager().bindTexture(RES_MAP_BACKGROUND); ++ Tessellator var29 = Tessellator.instance; ++ GL11.glNormal3f(0.0F, 0.0F, -1.0F); ++ var29.startDrawingQuads(); ++ byte var30 = 7; ++ var29.addVertexWithUV((double)(0 - var30), (double)(128 + var30), 0.0D, 0.0D, 1.0D); ++ var29.addVertexWithUV((double)(128 + var30), (double)(128 + var30), 0.0D, 1.0D, 1.0D); ++ var29.addVertexWithUV((double)(128 + var30), (double)(0 - var30), 0.0D, 1.0D, 0.0D); ++ var29.addVertexWithUV((double)(0 - var30), (double)(0 - var30), 0.0D, 0.0D, 0.0D); ++ var29.draw(); ++ MapData var19 = Item.map.getMapData(var8, this.mc.theWorld); ++ ++ if (var19 != null) ++ { ++ this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.getTextureManager(), var19); ++ } ++ ++ GL11.glPopMatrix(); ++ } ++ else if (var8 != null) ++ { ++ GL11.glPushMatrix(); ++ var20 = 0.8F; ++ ++ if (var3.getItemInUseCount() > 0) ++ { ++ EnumAction var22 = var8.getItemUseAction(); ++ ++ if (var22 == EnumAction.eat || var22 == EnumAction.drink) ++ { ++ var23 = (float)var3.getItemInUseCount() - par1 + 1.0F; ++ var13 = 1.0F - var23 / (float)var8.getMaxItemUseDuration(); ++ var14 = 1.0F - var13; ++ var14 = var14 * var14 * var14; ++ var14 = var14 * var14 * var14; ++ var14 = var14 * var14 * var14; ++ var15 = 1.0F - var14; ++ GL11.glTranslatef(0.0F, MathHelper.abs(MathHelper.cos(var23 / 4.0F * (float)Math.PI) * 0.1F) * (float)((double)var13 > 0.2D ? 1 : 0), 0.0F); ++ GL11.glTranslatef(var15 * 0.6F, -var15 * 0.5F, 0.0F); ++ GL11.glRotatef(var15 * 90.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(var15 * 10.0F, 1.0F, 0.0F, 0.0F); ++ GL11.glRotatef(var15 * 30.0F, 0.0F, 0.0F, 1.0F); ++ } ++ } ++ else ++ { ++ var21 = var3.getSwingProgress(par1); ++ var23 = MathHelper.sin(var21 * (float)Math.PI); ++ var13 = MathHelper.sin(MathHelper.sqrt_float(var21) * (float)Math.PI); ++ GL11.glTranslatef(-var13 * 0.4F, MathHelper.sin(MathHelper.sqrt_float(var21) * (float)Math.PI * 2.0F) * 0.2F, -var23 * 0.2F); ++ } ++ ++ GL11.glTranslatef(0.7F * var20, -0.65F * var20 - (1.0F - var2) * 0.6F, -0.9F * var20); ++ GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glEnable(GL12.GL_RESCALE_NORMAL); ++ var21 = var3.getSwingProgress(par1); ++ var23 = MathHelper.sin(var21 * var21 * (float)Math.PI); ++ var13 = MathHelper.sin(MathHelper.sqrt_float(var21) * (float)Math.PI); ++ GL11.glRotatef(-var23 * 20.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(-var13 * 20.0F, 0.0F, 0.0F, 1.0F); ++ GL11.glRotatef(-var13 * 80.0F, 1.0F, 0.0F, 0.0F); ++ var14 = 0.4F; ++ GL11.glScalef(var14, var14, var14); ++ float var17; ++ float var18; ++ ++ if (var3.getItemInUseCount() > 0) ++ { ++ EnumAction var25 = var8.getItemUseAction(); ++ ++ if (var25 == EnumAction.block) ++ { ++ GL11.glTranslatef(-0.5F, 0.2F, 0.0F); ++ GL11.glRotatef(30.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(-80.0F, 1.0F, 0.0F, 0.0F); ++ GL11.glRotatef(60.0F, 0.0F, 1.0F, 0.0F); ++ } ++ else if (var25 == EnumAction.bow) ++ { ++ GL11.glRotatef(-18.0F, 0.0F, 0.0F, 1.0F); ++ GL11.glRotatef(-12.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(-8.0F, 1.0F, 0.0F, 0.0F); ++ GL11.glTranslatef(-0.9F, 0.2F, 0.0F); ++ var16 = (float)var8.getMaxItemUseDuration() - ((float)var3.getItemInUseCount() - par1 + 1.0F); ++ var17 = var16 / 20.0F; ++ var17 = (var17 * var17 + var17 * 2.0F) / 3.0F; ++ ++ if (var17 > 1.0F) ++ { ++ var17 = 1.0F; ++ } ++ ++ if (var17 > 0.1F) ++ { ++ GL11.glTranslatef(0.0F, MathHelper.sin((var16 - 0.1F) * 1.3F) * 0.01F * (var17 - 0.1F), 0.0F); ++ } ++ ++ GL11.glTranslatef(0.0F, 0.0F, var17 * 0.1F); ++ GL11.glRotatef(-335.0F, 0.0F, 0.0F, 1.0F); ++ GL11.glRotatef(-50.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glTranslatef(0.0F, 0.5F, 0.0F); ++ var18 = 1.0F + var17 * 0.2F; ++ GL11.glScalef(1.0F, 1.0F, var18); ++ GL11.glTranslatef(0.0F, -0.5F, 0.0F); ++ GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F); ++ } ++ } ++ ++ if (var8.getItem().shouldRotateAroundWhenRendering()) ++ { ++ GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); ++ } ++ ++ if (var8.getItem().requiresMultipleRenderPasses()) ++ { ++ this.renderItem(var3, var8, 0); ++ int var27 = Item.itemsList[var8.itemID].getColorFromItemStack(var8, 1); ++ var16 = (float)(var27 >> 16 & 255) / 255.0F; ++ var17 = (float)(var27 >> 8 & 255) / 255.0F; ++ var18 = (float)(var27 & 255) / 255.0F; ++ GL11.glColor4f(var9 * var16, var9 * var17, var9 * var18, 1.0F); ++ this.renderItem(var3, var8, 1); ++ } ++ else ++ { ++ this.renderItem(var3, var8, 0); ++ } ++ ++ GL11.glPopMatrix(); ++ } ++ else if (!var3.isInvisible()) ++ { ++ GL11.glPushMatrix(); ++ var20 = 0.8F; ++ var21 = var3.getSwingProgress(par1); ++ var23 = MathHelper.sin(var21 * (float)Math.PI); ++ var13 = MathHelper.sin(MathHelper.sqrt_float(var21) * (float)Math.PI); ++ GL11.glTranslatef(-var13 * 0.3F, MathHelper.sin(MathHelper.sqrt_float(var21) * (float)Math.PI * 2.0F) * 0.4F, -var23 * 0.4F); ++ GL11.glTranslatef(0.8F * var20, -0.75F * var20 - (1.0F - var2) * 0.6F, -0.9F * var20); ++ GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glEnable(GL12.GL_RESCALE_NORMAL); ++ var21 = var3.getSwingProgress(par1); ++ var23 = MathHelper.sin(var21 * var21 * (float)Math.PI); ++ var13 = MathHelper.sin(MathHelper.sqrt_float(var21) * (float)Math.PI); ++ GL11.glRotatef(var13 * 70.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(-var23 * 20.0F, 0.0F, 0.0F, 1.0F); ++ this.mc.getTextureManager().bindTexture(var3.getLocationSkin()); ++ GL11.glTranslatef(-1.0F, 3.6F, 3.5F); ++ GL11.glRotatef(120.0F, 0.0F, 0.0F, 1.0F); ++ GL11.glRotatef(200.0F, 1.0F, 0.0F, 0.0F); ++ GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glScalef(1.0F, 1.0F, 1.0F); ++ GL11.glTranslatef(5.6F, 0.0F, 0.0F); ++ var26 = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer); ++ var28 = (RenderPlayer)var26; ++ var16 = 1.0F; ++ GL11.glScalef(var16, var16, var16); ++ var28.renderFirstPersonArm(this.mc.thePlayer); ++ GL11.glPopMatrix(); ++ } ++ ++ GL11.glDisable(GL12.GL_RESCALE_NORMAL); ++ RenderHelper.disableStandardItemLighting(); ++ } ++ ++ /** ++ * Renders all the overlays that are in first person mode. Args: partialTickTime ++ */ ++ public void renderOverlays(float par1) ++ { ++ GL11.glDisable(GL11.GL_ALPHA_TEST); ++ ++ if (this.mc.thePlayer.isBurning()) ++ { ++ this.renderFireInFirstPerson(par1); ++ } ++ ++ if (this.mc.thePlayer.isEntityInsideOpaqueBlock()) ++ { ++ int var2 = MathHelper.floor_double(this.mc.thePlayer.posX); ++ int var3 = MathHelper.floor_double(this.mc.thePlayer.posY); ++ int var4 = MathHelper.floor_double(this.mc.thePlayer.posZ); ++ int var5 = this.mc.theWorld.getBlockId(var2, var3, var4); ++ ++ if (this.mc.theWorld.isBlockNormalCube(var2, var3, var4)) ++ { ++ this.renderInsideOfBlock(par1, Block.blocksList[var5].getBlockTextureFromSide(2)); ++ } ++ else ++ { ++ for (int var6 = 0; var6 < 8; ++var6) ++ { ++ float var7 = ((float)((var6 >> 0) % 2) - 0.5F) * this.mc.thePlayer.width * 0.9F; ++ float var8 = ((float)((var6 >> 1) % 2) - 0.5F) * this.mc.thePlayer.height * 0.2F; ++ float var9 = ((float)((var6 >> 2) % 2) - 0.5F) * this.mc.thePlayer.width * 0.9F; ++ int var10 = MathHelper.floor_float((float)var2 + var7); ++ int var11 = MathHelper.floor_float((float)var3 + var8); ++ int var12 = MathHelper.floor_float((float)var4 + var9); ++ ++ if (this.mc.theWorld.isBlockNormalCube(var10, var11, var12)) ++ { ++ var5 = this.mc.theWorld.getBlockId(var10, var11, var12); ++ } ++ } ++ } ++ ++ if (Block.blocksList[var5] != null) ++ { ++ this.renderInsideOfBlock(par1, Block.blocksList[var5].getBlockTextureFromSide(2)); ++ } ++ } ++ ++ if (this.mc.thePlayer.isInsideOfMaterial(Material.water)) ++ { ++ this.renderWarpedTextureOverlay(par1); ++ } ++ ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ } ++ ++ /** ++ * Renders the texture of the block the player is inside as an overlay. Args: partialTickTime, blockTextureIndex ++ */ ++ private void renderInsideOfBlock(float par1, Icon par2Icon) ++ { ++ this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); ++ Tessellator var3 = Tessellator.instance; ++ float var4 = 0.1F; ++ GL11.glColor4f(var4, var4, var4, 0.5F); ++ GL11.glPushMatrix(); ++ float var5 = -1.0F; ++ float var6 = 1.0F; ++ float var7 = -1.0F; ++ float var8 = 1.0F; ++ float var9 = -0.5F; ++ float var10 = par2Icon.getMinU(); ++ float var11 = par2Icon.getMaxU(); ++ float var12 = par2Icon.getMinV(); ++ float var13 = par2Icon.getMaxV(); ++ var3.startDrawingQuads(); ++ var3.addVertexWithUV((double)var5, (double)var7, (double)var9, (double)var11, (double)var13); ++ var3.addVertexWithUV((double)var6, (double)var7, (double)var9, (double)var10, (double)var13); ++ var3.addVertexWithUV((double)var6, (double)var8, (double)var9, (double)var10, (double)var12); ++ var3.addVertexWithUV((double)var5, (double)var8, (double)var9, (double)var11, (double)var12); ++ var3.draw(); ++ GL11.glPopMatrix(); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ } ++ ++ /** ++ * Renders a texture that warps around based on the direction the player is looking. Texture needs to be bound ++ * before being called. Used for the water overlay. Args: parialTickTime ++ */ ++ private void renderWarpedTextureOverlay(float par1) ++ { ++ this.mc.getTextureManager().bindTexture(RES_UNDERWATER_OVERLAY); ++ Tessellator var2 = Tessellator.instance; ++ float var3 = this.mc.thePlayer.getBrightness(par1); ++ GL11.glColor4f(var3, var3, var3, 0.5F); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ GL11.glPushMatrix(); ++ float var4 = 4.0F; ++ float var5 = -1.0F; ++ float var6 = 1.0F; ++ float var7 = -1.0F; ++ float var8 = 1.0F; ++ float var9 = -0.5F; ++ float var10 = -this.mc.thePlayer.rotationYaw / 64.0F; ++ float var11 = this.mc.thePlayer.rotationPitch / 64.0F; ++ var2.startDrawingQuads(); ++ var2.addVertexWithUV((double)var5, (double)var7, (double)var9, (double)(var4 + var10), (double)(var4 + var11)); ++ var2.addVertexWithUV((double)var6, (double)var7, (double)var9, (double)(0.0F + var10), (double)(var4 + var11)); ++ var2.addVertexWithUV((double)var6, (double)var8, (double)var9, (double)(0.0F + var10), (double)(0.0F + var11)); ++ var2.addVertexWithUV((double)var5, (double)var8, (double)var9, (double)(var4 + var10), (double)(0.0F + var11)); ++ var2.draw(); ++ GL11.glPopMatrix(); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glDisable(GL11.GL_BLEND); ++ } ++ ++ /** ++ * Renders the fire on the screen for first person mode. Arg: partialTickTime ++ */ ++ private void renderFireInFirstPerson(float par1) ++ { ++ Tessellator var2 = Tessellator.instance; ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.9F); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ float var3 = 1.0F; ++ ++ for (int var4 = 0; var4 < 2; ++var4) ++ { ++ GL11.glPushMatrix(); ++ Icon var5 = Block.fire.getFireIcon(1); ++ this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); ++ float var6 = var5.getMinU(); ++ float var7 = var5.getMaxU(); ++ float var8 = var5.getMinV(); ++ float var9 = var5.getMaxV(); ++ float var10 = (0.0F - var3) / 2.0F; ++ float var11 = var10 + var3; ++ float var12 = 0.0F - var3 / 2.0F; ++ float var13 = var12 + var3; ++ float var14 = -0.5F; ++ GL11.glTranslatef((float)(-(var4 * 2 - 1)) * 0.24F, -0.3F, 0.0F); ++ GL11.glRotatef((float)(var4 * 2 - 1) * 10.0F, 0.0F, 1.0F, 0.0F); ++ var2.startDrawingQuads(); ++ var2.addVertexWithUV((double)var10, (double)var12, (double)var14, (double)var7, (double)var9); ++ var2.addVertexWithUV((double)var11, (double)var12, (double)var14, (double)var6, (double)var9); ++ var2.addVertexWithUV((double)var11, (double)var13, (double)var14, (double)var6, (double)var8); ++ var2.addVertexWithUV((double)var10, (double)var13, (double)var14, (double)var7, (double)var8); ++ var2.draw(); ++ GL11.glPopMatrix(); ++ } ++ ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glDisable(GL11.GL_BLEND); ++ } ++ ++ public void updateEquippedItem() ++ { ++ this.prevEquippedProgress = this.equippedProgress; ++ EntityClientPlayerMP var1 = this.mc.thePlayer; ++ ItemStack var2 = var1.inventory.getCurrentItem(); ++ boolean var3 = this.equippedItemSlot == var1.inventory.currentItem && var2 == this.itemToRender; ++ ++ if (this.itemToRender == null && var2 == null) ++ { ++ var3 = true; ++ } ++ ++ if (var2 != null && this.itemToRender != null && var2 != this.itemToRender && var2.itemID == this.itemToRender.itemID && var2.getItemDamage() == this.itemToRender.getItemDamage()) ++ { ++ this.itemToRender = var2; ++ var3 = true; ++ } ++ ++ float var4 = 0.4F; ++ float var5 = var3 ? 1.0F : 0.0F; ++ float var6 = var5 - this.equippedProgress; ++ ++ if (var6 < -var4) ++ { ++ var6 = -var4; ++ } ++ ++ if (var6 > var4) ++ { ++ var6 = var4; ++ } ++ ++ this.equippedProgress += var6; ++ ++ if (this.equippedProgress < 0.1F) ++ { ++ this.itemToRender = var2; ++ this.equippedItemSlot = var1.inventory.currentItem; ++ } ++ } ++ ++ /** ++ * Resets equippedProgress ++ */ ++ public void resetEquippedProgress() ++ { ++ this.equippedProgress = 0.0F; ++ } ++ ++ /** ++ * Resets equippedProgress ++ */ ++ public void resetEquippedProgress2() ++ { ++ this.equippedProgress = 0.0F; ++ } ++ } +*** ItemSaddle.java Sat Feb 5 04:13:14 2022 +--- ItemSaddle.java Sat Feb 5 04:12:35 2022 +*** ItemSeedFood.java Sat Feb 5 04:13:14 2022 +--- ItemSeedFood.java Sat Feb 5 04:12:35 2022 +*** ItemSeeds.java Sat Feb 5 04:13:14 2022 +--- ItemSeeds.java Sat Feb 5 04:12:35 2022 +*** ItemShears.java Sat Feb 5 04:13:14 2022 +--- ItemShears.java Sat Feb 5 04:12:35 2022 +*** ItemSign.java Sat Feb 5 04:13:14 2022 +--- ItemSign.java Sat Feb 5 04:12:35 2022 +*** ItemSimpleFoiled.java Sat Feb 5 04:13:14 2022 +--- ItemSimpleFoiled.java Sat Feb 5 04:12:35 2022 +*************** +*** 4,9 **** +--- 4,14 ---- + { + public ItemSimpleFoiled(int par1) + { + super(par1); + } ++ ++ public boolean hasEffect(ItemStack par1ItemStack) ++ { ++ return true; ++ } + } +*** ItemSkull.java Sat Feb 5 04:13:14 2022 +--- ItemSkull.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,11 **** +--- 1,14 ---- + package net.minecraft.src; + ++ import java.util.List; ++ + public class ItemSkull extends Item + { + private static final String[] skullTypes = new String[] {"skeleton", "wither", "zombie", "char", "creeper"}; + public static final String[] field_94587_a = new String[] {"skeleton", "wither", "zombie", "steve", "creeper"}; ++ private Icon[] field_94586_c; + + public ItemSkull(int par1) + { + super(par1); + this.setCreativeTab(CreativeTabs.tabDecorations); +*************** +*** 93,102 **** +--- 96,129 ---- + } + } + } + + /** ++ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) ++ */ ++ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) ++ { ++ for (int var4 = 0; var4 < skullTypes.length; ++var4) ++ { ++ par3List.add(new ItemStack(par1, 1, var4)); ++ } ++ } ++ ++ /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) ++ { ++ if (par1 < 0 || par1 >= skullTypes.length) ++ { ++ par1 = 0; ++ } ++ ++ return this.field_94586_c[par1]; ++ } ++ ++ /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int par1) + { + return par1; +*************** +*** 119,125 **** +--- 146,162 ---- + } + + public String getItemDisplayName(ItemStack par1ItemStack) + { + return par1ItemStack.getItemDamage() == 3 && par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().hasKey("SkullOwner") ? StatCollector.translateToLocalFormatted("item.skull.player.name", new Object[] {par1ItemStack.getTagCompound().getString("SkullOwner")}): super.getItemDisplayName(par1ItemStack); ++ } ++ ++ public void registerIcons(IconRegister par1IconRegister) ++ { ++ this.field_94586_c = new Icon[field_94587_a.length]; ++ ++ for (int var2 = 0; var2 < field_94587_a.length; ++var2) ++ { ++ this.field_94586_c[var2] = par1IconRegister.registerIcon(this.getIconString() + "_" + field_94587_a[var2]); ++ } + } + } +*** ItemSlab.java Sat Feb 5 04:13:14 2022 +--- ItemSlab.java Sat Feb 5 04:12:35 2022 +*************** +*** 19,28 **** +--- 19,36 ---- + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) ++ { ++ return Block.blocksList[this.itemID].getIcon(2, par1); ++ } ++ ++ /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int par1) + { + return par1; +*************** +*** 74,83 **** +--- 82,148 ---- + } + else + { + return this.func_77888_a(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7) ? true : super.onItemUse(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10); + } ++ } ++ } ++ ++ /** ++ * Returns true if the given ItemBlock can be placed on the given side of the given block position. ++ */ ++ public boolean canPlaceItemBlockOnSide(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer, ItemStack par7ItemStack) ++ { ++ int var8 = par2; ++ int var9 = par3; ++ int var10 = par4; ++ int var11 = par1World.getBlockId(par2, par3, par4); ++ int var12 = par1World.getBlockMetadata(par2, par3, par4); ++ int var13 = var12 & 7; ++ boolean var14 = (var12 & 8) != 0; ++ ++ if ((par5 == 1 && !var14 || par5 == 0 && var14) && var11 == this.theHalfSlab.blockID && var13 == par7ItemStack.getItemDamage()) ++ { ++ return true; ++ } ++ else ++ { ++ if (par5 == 0) ++ { ++ --par3; ++ } ++ ++ if (par5 == 1) ++ { ++ ++par3; ++ } ++ ++ if (par5 == 2) ++ { ++ --par4; ++ } ++ ++ if (par5 == 3) ++ { ++ ++par4; ++ } ++ ++ if (par5 == 4) ++ { ++ --par2; ++ } ++ ++ if (par5 == 5) ++ { ++ ++par2; ++ } ++ ++ var11 = par1World.getBlockId(par2, par3, par4); ++ var12 = par1World.getBlockMetadata(par2, par3, par4); ++ var13 = var12 & 7; ++ var14 = (var12 & 8) != 0; ++ return var11 == this.theHalfSlab.blockID && var13 == par7ItemStack.getItemDamage() ? true : super.canPlaceItemBlockOnSide(par1World, var8, var9, var10, par5, par6EntityPlayer, par7ItemStack); + } + } + + private boolean func_77888_a(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7) + { +*** ItemSnow.java Sat Feb 5 04:13:14 2022 +--- ItemSnow.java Sat Feb 5 04:12:35 2022 +*************** +*** 29,39 **** + { + Block var12 = Block.blocksList[this.getBlockID()]; + int var13 = par3World.getBlockMetadata(par4, par5, par6); + int var14 = var13 & 7; + +! if (var14 <= 6 && par3World.checkNoEntityCollision(var12.getCollisionBoundingBoxFromPool(par3World, par4, par5, par6)) && par3World.setBlockMetadata(par4, par5, par6, var14 + 1 | var13 & -8, 2)) + { + par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), var12.stepSound.getPlaceSound(), (var12.stepSound.getVolume() + 1.0F) / 2.0F, var12.stepSound.getPitch() * 0.8F); + --par1ItemStack.stackSize; + return true; + } +--- 29,39 ---- + { + Block var12 = Block.blocksList[this.getBlockID()]; + int var13 = par3World.getBlockMetadata(par4, par5, par6); + int var14 = var13 & 7; + +! if (var14 <= 6 && par3World.checkNoEntityCollision(var12.getCollisionBoundingBoxFromPool(par3World, par4, par5, par6)) && par3World.setBlockMetadataWithNotify(par4, par5, par6, var14 + 1 | var13 & -8, 2)) + { + par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), var12.stepSound.getPlaceSound(), (var12.stepSound.getVolume() + 1.0F) / 2.0F, var12.stepSound.getPitch() * 0.8F); + --par1ItemStack.stackSize; + return true; + } +*** ItemSnowball.java Sat Feb 5 04:13:14 2022 +--- ItemSnowball.java Sat Feb 5 04:12:35 2022 +*** ItemSoup.java Sat Feb 5 04:13:14 2022 +--- ItemSoup.java Sat Feb 5 04:12:35 2022 +*** ItemSpade.java Sat Feb 5 04:13:14 2022 +--- ItemSpade.java Sat Feb 5 04:12:35 2022 +*** ItemStack.java Sat Feb 5 04:13:14 2022 +--- ItemStack.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,11 **** +--- 1,15 ---- + package net.minecraft.src; + + import com.google.common.collect.HashMultimap; + import com.google.common.collect.Multimap; + import java.text.DecimalFormat; ++ import java.util.ArrayList; ++ import java.util.Iterator; ++ import java.util.List; + import java.util.Random; ++ import java.util.Map.Entry; + + public final class ItemStack + { + public static final DecimalFormat field_111284_a = new DecimalFormat("#.###"); + +*************** +*** 104,113 **** +--- 108,130 ---- + public Item getItem() + { + return Item.itemsList[this.itemID]; + } + ++ /** ++ * Returns the icon index of the current stack. ++ */ ++ public Icon getIconIndex() ++ { ++ return this.getItem().getIconIndex(this); ++ } ++ ++ public int getItemSpriteNumber() ++ { ++ return this.getItem().getSpriteNumber(); ++ } ++ + public boolean tryPlaceItemIntoWorld(EntityPlayer par1EntityPlayer, World par2World, int par3, int par4, int par5, int par6, float par7, float par8, float par9) + { + boolean var10 = this.getItem().onItemUse(this, par1EntityPlayer, par2World, par3, par4, par5, par6, par7, par8, par9); + + if (var10) +*************** +*** 557,566 **** +--- 574,726 ---- + * Returns true if the itemstack has a display name + */ + public boolean hasDisplayName() + { + return this.stackTagCompound == null ? false : (!this.stackTagCompound.hasKey("display") ? false : this.stackTagCompound.getCompoundTag("display").hasKey("Name")); ++ } ++ ++ /** ++ * Return a list of strings containing information about the item ++ */ ++ public List getTooltip(EntityPlayer par1EntityPlayer, boolean par2) ++ { ++ ArrayList var3 = new ArrayList(); ++ Item var4 = Item.itemsList[this.itemID]; ++ String var5 = this.getDisplayName(); ++ ++ if (this.hasDisplayName()) ++ { ++ var5 = EnumChatFormatting.ITALIC + var5 + EnumChatFormatting.RESET; ++ } ++ ++ if (par2) ++ { ++ String var6 = ""; ++ ++ if (var5.length() > 0) ++ { ++ var5 = var5 + " ("; ++ var6 = ")"; ++ } ++ ++ if (this.getHasSubtypes()) ++ { ++ var5 = var5 + String.format("#%04d/%d%s", new Object[] {Integer.valueOf(this.itemID), Integer.valueOf(this.itemDamage), var6}); ++ } ++ else ++ { ++ var5 = var5 + String.format("#%04d%s", new Object[] {Integer.valueOf(this.itemID), var6}); ++ } ++ } ++ else if (!this.hasDisplayName() && this.itemID == Item.map.itemID) ++ { ++ var5 = var5 + " #" + this.itemDamage; ++ } ++ ++ var3.add(var5); ++ var4.addInformation(this, par1EntityPlayer, var3, par2); ++ ++ if (this.hasTagCompound()) ++ { ++ NBTTagList var14 = this.getEnchantmentTagList(); ++ ++ if (var14 != null) ++ { ++ for (int var7 = 0; var7 < var14.tagCount(); ++var7) ++ { ++ short var8 = ((NBTTagCompound)var14.tagAt(var7)).getShort("id"); ++ short var9 = ((NBTTagCompound)var14.tagAt(var7)).getShort("lvl"); ++ ++ if (Enchantment.enchantmentsList[var8] != null) ++ { ++ var3.add(Enchantment.enchantmentsList[var8].getTranslatedName(var9)); ++ } ++ } ++ } ++ ++ if (this.stackTagCompound.hasKey("display")) ++ { ++ NBTTagCompound var16 = this.stackTagCompound.getCompoundTag("display"); ++ ++ if (var16.hasKey("color")) ++ { ++ if (par2) ++ { ++ var3.add("Color: #" + Integer.toHexString(var16.getInteger("color")).toUpperCase()); ++ } ++ else ++ { ++ var3.add(EnumChatFormatting.ITALIC + StatCollector.translateToLocal("item.dyed")); ++ } ++ } ++ ++ if (var16.hasKey("Lore")) ++ { ++ NBTTagList var18 = var16.getTagList("Lore"); ++ ++ if (var18.tagCount() > 0) ++ { ++ for (int var20 = 0; var20 < var18.tagCount(); ++var20) ++ { ++ var3.add(EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.ITALIC + ((NBTTagString)var18.tagAt(var20)).data); ++ } ++ } ++ } ++ } ++ } ++ ++ Multimap var15 = this.getAttributeModifiers(); ++ ++ if (!var15.isEmpty()) ++ { ++ var3.add(""); ++ Iterator var17 = var15.entries().iterator(); ++ ++ while (var17.hasNext()) ++ { ++ Entry var19 = (Entry)var17.next(); ++ AttributeModifier var21 = (AttributeModifier)var19.getValue(); ++ double var10 = var21.getAmount(); ++ double var12; ++ ++ if (var21.getOperation() != 1 && var21.getOperation() != 2) ++ { ++ var12 = var21.getAmount(); ++ } ++ else ++ { ++ var12 = var21.getAmount() * 100.0D; ++ } ++ ++ if (var10 > 0.0D) ++ { ++ var3.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + var21.getOperation(), new Object[] {field_111284_a.format(var12), StatCollector.translateToLocal("attribute.name." + (String)var19.getKey())})); ++ } ++ else if (var10 < 0.0D) ++ { ++ var12 *= -1.0D; ++ var3.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + var21.getOperation(), new Object[] {field_111284_a.format(var12), StatCollector.translateToLocal("attribute.name." + (String)var19.getKey())})); ++ } ++ } ++ } ++ ++ if (par2 && this.isItemDamaged()) ++ { ++ var3.add("Durability: " + (this.getMaxDamage() - this.getItemDamageForDisplay()) + " / " + this.getMaxDamage()); ++ } ++ ++ return var3; ++ } ++ ++ public boolean hasEffect() ++ { ++ return this.getItem().hasEffect(this); ++ } ++ ++ public EnumRarity getRarity() ++ { ++ return this.getItem().getRarity(this); + } + + /** + * True if it is a tool and has no enchantments to begin with + */ +*** ItemSword.java Sat Feb 5 04:13:14 2022 +--- ItemSword.java Sat Feb 5 04:12:35 2022 +*************** +*** 58,67 **** +--- 58,75 ---- + + return true; + } + + /** ++ * Returns True is the item is renderer in full 3D when hold. ++ */ ++ public boolean isFull3D() ++ { ++ return true; ++ } ++ ++ /** + * returns the action that specifies what animation to play when the items is being used + */ + public EnumAction getItemUseAction(ItemStack par1ItemStack) + { + return EnumAction.block; +*** ItemTool.java Sat Feb 5 04:13:14 2022 +--- ItemTool.java Sat Feb 5 04:12:35 2022 +*************** +*** 62,71 **** +--- 62,79 ---- + + return true; + } + + /** ++ * Returns True is the item is renderer in full 3D when hold. ++ */ ++ public boolean isFull3D() ++ { ++ return true; ++ } ++ ++ /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + public int getItemEnchantability() + { + return this.toolMaterial.getEnchantability(); +*** ItemWritableBook.java Sat Feb 5 04:13:14 2022 +--- ItemWritableBook.java Sat Feb 5 04:12:35 2022 +*** IThreadedFileIO.java Sat Feb 5 04:13:14 2022 +--- IThreadedFileIO.java Sat Feb 5 04:12:35 2022 +*** ITileEntityProvider.java Sat Feb 5 04:13:14 2022 +--- ITileEntityProvider.java Sat Feb 5 04:12:35 2022 +*** IUpdatePlayerListBox.java Sat Feb 5 04:13:14 2022 +--- IUpdatePlayerListBox.java Sat Feb 5 04:12:35 2022 +*** IWorldAccess.java Sat Feb 5 04:13:14 2022 +--- IWorldAccess.java Sat Feb 5 04:12:35 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- KeyBinding.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,87 ---- ++ package net.minecraft.src; ++ ++ import java.util.ArrayList; ++ import java.util.Iterator; ++ import java.util.List; ++ ++ public class KeyBinding ++ { ++ public static List keybindArray = new ArrayList(); ++ public static IntHashMap hash = new IntHashMap(); ++ public String keyDescription; ++ public int keyCode; ++ ++ /** because _303 wanted me to call it that(Caironater) */ ++ public boolean pressed; ++ public int pressTime; ++ ++ public static void onTick(int par0) ++ { ++ KeyBinding var1 = (KeyBinding)hash.lookup(par0); ++ ++ if (var1 != null) ++ { ++ ++var1.pressTime; ++ } ++ } ++ ++ public static void setKeyBindState(int par0, boolean par1) ++ { ++ KeyBinding var2 = (KeyBinding)hash.lookup(par0); ++ ++ if (var2 != null) ++ { ++ var2.pressed = par1; ++ } ++ } ++ ++ public static void unPressAllKeys() ++ { ++ Iterator var0 = keybindArray.iterator(); ++ ++ while (var0.hasNext()) ++ { ++ KeyBinding var1 = (KeyBinding)var0.next(); ++ var1.unpressKey(); ++ } ++ } ++ ++ public static void resetKeyBindingArrayAndHash() ++ { ++ hash.clearMap(); ++ Iterator var0 = keybindArray.iterator(); ++ ++ while (var0.hasNext()) ++ { ++ KeyBinding var1 = (KeyBinding)var0.next(); ++ hash.addKey(var1.keyCode, var1); ++ } ++ } ++ ++ public KeyBinding(String par1Str, int par2) ++ { ++ this.keyDescription = par1Str; ++ this.keyCode = par2; ++ keybindArray.add(this); ++ hash.addKey(par2, this); ++ } ++ ++ public boolean isPressed() ++ { ++ if (this.pressTime == 0) ++ { ++ return false; ++ } ++ else ++ { ++ --this.pressTime; ++ return true; ++ } ++ } ++ ++ private void unpressKey() ++ { ++ this.pressTime = 0; ++ this.pressed = false; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- Language.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,52 ---- ++ package net.minecraft.src; ++ ++ public class Language implements Comparable ++ { ++ private final String languageCode; ++ private final String region; ++ private final String name; ++ private final boolean bidirectional; ++ ++ public Language(String par1Str, String par2Str, String par3Str, boolean par4) ++ { ++ this.languageCode = par1Str; ++ this.region = par2Str; ++ this.name = par3Str; ++ this.bidirectional = par4; ++ } ++ ++ public String getLanguageCode() ++ { ++ return this.languageCode; ++ } ++ ++ public boolean isBidirectional() ++ { ++ return this.bidirectional; ++ } ++ ++ public String toString() ++ { ++ return String.format("%s (%s)", new Object[] {this.name, this.region}); ++ } ++ ++ public boolean equals(Object par1Obj) ++ { ++ return this == par1Obj ? true : (!(par1Obj instanceof Language) ? false : this.languageCode.equals(((Language)par1Obj).languageCode)); ++ } ++ ++ public int hashCode() ++ { ++ return this.languageCode.hashCode(); ++ } ++ ++ public int func_135033_a(Language par1Language) ++ { ++ return this.languageCode.compareTo(par1Language.languageCode); ++ } ++ ++ public int compareTo(Object par1Obj) ++ { ++ return this.func_135033_a((Language)par1Obj); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- LanguageManager.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,103 ---- ++ package net.minecraft.src; ++ ++ import com.google.common.collect.Lists; ++ import com.google.common.collect.Maps; ++ import com.google.common.collect.Sets; ++ import java.io.IOException; ++ import java.util.ArrayList; ++ import java.util.Iterator; ++ import java.util.List; ++ import java.util.Map; ++ import java.util.SortedSet; ++ ++ public class LanguageManager implements ResourceManagerReloadListener ++ { ++ private final MetadataSerializer field_135047_b; ++ private String currentLanguage; ++ protected static final Locale currentLocale = new Locale(); ++ private Map languageMap = Maps.newHashMap(); ++ ++ public LanguageManager(MetadataSerializer par1MetadataSerializer, String par2Str) ++ { ++ this.field_135047_b = par1MetadataSerializer; ++ this.currentLanguage = par2Str; ++ I18n.setLocale(currentLocale); ++ } ++ ++ public void parseLanguageMetadata(List par1List) ++ { ++ this.languageMap.clear(); ++ Iterator var2 = par1List.iterator(); ++ ++ while (var2.hasNext()) ++ { ++ ResourcePack var3 = (ResourcePack)var2.next(); ++ ++ try ++ { ++ LanguageMetadataSection var4 = (LanguageMetadataSection)var3.getPackMetadata(this.field_135047_b, "language"); ++ ++ if (var4 != null) ++ { ++ Iterator var5 = var4.getLanguages().iterator(); ++ ++ while (var5.hasNext()) ++ { ++ Language var6 = (Language)var5.next(); ++ ++ if (!this.languageMap.containsKey(var6.getLanguageCode())) ++ { ++ this.languageMap.put(var6.getLanguageCode(), var6); ++ } ++ } ++ } ++ } ++ catch (RuntimeException var7) ++ { ++ Minecraft.getMinecraft().getLogAgent().logWarningException("Unable to parse metadata section of resourcepack: " + var3.getPackName(), var7); ++ } ++ catch (IOException var8) ++ { ++ Minecraft.getMinecraft().getLogAgent().logWarningException("Unable to parse metadata section of resourcepack: " + var3.getPackName(), var8); ++ } ++ } ++ } ++ ++ public void onResourceManagerReload(ResourceManager par1ResourceManager) ++ { ++ ArrayList var2 = Lists.newArrayList(new String[] {"en_US"}); ++ ++ if (!"en_US".equals(this.currentLanguage)) ++ { ++ var2.add(this.currentLanguage); ++ } ++ ++ currentLocale.loadLocaleDataFiles(par1ResourceManager, var2); ++ StringTranslate.func_135063_a(currentLocale.field_135032_a); ++ } ++ ++ public boolean isCurrentLocaleUnicode() ++ { ++ return currentLocale.isUnicode(); ++ } ++ ++ public boolean isCurrentLanguageBidirectional() ++ { ++ return this.getCurrentLanguage().isBidirectional(); ++ } ++ ++ public void setCurrentLanguage(Language par1Language) ++ { ++ this.currentLanguage = par1Language.getLanguageCode(); ++ } ++ ++ public Language getCurrentLanguage() ++ { ++ return this.languageMap.containsKey(this.currentLanguage) ? (Language)this.languageMap.get(this.currentLanguage) : (Language)this.languageMap.get("en_US"); ++ } ++ ++ public SortedSet getLanguages() ++ { ++ return Sets.newTreeSet(this.languageMap.values()); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- LanguageMetadataSection.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,18 ---- ++ package net.minecraft.src; ++ ++ import java.util.Collection; ++ ++ public class LanguageMetadataSection implements MetadataSection ++ { ++ private final Collection languages; ++ ++ public LanguageMetadataSection(Collection par1Collection) ++ { ++ this.languages = par1Collection; ++ } ++ ++ public Collection getLanguages() ++ { ++ return this.languages; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- LanguageMetadataSectionSerializer.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,73 ---- ++ package net.minecraft.src; ++ ++ import com.google.common.collect.Sets; ++ import com.google.gson.JsonDeserializationContext; ++ import com.google.gson.JsonElement; ++ import com.google.gson.JsonObject; ++ import com.google.gson.JsonParseException; ++ import java.lang.reflect.Type; ++ import java.util.HashSet; ++ import java.util.Iterator; ++ import java.util.Map.Entry; ++ ++ public class LanguageMetadataSectionSerializer extends BaseMetadataSectionSerializer ++ { ++ public LanguageMetadataSection func_135020_a(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) ++ { ++ JsonObject var4 = par1JsonElement.getAsJsonObject(); ++ HashSet var5 = Sets.newHashSet(); ++ Iterator var6 = var4.entrySet().iterator(); ++ String var8; ++ String var11; ++ String var12; ++ boolean var13; ++ ++ do ++ { ++ if (!var6.hasNext()) ++ { ++ return new LanguageMetadataSection(var5); ++ } ++ ++ Entry var7 = (Entry)var6.next(); ++ var8 = (String)var7.getKey(); ++ JsonElement var9 = (JsonElement)var7.getValue(); ++ ++ if (!var9.isJsonObject()) ++ { ++ throw new JsonParseException("Invalid language->\'" + var8 + "\': expected object, was " + var9); ++ } ++ ++ JsonObject var10 = var9.getAsJsonObject(); ++ var11 = this.func_110486_a(var10.get("region"), "region", "", 0, Integer.MAX_VALUE); ++ var12 = this.func_110486_a(var10.get("name"), "name", "", 0, Integer.MAX_VALUE); ++ var13 = this.func_110484_a(var10.get("bidirectional"), "bidirectional", Boolean.valueOf(false)); ++ ++ if (var11.isEmpty()) ++ { ++ throw new JsonParseException("Invalid language->\'" + var8 + "\'->region: empty value"); ++ } ++ ++ if (var12.isEmpty()) ++ { ++ throw new JsonParseException("Invalid language->\'" + var8 + "\'->name: empty value"); ++ } ++ } ++ while (var5.add(new Language(var8, var11, var12, var13))); ++ ++ throw new JsonParseException("Duplicate language->\'" + var8 + "\' defined"); ++ } ++ ++ /** ++ * The name of this section type as it appears in JSON. ++ */ ++ public String getSectionName() ++ { ++ return "language"; ++ } ++ ++ public Object deserialize(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) ++ { ++ return this.func_135020_a(par1JsonElement, par2Type, par3JsonDeserializationContext); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- LanServer.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,35 ---- ++ package net.minecraft.src; ++ ++ public class LanServer ++ { ++ private String lanServerMotd; ++ private String lanServerIpPort; ++ ++ /** Last time this LanServer was seen. */ ++ private long timeLastSeen; ++ ++ public LanServer(String par1Str, String par2Str) ++ { ++ this.lanServerMotd = par1Str; ++ this.lanServerIpPort = par2Str; ++ this.timeLastSeen = Minecraft.getSystemTime(); ++ } ++ ++ public String getServerMotd() ++ { ++ return this.lanServerMotd; ++ } ++ ++ public String getServerIpPort() ++ { ++ return this.lanServerIpPort; ++ } ++ ++ /** ++ * Updates the time this LanServer was last seen. ++ */ ++ public void updateLastSeen() ++ { ++ this.timeLastSeen = Minecraft.getSystemTime(); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- LanServerList.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,59 ---- ++ package net.minecraft.src; ++ ++ import java.net.InetAddress; ++ import java.util.ArrayList; ++ import java.util.Collections; ++ import java.util.Iterator; ++ import java.util.List; ++ ++ public class LanServerList ++ { ++ private ArrayList listOfLanServers = new ArrayList(); ++ boolean wasUpdated; ++ ++ public synchronized boolean getWasUpdated() ++ { ++ return this.wasUpdated; ++ } ++ ++ public synchronized void setWasNotUpdated() ++ { ++ this.wasUpdated = false; ++ } ++ ++ public synchronized List getLanServers() ++ { ++ return Collections.unmodifiableList(this.listOfLanServers); ++ } ++ ++ public synchronized void func_77551_a(String par1Str, InetAddress par2InetAddress) ++ { ++ String var3 = ThreadLanServerPing.getMotdFromPingResponse(par1Str); ++ String var4 = ThreadLanServerPing.getAdFromPingResponse(par1Str); ++ ++ if (var4 != null) ++ { ++ var4 = par2InetAddress.getHostAddress() + ":" + var4; ++ boolean var5 = false; ++ Iterator var6 = this.listOfLanServers.iterator(); ++ ++ while (var6.hasNext()) ++ { ++ LanServer var7 = (LanServer)var6.next(); ++ ++ if (var7.getServerIpPort().equals(var4)) ++ { ++ var7.updateLastSeen(); ++ var5 = true; ++ break; ++ } ++ } ++ ++ if (!var5) ++ { ++ this.listOfLanServers.add(new LanServer(var3, var4)); ++ this.wasUpdated = true; ++ } ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- LayeredTexture.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,55 ---- ++ package net.minecraft.src; ++ ++ import com.google.common.collect.Lists; ++ import java.awt.image.BufferedImage; ++ import java.awt.image.ImageObserver; ++ import java.io.IOException; ++ import java.io.InputStream; ++ 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 = Lists.newArrayList(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 ResourceLocation(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); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- LoadingScreenRenderer.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,167 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.Display; ++ import org.lwjgl.opengl.GL11; ++ ++ public class LoadingScreenRenderer implements IProgressUpdate ++ { ++ private String field_73727_a = ""; ++ ++ /** A reference to the Minecraft object. */ ++ private Minecraft mc; ++ ++ /** ++ * The text currently displayed (i.e. the argument to the last call to printText or func_73722_d) ++ */ ++ private String currentlyDisplayedText = ""; ++ private long field_73723_d = Minecraft.getSystemTime(); ++ private boolean field_73724_e; ++ ++ public LoadingScreenRenderer(Minecraft par1Minecraft) ++ { ++ this.mc = par1Minecraft; ++ } ++ ++ /** ++ * this string, followed by "working..." and then the "% complete" are the 3 lines shown. This resets progress to 0, ++ * and the WorkingString to "working...". ++ */ ++ public void resetProgressAndMessage(String par1Str) ++ { ++ this.field_73724_e = false; ++ this.func_73722_d(par1Str); ++ } ++ ++ /** ++ * "Saving level", or the loading,or downloading equivelent ++ */ ++ public void displayProgressMessage(String par1Str) ++ { ++ this.field_73724_e = true; ++ this.func_73722_d(par1Str); ++ } ++ ++ public void func_73722_d(String par1Str) ++ { ++ this.currentlyDisplayedText = par1Str; ++ ++ if (!this.mc.running) ++ { ++ if (!this.field_73724_e) ++ { ++ throw new MinecraftError(); ++ } ++ } ++ else ++ { ++ ScaledResolution var2 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); ++ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); ++ GL11.glMatrixMode(GL11.GL_PROJECTION); ++ GL11.glLoadIdentity(); ++ GL11.glOrtho(0.0D, var2.getScaledWidth_double(), var2.getScaledHeight_double(), 0.0D, 100.0D, 300.0D); ++ GL11.glMatrixMode(GL11.GL_MODELVIEW); ++ GL11.glLoadIdentity(); ++ GL11.glTranslatef(0.0F, 0.0F, -200.0F); ++ } ++ } ++ ++ /** ++ * This is called with "Working..." by resetProgressAndMessage ++ */ ++ public void resetProgresAndWorkingMessage(String par1Str) ++ { ++ if (!this.mc.running) ++ { ++ if (!this.field_73724_e) ++ { ++ throw new MinecraftError(); ++ } ++ } ++ else ++ { ++ this.field_73723_d = 0L; ++ this.field_73727_a = par1Str; ++ this.setLoadingProgress(-1); ++ this.field_73723_d = 0L; ++ } ++ } ++ ++ /** ++ * Updates the progress bar on the loading screen to the specified amount. Args: loadProgress ++ */ ++ public void setLoadingProgress(int par1) ++ { ++ if (!this.mc.running) ++ { ++ if (!this.field_73724_e) ++ { ++ throw new MinecraftError(); ++ } ++ } ++ else ++ { ++ long var2 = Minecraft.getSystemTime(); ++ ++ if (var2 - this.field_73723_d >= 100L) ++ { ++ this.field_73723_d = var2; ++ ScaledResolution var4 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); ++ int var5 = var4.getScaledWidth(); ++ int var6 = var4.getScaledHeight(); ++ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); ++ GL11.glMatrixMode(GL11.GL_PROJECTION); ++ GL11.glLoadIdentity(); ++ GL11.glOrtho(0.0D, var4.getScaledWidth_double(), var4.getScaledHeight_double(), 0.0D, 100.0D, 300.0D); ++ GL11.glMatrixMode(GL11.GL_MODELVIEW); ++ GL11.glLoadIdentity(); ++ 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); ++ float var8 = 32.0F; ++ var7.startDrawingQuads(); ++ var7.setColorOpaque_I(4210752); ++ var7.addVertexWithUV(0.0D, (double)var6, 0.0D, 0.0D, (double)((float)var6 / var8)); ++ var7.addVertexWithUV((double)var5, (double)var6, 0.0D, (double)((float)var5 / var8), (double)((float)var6 / var8)); ++ var7.addVertexWithUV((double)var5, 0.0D, 0.0D, (double)((float)var5 / var8), 0.0D); ++ var7.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D); ++ var7.draw(); ++ ++ if (par1 >= 0) ++ { ++ byte var9 = 100; ++ byte var10 = 2; ++ int var11 = var5 / 2 - var9 / 2; ++ int var12 = var6 / 2 + 16; ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ var7.startDrawingQuads(); ++ var7.setColorOpaque_I(8421504); ++ var7.addVertex((double)var11, (double)var12, 0.0D); ++ var7.addVertex((double)var11, (double)(var12 + var10), 0.0D); ++ var7.addVertex((double)(var11 + var9), (double)(var12 + var10), 0.0D); ++ var7.addVertex((double)(var11 + var9), (double)var12, 0.0D); ++ var7.setColorOpaque_I(8454016); ++ var7.addVertex((double)var11, (double)var12, 0.0D); ++ var7.addVertex((double)var11, (double)(var12 + var10), 0.0D); ++ var7.addVertex((double)(var11 + par1), (double)(var12 + var10), 0.0D); ++ var7.addVertex((double)(var11 + par1), (double)var12, 0.0D); ++ var7.draw(); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ } ++ ++ this.mc.fontRenderer.drawStringWithShadow(this.currentlyDisplayedText, (var5 - this.mc.fontRenderer.getStringWidth(this.currentlyDisplayedText)) / 2, var6 / 2 - 4 - 16, 16777215); ++ this.mc.fontRenderer.drawStringWithShadow(this.field_73727_a, (var5 - this.mc.fontRenderer.getStringWidth(this.field_73727_a)) / 2, var6 / 2 - 4 + 8, 16777215); ++ Display.update(); ++ ++ try ++ { ++ Thread.yield(); ++ } ++ catch (Exception var13) ++ { ++ ; ++ } ++ } ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- Locale.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,150 ---- ++ package net.minecraft.src; ++ ++ import com.google.common.base.Splitter; ++ import com.google.common.collect.Iterables; ++ import com.google.common.collect.Maps; ++ import java.io.IOException; ++ import java.io.InputStream; ++ import java.util.IllegalFormatException; ++ import java.util.Iterator; ++ import java.util.List; ++ import java.util.Map; ++ import java.util.regex.Pattern; ++ import org.apache.commons.io.Charsets; ++ import org.apache.commons.io.IOUtils; ++ ++ public class Locale ++ { ++ /** Splits on "=" */ ++ private static final Splitter splitter = Splitter.on('=').limit(2); ++ private static final Pattern field_135031_c = Pattern.compile("%(\\d+\\$)?[\\d\\.]*[df]"); ++ Map field_135032_a = Maps.newHashMap(); ++ private boolean field_135029_d; ++ ++ /** ++ * par2 is a list of languages. For each language $L and domain $D, attempts to load the resource $D:lang/$L.lang ++ */ ++ public synchronized void loadLocaleDataFiles(ResourceManager par1ResourceManager, List par2List) ++ { ++ this.field_135032_a.clear(); ++ Iterator var3 = par2List.iterator(); ++ ++ while (var3.hasNext()) ++ { ++ String var4 = (String)var3.next(); ++ String var5 = String.format("lang/%s.lang", new Object[] {var4}); ++ Iterator var6 = par1ResourceManager.getResourceDomains().iterator(); ++ ++ while (var6.hasNext()) ++ { ++ String var7 = (String)var6.next(); ++ ++ try ++ { ++ this.loadLocaleData(par1ResourceManager.getAllResources(new ResourceLocation(var7, var5))); ++ } ++ catch (IOException var9) ++ { ++ ; ++ } ++ } ++ } ++ ++ this.checkUnicode(); ++ } ++ ++ public boolean isUnicode() ++ { ++ return this.field_135029_d; ++ } ++ ++ private void checkUnicode() ++ { ++ this.field_135029_d = false; ++ Iterator var1 = this.field_135032_a.values().iterator(); ++ ++ while (var1.hasNext()) ++ { ++ String var2 = (String)var1.next(); ++ ++ for (int var3 = 0; var3 < var2.length(); ++var3) ++ { ++ if (var2.charAt(var3) >= 256) ++ { ++ this.field_135029_d = true; ++ break; ++ } ++ } ++ } ++ } ++ ++ /** ++ * par1 is a list of Resources ++ */ ++ private void loadLocaleData(List par1List) throws IOException ++ { ++ Iterator var2 = par1List.iterator(); ++ ++ while (var2.hasNext()) ++ { ++ Resource var3 = (Resource)var2.next(); ++ this.loadLocaleData(var3.getInputStream()); ++ } ++ } ++ ++ private void loadLocaleData(InputStream par1InputStream) throws IOException ++ { ++ Iterator var2 = IOUtils.readLines(par1InputStream, Charsets.UTF_8).iterator(); ++ ++ while (var2.hasNext()) ++ { ++ String var3 = (String)var2.next(); ++ ++ if (!var3.isEmpty() && var3.charAt(0) != 35) ++ { ++ String[] var4 = (String[])Iterables.toArray(splitter.split(var3), String.class); ++ ++ if (var4 != null && var4.length == 2) ++ { ++ String var5 = var4[0]; ++ String var6 = field_135031_c.matcher(var4[1]).replaceAll("%$1s"); ++ this.field_135032_a.put(var5, var6); ++ } ++ } ++ } ++ } ++ ++ /** ++ * Returns the translation, or the key itself if the key could not be translated. ++ */ ++ private String translateKeyPrivate(String par1Str) ++ { ++ String var2 = (String)this.field_135032_a.get(par1Str); ++ return var2 == null ? par1Str : var2; ++ } ++ ++ /** ++ * Returns the translation, or the key itself if the key could not be translated. ++ */ ++ public String translateKey(String par1Str) ++ { ++ return this.translateKeyPrivate(par1Str); ++ } ++ ++ /** ++ * Calls String.format(translateKey(key), params) ++ */ ++ public String formatMessage(String par1Str, Object[] par2ArrayOfObj) ++ { ++ String var3 = this.translateKeyPrivate(par1Str); ++ ++ try ++ { ++ return String.format(var3, par2ArrayOfObj); ++ } ++ catch (IllegalFormatException var5) ++ { ++ return "Format error: " + var3; ++ } ++ } ++ } +*** LogAgent.java Sat Feb 5 04:13:14 2022 +--- LogAgent.java Sat Feb 5 04:12:35 2022 +*************** +*** 52,77 **** + { + this.serverLogger.log(Level.WARNING, "Failed to log " + this.loggerName + " to " + this.logFile, var5); + } + } + +- public Logger func_120013_a() +- { +- return this.serverLogger; +- } +- +- /** +- * Logs plain text message. +- */ + public void logInfo(String par1Str) + { + this.serverLogger.log(Level.INFO, par1Str); + } + +- /** +- * Logs text as warning. +- */ + public void logWarning(String par1Str) + { + this.serverLogger.log(Level.WARNING, par1Str); + } + +--- 52,66 ---- +*************** +*** 91,100 **** +--- 80,94 ---- + } + + public void logSevereException(String par1Str, Throwable par2Throwable) + { + this.serverLogger.log(Level.SEVERE, par1Str, par2Throwable); ++ } ++ ++ public void logFine(String par1Str) ++ { ++ this.serverLogger.log(Level.FINE, par1Str); + } + + static String func_98237_a(LogAgent par0LogAgent) + { + return par0LogAgent.loggerPrefix; +*** LogAgentEmptyAnon.java Sat Feb 5 04:13:14 2022 +--- LogAgentEmptyAnon.java Sat Feb 5 04:12:35 2022 +*** LogFormatter.java Sat Feb 5 04:13:14 2022 +--- LogFormatter.java Sat Feb 5 04:12:35 2022 +*** LongHashMap.java Sat Feb 5 04:13:14 2022 +--- LongHashMap.java Sat Feb 5 04:12:35 2022 +*** LongHashMapEntry.java Sat Feb 5 04:13:14 2022 +--- LongHashMapEntry.java Sat Feb 5 04:12:35 2022 +*** LowerStringMap.java Sat Feb 5 04:13:14 2022 +--- LowerStringMap.java Sat Feb 5 04:12:35 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- MainProxyAuthenticator.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,22 ---- ++ package net.minecraft.src; ++ ++ import java.net.Authenticator; ++ import java.net.PasswordAuthentication; ++ ++ public final class MainProxyAuthenticator extends Authenticator ++ { ++ final String field_111237_a; ++ ++ final String field_111236_b; ++ ++ public MainProxyAuthenticator(String par1Str, String par2Str) ++ { ++ this.field_111237_a = par1Str; ++ this.field_111236_b = par2Str; ++ } ++ ++ protected PasswordAuthentication getPasswordAuthentication() ++ { ++ return new PasswordAuthentication(this.field_111237_a, this.field_111236_b.toCharArray()); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- MainShutdownHook.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,9 ---- ++ package net.minecraft.src; ++ ++ public final class MainShutdownHook extends Thread ++ { ++ public void run() ++ { ++ Minecraft.stopIntegratedServer(); ++ } ++ } +*** MapColor.java Sat Feb 5 04:13:14 2022 +--- MapColor.java Sat Feb 5 04:12:35 2022 +*** MapCoord.java Sat Feb 5 04:13:14 2022 +--- MapCoord.java Sat Feb 5 04:12:35 2022 +*** MapData.java Sat Feb 5 04:13:14 2022 +--- MapData.java Sat Feb 5 04:12:35 2022 +*************** +*** 228,237 **** +--- 228,275 ---- + var5.field_76210_c[par1] = par3; + } + } + } + ++ /** ++ * Updates the client's map with information from other players in MP ++ */ ++ public void updateMPMapData(byte[] par1ArrayOfByte) ++ { ++ int var2; ++ ++ if (par1ArrayOfByte[0] == 0) ++ { ++ var2 = par1ArrayOfByte[1] & 255; ++ int var3 = par1ArrayOfByte[2] & 255; ++ ++ for (int var4 = 0; var4 < par1ArrayOfByte.length - 3; ++var4) ++ { ++ this.colors[(var4 + var3) * 128 + var2] = par1ArrayOfByte[var4 + 3]; ++ } ++ ++ this.markDirty(); ++ } ++ else if (par1ArrayOfByte[0] == 1) ++ { ++ this.playersVisibleOnMap.clear(); ++ ++ for (var2 = 0; var2 < (par1ArrayOfByte.length - 1) / 3; ++var2) ++ { ++ byte var7 = (byte)(par1ArrayOfByte[var2 * 3 + 1] >> 4); ++ byte var8 = par1ArrayOfByte[var2 * 3 + 2]; ++ byte var5 = par1ArrayOfByte[var2 * 3 + 3]; ++ byte var6 = (byte)(par1ArrayOfByte[var2 * 3 + 1] & 15); ++ this.playersVisibleOnMap.put("icon-" + var2, new MapCoord(this, var7, var8, var5, var6)); ++ } ++ } ++ else if (par1ArrayOfByte[0] == 2) ++ { ++ this.scale = par1ArrayOfByte[1]; ++ } ++ } ++ + public MapInfo func_82568_a(EntityPlayer par1EntityPlayer) + { + MapInfo var2 = (MapInfo)this.playersHashMap.get(par1EntityPlayer); + + if (var2 == null) +*** MapGenBase.java Sat Feb 5 04:13:14 2022 +--- MapGenBase.java Sat Feb 5 04:12:35 2022 +*** MapGenCaves.java Sat Feb 5 04:13:14 2022 +--- MapGenCaves.java Sat Feb 5 04:12:35 2022 +*** MapGenCavesHell.java Sat Feb 5 04:13:14 2022 +--- MapGenCavesHell.java Sat Feb 5 04:12:35 2022 +*** MapGenMineshaft.java Sat Feb 5 04:13:14 2022 +--- MapGenMineshaft.java Sat Feb 5 04:12:35 2022 +*** MapGenNetherBridge.java Sat Feb 5 04:13:14 2022 +--- MapGenNetherBridge.java Sat Feb 5 04:12:35 2022 +*** MapGenRavine.java Sat Feb 5 04:13:14 2022 +--- MapGenRavine.java Sat Feb 5 04:12:35 2022 +*** MapGenScatteredFeature.java Sat Feb 5 04:13:14 2022 +--- MapGenScatteredFeature.java Sat Feb 5 04:12:35 2022 +*** MapGenStronghold.java Sat Feb 5 04:13:14 2022 +--- MapGenStronghold.java Sat Feb 5 04:12:35 2022 +*** MapGenStructure.java Sat Feb 5 04:13:14 2022 +--- MapGenStructure.java Sat Feb 5 04:12:35 2022 +*** MapGenStructureData.java Sat Feb 5 04:13:14 2022 +--- MapGenStructureData.java Sat Feb 5 04:12:35 2022 +*** MapGenStructureIO.java Sat Feb 5 04:13:14 2022 +--- MapGenStructureIO.java Sat Feb 5 04:12:35 2022 +*** MapGenVillage.java Sat Feb 5 04:13:14 2022 +--- MapGenVillage.java Sat Feb 5 04:12:35 2022 +*** MapInfo.java Sat Feb 5 04:13:14 2022 +--- MapInfo.java Sat Feb 5 04:12:35 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- MapItemRenderer.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,106 ---- ++ package net.minecraft.src; ++ ++ import java.util.Iterator; ++ import org.lwjgl.opengl.GL11; ++ ++ public class MapItemRenderer ++ { ++ private static final ResourceLocation field_111277_a = new ResourceLocation("textures/map/map_icons.png"); ++ private final DynamicTexture bufferedImage; ++ private int[] intArray = new int[16384]; ++ private GameSettings gameSettings; ++ private final ResourceLocation field_111276_e; ++ ++ public MapItemRenderer(GameSettings par1GameSettings, TextureManager par2TextureManager) ++ { ++ this.gameSettings = par1GameSettings; ++ this.bufferedImage = new DynamicTexture(128, 128); ++ this.field_111276_e = par2TextureManager.getDynamicTextureLocation("map", this.bufferedImage); ++ this.intArray = this.bufferedImage.getTextureData(); ++ ++ for (int var4 = 0; var4 < this.intArray.length; ++var4) ++ { ++ this.intArray[var4] = 0; ++ } ++ } ++ ++ public void renderMap(EntityPlayer par1EntityPlayer, TextureManager par2TextureManager, MapData par3MapData) ++ { ++ for (int var4 = 0; var4 < 16384; ++var4) ++ { ++ byte var5 = par3MapData.colors[var4]; ++ ++ if (var5 / 4 == 0) ++ { ++ this.intArray[var4] = (var4 + var4 / 128 & 1) * 8 + 16 << 24; ++ } ++ else ++ { ++ int var6 = MapColor.mapColorArray[var5 / 4].colorValue; ++ int var7 = var5 & 3; ++ short var8 = 220; ++ ++ if (var7 == 2) ++ { ++ var8 = 255; ++ } ++ ++ if (var7 == 0) ++ { ++ var8 = 180; ++ } ++ ++ int var9 = (var6 >> 16 & 255) * var8 / 255; ++ int var10 = (var6 >> 8 & 255) * var8 / 255; ++ int var11 = (var6 & 255) * var8 / 255; ++ this.intArray[var4] = -16777216 | var9 << 16 | var10 << 8 | var11; ++ } ++ } ++ ++ this.bufferedImage.updateDynamicTexture(); ++ byte var15 = 0; ++ byte var16 = 0; ++ Tessellator var17 = Tessellator.instance; ++ float var18 = 0.0F; ++ par2TextureManager.bindTexture(this.field_111276_e); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ GL11.glDisable(GL11.GL_ALPHA_TEST); ++ var17.startDrawingQuads(); ++ var17.addVertexWithUV((double)((float)(var15 + 0) + var18), (double)((float)(var16 + 128) - var18), -0.009999999776482582D, 0.0D, 1.0D); ++ var17.addVertexWithUV((double)((float)(var15 + 128) - var18), (double)((float)(var16 + 128) - var18), -0.009999999776482582D, 1.0D, 1.0D); ++ var17.addVertexWithUV((double)((float)(var15 + 128) - var18), (double)((float)(var16 + 0) + var18), -0.009999999776482582D, 1.0D, 0.0D); ++ var17.addVertexWithUV((double)((float)(var15 + 0) + var18), (double)((float)(var16 + 0) + var18), -0.009999999776482582D, 0.0D, 0.0D); ++ var17.draw(); ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ GL11.glDisable(GL11.GL_BLEND); ++ par2TextureManager.bindTexture(field_111277_a); ++ int var19 = 0; ++ ++ for (Iterator var20 = par3MapData.playersVisibleOnMap.values().iterator(); var20.hasNext(); ++var19) ++ { ++ MapCoord var21 = (MapCoord)var20.next(); ++ GL11.glPushMatrix(); ++ GL11.glTranslatef((float)var15 + (float)var21.centerX / 2.0F + 64.0F, (float)var16 + (float)var21.centerZ / 2.0F + 64.0F, -0.02F); ++ GL11.glRotatef((float)(var21.iconRotation * 360) / 16.0F, 0.0F, 0.0F, 1.0F); ++ GL11.glScalef(4.0F, 4.0F, 3.0F); ++ GL11.glTranslatef(-0.125F, 0.125F, 0.0F); ++ float var22 = (float)(var21.iconSize % 4 + 0) / 4.0F; ++ float var12 = (float)(var21.iconSize / 4 + 0) / 4.0F; ++ float var13 = (float)(var21.iconSize % 4 + 1) / 4.0F; ++ float var14 = (float)(var21.iconSize / 4 + 1) / 4.0F; ++ var17.startDrawingQuads(); ++ var17.addVertexWithUV(-1.0D, 1.0D, (double)((float)var19 * 0.001F), (double)var22, (double)var12); ++ var17.addVertexWithUV(1.0D, 1.0D, (double)((float)var19 * 0.001F), (double)var13, (double)var12); ++ var17.addVertexWithUV(1.0D, -1.0D, (double)((float)var19 * 0.001F), (double)var13, (double)var14); ++ var17.addVertexWithUV(-1.0D, -1.0D, (double)((float)var19 * 0.001F), (double)var22, (double)var14); ++ var17.draw(); ++ GL11.glPopMatrix(); ++ } ++ ++ GL11.glPushMatrix(); ++ GL11.glTranslatef(0.0F, 0.0F, -0.04F); ++ GL11.glScalef(1.0F, 1.0F, 1.0F); ++ GL11.glPopMatrix(); ++ } ++ } +*** MapStorage.java Sat Feb 5 04:13:14 2022 +--- MapStorage.java Sat Feb 5 04:12:35 2022 +*** Material.java Sat Feb 5 04:13:14 2022 +--- Material.java Sat Feb 5 04:12:35 2022 +*** MaterialLiquid.java Sat Feb 5 04:13:14 2022 +--- MaterialLiquid.java Sat Feb 5 04:12:35 2022 +*** MaterialLogic.java Sat Feb 5 04:13:14 2022 +--- MaterialLogic.java Sat Feb 5 04:12:35 2022 +*** MaterialPortal.java Sat Feb 5 04:13:14 2022 +--- MaterialPortal.java Sat Feb 5 04:12:35 2022 +*** MaterialTransparent.java Sat Feb 5 04:13:14 2022 +--- MaterialTransparent.java Sat Feb 5 04:12:35 2022 +*** MaterialWeb.java Sat Feb 5 04:13:14 2022 +--- MaterialWeb.java Sat Feb 5 04:12:35 2022 +*** MathHelper.java Sat Feb 5 04:13:14 2022 +--- MathHelper.java Sat Feb 5 04:12:35 2022 +*************** +*** 43,52 **** +--- 43,60 ---- + int var1 = (int)par0; + return par0 < (float)var1 ? var1 - 1 : var1; + } + + /** ++ * returns par0 cast as an int, and no greater than Integer.MAX_VALUE-1024 ++ */ ++ public static int truncateDoubleToInt(double par0) ++ { ++ return (int)(par0 + 1024.0D) - 1024; ++ } ++ ++ /** + * Returns the greatest integer less than or equal to the double argument + */ + public static int floor_double(double par0) + { + int var2 = (int)par0; +*************** +*** 119,128 **** +--- 127,152 ---- + { + par2 = -par2; + } + + return par0 > par2 ? par0 : par2; ++ } ++ ++ /** ++ * Buckets an integer with specifed bucket sizes. Args: i, bucketSize ++ */ ++ public static int bucketInt(int par0, int par1) ++ { ++ return par0 < 0 ? -((-par0 - 1) / par1) - 1 : par0 / par1; ++ } ++ ++ /** ++ * Tests if a string is null or of length zero ++ */ ++ public static boolean stringNullOrLengthZero(String par0Str) ++ { ++ return par0Str == null || par0Str.length() == 0; + } + + public static int getRandomIntegerInRange(Random par0Random, int par1, int par2) + { + return par1 >= par2 ? par1 : par0Random.nextInt(par2 - par1 + 1) + par1; +*** /dev/null Thu Jan 1 01:00:00 1970 +--- McoClient.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,265 ---- ++ package net.minecraft.src; ++ ++ import java.io.IOException; ++ import java.io.UnsupportedEncodingException; ++ import java.net.URLEncoder; ++ import java.util.HashMap; ++ import java.util.Iterator; ++ import java.util.Map.Entry; ++ ++ public class McoClient ++ { ++ private final String field_96390_a; ++ private final String field_100007_c; ++ private static String field_96388_b = "https://mcoapi.minecraft.net/"; ++ ++ public McoClient(Session par1Session) ++ { ++ this.field_96390_a = par1Session.getSessionID(); ++ this.field_100007_c = par1Session.getUsername(); ++ } ++ ++ public ValueObjectList func_96382_a() throws ExceptionMcoService, IOException ++ { ++ String var1 = this.func_96377_a(Request.func_96358_a(field_96388_b + "worlds")); ++ return ValueObjectList.func_98161_a(var1); ++ } ++ ++ public McoServer func_98176_a(long par1) throws ExceptionMcoService, IOException ++ { ++ String var3 = this.func_96377_a(Request.func_96358_a(field_96388_b + "worlds" + "/$ID".replace("$ID", String.valueOf(par1)))); ++ return McoServer.func_98165_c(var3); ++ } ++ ++ public McoServerAddress func_96374_a(long par1) throws ExceptionMcoService, IOException ++ { ++ String var3 = field_96388_b + "worlds" + "/$ID/join".replace("$ID", "" + par1); ++ String var4 = this.func_96377_a(Request.func_96358_a(var3)); ++ return McoServerAddress.func_98162_a(var4); ++ } ++ ++ public void func_96386_a(String par1Str, String par2Str, String par3Str, String par4Str) throws ExceptionMcoService, UnsupportedEncodingException ++ { ++ StringBuilder var5 = new StringBuilder(); ++ var5.append(field_96388_b).append("worlds").append("/$NAME/$LOCATION_ID".replace("$NAME", this.func_96380_a(par1Str))); ++ HashMap var6 = new HashMap(); ++ ++ if (par2Str != null && !par2Str.trim().equals("")) ++ { ++ var6.put("motd", par2Str); ++ } ++ ++ if (par3Str != null && !par3Str.equals("")) ++ { ++ var6.put("seed", par3Str); ++ } ++ ++ var6.put("template", par4Str); ++ ++ if (!var6.isEmpty()) ++ { ++ boolean var7 = true; ++ Entry var9; ++ ++ for (Iterator var8 = var6.entrySet().iterator(); var8.hasNext(); var5.append((String)var9.getKey()).append("=").append(this.func_96380_a((String)var9.getValue()))) ++ { ++ var9 = (Entry)var8.next(); ++ ++ if (var7) ++ { ++ var5.append("?"); ++ var7 = false; ++ } ++ else ++ { ++ var5.append("&"); ++ } ++ } ++ } ++ ++ this.func_96377_a(Request.func_104064_a(var5.toString(), "", 5000, 30000)); ++ } ++ ++ public Boolean func_96375_b() throws ExceptionMcoService, IOException ++ { ++ String var1 = field_96388_b + "mco" + "/available"; ++ String var2 = this.func_96377_a(Request.func_96358_a(var1)); ++ return Boolean.valueOf(var2); ++ } ++ ++ public Boolean func_140054_c() throws ExceptionMcoService, IOException ++ { ++ String var1 = field_96388_b + "mco" + "/client/outdated"; ++ String var2 = this.func_96377_a(Request.func_96358_a(var1)); ++ return Boolean.valueOf(var2); ++ } ++ ++ public int func_96379_c() throws ExceptionMcoService ++ { ++ String var1 = field_96388_b + "payments" + "/unused"; ++ String var2 = this.func_96377_a(Request.func_96358_a(var1)); ++ return Integer.valueOf(var2).intValue(); ++ } ++ ++ public void func_96381_a(long par1, String par3Str) throws ExceptionMcoService ++ { ++ String var4 = field_96388_b + "invites" + "/$WORLD_ID/invite/$USER_NAME".replace("$WORLD_ID", String.valueOf(par1)).replace("$USER_NAME", par3Str); ++ this.func_96377_a(Request.func_96355_b(var4)); ++ } ++ ++ public void func_140055_c(long par1) throws ExceptionMcoService ++ { ++ String var3 = field_96388_b + "invites" + "/$WORLD_ID".replace("$WORLD_ID", String.valueOf(par1)); ++ this.func_96377_a(Request.func_96355_b(var3)); ++ } ++ ++ public McoServer func_96387_b(long par1, String par3Str) throws ExceptionMcoService, IOException ++ { ++ String var4 = field_96388_b + "invites" + "/$WORLD_ID/invite/$USER_NAME".replace("$WORLD_ID", String.valueOf(par1)).replace("$USER_NAME", par3Str); ++ String var5 = this.func_96377_a(Request.func_96361_b(var4, "")); ++ return McoServer.func_98165_c(var5); ++ } ++ ++ public BackupList func_111232_c(long par1) throws ExceptionMcoService ++ { ++ String var3 = field_96388_b + "worlds" + "/$WORLD_ID/backups".replace("$WORLD_ID", String.valueOf(par1)); ++ String var4 = this.func_96377_a(Request.func_96358_a(var3)); ++ return BackupList.func_111222_a(var4); ++ } ++ ++ public void func_96384_a(long par1, String par3Str, String par4Str, int par5, int par6) throws ExceptionMcoService, UnsupportedEncodingException ++ { ++ StringBuilder var7 = new StringBuilder(); ++ var7.append(field_96388_b).append("worlds").append("/$WORLD_ID/$NAME".replace("$WORLD_ID", String.valueOf(par1)).replace("$NAME", this.func_96380_a(par3Str))); ++ ++ if (par4Str != null && !par4Str.trim().equals("")) ++ { ++ var7.append("?motd=").append(this.func_96380_a(par4Str)); ++ } ++ else ++ { ++ var7.append("?motd="); ++ } ++ ++ var7.append("&difficulty=").append(par5).append("&gameMode=").append(par6); ++ this.func_96377_a(Request.func_96363_c(var7.toString(), "")); ++ } ++ ++ public void func_111235_c(long par1, String par3Str) throws ExceptionMcoService ++ { ++ String var4 = field_96388_b + "worlds" + "/$WORLD_ID/backups".replace("$WORLD_ID", String.valueOf(par1)) + "?backupId=" + par3Str; ++ this.func_96377_a(Request.func_96363_c(var4, "")); ++ } ++ ++ public WorldTemplateList func_111231_d() throws ExceptionMcoService ++ { ++ String var1 = field_96388_b + "worlds" + "/templates"; ++ String var2 = this.func_96377_a(Request.func_96358_a(var1)); ++ return WorldTemplateList.func_110735_a(var2); ++ } ++ ++ public Boolean func_96383_b(long par1) throws ExceptionMcoService, IOException ++ { ++ String var3 = field_96388_b + "worlds" + "/$WORLD_ID/open".replace("$WORLD_ID", String.valueOf(par1)); ++ String var4 = this.func_96377_a(Request.func_96363_c(var3, "")); ++ return Boolean.valueOf(var4); ++ } ++ ++ public Boolean func_96378_c(long par1) throws ExceptionMcoService, IOException ++ { ++ String var3 = field_96388_b + "worlds" + "/$WORLD_ID/close".replace("$WORLD_ID", String.valueOf(par1)); ++ String var4 = this.func_96377_a(Request.func_96363_c(var3, "")); ++ return Boolean.valueOf(var4); ++ } ++ ++ public Boolean func_96376_d(long par1, String par3Str) throws ExceptionMcoService, UnsupportedEncodingException ++ { ++ StringBuilder var4 = new StringBuilder(); ++ var4.append(field_96388_b).append("worlds").append("/$WORLD_ID/reset".replace("$WORLD_ID", String.valueOf(par1))); ++ ++ if (par3Str != null && par3Str.length() > 0) ++ { ++ var4.append("?seed=").append(this.func_96380_a(par3Str)); ++ } ++ ++ String var5 = this.func_96377_a(Request.func_96353_a(var4.toString(), "", 30000, 80000)); ++ return Boolean.valueOf(var5); ++ } ++ ++ public Boolean func_111233_e(long par1, String par3Str) throws ExceptionMcoService ++ { ++ StringBuilder var4 = new StringBuilder(); ++ var4.append(field_96388_b).append("worlds").append("/$WORLD_ID/reset".replace("$WORLD_ID", String.valueOf(par1))); ++ ++ if (par3Str != null) ++ { ++ var4.append("?template=").append(par3Str); ++ } ++ ++ String var5 = this.func_96377_a(Request.func_96353_a(var4.toString(), "", 30000, 80000)); ++ return Boolean.valueOf(var5); ++ } ++ ++ public ValueObjectSubscription func_98177_f(long par1) throws ExceptionMcoService, IOException ++ { ++ String var3 = this.func_96377_a(Request.func_96358_a(field_96388_b + "subscriptions" + "/$WORLD_ID".replace("$WORLD_ID", String.valueOf(par1)))); ++ return ValueObjectSubscription.func_98169_a(var3); ++ } ++ ++ public int func_130106_e() throws ExceptionMcoService ++ { ++ String var1 = this.func_96377_a(Request.func_96358_a(field_96388_b + "invites" + "/count/pending")); ++ return Integer.parseInt(var1); ++ } ++ ++ public PendingInvitesList func_130108_f() throws ExceptionMcoService ++ { ++ String var1 = this.func_96377_a(Request.func_96358_a(field_96388_b + "invites" + "/pending")); ++ return PendingInvitesList.func_130095_a(var1); ++ } ++ ++ public void func_130107_a(String par1Str) throws ExceptionMcoService ++ { ++ this.func_96377_a(Request.func_96363_c(field_96388_b + "invites" + "/accept/$INVITATION_ID".replace("$INVITATION_ID", par1Str), "")); ++ } ++ ++ public void func_130109_b(String par1Str) throws ExceptionMcoService ++ { ++ this.func_96377_a(Request.func_96363_c(field_96388_b + "invites" + "/reject/$INVITATION_ID".replace("$INVITATION_ID", par1Str), "")); ++ } ++ ++ private String func_96380_a(String par1Str) throws UnsupportedEncodingException ++ { ++ return URLEncoder.encode(par1Str, "UTF-8"); ++ } ++ ++ private String func_96377_a(Request par1Request) throws ExceptionMcoService ++ { ++ par1Request.func_100006_a("sid", this.field_96390_a); ++ par1Request.func_100006_a("user", this.field_100007_c); ++ par1Request.func_100006_a("version", "1.6.4"); ++ ++ try ++ { ++ int var2 = par1Request.func_96362_a(); ++ ++ if (var2 == 503) ++ { ++ int var3 = par1Request.func_111221_b(); ++ throw new ExceptionRetryCall(var3); ++ } ++ else if (var2 >= 200 && var2 < 300) ++ { ++ return par1Request.func_96364_c(); ++ } ++ else ++ { ++ throw new ExceptionMcoService(par1Request.func_96362_a(), par1Request.func_96364_c(), par1Request.func_130110_g()); ++ } ++ } ++ catch (ExceptionMcoHttp var4) ++ { ++ throw new ExceptionMcoService(500, "Server not available!", -1); ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- McoServer.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,180 ---- ++ package net.minecraft.src; ++ ++ import argo.jdom.JdomParser; ++ import argo.jdom.JsonNode; ++ import argo.saj.InvalidSyntaxException; ++ import java.io.UnsupportedEncodingException; ++ import java.net.URLDecoder; ++ import java.util.ArrayList; ++ import java.util.Iterator; ++ import java.util.List; ++ import org.apache.commons.lang3.builder.EqualsBuilder; ++ import org.apache.commons.lang3.builder.HashCodeBuilder; ++ ++ public class McoServer ++ { ++ public long field_96408_a; ++ public String field_96406_b; ++ public String field_96407_c; ++ public String field_96404_d; ++ public String field_96405_e; ++ public List field_96402_f; ++ public String field_96403_g; ++ public boolean field_98166_h; ++ public int field_110729_i; ++ public int field_110728_j; ++ public int field_104063_i; ++ public int field_96415_h; ++ public String field_96414_k = ""; ++ public boolean field_96411_l; ++ public boolean field_102022_m; ++ public long field_96412_m; ++ private String field_96409_n; ++ private String field_96410_o; ++ ++ public String func_96397_a() ++ { ++ if (this.field_96409_n == null) ++ { ++ try ++ { ++ this.field_96409_n = URLDecoder.decode(this.field_96407_c, "UTF-8"); ++ } ++ catch (UnsupportedEncodingException var2) ++ { ++ this.field_96409_n = this.field_96407_c; ++ } ++ } ++ ++ return this.field_96409_n; ++ } ++ ++ public String func_96398_b() ++ { ++ if (this.field_96410_o == null) ++ { ++ try ++ { ++ this.field_96410_o = URLDecoder.decode(this.field_96406_b, "UTF-8"); ++ } ++ catch (UnsupportedEncodingException var2) ++ { ++ this.field_96410_o = this.field_96406_b; ++ } ++ } ++ ++ return this.field_96410_o; ++ } ++ ++ public void func_96399_a(String par1Str) ++ { ++ this.field_96406_b = par1Str; ++ this.field_96410_o = null; ++ } ++ ++ public void func_96400_b(String par1Str) ++ { ++ this.field_96407_c = par1Str; ++ this.field_96409_n = null; ++ } ++ ++ public void func_96401_a(McoServer par1McoServer) ++ { ++ this.field_96414_k = par1McoServer.field_96414_k; ++ this.field_96412_m = par1McoServer.field_96412_m; ++ this.field_96411_l = par1McoServer.field_96411_l; ++ this.field_96415_h = par1McoServer.field_96415_h; ++ this.field_102022_m = true; ++ } ++ ++ public static McoServer func_98163_a(JsonNode par0JsonNode) ++ { ++ McoServer var1 = new McoServer(); ++ ++ try ++ { ++ var1.field_96408_a = Long.parseLong(par0JsonNode.getNumberValue(new Object[] {"id"})); ++ var1.field_96406_b = par0JsonNode.getStringValue(new Object[] {"name"}); ++ var1.field_96407_c = par0JsonNode.getStringValue(new Object[] {"motd"}); ++ var1.field_96404_d = par0JsonNode.getStringValue(new Object[] {"state"}); ++ var1.field_96405_e = par0JsonNode.getStringValue(new Object[] {"owner"}); ++ ++ if (par0JsonNode.isArrayNode(new Object[] {"invited"})) ++ { ++ var1.field_96402_f = func_98164_a(par0JsonNode.getArrayNode(new Object[] {"invited"})); ++ } ++ else ++ { ++ var1.field_96402_f = new ArrayList(); ++ } ++ ++ var1.field_104063_i = Integer.parseInt(par0JsonNode.getNumberValue(new Object[] {"daysLeft"})); ++ var1.field_96403_g = par0JsonNode.getStringValue(new Object[] {"ip"}); ++ var1.field_98166_h = par0JsonNode.getBooleanValue(new Object[] {"expired"}).booleanValue(); ++ var1.field_110729_i = Integer.parseInt(par0JsonNode.getNumberValue(new Object[] {"difficulty"})); ++ var1.field_110728_j = Integer.parseInt(par0JsonNode.getNumberValue(new Object[] {"gameMode"})); ++ } ++ catch (IllegalArgumentException var3) ++ { ++ ; ++ } ++ ++ return var1; ++ } ++ ++ private static List func_98164_a(List par0List) ++ { ++ ArrayList var1 = new ArrayList(); ++ Iterator var2 = par0List.iterator(); ++ ++ while (var2.hasNext()) ++ { ++ JsonNode var3 = (JsonNode)var2.next(); ++ var1.add(var3.getStringValue(new Object[0])); ++ } ++ ++ return var1; ++ } ++ ++ public static McoServer func_98165_c(String par0Str) ++ { ++ McoServer var1 = new McoServer(); ++ ++ try ++ { ++ var1 = func_98163_a((new JdomParser()).parse(par0Str)); ++ } ++ catch (InvalidSyntaxException var3) ++ { ++ ; ++ } ++ ++ return var1; ++ } ++ ++ public int hashCode() ++ { ++ return (new HashCodeBuilder(17, 37)).append(this.field_96408_a).append(this.field_96406_b).append(this.field_96407_c).append(this.field_96404_d).append(this.field_96405_e).append(this.field_98166_h).toHashCode(); ++ } ++ ++ public boolean equals(Object par1Obj) ++ { ++ if (par1Obj == null) ++ { ++ return false; ++ } ++ else if (par1Obj == this) ++ { ++ return true; ++ } ++ else if (par1Obj.getClass() != this.getClass()) ++ { ++ return false; ++ } ++ else ++ { ++ McoServer var2 = (McoServer)par1Obj; ++ return (new EqualsBuilder()).append(this.field_96408_a, var2.field_96408_a).append(this.field_96406_b, var2.field_96406_b).append(this.field_96407_c, var2.field_96407_c).append(this.field_96404_d, var2.field_96404_d).append(this.field_96405_e, var2.field_96405_e).append(this.field_98166_h, var2.field_98166_h).isEquals(); ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- McoServerAddress.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,31 ---- ++ package net.minecraft.src; ++ ++ import argo.jdom.JdomParser; ++ import argo.jdom.JsonRootNode; ++ import argo.saj.InvalidSyntaxException; ++ ++ public class McoServerAddress extends ValueObject ++ { ++ public String field_96417_a; ++ ++ public static McoServerAddress func_98162_a(String par0Str) ++ { ++ McoServerAddress var1 = new McoServerAddress(); ++ ++ try ++ { ++ JsonRootNode var2 = (new JdomParser()).parse(par0Str); ++ var1.field_96417_a = var2.getStringValue(new Object[] {"address"}); ++ } ++ catch (InvalidSyntaxException var3) ++ { ++ ; ++ } ++ catch (IllegalArgumentException var4) ++ { ++ ; ++ } ++ ++ return var1; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- McoServerList.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,131 ---- ++ package net.minecraft.src; ++ ++ import com.google.common.collect.Lists; ++ import com.google.common.collect.Sets; ++ import java.util.Iterator; ++ import java.util.List; ++ import java.util.Set; ++ ++ public class McoServerList ++ { ++ private volatile boolean field_98259_a; ++ private McoServerListUpdateTask field_98257_b = new McoServerListUpdateTask(this, (McoServerListEmptyAnon)null); ++ private java.util.Timer field_98258_c = new java.util.Timer(); ++ private Set field_140060_d = Sets.newHashSet(); ++ private List field_98255_d = Lists.newArrayList(); ++ private int field_130130_e; ++ private boolean field_140059_g; ++ private Session field_98254_f; ++ private int field_140061_i; ++ ++ public McoServerList() ++ { ++ this.field_98258_c.schedule(this.field_98257_b, 0L, 10000L); ++ this.field_98254_f = Minecraft.getMinecraft().getSession(); ++ } ++ ++ public synchronized void func_130129_a(Session par1Session) ++ { ++ this.field_98254_f = par1Session; ++ ++ if (this.field_98259_a) ++ { ++ this.field_98259_a = false; ++ this.field_98257_b = new McoServerListUpdateTask(this, (McoServerListEmptyAnon)null); ++ this.field_98258_c = new java.util.Timer(); ++ this.field_98258_c.schedule(this.field_98257_b, 0L, 10000L); ++ } ++ } ++ ++ public synchronized boolean func_130127_a() ++ { ++ return this.field_140059_g; ++ } ++ ++ public synchronized void func_98250_b() ++ { ++ this.field_140059_g = false; ++ } ++ ++ public synchronized List func_98252_c() ++ { ++ return Lists.newArrayList(this.field_98255_d); ++ } ++ ++ public int func_130124_d() ++ { ++ return this.field_130130_e; ++ } ++ ++ public int func_140056_e() ++ { ++ return this.field_140061_i; ++ } ++ ++ public synchronized void func_98248_d() ++ { ++ this.field_98259_a = true; ++ this.field_98257_b.cancel(); ++ this.field_98258_c.cancel(); ++ } ++ ++ private synchronized void func_96426_a(List par1List) ++ { ++ int var2 = 0; ++ Iterator var3 = this.field_140060_d.iterator(); ++ ++ while (var3.hasNext()) ++ { ++ McoServer var4 = (McoServer)var3.next(); ++ ++ if (par1List.remove(var4)) ++ { ++ ++var2; ++ } ++ } ++ ++ if (var2 == 0) ++ { ++ this.field_140060_d.clear(); ++ } ++ ++ this.field_98255_d = par1List; ++ this.field_140059_g = true; ++ } ++ ++ public synchronized void func_140058_a(McoServer par1McoServer) ++ { ++ this.field_98255_d.remove(par1McoServer); ++ this.field_140060_d.add(par1McoServer); ++ } ++ ++ private void func_130123_a(int par1) ++ { ++ this.field_130130_e = par1; ++ } ++ ++ static boolean func_98249_b(McoServerList par0McoServerList) ++ { ++ return par0McoServerList.field_98259_a; ++ } ++ ++ static Session func_100014_a(McoServerList par0McoServerList) ++ { ++ return par0McoServerList.field_98254_f; ++ } ++ ++ static void func_98247_a(McoServerList par0McoServerList, List par1List) ++ { ++ par0McoServerList.func_96426_a(par1List); ++ } ++ ++ static void func_130122_a(McoServerList par0McoServerList, int par1) ++ { ++ par0McoServerList.func_130123_a(par1); ++ } ++ ++ static int func_140057_b(McoServerList par0McoServerList, int par1) ++ { ++ return par0McoServerList.field_140061_i = par1; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- McoServerListEmptyAnon.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,5 ---- ++ package net.minecraft.src; ++ ++ class McoServerListEmptyAnon ++ { ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- McoServerListUpdateTask.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,97 ---- ++ package net.minecraft.src; ++ ++ import java.io.IOException; ++ import java.util.Collections; ++ import java.util.List; ++ import java.util.TimerTask; ++ ++ class McoServerListUpdateTask extends TimerTask ++ { ++ private McoClient field_140066_b; ++ ++ final McoServerList field_140067_a; ++ ++ private McoServerListUpdateTask(McoServerList par1McoServerList) ++ { ++ this.field_140067_a = par1McoServerList; ++ } ++ ++ public void run() ++ { ++ if (!McoServerList.func_98249_b(this.field_140067_a)) ++ { ++ this.func_140064_c(); ++ this.func_140062_a(); ++ this.func_140063_b(); ++ } ++ } ++ ++ private void func_140062_a() ++ { ++ try ++ { ++ if (McoServerList.func_100014_a(this.field_140067_a) != null) ++ { ++ this.field_140066_b = new McoClient(McoServerList.func_100014_a(this.field_140067_a)); ++ List var1 = this.field_140066_b.func_96382_a().field_96430_d; ++ ++ if (var1 != null) ++ { ++ this.func_140065_a(var1); ++ McoServerList.func_98247_a(this.field_140067_a, var1); ++ } ++ } ++ } ++ catch (ExceptionMcoService var2) ++ { ++ Minecraft.getMinecraft().getLogAgent().logSevere(var2.toString()); ++ } ++ catch (IOException var3) ++ { ++ Minecraft.getMinecraft().getLogAgent().logWarning("Realms: could not parse response from server"); ++ } ++ } ++ ++ private void func_140063_b() ++ { ++ try ++ { ++ if (McoServerList.func_100014_a(this.field_140067_a) != null) ++ { ++ int var1 = this.field_140066_b.func_130106_e(); ++ McoServerList.func_130122_a(this.field_140067_a, var1); ++ } ++ } ++ catch (ExceptionMcoService var2) ++ { ++ Minecraft.getMinecraft().getLogAgent().logSevere(var2.toString()); ++ } ++ } ++ ++ private void func_140064_c() ++ { ++ try ++ { ++ if (McoServerList.func_100014_a(this.field_140067_a) != null) ++ { ++ McoClient var1 = new McoClient(McoServerList.func_100014_a(this.field_140067_a)); ++ McoServerList.func_140057_b(this.field_140067_a, var1.func_96379_c()); ++ } ++ } ++ catch (ExceptionMcoService var2) ++ { ++ Minecraft.getMinecraft().getLogAgent().logSevere(var2.toString()); ++ McoServerList.func_140057_b(this.field_140067_a, 0); ++ } ++ } ++ ++ private void func_140065_a(List par1List) ++ { ++ Collections.sort(par1List, new McoServerListUpdateTaskComparator(this, McoServerList.func_100014_a(this.field_140067_a).getUsername(), (McoServerListEmptyAnon)null)); ++ } ++ ++ McoServerListUpdateTask(McoServerList par1McoServerList, McoServerListEmptyAnon par2McoServerListEmptyAnon) ++ { ++ this(par1McoServerList); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- McoServerListUpdateTaskComparator.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,59 ---- ++ package net.minecraft.src; ++ ++ import java.util.Comparator; ++ ++ class McoServerListUpdateTaskComparator implements Comparator ++ { ++ private final String field_140069_b; ++ ++ final McoServerListUpdateTask field_140070_a; ++ ++ private McoServerListUpdateTaskComparator(McoServerListUpdateTask par1McoServerListUpdateTask, String par2Str) ++ { ++ this.field_140070_a = par1McoServerListUpdateTask; ++ this.field_140069_b = par2Str; ++ } ++ ++ public int func_140068_a(McoServer par1McoServer, McoServer par2McoServer) ++ { ++ if (par1McoServer.field_96405_e.equals(par2McoServer.field_96405_e)) ++ { ++ return par1McoServer.field_96408_a < par2McoServer.field_96408_a ? 1 : (par1McoServer.field_96408_a > par2McoServer.field_96408_a ? -1 : 0); ++ } ++ else if (par1McoServer.field_96405_e.equals(this.field_140069_b)) ++ { ++ return -1; ++ } ++ else if (par2McoServer.field_96405_e.equals(this.field_140069_b)) ++ { ++ return 1; ++ } ++ else ++ { ++ if (par1McoServer.field_96404_d.equals("CLOSED") || par2McoServer.field_96404_d.equals("CLOSED")) ++ { ++ if (par1McoServer.field_96404_d.equals("CLOSED")) ++ { ++ return 1; ++ } ++ ++ if (par2McoServer.field_96404_d.equals("CLOSED")) ++ { ++ return 0; ++ } ++ } ++ ++ return par1McoServer.field_96408_a < par2McoServer.field_96408_a ? 1 : (par1McoServer.field_96408_a > par2McoServer.field_96408_a ? -1 : 0); ++ } ++ } ++ ++ public int compare(Object par1Obj, Object par2Obj) ++ { ++ return this.func_140068_a((McoServer)par1Obj, (McoServer)par2Obj); ++ } ++ ++ McoServerListUpdateTaskComparator(McoServerListUpdateTask par1McoServerListUpdateTask, String par2Str, McoServerListEmptyAnon par3McoServerListEmptyAnon) ++ { ++ this(par1McoServerListUpdateTask, par2Str); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- MD5String.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,34 ---- ++ package net.minecraft.src; ++ ++ import java.math.BigInteger; ++ import java.security.MessageDigest; ++ import java.security.NoSuchAlgorithmException; ++ ++ public class MD5String ++ { ++ /** The salt prepended to the string to be hashed */ ++ private String salt; ++ ++ public MD5String(String par1Str) ++ { ++ this.salt = par1Str; ++ } ++ ++ /** ++ * Gets the MD5 string ++ */ ++ public String getMD5String(String par1Str) ++ { ++ try ++ { ++ String var2 = this.salt + par1Str; ++ MessageDigest var3 = MessageDigest.getInstance("MD5"); ++ var3.update(var2.getBytes(), 0, var2.length()); ++ return (new BigInteger(1, var3.digest())).toString(16); ++ } ++ catch (NoSuchAlgorithmException var4) ++ { ++ throw new RuntimeException(var4); ++ } ++ } ++ } +*** MemoryConnection.java Sat Feb 5 04:13:14 2022 +--- MemoryConnection.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,28 **** + package net.minecraft.src; + + import java.net.InetSocketAddress; + import java.net.SocketAddress; + import java.util.List; + + public class MemoryConnection implements INetworkManager + { + private static final SocketAddress mySocketAddress = new InetSocketAddress("127.0.0.1", 0); +! private final List readPacketCache = java.util.Collections.synchronizedList(new java.util.ArrayList()); + private final ILogAgent field_98214_c; + private MemoryConnection pairedConnection; + private NetHandler myNetHandler; + + /** set to true by {server,network}Shutdown */ + private boolean shuttingDown; +! private String shutdownReason; + private Object[] field_74439_g; + +! public MemoryConnection(ILogAgent p_i1392_1_, NetHandler p_i1392_2_) + { +! this.myNetHandler = p_i1392_2_; +! this.field_98214_c = p_i1392_1_; + } + + /** + * Sets the NetHandler for this NetworkManager. Server-only. + */ +--- 1,31 ---- + package net.minecraft.src; + + import java.net.InetSocketAddress; + import java.net.SocketAddress; ++ import java.util.ArrayList; ++ import java.util.Collections; + import java.util.List; + + public class MemoryConnection implements INetworkManager + { + private static final SocketAddress mySocketAddress = new InetSocketAddress("127.0.0.1", 0); +! private final List readPacketCache = Collections.synchronizedList(new ArrayList()); + private final ILogAgent field_98214_c; + private MemoryConnection pairedConnection; + private NetHandler myNetHandler; + + /** set to true by {server,network}Shutdown */ + private boolean shuttingDown; +! private String shutdownReason = ""; + private Object[] field_74439_g; ++ private boolean gamePaused; + +! public MemoryConnection(ILogAgent par1ILogAgent, NetHandler par2NetHandler) + { +! this.myNetHandler = par2NetHandler; +! this.field_98214_c = par1ILogAgent; + } + + /** + * Sets the NetHandler for this NetworkManager. Server-only. + */ +*************** +*** 40,49 **** +--- 43,63 ---- + { + this.pairedConnection.processOrCachePacket(par1Packet); + } + } + ++ public void closeConnections() ++ { ++ this.pairedConnection = null; ++ this.myNetHandler = null; ++ } ++ ++ public boolean isConnectionActive() ++ { ++ return !this.shuttingDown && this.pairedConnection != null; ++ } ++ + /** + * Wakes reader and writer threads + */ + public void wakeThreads() {} + +*************** +*** 70,82 **** + this.myNetHandler.handleErrorMessage(this.shutdownReason, this.field_74439_g); + } + } + + /** +! * Returns the socket address of the remote side. Server-only. + */ +! public SocketAddress getRemoteAddress() + { + return mySocketAddress; + } + + /** +--- 84,96 ---- + this.myNetHandler.handleErrorMessage(this.shutdownReason, this.field_74439_g); + } + } + + /** +! * Return the InetSocketAddress of the remote endpoint + */ +! public SocketAddress getSocketAddress() + { + return mySocketAddress; + } + + /** +*************** +*** 97,111 **** + this.shutdownReason = par1Str; + this.field_74439_g = par2ArrayOfObj; + } + + /** +! * Returns the number of chunk data packets waiting to be sent. + */ +! public int getNumChunkDataPackets() + { + return 0; + } + + /** + * acts immiditally if isWritePacket, otherwise adds it to the readCache to be processed next tick + */ +--- 111,146 ---- + this.shutdownReason = par1Str; + this.field_74439_g = par2ArrayOfObj; + } + + /** +! * returns 0 for memoryConnections + */ +! public int packetSize() + { + return 0; ++ } ++ ++ public void pairWith(MemoryConnection par1MemoryConnection) ++ { ++ this.pairedConnection = par1MemoryConnection; ++ par1MemoryConnection.pairedConnection = this; ++ } ++ ++ public boolean isGamePaused() ++ { ++ return this.gamePaused; ++ } ++ ++ public void setGamePaused(boolean par1) ++ { ++ this.gamePaused = par1; ++ } ++ ++ public MemoryConnection getPairedConnection() ++ { ++ return this.pairedConnection; + } + + /** + * acts immiditally if isWritePacket, otherwise adds it to the readCache to be processed next tick + */ +*** MerchantRecipe.java Sat Feb 5 04:13:14 2022 +--- MerchantRecipe.java Sat Feb 5 04:12:35 2022 +*************** +*** 103,112 **** +--- 103,117 ---- + public boolean func_82784_g() + { + return this.toolUses >= this.maxTradeUses; + } + ++ public void func_82785_h() ++ { ++ this.toolUses = this.maxTradeUses; ++ } ++ + public void readFromTags(NBTTagCompound par1NBTTagCompound) + { + NBTTagCompound var2 = par1NBTTagCompound.getCompoundTag("buy"); + this.itemToBuy = ItemStack.loadItemStackFromNBT(var2); + NBTTagCompound var3 = par1NBTTagCompound.getCompoundTag("sell"); +*** MerchantRecipeList.java Sat Feb 5 04:13:14 2022 +--- MerchantRecipeList.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,7 **** +--- 1,8 ---- + package net.minecraft.src; + ++ import java.io.DataInputStream; + import java.io.DataOutputStream; + import java.io.IOException; + import java.util.ArrayList; + + public class MerchantRecipeList extends ArrayList +*************** +*** 79,88 **** +--- 80,119 ---- + Packet.writeItemStack(var4, par1DataOutputStream); + } + + par1DataOutputStream.writeBoolean(var3.func_82784_g()); + } ++ } ++ ++ public static MerchantRecipeList readRecipiesFromStream(DataInputStream par0DataInputStream) throws IOException ++ { ++ MerchantRecipeList var1 = new MerchantRecipeList(); ++ int var2 = par0DataInputStream.readByte() & 255; ++ ++ for (int var3 = 0; var3 < var2; ++var3) ++ { ++ ItemStack var4 = Packet.readItemStack(par0DataInputStream); ++ ItemStack var5 = Packet.readItemStack(par0DataInputStream); ++ ItemStack var6 = null; ++ ++ if (par0DataInputStream.readBoolean()) ++ { ++ var6 = Packet.readItemStack(par0DataInputStream); ++ } ++ ++ boolean var7 = par0DataInputStream.readBoolean(); ++ MerchantRecipe var8 = new MerchantRecipe(var4, var6, var5); ++ ++ if (var7) ++ { ++ var8.func_82785_h(); ++ } ++ ++ var1.add(var8); ++ } ++ ++ return var1; + } + + public void readRecipiesFromTags(NBTTagCompound par1NBTTagCompound) + { + NBTTagList var2 = par1NBTTagCompound.getTagList("Recipes"); +*** MessageComponentSerializer.java Sat Feb 5 04:13:14 2022 +--- MessageComponentSerializer.java Sat Feb 5 04:12:35 2022 +*************** +*** 30,40 **** + + if (var8 != null && var8.isJsonPrimitive()) + { + EnumChatFormatting var13 = EnumChatFormatting.func_96300_b(var8.getAsString()); + +! if (var13 == null || !var13.Checks()) + { + throw new JsonParseException("Given color (" + var8.getAsString() + ") is not a valid selection"); + } + + var4.setColor(var13); +--- 30,40 ---- + + if (var8 != null && var8.isJsonPrimitive()) + { + EnumChatFormatting var13 = EnumChatFormatting.func_96300_b(var8.getAsString()); + +! if (var13 == null || !var13.isColor()) + { + throw new JsonParseException("Given color (" + var8.getAsString() + ") is not a valid selection"); + } + + var4.setColor(var13); +*** /dev/null Thu Jan 1 01:00:00 1970 +--- MetadataSection.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,5 ---- ++ package net.minecraft.src; ++ ++ public interface MetadataSection ++ { ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- MetadataSectionSerializer.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,11 ---- ++ package net.minecraft.src; ++ ++ import com.google.gson.JsonDeserializer; ++ ++ public interface MetadataSectionSerializer extends JsonDeserializer ++ { ++ /** ++ * The name of this section type as it appears in JSON. ++ */ ++ String getSectionName(); ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- MetadataSerializer.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,65 ---- ++ package net.minecraft.src; ++ ++ import com.google.gson.Gson; ++ import com.google.gson.GsonBuilder; ++ import com.google.gson.JsonObject; ++ ++ public class MetadataSerializer ++ { ++ private final IRegistry metadataSectionSerializerRegistry = new RegistrySimple(); ++ private final GsonBuilder gsonBuilder = new GsonBuilder(); ++ ++ /** ++ * Cached Gson instance. Set to null when more sections are registered, and then re-created from the builder. ++ */ ++ private Gson gson; ++ ++ public void registerMetadataSectionType(MetadataSectionSerializer par1MetadataSectionSerializer, Class par2Class) ++ { ++ this.metadataSectionSerializerRegistry.putObject(par1MetadataSectionSerializer.getSectionName(), new MetadataSerializerRegistration(this, par1MetadataSectionSerializer, par2Class, (MetadataSerializerEmptyAnon)null)); ++ this.gsonBuilder.registerTypeAdapter(par2Class, par1MetadataSectionSerializer); ++ this.gson = null; ++ } ++ ++ public MetadataSection parseMetadataSection(String par1Str, JsonObject par2JsonObject) ++ { ++ if (par1Str == null) ++ { ++ throw new IllegalArgumentException("Metadata section name cannot be null"); ++ } ++ else if (!par2JsonObject.has(par1Str)) ++ { ++ return null; ++ } ++ else if (!par2JsonObject.get(par1Str).isJsonObject()) ++ { ++ throw new IllegalArgumentException("Invalid metadata for \'" + par1Str + "\' - expected object, found " + par2JsonObject.get(par1Str)); ++ } ++ else ++ { ++ MetadataSerializerRegistration var3 = (MetadataSerializerRegistration)this.metadataSectionSerializerRegistry.getObject(par1Str); ++ ++ if (var3 == null) ++ { ++ throw new IllegalArgumentException("Don\'t know how to handle metadata section \'" + par1Str + "\'"); ++ } ++ else ++ { ++ return (MetadataSection)this.getGson().fromJson(par2JsonObject.getAsJsonObject(par1Str), var3.field_110500_b); ++ } ++ } ++ } ++ ++ /** ++ * Returns a Gson instance with type adapters registered for metadata sections. ++ */ ++ private Gson getGson() ++ { ++ if (this.gson == null) ++ { ++ this.gson = this.gsonBuilder.create(); ++ } ++ ++ return this.gson; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- MetadataSerializerEmptyAnon.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,5 ---- ++ package net.minecraft.src; ++ ++ class MetadataSerializerEmptyAnon ++ { ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- MetadataSerializerRegistration.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,21 ---- ++ package net.minecraft.src; ++ ++ class MetadataSerializerRegistration ++ { ++ final MetadataSectionSerializer field_110502_a; ++ final Class field_110500_b; ++ ++ final MetadataSerializer field_110501_c; ++ ++ private MetadataSerializerRegistration(MetadataSerializer par1MetadataSerializer, MetadataSectionSerializer par2MetadataSectionSerializer, Class par3Class) ++ { ++ this.field_110501_c = par1MetadataSerializer; ++ this.field_110502_a = par2MetadataSectionSerializer; ++ this.field_110500_b = par3Class; ++ } ++ ++ MetadataSerializerRegistration(MetadataSerializer par1MetadataSerializer, MetadataSectionSerializer par2MetadataSectionSerializer, Class par3Class, MetadataSerializerEmptyAnon par4MetadataSerializerEmptyAnon) ++ { ++ this(par1MetadataSerializer, par2MetadataSectionSerializer, par3Class); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- Minecraft.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,2419 ---- ++ package net.minecraft.src; ++ ++ import com.google.common.collect.Lists; ++ import java.awt.image.BufferedImage; ++ import java.io.File; ++ import java.io.IOException; ++ import java.net.Proxy; ++ import java.nio.ByteBuffer; ++ import java.text.DecimalFormat; ++ import java.text.SimpleDateFormat; ++ import java.util.ArrayList; ++ import java.util.Collections; ++ import java.util.Date; ++ import java.util.HashSet; ++ import java.util.Iterator; ++ import java.util.List; ++ import javax.imageio.ImageIO; ++ import net.minecraft.client.ClientBrandRetriever; ++ import net.minecraft.server.MinecraftServer; ++ import org.lwjgl.LWJGLException; ++ import org.lwjgl.Sys; ++ import org.lwjgl.input.Keyboard; ++ import org.lwjgl.input.Mouse; ++ import org.lwjgl.opengl.ContextCapabilities; ++ import org.lwjgl.opengl.Display; ++ import org.lwjgl.opengl.DisplayMode; ++ import org.lwjgl.opengl.GL11; ++ import org.lwjgl.opengl.GL20; ++ import org.lwjgl.opengl.GLContext; ++ import org.lwjgl.opengl.PixelFormat; ++ import org.lwjgl.util.glu.GLU; ++ ++ public class Minecraft implements IPlayerUsage ++ { ++ private static final ResourceLocation locationMojangPng = new ResourceLocation("textures/gui/title/mojang.png"); ++ public static final boolean isRunningOnMac = Util.getOSType() == EnumOS.MACOS; ++ ++ /** A 10MiB preallocation to ensure the heap is reasonably sized. */ ++ public static byte[] memoryReserve = new byte[10485760]; ++ private static final List macDisplayModes = Lists.newArrayList(new DisplayMode[] {new DisplayMode(2560, 1600), new DisplayMode(2880, 1800)}); ++ private final ILogAgent mcLogAgent; ++ private final File fileResourcepacks; ++ private ServerData currentServerData; ++ ++ /** The RenderEngine instance used by Minecraft */ ++ private TextureManager renderEngine; ++ ++ /** ++ * Set to 'this' in Minecraft constructor; used by some settings get methods ++ */ ++ private static Minecraft theMinecraft; ++ public PlayerControllerMP playerController; ++ private boolean fullscreen; ++ private boolean hasCrashed; ++ ++ /** Instance of CrashReport. */ ++ private CrashReport crashReporter; ++ public int displayWidth; ++ public int displayHeight; ++ private Timer timer = new Timer(20.0F); ++ ++ /** Instance of PlayerUsageSnooper. */ ++ private PlayerUsageSnooper usageSnooper = new PlayerUsageSnooper("client", this, MinecraftServer.getSystemTimeMillis()); ++ public WorldClient theWorld; ++ public RenderGlobal renderGlobal; ++ public EntityClientPlayerMP thePlayer; ++ ++ /** ++ * The Entity from which the renderer determines the render viewpoint. Currently is always the parent Minecraft ++ * class's 'thePlayer' instance. Modification of its location, rotation, or other settings at render time will ++ * modify the camera likewise, with the caveat of triggering chunk rebuilds as it moves, making it unsuitable for ++ * changing the viewpoint mid-render. ++ */ ++ public EntityLivingBase renderViewEntity; ++ public EntityLivingBase pointedEntityLiving; ++ public EffectRenderer effectRenderer; ++ private final Session session; ++ private boolean isGamePaused; ++ ++ /** The font renderer used for displaying and measuring text. */ ++ public FontRenderer fontRenderer; ++ public FontRenderer standardGalacticFontRenderer; ++ ++ /** The GuiScreen that's being displayed at the moment. */ ++ public GuiScreen currentScreen; ++ public LoadingScreenRenderer loadingScreen; ++ public EntityRenderer entityRenderer; ++ ++ /** Mouse left click counter */ ++ private int leftClickCounter; ++ ++ /** Display width */ ++ private int tempDisplayWidth; ++ ++ /** Display height */ ++ private int tempDisplayHeight; ++ ++ /** Instance of IntegratedServer. */ ++ private IntegratedServer theIntegratedServer; ++ ++ /** Gui achievement */ ++ public GuiAchievement guiAchievement; ++ public GuiIngame ingameGUI; ++ ++ /** Skip render world */ ++ public boolean skipRenderWorld; ++ ++ /** The ray trace hit that the mouse is over. */ ++ public MovingObjectPosition objectMouseOver; ++ ++ /** The game settings that currently hold effect. */ ++ public GameSettings gameSettings; ++ public SoundManager sndManager; ++ ++ /** Mouse helper instance. */ ++ public MouseHelper mouseHelper; ++ public final File mcDataDir; ++ private final File fileAssets; ++ private final String launchedVersion; ++ private final Proxy proxy; ++ private ISaveFormat saveLoader; ++ ++ /** ++ * This is set to fpsCounter every debug screen update, and is shown on the debug screen. It's also sent as part of ++ * the usage snooping. ++ */ ++ private static int debugFPS; ++ ++ /** ++ * When you place a block, it's set to 6, decremented once per tick, when it's 0, you can place another block. ++ */ ++ private int rightClickDelayTimer; ++ ++ /** ++ * Checked in Minecraft's while(running) loop, if true it's set to false and the textures refreshed. ++ */ ++ private boolean refreshTexturePacksScheduled; ++ ++ /** Stat file writer */ ++ public StatFileWriter statFileWriter; ++ private String serverName; ++ private int serverPort; ++ ++ /** ++ * Makes sure it doesn't keep taking screenshots when both buttons are down. ++ */ ++ boolean isTakingScreenshot; ++ ++ /** ++ * Does the actual gameplay have focus. If so then mouse and keys will effect the player instead of menus. ++ */ ++ public boolean inGameHasFocus; ++ long systemTime = getSystemTime(); ++ ++ /** Join player counter */ ++ private int joinPlayerCounter; ++ private final boolean isDemo; ++ private INetworkManager myNetworkManager; ++ private boolean integratedServerIsRunning; ++ ++ /** The profiler instance */ ++ public final Profiler mcProfiler = new Profiler(); ++ private long field_83002_am = -1L; ++ private ReloadableResourceManager mcResourceManager; ++ private final MetadataSerializer metadataSerializer_ = new MetadataSerializer(); ++ private List defaultResourcePacks = Lists.newArrayList(); ++ private DefaultResourcePack mcDefaultResourcePack; ++ private ResourcePackRepository mcResourcePackRepository; ++ private LanguageManager mcLanguageManager; ++ ++ /** ++ * Set to true to keep the game loop running. Set to false by shutdown() to allow the game loop to exit cleanly. ++ */ ++ volatile boolean running = true; ++ ++ /** String that shows the debug information */ ++ public String debug = ""; ++ ++ /** Approximate time (in ms) of last update to debug string */ ++ long debugUpdateTime = getSystemTime(); ++ ++ /** holds the current fps */ ++ int fpsCounter; ++ long prevFrameTime = -1L; ++ ++ /** Profiler currently displayed in the debug screen pie chart */ ++ private String debugProfilerName = "root"; ++ ++ public Minecraft(Session par1Session, int par2, int par3, boolean par4, boolean par5, File par6File, File par7File, File par8File, Proxy par9Proxy, String par10Str) ++ { ++ theMinecraft = this; ++ this.mcLogAgent = new LogAgent("Minecraft-Client", " [CLIENT]", (new File(par6File, "output-client.log")).getAbsolutePath()); ++ this.mcDataDir = par6File; ++ this.fileAssets = par7File; ++ this.fileResourcepacks = par8File; ++ this.launchedVersion = par10Str; ++ this.mcDefaultResourcePack = new DefaultResourcePack(this.fileAssets); ++ this.addDefaultResourcePack(); ++ this.proxy = par9Proxy; ++ this.startTimerHackThread(); ++ this.session = par1Session; ++ this.mcLogAgent.logInfo("Setting user: " + par1Session.getUsername()); ++ this.mcLogAgent.logInfo("(Session ID is " + par1Session.getSessionID() + ")"); ++ this.isDemo = par5; ++ this.displayWidth = par2; ++ this.displayHeight = par3; ++ this.tempDisplayWidth = par2; ++ this.tempDisplayHeight = par3; ++ this.fullscreen = par4; ++ ImageIO.setUseCache(false); ++ StatList.nopInit(); ++ } ++ ++ private void startTimerHackThread() ++ { ++ ThreadClientSleep var1 = new ThreadClientSleep(this, "Timer hack thread"); ++ var1.setDaemon(true); ++ var1.start(); ++ } ++ ++ public void crashed(CrashReport par1CrashReport) ++ { ++ this.hasCrashed = true; ++ this.crashReporter = par1CrashReport; ++ } ++ ++ /** ++ * Wrapper around displayCrashReportInternal ++ */ ++ public void displayCrashReport(CrashReport par1CrashReport) ++ { ++ File var2 = new File(getMinecraft().mcDataDir, "crash-reports"); ++ File var3 = new File(var2, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt"); ++ System.out.println(par1CrashReport.getCompleteReport()); ++ ++ if (par1CrashReport.getFile() != null) ++ { ++ System.out.println("#@!@# Game crashed! Crash report saved to: #@!@# " + par1CrashReport.getFile()); ++ System.exit(-1); ++ } ++ else if (par1CrashReport.saveToFile(var3, this.getLogAgent())) ++ { ++ System.out.println("#@!@# Game crashed! Crash report saved to: #@!@# " + var3.getAbsolutePath()); ++ System.exit(-1); ++ } ++ else ++ { ++ System.out.println("#@?@# Game crashed! Crash report could not be saved. #@?@#"); ++ System.exit(-2); ++ } ++ } ++ ++ public void setServer(String par1Str, int par2) ++ { ++ this.serverName = par1Str; ++ this.serverPort = par2; ++ } ++ ++ /** ++ * Starts the game: initializes the canvas, the title, the settings, etcetera. ++ */ ++ private void startGame() throws LWJGLException ++ { ++ this.gameSettings = new GameSettings(this, this.mcDataDir); ++ ++ if (this.gameSettings.overrideHeight > 0 && this.gameSettings.overrideWidth > 0) ++ { ++ this.displayWidth = this.gameSettings.overrideWidth; ++ this.displayHeight = this.gameSettings.overrideHeight; ++ } ++ ++ if (this.fullscreen) ++ { ++ Display.setFullscreen(true); ++ this.displayWidth = Display.getDisplayMode().getWidth(); ++ this.displayHeight = Display.getDisplayMode().getHeight(); ++ ++ if (this.displayWidth <= 0) ++ { ++ this.displayWidth = 1; ++ } ++ ++ if (this.displayHeight <= 0) ++ { ++ this.displayHeight = 1; ++ } ++ } ++ else ++ { ++ Display.setDisplayMode(new DisplayMode(this.displayWidth, this.displayHeight)); ++ } ++ ++ Display.setResizable(true); ++ Display.setTitle("Minecraft 1.6.4"); ++ this.getLogAgent().logInfo("LWJGL Version: " + Sys.getVersion()); ++ ++ if (Util.getOSType() != EnumOS.MACOS) ++ { ++ try ++ { ++ Display.setIcon(new ByteBuffer[] {this.readImage(new File(this.fileAssets, "/icons/icon_16x16.png")), this.readImage(new File(this.fileAssets, "/icons/icon_32x32.png"))}); ++ } ++ catch (IOException var5) ++ { ++ var5.printStackTrace(); ++ } ++ } ++ ++ try ++ { ++ Display.create((new PixelFormat()).withDepthBits(24)); ++ } ++ catch (LWJGLException var4) ++ { ++ var4.printStackTrace(); ++ ++ try ++ { ++ Thread.sleep(1000L); ++ } ++ catch (InterruptedException var3) ++ { ++ ; ++ } ++ ++ if (this.fullscreen) ++ { ++ this.updateDisplayMode(); ++ } ++ ++ Display.create(); ++ } ++ ++ OpenGlHelper.initializeTextures(); ++ this.guiAchievement = new GuiAchievement(this); ++ this.metadataSerializer_.registerMetadataSectionType(new TextureMetadataSectionSerializer(), TextureMetadataSection.class); ++ this.metadataSerializer_.registerMetadataSectionType(new FontMetadataSectionSerializer(), FontMetadataSection.class); ++ this.metadataSerializer_.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class); ++ this.metadataSerializer_.registerMetadataSectionType(new PackMetadataSectionSerializer(), PackMetadataSection.class); ++ this.metadataSerializer_.registerMetadataSectionType(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class); ++ this.saveLoader = new AnvilSaveConverter(new File(this.mcDataDir, "saves")); ++ this.mcResourcePackRepository = new ResourcePackRepository(this.fileResourcepacks, this.mcDefaultResourcePack, this.metadataSerializer_, this.gameSettings); ++ this.mcResourceManager = new SimpleReloadableResourceManager(this.metadataSerializer_); ++ this.mcLanguageManager = new LanguageManager(this.metadataSerializer_, this.gameSettings.language); ++ this.mcResourceManager.registerReloadListener(this.mcLanguageManager); ++ this.refreshResources(); ++ this.renderEngine = new TextureManager(this.mcResourceManager); ++ this.mcResourceManager.registerReloadListener(this.renderEngine); ++ this.sndManager = new SoundManager(this.mcResourceManager, this.gameSettings, this.fileAssets); ++ this.mcResourceManager.registerReloadListener(this.sndManager); ++ this.loadScreen(); ++ this.fontRenderer = new FontRenderer(this.gameSettings, new ResourceLocation("textures/font/ascii.png"), this.renderEngine, false); ++ ++ if (this.gameSettings.language != null) ++ { ++ this.fontRenderer.setUnicodeFlag(this.mcLanguageManager.isCurrentLocaleUnicode()); ++ this.fontRenderer.setBidiFlag(this.mcLanguageManager.isCurrentLanguageBidirectional()); ++ } ++ ++ this.standardGalacticFontRenderer = new FontRenderer(this.gameSettings, new ResourceLocation("textures/font/ascii_sga.png"), this.renderEngine, false); ++ this.mcResourceManager.registerReloadListener(this.fontRenderer); ++ this.mcResourceManager.registerReloadListener(this.standardGalacticFontRenderer); ++ this.mcResourceManager.registerReloadListener(new GrassColorReloadListener()); ++ this.mcResourceManager.registerReloadListener(new FoliageColorReloadListener()); ++ RenderManager.instance.itemRenderer = new ItemRenderer(this); ++ this.entityRenderer = new EntityRenderer(this); ++ this.statFileWriter = new StatFileWriter(this.session, this.mcDataDir); ++ AchievementList.openInventory.setStatStringFormatter(new StatStringFormatKeyInv(this)); ++ this.mouseHelper = new MouseHelper(); ++ this.checkGLError("Pre startup"); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ GL11.glShadeModel(GL11.GL_SMOOTH); ++ GL11.glClearDepth(1.0D); ++ GL11.glEnable(GL11.GL_DEPTH_TEST); ++ GL11.glDepthFunc(GL11.GL_LEQUAL); ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); ++ GL11.glCullFace(GL11.GL_BACK); ++ GL11.glMatrixMode(GL11.GL_PROJECTION); ++ GL11.glLoadIdentity(); ++ GL11.glMatrixMode(GL11.GL_MODELVIEW); ++ this.checkGLError("Startup"); ++ this.renderGlobal = new RenderGlobal(this); ++ this.renderEngine.loadTextureMap(TextureMap.locationBlocksTexture, new TextureMap(0, "textures/blocks")); ++ this.renderEngine.loadTextureMap(TextureMap.locationItemsTexture, new TextureMap(1, "textures/items")); ++ GL11.glViewport(0, 0, this.displayWidth, this.displayHeight); ++ this.effectRenderer = new EffectRenderer(this.theWorld, this.renderEngine); ++ this.checkGLError("Post startup"); ++ this.ingameGUI = new GuiIngame(this); ++ ++ if (this.serverName != null) ++ { ++ this.displayGuiScreen(new GuiConnecting(new GuiMainMenu(), this, this.serverName, this.serverPort)); ++ } ++ else ++ { ++ this.displayGuiScreen(new GuiMainMenu()); ++ } ++ ++ this.loadingScreen = new LoadingScreenRenderer(this); ++ ++ if (this.gameSettings.fullScreen && !this.fullscreen) ++ { ++ this.toggleFullscreen(); ++ } ++ } ++ ++ public void refreshResources() ++ { ++ ArrayList var1 = Lists.newArrayList(this.defaultResourcePacks); ++ Iterator var2 = this.mcResourcePackRepository.getRepositoryEntries().iterator(); ++ ++ while (var2.hasNext()) ++ { ++ ResourcePackRepositoryEntry var3 = (ResourcePackRepositoryEntry)var2.next(); ++ var1.add(var3.getResourcePack()); ++ } ++ ++ this.mcLanguageManager.parseLanguageMetadata(var1); ++ this.mcResourceManager.reloadResources(var1); ++ ++ if (this.renderGlobal != null) ++ { ++ this.renderGlobal.loadRenderers(); ++ } ++ } ++ ++ private void addDefaultResourcePack() ++ { ++ this.defaultResourcePacks.add(this.mcDefaultResourcePack); ++ } ++ ++ private ByteBuffer readImage(File par1File) throws IOException ++ { ++ BufferedImage var2 = ImageIO.read(par1File); ++ int[] var3 = var2.getRGB(0, 0, var2.getWidth(), var2.getHeight(), (int[])null, 0, var2.getWidth()); ++ ByteBuffer var4 = ByteBuffer.allocate(4 * var3.length); ++ int[] var5 = var3; ++ int var6 = var3.length; ++ ++ for (int var7 = 0; var7 < var6; ++var7) ++ { ++ int var8 = var5[var7]; ++ var4.putInt(var8 << 8 | var8 >> 24 & 255); ++ } ++ ++ var4.flip(); ++ return var4; ++ } ++ ++ private void updateDisplayMode() throws LWJGLException ++ { ++ HashSet var1 = new HashSet(); ++ Collections.addAll(var1, Display.getAvailableDisplayModes()); ++ DisplayMode var2 = Display.getDesktopDisplayMode(); ++ ++ if (!var1.contains(var2) && Util.getOSType() == EnumOS.MACOS) ++ { ++ Iterator var3 = macDisplayModes.iterator(); ++ ++ while (var3.hasNext()) ++ { ++ DisplayMode var4 = (DisplayMode)var3.next(); ++ boolean var5 = true; ++ Iterator var6 = var1.iterator(); ++ DisplayMode var7; ++ ++ while (var6.hasNext()) ++ { ++ var7 = (DisplayMode)var6.next(); ++ ++ if (var7.getBitsPerPixel() == 32 && var7.getWidth() == var4.getWidth() && var7.getHeight() == var4.getHeight()) ++ { ++ var5 = false; ++ break; ++ } ++ } ++ ++ if (!var5) ++ { ++ var6 = var1.iterator(); ++ ++ while (var6.hasNext()) ++ { ++ var7 = (DisplayMode)var6.next(); ++ ++ if (var7.getBitsPerPixel() == 32 && var7.getWidth() == var4.getWidth() / 2 && var7.getHeight() == var4.getHeight() / 2) ++ { ++ var2 = var7; ++ break; ++ } ++ } ++ } ++ } ++ } ++ ++ Display.setDisplayMode(var2); ++ this.displayWidth = var2.getWidth(); ++ this.displayHeight = var2.getHeight(); ++ } ++ ++ /** ++ * Displays a new screen. ++ */ ++ private void loadScreen() throws LWJGLException ++ { ++ ScaledResolution var1 = new ScaledResolution(this.gameSettings, this.displayWidth, this.displayHeight); ++ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); ++ GL11.glMatrixMode(GL11.GL_PROJECTION); ++ GL11.glLoadIdentity(); ++ GL11.glOrtho(0.0D, var1.getScaledWidth_double(), var1.getScaledHeight_double(), 0.0D, 1000.0D, 3000.0D); ++ GL11.glMatrixMode(GL11.GL_MODELVIEW); ++ GL11.glLoadIdentity(); ++ GL11.glTranslatef(0.0F, 0.0F, -2000.0F); ++ GL11.glViewport(0, 0, this.displayWidth, this.displayHeight); ++ GL11.glClearColor(0.0F, 0.0F, 0.0F, 0.0F); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ GL11.glDisable(GL11.GL_FOG); ++ this.renderEngine.bindTexture(locationMojangPng); ++ Tessellator var2 = Tessellator.instance; ++ var2.startDrawingQuads(); ++ var2.setColorOpaque_I(16777215); ++ var2.addVertexWithUV(0.0D, (double)this.displayHeight, 0.0D, 0.0D, 0.0D); ++ var2.addVertexWithUV((double)this.displayWidth, (double)this.displayHeight, 0.0D, 0.0D, 0.0D); ++ var2.addVertexWithUV((double)this.displayWidth, 0.0D, 0.0D, 0.0D, 0.0D); ++ var2.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D); ++ var2.draw(); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ var2.setColorOpaque_I(16777215); ++ short var3 = 256; ++ short var4 = 256; ++ this.scaledTessellator((var1.getScaledWidth() - var3) / 2, (var1.getScaledHeight() - var4) / 2, 0, 0, var3, var4); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glDisable(GL11.GL_FOG); ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); ++ Display.update(); ++ } ++ ++ /** ++ * Loads Tessellator with a scaled resolution ++ */ ++ public void scaledTessellator(int par1, int par2, int par3, int par4, int par5, int par6) ++ { ++ float var7 = 0.00390625F; ++ float var8 = 0.00390625F; ++ Tessellator var9 = Tessellator.instance; ++ var9.startDrawingQuads(); ++ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + par6), 0.0D, (double)((float)(par3 + 0) * var7), (double)((float)(par4 + par6) * var8)); ++ var9.addVertexWithUV((double)(par1 + par5), (double)(par2 + par6), 0.0D, (double)((float)(par3 + par5) * var7), (double)((float)(par4 + par6) * var8)); ++ var9.addVertexWithUV((double)(par1 + par5), (double)(par2 + 0), 0.0D, (double)((float)(par3 + par5) * var7), (double)((float)(par4 + 0) * var8)); ++ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), 0.0D, (double)((float)(par3 + 0) * var7), (double)((float)(par4 + 0) * var8)); ++ var9.draw(); ++ } ++ ++ /** ++ * Returns the save loader that is currently being used ++ */ ++ public ISaveFormat getSaveLoader() ++ { ++ return this.saveLoader; ++ } ++ ++ /** ++ * Sets the argument GuiScreen as the main (topmost visible) screen. ++ */ ++ public void displayGuiScreen(GuiScreen par1GuiScreen) ++ { ++ if (this.currentScreen != null) ++ { ++ this.currentScreen.onGuiClosed(); ++ } ++ ++ this.statFileWriter.syncStats(); ++ ++ if (par1GuiScreen == null && this.theWorld == null) ++ { ++ par1GuiScreen = new GuiMainMenu(); ++ } ++ else if (par1GuiScreen == null && this.thePlayer.getHealth() <= 0.0F) ++ { ++ par1GuiScreen = new GuiGameOver(); ++ } ++ ++ if (par1GuiScreen instanceof GuiMainMenu) ++ { ++ this.gameSettings.showDebugInfo = false; ++ this.ingameGUI.getChatGUI().clearChatMessages(); ++ } ++ ++ this.currentScreen = (GuiScreen)par1GuiScreen; ++ ++ if (par1GuiScreen != null) ++ { ++ this.setIngameNotInFocus(); ++ ScaledResolution var2 = new ScaledResolution(this.gameSettings, this.displayWidth, this.displayHeight); ++ int var3 = var2.getScaledWidth(); ++ int var4 = var2.getScaledHeight(); ++ ((GuiScreen)par1GuiScreen).setWorldAndResolution(this, var3, var4); ++ this.skipRenderWorld = false; ++ } ++ else ++ { ++ this.setIngameFocus(); ++ } ++ } ++ ++ /** ++ * Checks for an OpenGL error. If there is one, prints the error ID and error string. ++ */ ++ private void checkGLError(String par1Str) ++ { ++ int var2 = GL11.glGetError(); ++ ++ if (var2 != 0) ++ { ++ String var3 = GLU.gluErrorString(var2); ++ this.getLogAgent().logSevere("########## GL ERROR ##########"); ++ this.getLogAgent().logSevere("@ " + par1Str); ++ this.getLogAgent().logSevere(var2 + ": " + var3); ++ } ++ } ++ ++ /** ++ * Shuts down the minecraft applet by stopping the resource downloads, and clearing up GL stuff; called when the ++ * application (or web page) is exited. ++ */ ++ public void shutdownMinecraftApplet() ++ { ++ try ++ { ++ this.statFileWriter.syncStats(); ++ this.getLogAgent().logInfo("Stopping!"); ++ ++ try ++ { ++ this.loadWorld((WorldClient)null); ++ } ++ catch (Throwable var7) ++ { ++ ; ++ } ++ ++ try ++ { ++ GLAllocation.deleteTexturesAndDisplayLists(); ++ } ++ catch (Throwable var6) ++ { ++ ; ++ } ++ ++ this.sndManager.cleanup(); ++ } ++ finally ++ { ++ Display.destroy(); ++ ++ if (!this.hasCrashed) ++ { ++ System.exit(0); ++ } ++ } ++ ++ System.gc(); ++ } ++ ++ public void run() ++ { ++ this.running = true; ++ CrashReport var2; ++ ++ try ++ { ++ this.startGame(); ++ } ++ catch (Throwable var11) ++ { ++ var2 = CrashReport.makeCrashReport(var11, "Initializing game"); ++ var2.makeCategory("Initialization"); ++ this.displayCrashReport(this.addGraphicsAndWorldToCrashReport(var2)); ++ return; ++ } ++ ++ try ++ { ++ while (this.running) ++ { ++ if (this.running) ++ { ++ if (this.hasCrashed && this.crashReporter != null) ++ { ++ this.displayCrashReport(this.crashReporter); ++ return; ++ } ++ ++ if (this.refreshTexturePacksScheduled) ++ { ++ this.refreshTexturePacksScheduled = false; ++ this.refreshResources(); ++ } ++ ++ try ++ { ++ this.runGameLoop(); ++ } ++ catch (OutOfMemoryError var10) ++ { ++ this.freeMemory(); ++ this.displayGuiScreen(new GuiMemoryErrorScreen()); ++ System.gc(); ++ } ++ ++ continue; ++ } ++ } ++ } ++ catch (MinecraftError var12) ++ { ++ } ++ catch (ReportedException var13) ++ { ++ this.addGraphicsAndWorldToCrashReport(var13.getCrashReport()); ++ this.freeMemory(); ++ var13.printStackTrace(); ++ this.displayCrashReport(var13.getCrashReport()); ++ } ++ catch (Throwable var14) ++ { ++ var2 = this.addGraphicsAndWorldToCrashReport(new CrashReport("Unexpected error", var14)); ++ this.freeMemory(); ++ var14.printStackTrace(); ++ this.displayCrashReport(var2); ++ } ++ finally ++ { ++ this.shutdownMinecraftApplet(); ++ } ++ } ++ ++ /** ++ * Called repeatedly from run() ++ */ ++ private void runGameLoop() ++ { ++ AxisAlignedBB.getAABBPool().cleanPool(); ++ ++ if (this.theWorld != null) ++ { ++ this.theWorld.getWorldVec3Pool().clear(); ++ } ++ ++ this.mcProfiler.startSection("root"); ++ ++ if (Display.isCloseRequested()) ++ { ++ this.shutdown(); ++ } ++ ++ if (this.isGamePaused && this.theWorld != null) ++ { ++ float var1 = this.timer.renderPartialTicks; ++ this.timer.updateTimer(); ++ this.timer.renderPartialTicks = var1; ++ } ++ else ++ { ++ this.timer.updateTimer(); ++ } ++ ++ long var6 = System.nanoTime(); ++ this.mcProfiler.startSection("tick"); ++ ++ for (int var3 = 0; var3 < this.timer.elapsedTicks; ++var3) ++ { ++ this.runTick(); ++ } ++ ++ this.mcProfiler.endStartSection("preRenderErrors"); ++ long var7 = System.nanoTime() - var6; ++ this.checkGLError("Pre render"); ++ RenderBlocks.fancyGrass = this.gameSettings.fancyGraphics; ++ this.mcProfiler.endStartSection("sound"); ++ this.sndManager.setListener(this.thePlayer, this.timer.renderPartialTicks); ++ ++ if (!this.isGamePaused) ++ { ++ this.sndManager.func_92071_g(); ++ } ++ ++ this.mcProfiler.endSection(); ++ this.mcProfiler.startSection("render"); ++ this.mcProfiler.startSection("display"); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ ++ if (!Keyboard.isKeyDown(65)) ++ { ++ Display.update(); ++ } ++ ++ if (this.thePlayer != null && this.thePlayer.isEntityInsideOpaqueBlock()) ++ { ++ this.gameSettings.thirdPersonView = 0; ++ } ++ ++ this.mcProfiler.endSection(); ++ ++ if (!this.skipRenderWorld) ++ { ++ this.mcProfiler.endStartSection("gameRenderer"); ++ this.entityRenderer.updateCameraAndRender(this.timer.renderPartialTicks); ++ this.mcProfiler.endSection(); ++ } ++ ++ GL11.glFlush(); ++ this.mcProfiler.endSection(); ++ ++ if (!Display.isActive() && this.fullscreen) ++ { ++ this.toggleFullscreen(); ++ } ++ ++ if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart) ++ { ++ if (!this.mcProfiler.profilingEnabled) ++ { ++ this.mcProfiler.clearProfiling(); ++ } ++ ++ this.mcProfiler.profilingEnabled = true; ++ this.displayDebugInfo(var7); ++ } ++ else ++ { ++ this.mcProfiler.profilingEnabled = false; ++ this.prevFrameTime = System.nanoTime(); ++ } ++ ++ this.guiAchievement.updateAchievementWindow(); ++ this.mcProfiler.startSection("root"); ++ Thread.yield(); ++ ++ if (Keyboard.isKeyDown(65)) ++ { ++ Display.update(); ++ } ++ ++ this.screenshotListener(); ++ ++ if (!this.fullscreen && Display.wasResized()) ++ { ++ this.displayWidth = Display.getWidth(); ++ this.displayHeight = Display.getHeight(); ++ ++ if (this.displayWidth <= 0) ++ { ++ this.displayWidth = 1; ++ } ++ ++ if (this.displayHeight <= 0) ++ { ++ this.displayHeight = 1; ++ } ++ ++ this.resize(this.displayWidth, this.displayHeight); ++ } ++ ++ this.checkGLError("Post render"); ++ ++this.fpsCounter; ++ boolean var5 = this.isGamePaused; ++ this.isGamePaused = this.isSingleplayer() && this.currentScreen != null && this.currentScreen.doesGuiPauseGame() && !this.theIntegratedServer.getPublic(); ++ ++ if (this.isIntegratedServerRunning() && this.thePlayer != null && this.thePlayer.sendQueue != null && this.isGamePaused != var5) ++ { ++ ((MemoryConnection)this.thePlayer.sendQueue.getNetManager()).setGamePaused(this.isGamePaused); ++ } ++ ++ while (getSystemTime() >= this.debugUpdateTime + 1000L) ++ { ++ debugFPS = this.fpsCounter; ++ this.debug = debugFPS + " fps, " + WorldRenderer.chunksUpdated + " chunk updates"; ++ WorldRenderer.chunksUpdated = 0; ++ this.debugUpdateTime += 1000L; ++ this.fpsCounter = 0; ++ this.usageSnooper.addMemoryStatsToSnooper(); ++ ++ if (!this.usageSnooper.isSnooperRunning()) ++ { ++ this.usageSnooper.startSnooper(); ++ } ++ } ++ ++ this.mcProfiler.endSection(); ++ ++ if (this.getLimitFramerate() > 0) ++ { ++ Display.sync(EntityRenderer.performanceToFps(this.getLimitFramerate())); ++ } ++ } ++ ++ private int getLimitFramerate() ++ { ++ return this.currentScreen != null && this.currentScreen instanceof GuiMainMenu ? 2 : this.gameSettings.limitFramerate; ++ } ++ ++ public void freeMemory() ++ { ++ try ++ { ++ memoryReserve = new byte[0]; ++ this.renderGlobal.deleteAllDisplayLists(); ++ } ++ catch (Throwable var4) ++ { ++ ; ++ } ++ ++ try ++ { ++ System.gc(); ++ AxisAlignedBB.getAABBPool().clearPool(); ++ this.theWorld.getWorldVec3Pool().clearAndFreeCache(); ++ } ++ catch (Throwable var3) ++ { ++ ; ++ } ++ ++ try ++ { ++ System.gc(); ++ this.loadWorld((WorldClient)null); ++ } ++ catch (Throwable var2) ++ { ++ ; ++ } ++ ++ System.gc(); ++ } ++ ++ /** ++ * checks if keys are down ++ */ ++ private void screenshotListener() ++ { ++ if (Keyboard.isKeyDown(60)) ++ { ++ if (!this.isTakingScreenshot) ++ { ++ this.isTakingScreenshot = true; ++ this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot(this.mcDataDir, this.displayWidth, this.displayHeight)); ++ } ++ } ++ else ++ { ++ this.isTakingScreenshot = false; ++ } ++ } ++ ++ /** ++ * Update debugProfilerName in response to number keys in debug screen ++ */ ++ private void updateDebugProfilerName(int par1) ++ { ++ List var2 = this.mcProfiler.getProfilingData(this.debugProfilerName); ++ ++ if (var2 != null && !var2.isEmpty()) ++ { ++ ProfilerResult var3 = (ProfilerResult)var2.remove(0); ++ ++ if (par1 == 0) ++ { ++ if (var3.field_76331_c.length() > 0) ++ { ++ int var4 = this.debugProfilerName.lastIndexOf("."); ++ ++ if (var4 >= 0) ++ { ++ this.debugProfilerName = this.debugProfilerName.substring(0, var4); ++ } ++ } ++ } ++ else ++ { ++ --par1; ++ ++ if (par1 < var2.size() && !((ProfilerResult)var2.get(par1)).field_76331_c.equals("unspecified")) ++ { ++ if (this.debugProfilerName.length() > 0) ++ { ++ this.debugProfilerName = this.debugProfilerName + "."; ++ } ++ ++ this.debugProfilerName = this.debugProfilerName + ((ProfilerResult)var2.get(par1)).field_76331_c; ++ } ++ } ++ } ++ } ++ ++ private void displayDebugInfo(long par1) ++ { ++ if (this.mcProfiler.profilingEnabled) ++ { ++ List var3 = this.mcProfiler.getProfilingData(this.debugProfilerName); ++ ProfilerResult var4 = (ProfilerResult)var3.remove(0); ++ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); ++ GL11.glMatrixMode(GL11.GL_PROJECTION); ++ GL11.glEnable(GL11.GL_COLOR_MATERIAL); ++ GL11.glLoadIdentity(); ++ GL11.glOrtho(0.0D, (double)this.displayWidth, (double)this.displayHeight, 0.0D, 1000.0D, 3000.0D); ++ GL11.glMatrixMode(GL11.GL_MODELVIEW); ++ GL11.glLoadIdentity(); ++ GL11.glTranslatef(0.0F, 0.0F, -2000.0F); ++ GL11.glLineWidth(1.0F); ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ Tessellator var5 = Tessellator.instance; ++ short var6 = 160; ++ int var7 = this.displayWidth - var6 - 10; ++ int var8 = this.displayHeight - var6 * 2; ++ GL11.glEnable(GL11.GL_BLEND); ++ var5.startDrawingQuads(); ++ var5.setColorRGBA_I(0, 200); ++ var5.addVertex((double)((float)var7 - (float)var6 * 1.1F), (double)((float)var8 - (float)var6 * 0.6F - 16.0F), 0.0D); ++ var5.addVertex((double)((float)var7 - (float)var6 * 1.1F), (double)(var8 + var6 * 2), 0.0D); ++ var5.addVertex((double)((float)var7 + (float)var6 * 1.1F), (double)(var8 + var6 * 2), 0.0D); ++ var5.addVertex((double)((float)var7 + (float)var6 * 1.1F), (double)((float)var8 - (float)var6 * 0.6F - 16.0F), 0.0D); ++ var5.draw(); ++ GL11.glDisable(GL11.GL_BLEND); ++ double var9 = 0.0D; ++ int var13; ++ ++ for (int var11 = 0; var11 < var3.size(); ++var11) ++ { ++ ProfilerResult var12 = (ProfilerResult)var3.get(var11); ++ var13 = MathHelper.floor_double(var12.field_76332_a / 4.0D) + 1; ++ var5.startDrawing(6); ++ var5.setColorOpaque_I(var12.func_76329_a()); ++ var5.addVertex((double)var7, (double)var8, 0.0D); ++ int var14; ++ float var15; ++ float var16; ++ float var17; ++ ++ for (var14 = var13; var14 >= 0; --var14) ++ { ++ var15 = (float)((var9 + var12.field_76332_a * (double)var14 / (double)var13) * Math.PI * 2.0D / 100.0D); ++ var16 = MathHelper.sin(var15) * (float)var6; ++ var17 = MathHelper.cos(var15) * (float)var6 * 0.5F; ++ var5.addVertex((double)((float)var7 + var16), (double)((float)var8 - var17), 0.0D); ++ } ++ ++ var5.draw(); ++ var5.startDrawing(5); ++ var5.setColorOpaque_I((var12.func_76329_a() & 16711422) >> 1); ++ ++ for (var14 = var13; var14 >= 0; --var14) ++ { ++ var15 = (float)((var9 + var12.field_76332_a * (double)var14 / (double)var13) * Math.PI * 2.0D / 100.0D); ++ var16 = MathHelper.sin(var15) * (float)var6; ++ var17 = MathHelper.cos(var15) * (float)var6 * 0.5F; ++ var5.addVertex((double)((float)var7 + var16), (double)((float)var8 - var17), 0.0D); ++ var5.addVertex((double)((float)var7 + var16), (double)((float)var8 - var17 + 10.0F), 0.0D); ++ } ++ ++ var5.draw(); ++ var9 += var12.field_76332_a; ++ } ++ ++ DecimalFormat var18 = new DecimalFormat("##0.00"); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ String var19 = ""; ++ ++ if (!var4.field_76331_c.equals("unspecified")) ++ { ++ var19 = var19 + "[0] "; ++ } ++ ++ if (var4.field_76331_c.length() == 0) ++ { ++ var19 = var19 + "ROOT "; ++ } ++ else ++ { ++ var19 = var19 + var4.field_76331_c + " "; ++ } ++ ++ var13 = 16777215; ++ this.fontRenderer.drawStringWithShadow(var19, var7 - var6, var8 - var6 / 2 - 16, var13); ++ this.fontRenderer.drawStringWithShadow(var19 = var18.format(var4.field_76330_b) + "%", var7 + var6 - this.fontRenderer.getStringWidth(var19), var8 - var6 / 2 - 16, var13); ++ ++ for (int var21 = 0; var21 < var3.size(); ++var21) ++ { ++ ProfilerResult var20 = (ProfilerResult)var3.get(var21); ++ String var22 = ""; ++ ++ if (var20.field_76331_c.equals("unspecified")) ++ { ++ var22 = var22 + "[?] "; ++ } ++ else ++ { ++ var22 = var22 + "[" + (var21 + 1) + "] "; ++ } ++ ++ var22 = var22 + var20.field_76331_c; ++ this.fontRenderer.drawStringWithShadow(var22, var7 - var6, var8 + var6 / 2 + var21 * 8 + 20, var20.func_76329_a()); ++ this.fontRenderer.drawStringWithShadow(var22 = var18.format(var20.field_76332_a) + "%", var7 + var6 - 50 - this.fontRenderer.getStringWidth(var22), var8 + var6 / 2 + var21 * 8 + 20, var20.func_76329_a()); ++ this.fontRenderer.drawStringWithShadow(var22 = var18.format(var20.field_76330_b) + "%", var7 + var6 - this.fontRenderer.getStringWidth(var22), var8 + var6 / 2 + var21 * 8 + 20, var20.func_76329_a()); ++ } ++ } ++ } ++ ++ /** ++ * Called when the window is closing. Sets 'running' to false which allows the game loop to exit cleanly. ++ */ ++ public void shutdown() ++ { ++ this.running = false; ++ } ++ ++ /** ++ * Will set the focus to ingame if the Minecraft window is the active with focus. Also clears any GUI screen ++ * currently displayed ++ */ ++ public void setIngameFocus() ++ { ++ if (Display.isActive()) ++ { ++ if (!this.inGameHasFocus) ++ { ++ this.inGameHasFocus = true; ++ this.mouseHelper.grabMouseCursor(); ++ this.displayGuiScreen((GuiScreen)null); ++ this.leftClickCounter = 10000; ++ } ++ } ++ } ++ ++ /** ++ * Resets the player keystate, disables the ingame focus, and ungrabs the mouse cursor. ++ */ ++ public void setIngameNotInFocus() ++ { ++ if (this.inGameHasFocus) ++ { ++ KeyBinding.unPressAllKeys(); ++ this.inGameHasFocus = false; ++ this.mouseHelper.ungrabMouseCursor(); ++ } ++ } ++ ++ /** ++ * Displays the ingame menu ++ */ ++ public void displayInGameMenu() ++ { ++ if (this.currentScreen == null) ++ { ++ this.displayGuiScreen(new GuiIngameMenu()); ++ ++ if (this.isSingleplayer() && !this.theIntegratedServer.getPublic()) ++ { ++ this.sndManager.pauseAllSounds(); ++ } ++ } ++ } ++ ++ private void sendClickBlockToController(int par1, boolean par2) ++ { ++ if (!par2) ++ { ++ this.leftClickCounter = 0; ++ } ++ ++ if (par1 != 0 || this.leftClickCounter <= 0) ++ { ++ if (par2 && this.objectMouseOver != null && this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE && par1 == 0) ++ { ++ int var3 = this.objectMouseOver.blockX; ++ int var4 = this.objectMouseOver.blockY; ++ int var5 = this.objectMouseOver.blockZ; ++ this.playerController.onPlayerDamageBlock(var3, var4, var5, this.objectMouseOver.sideHit); ++ ++ if (this.thePlayer.isCurrentToolAdventureModeExempt(var3, var4, var5)) ++ { ++ this.effectRenderer.addBlockHitEffects(var3, var4, var5, this.objectMouseOver.sideHit); ++ this.thePlayer.swingItem(); ++ } ++ } ++ else ++ { ++ this.playerController.resetBlockRemoving(); ++ } ++ } ++ } ++ ++ /** ++ * Called whenever the mouse is clicked. Button clicked is 0 for left clicking and 1 for right clicking. Args: ++ * buttonClicked ++ */ ++ private void clickMouse(int par1) ++ { ++ if (par1 != 0 || this.leftClickCounter <= 0) ++ { ++ if (par1 == 0) ++ { ++ this.thePlayer.swingItem(); ++ } ++ ++ if (par1 == 1) ++ { ++ this.rightClickDelayTimer = 4; ++ } ++ ++ boolean var2 = true; ++ ItemStack var3 = this.thePlayer.inventory.getCurrentItem(); ++ ++ if (this.objectMouseOver == null) ++ { ++ if (par1 == 0 && this.playerController.isNotCreative()) ++ { ++ this.leftClickCounter = 10; ++ } ++ } ++ else if (this.objectMouseOver.typeOfHit == EnumMovingObjectType.ENTITY) ++ { ++ if (par1 == 0) ++ { ++ this.playerController.attackEntity(this.thePlayer, this.objectMouseOver.entityHit); ++ } ++ ++ if (par1 == 1 && this.playerController.func_78768_b(this.thePlayer, this.objectMouseOver.entityHit)) ++ { ++ var2 = false; ++ } ++ } ++ else if (this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE) ++ { ++ int var4 = this.objectMouseOver.blockX; ++ int var5 = this.objectMouseOver.blockY; ++ int var6 = this.objectMouseOver.blockZ; ++ int var7 = this.objectMouseOver.sideHit; ++ ++ if (par1 == 0) ++ { ++ this.playerController.clickBlock(var4, var5, var6, this.objectMouseOver.sideHit); ++ } ++ else ++ { ++ int var8 = var3 != null ? var3.stackSize : 0; ++ ++ if (this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, var3, var4, var5, var6, var7, this.objectMouseOver.hitVec)) ++ { ++ var2 = false; ++ this.thePlayer.swingItem(); ++ } ++ ++ if (var3 == null) ++ { ++ return; ++ } ++ ++ if (var3.stackSize == 0) ++ { ++ this.thePlayer.inventory.mainInventory[this.thePlayer.inventory.currentItem] = null; ++ } ++ else if (var3.stackSize != var8 || this.playerController.isInCreativeMode()) ++ { ++ this.entityRenderer.itemRenderer.resetEquippedProgress(); ++ } ++ } ++ } ++ ++ if (var2 && par1 == 1) ++ { ++ ItemStack var9 = this.thePlayer.inventory.getCurrentItem(); ++ ++ if (var9 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, var9)) ++ { ++ this.entityRenderer.itemRenderer.resetEquippedProgress2(); ++ } ++ } ++ } ++ } ++ ++ /** ++ * Toggles fullscreen mode. ++ */ ++ public void toggleFullscreen() ++ { ++ try ++ { ++ this.fullscreen = !this.fullscreen; ++ ++ if (this.fullscreen) ++ { ++ this.updateDisplayMode(); ++ this.displayWidth = Display.getDisplayMode().getWidth(); ++ this.displayHeight = Display.getDisplayMode().getHeight(); ++ ++ if (this.displayWidth <= 0) ++ { ++ this.displayWidth = 1; ++ } ++ ++ if (this.displayHeight <= 0) ++ { ++ this.displayHeight = 1; ++ } ++ } ++ else ++ { ++ Display.setDisplayMode(new DisplayMode(this.tempDisplayWidth, this.tempDisplayHeight)); ++ this.displayWidth = this.tempDisplayWidth; ++ this.displayHeight = this.tempDisplayHeight; ++ ++ if (this.displayWidth <= 0) ++ { ++ this.displayWidth = 1; ++ } ++ ++ if (this.displayHeight <= 0) ++ { ++ this.displayHeight = 1; ++ } ++ } ++ ++ if (this.currentScreen != null) ++ { ++ this.resize(this.displayWidth, this.displayHeight); ++ } ++ ++ Display.setFullscreen(this.fullscreen); ++ Display.setVSyncEnabled(this.gameSettings.enableVsync); ++ Display.update(); ++ } ++ catch (Exception var2) ++ { ++ var2.printStackTrace(); ++ } ++ } ++ ++ /** ++ * Called to resize the current screen. ++ */ ++ private void resize(int par1, int par2) ++ { ++ this.displayWidth = par1 <= 0 ? 1 : par1; ++ this.displayHeight = par2 <= 0 ? 1 : par2; ++ ++ if (this.currentScreen != null) ++ { ++ ScaledResolution var3 = new ScaledResolution(this.gameSettings, par1, par2); ++ int var4 = var3.getScaledWidth(); ++ int var5 = var3.getScaledHeight(); ++ this.currentScreen.setWorldAndResolution(this, var4, var5); ++ } ++ } ++ ++ /** ++ * Runs the current tick. ++ */ ++ public void runTick() ++ { ++ if (this.rightClickDelayTimer > 0) ++ { ++ --this.rightClickDelayTimer; ++ } ++ ++ this.mcProfiler.startSection("stats"); ++ this.statFileWriter.func_77449_e(); ++ this.mcProfiler.endStartSection("gui"); ++ ++ if (!this.isGamePaused) ++ { ++ this.ingameGUI.updateTick(); ++ } ++ ++ this.mcProfiler.endStartSection("pick"); ++ this.entityRenderer.getMouseOver(1.0F); ++ this.mcProfiler.endStartSection("gameMode"); ++ ++ if (!this.isGamePaused && this.theWorld != null) ++ { ++ this.playerController.updateController(); ++ } ++ ++ this.mcProfiler.endStartSection("textures"); ++ ++ if (!this.isGamePaused) ++ { ++ this.renderEngine.tick(); ++ } ++ ++ if (this.currentScreen == null && this.thePlayer != null) ++ { ++ if (this.thePlayer.getHealth() <= 0.0F) ++ { ++ this.displayGuiScreen((GuiScreen)null); ++ } ++ else if (this.thePlayer.isPlayerSleeping() && this.theWorld != null) ++ { ++ this.displayGuiScreen(new GuiSleepMP()); ++ } ++ } ++ else if (this.currentScreen != null && this.currentScreen instanceof GuiSleepMP && !this.thePlayer.isPlayerSleeping()) ++ { ++ this.displayGuiScreen((GuiScreen)null); ++ } ++ ++ if (this.currentScreen != null) ++ { ++ this.leftClickCounter = 10000; ++ } ++ ++ CrashReport var2; ++ CrashReportCategory var3; ++ ++ if (this.currentScreen != null) ++ { ++ try ++ { ++ this.currentScreen.handleInput(); ++ } ++ catch (Throwable var6) ++ { ++ var2 = CrashReport.makeCrashReport(var6, "Updating screen events"); ++ var3 = var2.makeCategory("Affected screen"); ++ var3.addCrashSectionCallable("Screen name", new CallableUpdatingScreenName(this)); ++ throw new ReportedException(var2); ++ } ++ ++ if (this.currentScreen != null) ++ { ++ try ++ { ++ this.currentScreen.updateScreen(); ++ } ++ catch (Throwable var5) ++ { ++ var2 = CrashReport.makeCrashReport(var5, "Ticking screen"); ++ var3 = var2.makeCategory("Affected screen"); ++ var3.addCrashSectionCallable("Screen name", new CallableParticleScreenName(this)); ++ throw new ReportedException(var2); ++ } ++ } ++ } ++ ++ if (this.currentScreen == null || this.currentScreen.allowUserInput) ++ { ++ this.mcProfiler.endStartSection("mouse"); ++ int var1; ++ ++ while (Mouse.next()) ++ { ++ var1 = Mouse.getEventButton(); ++ ++ if (isRunningOnMac && var1 == 0 && (Keyboard.isKeyDown(29) || Keyboard.isKeyDown(157))) ++ { ++ var1 = 1; ++ } ++ ++ KeyBinding.setKeyBindState(var1 - 100, Mouse.getEventButtonState()); ++ ++ if (Mouse.getEventButtonState()) ++ { ++ KeyBinding.onTick(var1 - 100); ++ } ++ ++ long var9 = getSystemTime() - this.systemTime; ++ ++ if (var9 <= 200L) ++ { ++ int var4 = Mouse.getEventDWheel(); ++ ++ if (var4 != 0) ++ { ++ this.thePlayer.inventory.changeCurrentItem(var4); ++ ++ if (this.gameSettings.noclip) ++ { ++ if (var4 > 0) ++ { ++ var4 = 1; ++ } ++ ++ if (var4 < 0) ++ { ++ var4 = -1; ++ } ++ ++ this.gameSettings.noclipRate += (float)var4 * 0.25F; ++ } ++ } ++ ++ if (this.currentScreen == null) ++ { ++ if (!this.inGameHasFocus && Mouse.getEventButtonState()) ++ { ++ this.setIngameFocus(); ++ } ++ } ++ else if (this.currentScreen != null) ++ { ++ this.currentScreen.handleMouseInput(); ++ } ++ } ++ } ++ ++ if (this.leftClickCounter > 0) ++ { ++ --this.leftClickCounter; ++ } ++ ++ this.mcProfiler.endStartSection("keyboard"); ++ boolean var8; ++ ++ while (Keyboard.next()) ++ { ++ KeyBinding.setKeyBindState(Keyboard.getEventKey(), Keyboard.getEventKeyState()); ++ ++ if (Keyboard.getEventKeyState()) ++ { ++ KeyBinding.onTick(Keyboard.getEventKey()); ++ } ++ ++ if (this.field_83002_am > 0L) ++ { ++ if (getSystemTime() - this.field_83002_am >= 6000L) ++ { ++ throw new ReportedException(new CrashReport("Manually triggered debug crash", new Throwable())); ++ } ++ ++ if (!Keyboard.isKeyDown(46) || !Keyboard.isKeyDown(61)) ++ { ++ this.field_83002_am = -1L; ++ } ++ } ++ else if (Keyboard.isKeyDown(46) && Keyboard.isKeyDown(61)) ++ { ++ this.field_83002_am = getSystemTime(); ++ } ++ ++ if (Keyboard.getEventKeyState()) ++ { ++ if (Keyboard.getEventKey() == 87) ++ { ++ this.toggleFullscreen(); ++ } ++ else ++ { ++ if (this.currentScreen != null) ++ { ++ this.currentScreen.handleKeyboardInput(); ++ } ++ else ++ { ++ if (Keyboard.getEventKey() == 1) ++ { ++ this.displayInGameMenu(); ++ } ++ ++ if (Keyboard.getEventKey() == 31 && Keyboard.isKeyDown(61)) ++ { ++ this.refreshResources(); ++ } ++ ++ if (Keyboard.getEventKey() == 20 && Keyboard.isKeyDown(61)) ++ { ++ this.refreshResources(); ++ } ++ ++ if (Keyboard.getEventKey() == 33 && Keyboard.isKeyDown(61)) ++ { ++ var8 = Keyboard.isKeyDown(42) | Keyboard.isKeyDown(54); ++ this.gameSettings.setOptionValue(EnumOptions.RENDER_DISTANCE, var8 ? -1 : 1); ++ } ++ ++ if (Keyboard.getEventKey() == 30 && Keyboard.isKeyDown(61)) ++ { ++ this.renderGlobal.loadRenderers(); ++ } ++ ++ if (Keyboard.getEventKey() == 35 && Keyboard.isKeyDown(61)) ++ { ++ this.gameSettings.advancedItemTooltips = !this.gameSettings.advancedItemTooltips; ++ this.gameSettings.saveOptions(); ++ } ++ ++ if (Keyboard.getEventKey() == 48 && Keyboard.isKeyDown(61)) ++ { ++ RenderManager.field_85095_o = !RenderManager.field_85095_o; ++ } ++ ++ if (Keyboard.getEventKey() == 25 && Keyboard.isKeyDown(61)) ++ { ++ this.gameSettings.pauseOnLostFocus = !this.gameSettings.pauseOnLostFocus; ++ this.gameSettings.saveOptions(); ++ } ++ ++ if (Keyboard.getEventKey() == 59) ++ { ++ this.gameSettings.hideGUI = !this.gameSettings.hideGUI; ++ } ++ ++ if (Keyboard.getEventKey() == 61) ++ { ++ this.gameSettings.showDebugInfo = !this.gameSettings.showDebugInfo; ++ this.gameSettings.showDebugProfilerChart = GuiScreen.isShiftKeyDown(); ++ } ++ ++ if (Keyboard.getEventKey() == 63) ++ { ++ ++this.gameSettings.thirdPersonView; ++ ++ if (this.gameSettings.thirdPersonView > 2) ++ { ++ this.gameSettings.thirdPersonView = 0; ++ } ++ } ++ ++ if (Keyboard.getEventKey() == 66) ++ { ++ this.gameSettings.smoothCamera = !this.gameSettings.smoothCamera; ++ } ++ } ++ ++ for (var1 = 0; var1 < 9; ++var1) ++ { ++ if (Keyboard.getEventKey() == 2 + var1) ++ { ++ this.thePlayer.inventory.currentItem = var1; ++ } ++ } ++ ++ if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart) ++ { ++ if (Keyboard.getEventKey() == 11) ++ { ++ this.updateDebugProfilerName(0); ++ } ++ ++ for (var1 = 0; var1 < 9; ++var1) ++ { ++ if (Keyboard.getEventKey() == 2 + var1) ++ { ++ this.updateDebugProfilerName(var1 + 1); ++ } ++ } ++ } ++ } ++ } ++ } ++ ++ var8 = this.gameSettings.chatVisibility != 2; ++ ++ while (this.gameSettings.keyBindInventory.isPressed()) ++ { ++ if (this.playerController.func_110738_j()) ++ { ++ this.thePlayer.func_110322_i(); ++ } ++ else ++ { ++ this.displayGuiScreen(new GuiInventory(this.thePlayer)); ++ } ++ } ++ ++ while (this.gameSettings.keyBindDrop.isPressed()) ++ { ++ this.thePlayer.dropOneItem(GuiScreen.isCtrlKeyDown()); ++ } ++ ++ while (this.gameSettings.keyBindChat.isPressed() && var8) ++ { ++ this.displayGuiScreen(new GuiChat()); ++ } ++ ++ if (this.currentScreen == null && this.gameSettings.keyBindCommand.isPressed() && var8) ++ { ++ this.displayGuiScreen(new GuiChat("/")); ++ } ++ ++ if (this.thePlayer.isUsingItem()) ++ { ++ if (!this.gameSettings.keyBindUseItem.pressed) ++ { ++ this.playerController.onStoppedUsingItem(this.thePlayer); ++ } ++ ++ label381: ++ ++ while (true) ++ { ++ if (!this.gameSettings.keyBindAttack.isPressed()) ++ { ++ while (this.gameSettings.keyBindUseItem.isPressed()) ++ { ++ ; ++ } ++ ++ while (true) ++ { ++ if (this.gameSettings.keyBindPickBlock.isPressed()) ++ { ++ continue; ++ } ++ ++ break label381; ++ } ++ } ++ } ++ } ++ else ++ { ++ while (this.gameSettings.keyBindAttack.isPressed()) ++ { ++ this.clickMouse(0); ++ } ++ ++ while (this.gameSettings.keyBindUseItem.isPressed()) ++ { ++ this.clickMouse(1); ++ } ++ ++ while (this.gameSettings.keyBindPickBlock.isPressed()) ++ { ++ this.clickMiddleMouseButton(); ++ } ++ } ++ ++ if (this.gameSettings.keyBindUseItem.pressed && this.rightClickDelayTimer == 0 && !this.thePlayer.isUsingItem()) ++ { ++ this.clickMouse(1); ++ } ++ ++ this.sendClickBlockToController(0, this.currentScreen == null && this.gameSettings.keyBindAttack.pressed && this.inGameHasFocus); ++ } ++ ++ if (this.theWorld != null) ++ { ++ if (this.thePlayer != null) ++ { ++ ++this.joinPlayerCounter; ++ ++ if (this.joinPlayerCounter == 30) ++ { ++ this.joinPlayerCounter = 0; ++ this.theWorld.joinEntityInSurroundings(this.thePlayer); ++ } ++ } ++ ++ this.mcProfiler.endStartSection("gameRenderer"); ++ ++ if (!this.isGamePaused) ++ { ++ this.entityRenderer.updateRenderer(); ++ } ++ ++ this.mcProfiler.endStartSection("levelRenderer"); ++ ++ if (!this.isGamePaused) ++ { ++ this.renderGlobal.updateClouds(); ++ } ++ ++ this.mcProfiler.endStartSection("level"); ++ ++ if (!this.isGamePaused) ++ { ++ if (this.theWorld.lastLightningBolt > 0) ++ { ++ --this.theWorld.lastLightningBolt; ++ } ++ ++ this.theWorld.updateEntities(); ++ } ++ ++ if (!this.isGamePaused) ++ { ++ this.theWorld.setAllowedSpawnTypes(this.theWorld.difficultySetting > 0, true); ++ ++ try ++ { ++ this.theWorld.tick(); ++ } ++ catch (Throwable var7) ++ { ++ var2 = CrashReport.makeCrashReport(var7, "Exception in world tick"); ++ ++ if (this.theWorld == null) ++ { ++ var3 = var2.makeCategory("Affected level"); ++ var3.addCrashSection("Problem", "Level is null!"); ++ } ++ else ++ { ++ this.theWorld.addWorldInfoToCrashReport(var2); ++ } ++ ++ throw new ReportedException(var2); ++ } ++ } ++ ++ this.mcProfiler.endStartSection("animateTick"); ++ ++ if (!this.isGamePaused && this.theWorld != null) ++ { ++ this.theWorld.doVoidFogParticles(MathHelper.floor_double(this.thePlayer.posX), MathHelper.floor_double(this.thePlayer.posY), MathHelper.floor_double(this.thePlayer.posZ)); ++ } ++ ++ this.mcProfiler.endStartSection("particles"); ++ ++ if (!this.isGamePaused) ++ { ++ this.effectRenderer.updateEffects(); ++ } ++ } ++ else if (this.myNetworkManager != null) ++ { ++ this.mcProfiler.endStartSection("pendingConnection"); ++ this.myNetworkManager.processReadPackets(); ++ } ++ ++ this.mcProfiler.endSection(); ++ this.systemTime = getSystemTime(); ++ } ++ ++ /** ++ * Arguments: World foldername, World ingame name, WorldSettings ++ */ ++ public void launchIntegratedServer(String par1Str, String par2Str, WorldSettings par3WorldSettings) ++ { ++ this.loadWorld((WorldClient)null); ++ System.gc(); ++ ISaveHandler var4 = this.saveLoader.getSaveLoader(par1Str, false); ++ WorldInfo var5 = var4.loadWorldInfo(); ++ ++ if (var5 == null && par3WorldSettings != null) ++ { ++ var5 = new WorldInfo(par3WorldSettings, par1Str); ++ var4.saveWorldInfo(var5); ++ } ++ ++ if (par3WorldSettings == null) ++ { ++ par3WorldSettings = new WorldSettings(var5); ++ } ++ ++ this.statFileWriter.readStat(StatList.startGameStat, 1); ++ this.theIntegratedServer = new IntegratedServer(this, par1Str, par2Str, par3WorldSettings); ++ this.theIntegratedServer.startServerThread(); ++ this.integratedServerIsRunning = true; ++ this.loadingScreen.displayProgressMessage(I18n.getString("menu.loadingLevel")); ++ ++ while (!this.theIntegratedServer.serverIsInRunLoop()) ++ { ++ String var6 = this.theIntegratedServer.getUserMessage(); ++ ++ if (var6 != null) ++ { ++ this.loadingScreen.resetProgresAndWorkingMessage(I18n.getString(var6)); ++ } ++ else ++ { ++ this.loadingScreen.resetProgresAndWorkingMessage(""); ++ } ++ ++ try ++ { ++ Thread.sleep(200L); ++ } ++ catch (InterruptedException var9) ++ { ++ ; ++ } ++ } ++ ++ this.displayGuiScreen((GuiScreen)null); ++ ++ try ++ { ++ NetClientHandler var10 = new NetClientHandler(this, this.theIntegratedServer); ++ this.myNetworkManager = var10.getNetManager(); ++ } ++ catch (IOException var8) ++ { ++ this.displayCrashReport(this.addGraphicsAndWorldToCrashReport(new CrashReport("Connecting to integrated server", var8))); ++ } ++ } ++ ++ /** ++ * unloads the current world first ++ */ ++ public void loadWorld(WorldClient par1WorldClient) ++ { ++ this.loadWorld(par1WorldClient, ""); ++ } ++ ++ /** ++ * par2Str is displayed on the loading screen to the user unloads the current world first ++ */ ++ public void loadWorld(WorldClient par1WorldClient, String par2Str) ++ { ++ this.statFileWriter.syncStats(); ++ ++ if (par1WorldClient == null) ++ { ++ NetClientHandler var3 = this.getNetHandler(); ++ ++ if (var3 != null) ++ { ++ var3.cleanup(); ++ } ++ ++ if (this.myNetworkManager != null) ++ { ++ this.myNetworkManager.closeConnections(); ++ } ++ ++ if (this.theIntegratedServer != null) ++ { ++ this.theIntegratedServer.initiateShutdown(); ++ } ++ ++ this.theIntegratedServer = null; ++ } ++ ++ this.renderViewEntity = null; ++ this.myNetworkManager = null; ++ ++ if (this.loadingScreen != null) ++ { ++ this.loadingScreen.resetProgressAndMessage(par2Str); ++ this.loadingScreen.resetProgresAndWorkingMessage(""); ++ } ++ ++ if (par1WorldClient == null && this.theWorld != null) ++ { ++ this.setServerData((ServerData)null); ++ this.integratedServerIsRunning = false; ++ } ++ ++ this.sndManager.playStreaming((String)null, 0.0F, 0.0F, 0.0F); ++ this.sndManager.stopAllSounds(); ++ this.theWorld = par1WorldClient; ++ ++ if (par1WorldClient != null) ++ { ++ if (this.renderGlobal != null) ++ { ++ this.renderGlobal.setWorldAndLoadRenderers(par1WorldClient); ++ } ++ ++ if (this.effectRenderer != null) ++ { ++ this.effectRenderer.clearEffects(par1WorldClient); ++ } ++ ++ if (this.thePlayer == null) ++ { ++ this.thePlayer = this.playerController.func_78754_a(par1WorldClient); ++ this.playerController.flipPlayer(this.thePlayer); ++ } ++ ++ this.thePlayer.preparePlayerToSpawn(); ++ par1WorldClient.spawnEntityInWorld(this.thePlayer); ++ this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings); ++ this.playerController.setPlayerCapabilities(this.thePlayer); ++ this.renderViewEntity = this.thePlayer; ++ } ++ else ++ { ++ this.saveLoader.flushCache(); ++ this.thePlayer = null; ++ } ++ ++ System.gc(); ++ this.systemTime = 0L; ++ } ++ ++ /** ++ * A String of renderGlobal.getDebugInfoRenders ++ */ ++ public String debugInfoRenders() ++ { ++ return this.renderGlobal.getDebugInfoRenders(); ++ } ++ ++ /** ++ * Gets the information in the F3 menu about how many entities are infront/around you ++ */ ++ public String getEntityDebug() ++ { ++ return this.renderGlobal.getDebugInfoEntities(); ++ } ++ ++ /** ++ * Gets the name of the world's current chunk provider ++ */ ++ public String getWorldProviderName() ++ { ++ return this.theWorld.getProviderName(); ++ } ++ ++ /** ++ * A String of how many entities are in the world ++ */ ++ public String debugInfoEntities() ++ { ++ return "P: " + this.effectRenderer.getStatistics() + ". T: " + this.theWorld.getDebugLoadedEntities(); ++ } ++ ++ public void setDimensionAndSpawnPlayer(int par1) ++ { ++ this.theWorld.setSpawnLocation(); ++ this.theWorld.removeAllEntities(); ++ int var2 = 0; ++ String var3 = null; ++ ++ if (this.thePlayer != null) ++ { ++ var2 = this.thePlayer.entityId; ++ this.theWorld.removeEntity(this.thePlayer); ++ var3 = this.thePlayer.func_142021_k(); ++ } ++ ++ this.renderViewEntity = null; ++ this.thePlayer = this.playerController.func_78754_a(this.theWorld); ++ this.thePlayer.dimension = par1; ++ this.renderViewEntity = this.thePlayer; ++ this.thePlayer.preparePlayerToSpawn(); ++ this.thePlayer.func_142020_c(var3); ++ this.theWorld.spawnEntityInWorld(this.thePlayer); ++ this.playerController.flipPlayer(this.thePlayer); ++ this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings); ++ this.thePlayer.entityId = var2; ++ this.playerController.setPlayerCapabilities(this.thePlayer); ++ ++ if (this.currentScreen instanceof GuiGameOver) ++ { ++ this.displayGuiScreen((GuiScreen)null); ++ } ++ } ++ ++ /** ++ * Gets whether this is a demo or not. ++ */ ++ public final boolean isDemo() ++ { ++ return this.isDemo; ++ } ++ ++ /** ++ * Returns the NetClientHandler. ++ */ ++ public NetClientHandler getNetHandler() ++ { ++ return this.thePlayer != null ? this.thePlayer.sendQueue : null; ++ } ++ ++ public static boolean isGuiEnabled() ++ { ++ return theMinecraft == null || !theMinecraft.gameSettings.hideGUI; ++ } ++ ++ public static boolean isFancyGraphicsEnabled() ++ { ++ return theMinecraft != null && theMinecraft.gameSettings.fancyGraphics; ++ } ++ ++ /** ++ * Returns if ambient occlusion is enabled ++ */ ++ public static boolean isAmbientOcclusionEnabled() ++ { ++ return theMinecraft != null && theMinecraft.gameSettings.ambientOcclusion != 0; ++ } ++ ++ /** ++ * Returns true if the message is a client command and should not be sent to the server. However there are no such ++ * commands at this point in time. ++ */ ++ public boolean handleClientCommand(String par1Str) ++ { ++ return false; ++ } ++ ++ /** ++ * Called when the middle mouse button gets clicked ++ */ ++ private void clickMiddleMouseButton() ++ { ++ if (this.objectMouseOver != null) ++ { ++ boolean var1 = this.thePlayer.capabilities.isCreativeMode; ++ int var3 = 0; ++ boolean var4 = false; ++ int var2; ++ int var5; ++ ++ if (this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE) ++ { ++ var5 = this.objectMouseOver.blockX; ++ int var6 = this.objectMouseOver.blockY; ++ int var7 = this.objectMouseOver.blockZ; ++ Block var8 = Block.blocksList[this.theWorld.getBlockId(var5, var6, var7)]; ++ ++ if (var8 == null) ++ { ++ return; ++ } ++ ++ var2 = var8.idPicked(this.theWorld, var5, var6, var7); ++ ++ if (var2 == 0) ++ { ++ return; ++ } ++ ++ var4 = Item.itemsList[var2].getHasSubtypes(); ++ int var9 = var2 < 256 && !Block.blocksList[var8.blockID].isFlowerPot() ? var2 : var8.blockID; ++ var3 = Block.blocksList[var9].getDamageValue(this.theWorld, var5, var6, var7); ++ } ++ else ++ { ++ if (this.objectMouseOver.typeOfHit != EnumMovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !var1) ++ { ++ return; ++ } ++ ++ if (this.objectMouseOver.entityHit instanceof EntityPainting) ++ { ++ var2 = Item.painting.itemID; ++ } ++ else if (this.objectMouseOver.entityHit instanceof EntityLeashKnot) ++ { ++ var2 = Item.leash.itemID; ++ } ++ else if (this.objectMouseOver.entityHit instanceof EntityItemFrame) ++ { ++ EntityItemFrame var10 = (EntityItemFrame)this.objectMouseOver.entityHit; ++ ++ if (var10.getDisplayedItem() == null) ++ { ++ var2 = Item.itemFrame.itemID; ++ } ++ else ++ { ++ var2 = var10.getDisplayedItem().itemID; ++ var3 = var10.getDisplayedItem().getItemDamage(); ++ var4 = true; ++ } ++ } ++ else if (this.objectMouseOver.entityHit instanceof EntityMinecart) ++ { ++ EntityMinecart var11 = (EntityMinecart)this.objectMouseOver.entityHit; ++ ++ if (var11.getMinecartType() == 2) ++ { ++ var2 = Item.minecartPowered.itemID; ++ } ++ else if (var11.getMinecartType() == 1) ++ { ++ var2 = Item.minecartCrate.itemID; ++ } ++ else if (var11.getMinecartType() == 3) ++ { ++ var2 = Item.minecartTnt.itemID; ++ } ++ else if (var11.getMinecartType() == 5) ++ { ++ var2 = Item.minecartHopper.itemID; ++ } ++ else ++ { ++ var2 = Item.minecartEmpty.itemID; ++ } ++ } ++ else if (this.objectMouseOver.entityHit instanceof EntityBoat) ++ { ++ var2 = Item.boat.itemID; ++ } ++ else ++ { ++ var2 = Item.monsterPlacer.itemID; ++ var3 = EntityList.getEntityID(this.objectMouseOver.entityHit); ++ var4 = true; ++ ++ if (var3 <= 0 || !EntityList.entityEggs.containsKey(Integer.valueOf(var3))) ++ { ++ return; ++ } ++ } ++ } ++ ++ this.thePlayer.inventory.setCurrentItem(var2, var3, var4, var1); ++ ++ if (var1) ++ { ++ var5 = this.thePlayer.inventoryContainer.inventorySlots.size() - 9 + this.thePlayer.inventory.currentItem; ++ this.playerController.sendSlotPacket(this.thePlayer.inventory.getStackInSlot(this.thePlayer.inventory.currentItem), var5); ++ } ++ } ++ } ++ ++ /** ++ * adds core server Info (GL version , Texture pack, isModded, type), and the worldInfo to the crash report ++ */ ++ public CrashReport addGraphicsAndWorldToCrashReport(CrashReport par1CrashReport) ++ { ++ par1CrashReport.getCategory().addCrashSectionCallable("Launched Version", new CallableLaunchedVersion(this)); ++ par1CrashReport.getCategory().addCrashSectionCallable("LWJGL", new CallableLWJGLVersion(this)); ++ par1CrashReport.getCategory().addCrashSectionCallable("OpenGL", new CallableGLInfo(this)); ++ par1CrashReport.getCategory().addCrashSectionCallable("Is Modded", new CallableModded(this)); ++ par1CrashReport.getCategory().addCrashSectionCallable("Type", new CallableType2(this)); ++ par1CrashReport.getCategory().addCrashSectionCallable("Resource Pack", new CallableTexturePack(this)); ++ par1CrashReport.getCategory().addCrashSectionCallable("Current Language", new CallableClientProfiler(this)); ++ par1CrashReport.getCategory().addCrashSectionCallable("Profiler Position", new CallableClientMemoryStats(this)); ++ par1CrashReport.getCategory().addCrashSectionCallable("Vec3 Pool Size", new MinecraftINNER13(this)); ++ ++ if (this.theWorld != null) ++ { ++ this.theWorld.addWorldInfoToCrashReport(par1CrashReport); ++ } ++ ++ return par1CrashReport; ++ } ++ ++ /** ++ * Return the singleton Minecraft instance for the game ++ */ ++ public static Minecraft getMinecraft() ++ { ++ return theMinecraft; ++ } ++ ++ public void addServerStatsToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper) ++ { ++ par1PlayerUsageSnooper.addData("fps", Integer.valueOf(debugFPS)); ++ par1PlayerUsageSnooper.addData("texpack_name", this.mcResourcePackRepository.getResourcePackName()); ++ par1PlayerUsageSnooper.addData("vsync_enabled", Boolean.valueOf(this.gameSettings.enableVsync)); ++ par1PlayerUsageSnooper.addData("display_frequency", Integer.valueOf(Display.getDisplayMode().getFrequency())); ++ par1PlayerUsageSnooper.addData("display_type", this.fullscreen ? "fullscreen" : "windowed"); ++ par1PlayerUsageSnooper.addData("run_time", Long.valueOf((MinecraftServer.getSystemTimeMillis() - par1PlayerUsageSnooper.func_130105_g()) / 60L * 1000L)); ++ ++ if (this.theIntegratedServer != null && this.theIntegratedServer.getPlayerUsageSnooper() != null) ++ { ++ par1PlayerUsageSnooper.addData("snooper_partner", this.theIntegratedServer.getPlayerUsageSnooper().getUniqueID()); ++ } ++ } ++ ++ public void addServerTypeToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper) ++ { ++ par1PlayerUsageSnooper.addData("opengl_version", GL11.glGetString(GL11.GL_VERSION)); ++ par1PlayerUsageSnooper.addData("opengl_vendor", GL11.glGetString(GL11.GL_VENDOR)); ++ par1PlayerUsageSnooper.addData("client_brand", ClientBrandRetriever.getClientModName()); ++ par1PlayerUsageSnooper.addData("launched_version", this.launchedVersion); ++ ContextCapabilities var2 = GLContext.getCapabilities(); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_multitexture]", Boolean.valueOf(var2.GL_ARB_multitexture)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_multisample]", Boolean.valueOf(var2.GL_ARB_multisample)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_texture_cube_map]", Boolean.valueOf(var2.GL_ARB_texture_cube_map)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_vertex_blend]", Boolean.valueOf(var2.GL_ARB_vertex_blend)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_matrix_palette]", Boolean.valueOf(var2.GL_ARB_matrix_palette)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_vertex_program]", Boolean.valueOf(var2.GL_ARB_vertex_program)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_vertex_shader]", Boolean.valueOf(var2.GL_ARB_vertex_shader)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_fragment_program]", Boolean.valueOf(var2.GL_ARB_fragment_program)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_fragment_shader]", Boolean.valueOf(var2.GL_ARB_fragment_shader)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_shader_objects]", Boolean.valueOf(var2.GL_ARB_shader_objects)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_vertex_buffer_object]", Boolean.valueOf(var2.GL_ARB_vertex_buffer_object)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_framebuffer_object]", Boolean.valueOf(var2.GL_ARB_framebuffer_object)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_pixel_buffer_object]", Boolean.valueOf(var2.GL_ARB_pixel_buffer_object)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_uniform_buffer_object]", Boolean.valueOf(var2.GL_ARB_uniform_buffer_object)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_texture_non_power_of_two]", Boolean.valueOf(var2.GL_ARB_texture_non_power_of_two)); ++ par1PlayerUsageSnooper.addData("gl_caps[gl_max_vertex_uniforms]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_VERTEX_UNIFORM_COMPONENTS))); ++ par1PlayerUsageSnooper.addData("gl_caps[gl_max_fragment_uniforms]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_FRAGMENT_UNIFORM_COMPONENTS))); ++ par1PlayerUsageSnooper.addData("gl_max_texture_size", Integer.valueOf(getGLMaximumTextureSize())); ++ } ++ ++ /** ++ * Used in the usage snooper. ++ */ ++ public static int getGLMaximumTextureSize() ++ { ++ for (int var0 = 16384; var0 > 0; var0 >>= 1) ++ { ++ GL11.glTexImage2D(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_RGBA, var0, var0, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)null); ++ int var1 = GL11.glGetTexLevelParameteri(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH); ++ ++ if (var1 != 0) ++ { ++ return var0; ++ } ++ } ++ ++ return -1; ++ } ++ ++ /** ++ * Returns whether snooping is enabled or not. ++ */ ++ public boolean isSnooperEnabled() ++ { ++ return this.gameSettings.snooperEnabled; ++ } ++ ++ /** ++ * Set the current ServerData instance. ++ */ ++ public void setServerData(ServerData par1ServerData) ++ { ++ this.currentServerData = par1ServerData; ++ } ++ ++ public boolean isIntegratedServerRunning() ++ { ++ return this.integratedServerIsRunning; ++ } ++ ++ /** ++ * Returns true if there is only one player playing, and the current server is the integrated one. ++ */ ++ public boolean isSingleplayer() ++ { ++ return this.integratedServerIsRunning && this.theIntegratedServer != null; ++ } ++ ++ /** ++ * Returns the currently running integrated server ++ */ ++ public IntegratedServer getIntegratedServer() ++ { ++ return this.theIntegratedServer; ++ } ++ ++ public static void stopIntegratedServer() ++ { ++ if (theMinecraft != null) ++ { ++ IntegratedServer var0 = theMinecraft.getIntegratedServer(); ++ ++ if (var0 != null) ++ { ++ var0.stopServer(); ++ } ++ } ++ } ++ ++ /** ++ * Returns the PlayerUsageSnooper instance. ++ */ ++ public PlayerUsageSnooper getPlayerUsageSnooper() ++ { ++ return this.usageSnooper; ++ } ++ ++ /** ++ * Gets the system time in milliseconds. ++ */ ++ public static long getSystemTime() ++ { ++ return Sys.getTime() * 1000L / Sys.getTimerResolution(); ++ } ++ ++ /** ++ * Returns whether we're in full screen or not. ++ */ ++ public boolean isFullScreen() ++ { ++ return this.fullscreen; ++ } ++ ++ public ILogAgent getLogAgent() ++ { ++ return this.mcLogAgent; ++ } ++ ++ public Session getSession() ++ { ++ return this.session; ++ } ++ ++ public Proxy getProxy() ++ { ++ return this.proxy; ++ } ++ ++ public TextureManager getTextureManager() ++ { ++ return this.renderEngine; ++ } ++ ++ public ResourceManager getResourceManager() ++ { ++ return this.mcResourceManager; ++ } ++ ++ public ResourcePackRepository getResourcePackRepository() ++ { ++ return this.mcResourcePackRepository; ++ } ++ ++ public LanguageManager getLanguageManager() ++ { ++ return this.mcLanguageManager; ++ } ++ ++ static String getLaunchedVersion(Minecraft par0Minecraft) ++ { ++ return par0Minecraft.launchedVersion; ++ } ++ ++ static LanguageManager func_142024_b(Minecraft par0Minecraft) ++ { ++ return par0Minecraft.mcLanguageManager; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- MinecraftError.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,5 ---- ++ package net.minecraft.src; ++ ++ public class MinecraftError extends Error ++ { ++ } +*** MinecraftException.java Sat Feb 5 04:13:14 2022 +--- MinecraftException.java Sat Feb 5 04:12:35 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- MinecraftINNER13.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,29 ---- ++ package net.minecraft.src; ++ ++ import java.util.concurrent.Callable; ++ ++ class MinecraftINNER13 implements Callable ++ { ++ final Minecraft field_142056_a; ++ ++ MinecraftINNER13(Minecraft par1Minecraft) ++ { ++ this.field_142056_a = par1Minecraft; ++ } ++ ++ public String func_142055_a() ++ { ++ int var1 = this.field_142056_a.theWorld.getWorldVec3Pool().getPoolSize(); ++ int var2 = 56 * var1; ++ int var3 = var2 / 1024 / 1024; ++ int var4 = this.field_142056_a.theWorld.getWorldVec3Pool().func_82590_d(); ++ int var5 = 56 * var4; ++ int var6 = var5 / 1024 / 1024; ++ return var1 + " (" + var2 + " bytes; " + var3 + " MB) allocated, " + var4 + " (" + var5 + " bytes; " + var6 + " MB) used"; ++ } ++ ++ public Object call() ++ { ++ return this.func_142055_a(); ++ } ++ } +*** MinecraftServerGui.java Sat Feb 5 04:13:14 2022 +--- /dev/null Thu Jan 1 01:00:00 1970 +*************** +*** 1,96 **** +- package net.minecraft.src; +- +- import java.awt.BorderLayout; +- import java.awt.Component; +- import java.awt.Dimension; +- import javax.swing.JComponent; +- import javax.swing.JFrame; +- import javax.swing.JPanel; +- import javax.swing.JScrollPane; +- import javax.swing.JTextArea; +- import javax.swing.JTextField; +- import javax.swing.UIManager; +- import javax.swing.border.EtchedBorder; +- import javax.swing.border.TitledBorder; +- +- public class MinecraftServerGui extends JComponent +- { +- private static boolean field_120022_a; +- private DedicatedServer field_120021_b; +- +- public static void func_120016_a(DedicatedServer par0DedicatedServer) +- { +- try +- { +- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); +- } +- catch (Exception var3) +- { +- ; +- } +- +- MinecraftServerGui var1 = new MinecraftServerGui(par0DedicatedServer); +- field_120022_a = true; +- JFrame var2 = new JFrame("Minecraft server"); +- var2.add(var1); +- var2.pack(); +- var2.setLocationRelativeTo((Component)null); +- var2.setVisible(true); +- var2.addWindowListener(new MinecraftServerGuiINNER1(par0DedicatedServer)); +- } +- +- public MinecraftServerGui(DedicatedServer par1DedicatedServer) +- { +- this.field_120021_b = par1DedicatedServer; +- this.setPreferredSize(new Dimension(854, 480)); +- this.setLayout(new BorderLayout()); +- +- try +- { +- this.add(this.func_120018_d(), "Center"); +- this.add(this.func_120019_b(), "West"); +- } +- catch (Exception var3) +- { +- var3.printStackTrace(); +- } +- } +- +- private JComponent func_120019_b() +- { +- JPanel var1 = new JPanel(new BorderLayout()); +- var1.add(new StatsComponent(this.field_120021_b), "North"); +- var1.add(this.func_120020_c(), "Center"); +- var1.setBorder(new TitledBorder(new EtchedBorder(), "Stats")); +- return var1; +- } +- +- private JComponent func_120020_c() +- { +- PlayerListComponent var1 = new PlayerListComponent(this.field_120021_b); +- JScrollPane var2 = new JScrollPane(var1, 22, 30); +- var2.setBorder(new TitledBorder(new EtchedBorder(), "Players")); +- return var2; +- } +- +- private JComponent func_120018_d() +- { +- JPanel var1 = new JPanel(new BorderLayout()); +- JTextArea var2 = new JTextArea(); +- this.field_120021_b.getLogAgent().func_120013_a().addHandler(new TextAreaLogHandler(var2)); +- JScrollPane var3 = new JScrollPane(var2, 22, 30); +- var2.setEditable(false); +- JTextField var4 = new JTextField(); +- var4.addActionListener(new MinecraftServerGuiINNER2(this, var4)); +- var2.addFocusListener(new MinecraftServerGuiINNER3(this)); +- var1.add(var3, "Center"); +- var1.add(var4, "South"); +- var1.setBorder(new TitledBorder(new EtchedBorder(), "Log and chat")); +- return var1; +- } +- +- static DedicatedServer func_120017_a(MinecraftServerGui par0MinecraftServerGui) +- { +- return par0MinecraftServerGui.field_120021_b; +- } +- } +--- 0 ---- +*** MinecraftServerGuiINNER1.java Sat Feb 5 04:13:14 2022 +--- /dev/null Thu Jan 1 01:00:00 1970 +*************** +*** 1,33 **** +- package net.minecraft.src; +- +- import java.awt.event.WindowAdapter; +- import java.awt.event.WindowEvent; +- +- final class MinecraftServerGuiINNER1 extends WindowAdapter +- { +- final DedicatedServer field_120023_a; +- +- MinecraftServerGuiINNER1(DedicatedServer par1DedicatedServer) +- { +- this.field_120023_a = par1DedicatedServer; +- } +- +- public void windowClosing(WindowEvent par1WindowEvent) +- { +- this.field_120023_a.initiateShutdown(); +- +- while (!this.field_120023_a.isServerStopped()) +- { +- try +- { +- Thread.sleep(100L); +- } +- catch (InterruptedException var3) +- { +- var3.printStackTrace(); +- } +- } +- +- System.exit(0); +- } +- } +--- 0 ---- +*** MinecraftServerGuiINNER2.java Sat Feb 5 04:13:14 2022 +--- /dev/null Thu Jan 1 01:00:00 1970 +*************** +*** 1,31 **** +- package net.minecraft.src; +- +- import java.awt.event.ActionEvent; +- import java.awt.event.ActionListener; +- import javax.swing.JTextField; +- import net.minecraft.server.MinecraftServer; +- +- class MinecraftServerGuiINNER2 implements ActionListener +- { +- final JTextField field_120025_a; +- +- final MinecraftServerGui field_120024_b; +- +- MinecraftServerGuiINNER2(MinecraftServerGui par1MinecraftServerGui, JTextField par2JTextField) +- { +- this.field_120024_b = par1MinecraftServerGui; +- this.field_120025_a = par2JTextField; +- } +- +- public void actionPerformed(ActionEvent par1ActionEvent) +- { +- String var2 = this.field_120025_a.getText().trim(); +- +- if (var2.length() > 0) +- { +- MinecraftServerGui.func_120017_a(this.field_120024_b).addPendingCommand(var2, MinecraftServer.getServer()); +- } +- +- this.field_120025_a.setText(""); +- } +- } +--- 0 ---- +*** MinecraftServerGuiINNER3.java Sat Feb 5 04:13:14 2022 +--- /dev/null Thu Jan 1 01:00:00 1970 +*************** +*** 1,16 **** +- package net.minecraft.src; +- +- import java.awt.event.FocusAdapter; +- import java.awt.event.FocusEvent; +- +- class MinecraftServerGuiINNER3 extends FocusAdapter +- { +- final MinecraftServerGui field_120032_a; +- +- MinecraftServerGuiINNER3(MinecraftServerGui par1MinecraftServerGui) +- { +- this.field_120032_a = par1MinecraftServerGui; +- } +- +- public void focusGained(FocusEvent par1FocusEvent) {} +- } +--- 0 ---- +*** MobSpawnerBaseLogic.java Sat Feb 5 04:13:14 2022 +--- MobSpawnerBaseLogic.java Sat Feb 5 04:12:35 2022 +*************** +*** 15,24 **** +--- 15,26 ---- + private WeightedRandomMinecart randomMinecart; + public double field_98287_c; + public double field_98284_d; + private int minSpawnDelay = 200; + private int maxSpawnDelay = 800; ++ ++ /** A counter for spawn tries. */ + private int spawnCount = 4; + private Entity field_98291_j; + private int maxNearbyEntities = 6; + + /** The distance from which a player activates the spawner. */ +*************** +*** 313,322 **** +--- 315,336 ---- + var2.appendTag(this.getRandomMinecart().func_98220_a()); + } + + par1NBTTagCompound.setTag("SpawnPotentials", var2); + } ++ } ++ ++ public Entity func_98281_h() ++ { ++ if (this.field_98291_j == null) ++ { ++ Entity var1 = EntityList.createEntityByName(this.getEntityNameToSpawn(), (World)null); ++ var1 = this.func_98265_a(var1); ++ this.field_98291_j = var1; ++ } ++ ++ return this.field_98291_j; + } + + /** + * Sets the delay to minDelay if parameter given is 1, else return false. + */ +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelBase.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,57 ---- ++ package net.minecraft.src; ++ ++ import java.util.ArrayList; ++ import java.util.HashMap; ++ import java.util.List; ++ import java.util.Map; ++ import java.util.Random; ++ ++ public abstract class ModelBase ++ { ++ public float onGround; ++ public boolean isRiding; ++ ++ /** ++ * This is a list of all the boxes (ModelRenderer.class) in the current model. ++ */ ++ public List boxList = new ArrayList(); ++ public boolean isChild = true; ++ ++ /** A mapping for all texture offsets */ ++ private Map modelTextureMap = new HashMap(); ++ public int textureWidth = 64; ++ public int textureHeight = 32; ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {} ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) {} ++ ++ /** ++ * Used for easily adding entity-dependent animations. The second and third float params here are the same second ++ * and third as in the setRotationAngles method. ++ */ ++ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) {} ++ ++ public ModelRenderer getRandomModelBox(Random par1Random) ++ { ++ return (ModelRenderer)this.boxList.get(par1Random.nextInt(this.boxList.size())); ++ } ++ ++ protected void setTextureOffset(String par1Str, int par2, int par3) ++ { ++ this.modelTextureMap.put(par1Str, new TextureOffset(par2, par3)); ++ } ++ ++ public TextureOffset getTextureOffset(String par1Str) ++ { ++ return (TextureOffset)this.modelTextureMap.get(par1Str); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelBat.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,110 ---- ++ package net.minecraft.src; ++ ++ public class ModelBat extends ModelBase ++ { ++ private ModelRenderer batHead; ++ ++ /** The body box of the bat model. */ ++ private ModelRenderer batBody; ++ ++ /** The inner right wing box of the bat model. */ ++ private ModelRenderer batRightWing; ++ ++ /** The inner left wing box of the bat model. */ ++ private ModelRenderer batLeftWing; ++ ++ /** The outer right wing box of the bat model. */ ++ private ModelRenderer batOuterRightWing; ++ ++ /** The outer left wing box of the bat model. */ ++ private ModelRenderer batOuterLeftWing; ++ ++ public ModelBat() ++ { ++ this.textureWidth = 64; ++ this.textureHeight = 64; ++ this.batHead = new ModelRenderer(this, 0, 0); ++ this.batHead.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6); ++ ModelRenderer var1 = new ModelRenderer(this, 24, 0); ++ var1.addBox(-4.0F, -6.0F, -2.0F, 3, 4, 1); ++ this.batHead.addChild(var1); ++ ModelRenderer var2 = new ModelRenderer(this, 24, 0); ++ var2.mirror = true; ++ var2.addBox(1.0F, -6.0F, -2.0F, 3, 4, 1); ++ this.batHead.addChild(var2); ++ this.batBody = new ModelRenderer(this, 0, 16); ++ this.batBody.addBox(-3.0F, 4.0F, -3.0F, 6, 12, 6); ++ this.batBody.setTextureOffset(0, 34).addBox(-5.0F, 16.0F, 0.0F, 10, 6, 1); ++ this.batRightWing = new ModelRenderer(this, 42, 0); ++ this.batRightWing.addBox(-12.0F, 1.0F, 1.5F, 10, 16, 1); ++ this.batOuterRightWing = new ModelRenderer(this, 24, 16); ++ this.batOuterRightWing.setRotationPoint(-12.0F, 1.0F, 1.5F); ++ this.batOuterRightWing.addBox(-8.0F, 1.0F, 0.0F, 8, 12, 1); ++ this.batLeftWing = new ModelRenderer(this, 42, 0); ++ this.batLeftWing.mirror = true; ++ this.batLeftWing.addBox(2.0F, 1.0F, 1.5F, 10, 16, 1); ++ this.batOuterLeftWing = new ModelRenderer(this, 24, 16); ++ this.batOuterLeftWing.mirror = true; ++ this.batOuterLeftWing.setRotationPoint(12.0F, 1.0F, 1.5F); ++ this.batOuterLeftWing.addBox(0.0F, 1.0F, 0.0F, 8, 12, 1); ++ this.batBody.addChild(this.batRightWing); ++ this.batBody.addChild(this.batLeftWing); ++ this.batRightWing.addChild(this.batOuterRightWing); ++ this.batLeftWing.addChild(this.batOuterLeftWing); ++ } ++ ++ /** ++ * not actually sure this is size, is not used as of now, but the model would be recreated if the value changed and ++ * it seems a good match for a bats size ++ */ ++ public int getBatSize() ++ { ++ return 36; ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ EntityBat var8 = (EntityBat)par1Entity; ++ float var9; ++ ++ if (var8.getIsBatHanging()) ++ { ++ var9 = (180F / (float)Math.PI); ++ this.batHead.rotateAngleX = par6 / (180F / (float)Math.PI); ++ this.batHead.rotateAngleY = (float)Math.PI - par5 / (180F / (float)Math.PI); ++ this.batHead.rotateAngleZ = (float)Math.PI; ++ this.batHead.setRotationPoint(0.0F, -2.0F, 0.0F); ++ this.batRightWing.setRotationPoint(-3.0F, 0.0F, 3.0F); ++ this.batLeftWing.setRotationPoint(3.0F, 0.0F, 3.0F); ++ this.batBody.rotateAngleX = (float)Math.PI; ++ this.batRightWing.rotateAngleX = -0.15707964F; ++ this.batRightWing.rotateAngleY = -((float)Math.PI * 2F / 5F); ++ this.batOuterRightWing.rotateAngleY = -1.7278761F; ++ this.batLeftWing.rotateAngleX = this.batRightWing.rotateAngleX; ++ this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY; ++ this.batOuterLeftWing.rotateAngleY = -this.batOuterRightWing.rotateAngleY; ++ } ++ else ++ { ++ var9 = (180F / (float)Math.PI); ++ this.batHead.rotateAngleX = par6 / (180F / (float)Math.PI); ++ this.batHead.rotateAngleY = par5 / (180F / (float)Math.PI); ++ this.batHead.rotateAngleZ = 0.0F; ++ this.batHead.setRotationPoint(0.0F, 0.0F, 0.0F); ++ this.batRightWing.setRotationPoint(0.0F, 0.0F, 0.0F); ++ this.batLeftWing.setRotationPoint(0.0F, 0.0F, 0.0F); ++ this.batBody.rotateAngleX = ((float)Math.PI / 4F) + MathHelper.cos(par4 * 0.1F) * 0.15F; ++ this.batBody.rotateAngleY = 0.0F; ++ this.batRightWing.rotateAngleY = MathHelper.cos(par4 * 1.3F) * (float)Math.PI * 0.25F; ++ this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY; ++ this.batOuterRightWing.rotateAngleY = this.batRightWing.rotateAngleY * 0.5F; ++ this.batOuterLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY * 0.5F; ++ } ++ ++ this.batHead.render(par7); ++ this.batBody.render(par7); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelBiped.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,245 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class ModelBiped extends ModelBase ++ { ++ public ModelRenderer bipedHead; ++ public ModelRenderer bipedHeadwear; ++ public ModelRenderer bipedBody; ++ public ModelRenderer bipedRightArm; ++ public ModelRenderer bipedLeftArm; ++ public ModelRenderer bipedRightLeg; ++ public ModelRenderer bipedLeftLeg; ++ public ModelRenderer bipedEars; ++ public ModelRenderer bipedCloak; ++ ++ /** ++ * Records whether the model should be rendered holding an item in the left hand, and if that item is a block. ++ */ ++ public int heldItemLeft; ++ ++ /** ++ * Records whether the model should be rendered holding an item in the right hand, and if that item is a block. ++ */ ++ public int heldItemRight; ++ public boolean isSneak; ++ ++ /** Records whether the model should be rendered aiming a bow. */ ++ public boolean aimedBow; ++ ++ public ModelBiped() ++ { ++ this(0.0F); ++ } ++ ++ public ModelBiped(float par1) ++ { ++ this(par1, 0.0F, 64, 32); ++ } ++ ++ public ModelBiped(float par1, float par2, int par3, int par4) ++ { ++ this.textureWidth = par3; ++ this.textureHeight = par4; ++ this.bipedCloak = new ModelRenderer(this, 0, 0); ++ this.bipedCloak.addBox(-5.0F, 0.0F, -1.0F, 10, 16, 1, par1); ++ this.bipedEars = new ModelRenderer(this, 24, 0); ++ this.bipedEars.addBox(-3.0F, -6.0F, -1.0F, 6, 6, 1, par1); ++ this.bipedHead = new ModelRenderer(this, 0, 0); ++ this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1); ++ this.bipedHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F); ++ this.bipedHeadwear = new ModelRenderer(this, 32, 0); ++ this.bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1 + 0.5F); ++ this.bipedHeadwear.setRotationPoint(0.0F, 0.0F + par2, 0.0F); ++ this.bipedBody = new ModelRenderer(this, 16, 16); ++ this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1); ++ this.bipedBody.setRotationPoint(0.0F, 0.0F + par2, 0.0F); ++ this.bipedRightArm = new ModelRenderer(this, 40, 16); ++ this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, par1); ++ this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + par2, 0.0F); ++ this.bipedLeftArm = new ModelRenderer(this, 40, 16); ++ this.bipedLeftArm.mirror = true; ++ this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, par1); ++ this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + par2, 0.0F); ++ this.bipedRightLeg = new ModelRenderer(this, 0, 16); ++ this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); ++ this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + par2, 0.0F); ++ this.bipedLeftLeg = new ModelRenderer(this, 0, 16); ++ this.bipedLeftLeg.mirror = true; ++ this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); ++ this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + par2, 0.0F); ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ ++ if (this.isChild) ++ { ++ float var8 = 2.0F; ++ GL11.glPushMatrix(); ++ GL11.glScalef(1.5F / var8, 1.5F / var8, 1.5F / var8); ++ GL11.glTranslatef(0.0F, 16.0F * par7, 0.0F); ++ this.bipedHead.render(par7); ++ GL11.glPopMatrix(); ++ GL11.glPushMatrix(); ++ GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); ++ GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); ++ this.bipedBody.render(par7); ++ this.bipedRightArm.render(par7); ++ this.bipedLeftArm.render(par7); ++ this.bipedRightLeg.render(par7); ++ this.bipedLeftLeg.render(par7); ++ this.bipedHeadwear.render(par7); ++ GL11.glPopMatrix(); ++ } ++ else ++ { ++ this.bipedHead.render(par7); ++ this.bipedBody.render(par7); ++ this.bipedRightArm.render(par7); ++ this.bipedLeftArm.render(par7); ++ this.bipedRightLeg.render(par7); ++ this.bipedLeftLeg.render(par7); ++ this.bipedHeadwear.render(par7); ++ } ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ this.bipedHead.rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.bipedHead.rotateAngleX = par5 / (180F / (float)Math.PI); ++ this.bipedHeadwear.rotateAngleY = this.bipedHead.rotateAngleY; ++ this.bipedHeadwear.rotateAngleX = this.bipedHead.rotateAngleX; ++ this.bipedRightArm.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 2.0F * par2 * 0.5F; ++ this.bipedLeftArm.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 2.0F * par2 * 0.5F; ++ this.bipedRightArm.rotateAngleZ = 0.0F; ++ this.bipedLeftArm.rotateAngleZ = 0.0F; ++ this.bipedRightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2; ++ this.bipedLeftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2; ++ this.bipedRightLeg.rotateAngleY = 0.0F; ++ this.bipedLeftLeg.rotateAngleY = 0.0F; ++ ++ if (this.isRiding) ++ { ++ this.bipedRightArm.rotateAngleX += -((float)Math.PI / 5F); ++ this.bipedLeftArm.rotateAngleX += -((float)Math.PI / 5F); ++ this.bipedRightLeg.rotateAngleX = -((float)Math.PI * 2F / 5F); ++ this.bipedLeftLeg.rotateAngleX = -((float)Math.PI * 2F / 5F); ++ this.bipedRightLeg.rotateAngleY = ((float)Math.PI / 10F); ++ this.bipedLeftLeg.rotateAngleY = -((float)Math.PI / 10F); ++ } ++ ++ if (this.heldItemLeft != 0) ++ { ++ this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemLeft; ++ } ++ ++ if (this.heldItemRight != 0) ++ { ++ this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemRight; ++ } ++ ++ this.bipedRightArm.rotateAngleY = 0.0F; ++ this.bipedLeftArm.rotateAngleY = 0.0F; ++ float var8; ++ float var9; ++ ++ if (this.onGround > -9990.0F) ++ { ++ var8 = this.onGround; ++ this.bipedBody.rotateAngleY = MathHelper.sin(MathHelper.sqrt_float(var8) * (float)Math.PI * 2.0F) * 0.2F; ++ this.bipedRightArm.rotationPointZ = MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F; ++ this.bipedRightArm.rotationPointX = -MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F; ++ this.bipedLeftArm.rotationPointZ = -MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F; ++ this.bipedLeftArm.rotationPointX = MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F; ++ this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY; ++ this.bipedLeftArm.rotateAngleY += this.bipedBody.rotateAngleY; ++ this.bipedLeftArm.rotateAngleX += this.bipedBody.rotateAngleY; ++ var8 = 1.0F - this.onGround; ++ var8 *= var8; ++ var8 *= var8; ++ var8 = 1.0F - var8; ++ var9 = MathHelper.sin(var8 * (float)Math.PI); ++ float var10 = MathHelper.sin(this.onGround * (float)Math.PI) * -(this.bipedHead.rotateAngleX - 0.7F) * 0.75F; ++ this.bipedRightArm.rotateAngleX = (float)((double)this.bipedRightArm.rotateAngleX - ((double)var9 * 1.2D + (double)var10)); ++ this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F; ++ this.bipedRightArm.rotateAngleZ = MathHelper.sin(this.onGround * (float)Math.PI) * -0.4F; ++ } ++ ++ if (this.isSneak) ++ { ++ this.bipedBody.rotateAngleX = 0.5F; ++ this.bipedRightArm.rotateAngleX += 0.4F; ++ this.bipedLeftArm.rotateAngleX += 0.4F; ++ this.bipedRightLeg.rotationPointZ = 4.0F; ++ this.bipedLeftLeg.rotationPointZ = 4.0F; ++ this.bipedRightLeg.rotationPointY = 9.0F; ++ this.bipedLeftLeg.rotationPointY = 9.0F; ++ this.bipedHead.rotationPointY = 1.0F; ++ this.bipedHeadwear.rotationPointY = 1.0F; ++ } ++ else ++ { ++ this.bipedBody.rotateAngleX = 0.0F; ++ this.bipedRightLeg.rotationPointZ = 0.1F; ++ this.bipedLeftLeg.rotationPointZ = 0.1F; ++ this.bipedRightLeg.rotationPointY = 12.0F; ++ this.bipedLeftLeg.rotationPointY = 12.0F; ++ this.bipedHead.rotationPointY = 0.0F; ++ this.bipedHeadwear.rotationPointY = 0.0F; ++ } ++ ++ this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; ++ this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; ++ this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; ++ this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; ++ ++ if (this.aimedBow) ++ { ++ var8 = 0.0F; ++ var9 = 0.0F; ++ this.bipedRightArm.rotateAngleZ = 0.0F; ++ this.bipedLeftArm.rotateAngleZ = 0.0F; ++ this.bipedRightArm.rotateAngleY = -(0.1F - var8 * 0.6F) + this.bipedHead.rotateAngleY; ++ this.bipedLeftArm.rotateAngleY = 0.1F - var8 * 0.6F + this.bipedHead.rotateAngleY + 0.4F; ++ this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX; ++ this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX; ++ this.bipedRightArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; ++ this.bipedLeftArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; ++ this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; ++ this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; ++ this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; ++ this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; ++ } ++ } ++ ++ /** ++ * renders the ears (specifically, deadmau5's) ++ */ ++ public void renderEars(float par1) ++ { ++ this.bipedEars.rotateAngleY = this.bipedHead.rotateAngleY; ++ this.bipedEars.rotateAngleX = this.bipedHead.rotateAngleX; ++ this.bipedEars.rotationPointX = 0.0F; ++ this.bipedEars.rotationPointY = 0.0F; ++ this.bipedEars.render(par1); ++ } ++ ++ /** ++ * Renders the cloak of the current biped (in most cases, it's a player) ++ */ ++ public void renderCloak(float par1) ++ { ++ this.bipedCloak.render(par1); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelBlaze.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,81 ---- ++ package net.minecraft.src; ++ ++ public class ModelBlaze extends ModelBase ++ { ++ /** The sticks that fly around the Blaze. */ ++ private ModelRenderer[] blazeSticks = new ModelRenderer[12]; ++ private ModelRenderer blazeHead; ++ ++ public ModelBlaze() ++ { ++ for (int var1 = 0; var1 < this.blazeSticks.length; ++var1) ++ { ++ this.blazeSticks[var1] = new ModelRenderer(this, 0, 16); ++ this.blazeSticks[var1].addBox(0.0F, 0.0F, 0.0F, 2, 8, 2); ++ } ++ ++ this.blazeHead = new ModelRenderer(this, 0, 0); ++ this.blazeHead.addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8); ++ } ++ ++ public int func_78104_a() ++ { ++ return 8; ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ this.blazeHead.render(par7); ++ ++ for (int var8 = 0; var8 < this.blazeSticks.length; ++var8) ++ { ++ this.blazeSticks[var8].render(par7); ++ } ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ float var8 = par3 * (float)Math.PI * -0.1F; ++ int var9; ++ ++ for (var9 = 0; var9 < 4; ++var9) ++ { ++ this.blazeSticks[var9].rotationPointY = -2.0F + MathHelper.cos(((float)(var9 * 2) + par3) * 0.25F); ++ this.blazeSticks[var9].rotationPointX = MathHelper.cos(var8) * 9.0F; ++ this.blazeSticks[var9].rotationPointZ = MathHelper.sin(var8) * 9.0F; ++ ++var8; ++ } ++ ++ var8 = ((float)Math.PI / 4F) + par3 * (float)Math.PI * 0.03F; ++ ++ for (var9 = 4; var9 < 8; ++var9) ++ { ++ this.blazeSticks[var9].rotationPointY = 2.0F + MathHelper.cos(((float)(var9 * 2) + par3) * 0.25F); ++ this.blazeSticks[var9].rotationPointX = MathHelper.cos(var8) * 7.0F; ++ this.blazeSticks[var9].rotationPointZ = MathHelper.sin(var8) * 7.0F; ++ ++var8; ++ } ++ ++ var8 = 0.47123894F + par3 * (float)Math.PI * -0.05F; ++ ++ for (var9 = 8; var9 < 12; ++var9) ++ { ++ this.blazeSticks[var9].rotationPointY = 11.0F + MathHelper.cos(((float)var9 * 1.5F + par3) * 0.5F); ++ this.blazeSticks[var9].rotationPointX = MathHelper.cos(var8) * 5.0F; ++ this.blazeSticks[var9].rotationPointZ = MathHelper.sin(var8) * 5.0F; ++ ++var8; ++ } ++ ++ this.blazeHead.rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.blazeHead.rotateAngleX = par5 / (180F / (float)Math.PI); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelBoat.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,44 ---- ++ package net.minecraft.src; ++ ++ public class ModelBoat extends ModelBase ++ { ++ public ModelRenderer[] boatSides = new ModelRenderer[5]; ++ ++ public ModelBoat() ++ { ++ this.boatSides[0] = new ModelRenderer(this, 0, 8); ++ this.boatSides[1] = new ModelRenderer(this, 0, 0); ++ this.boatSides[2] = new ModelRenderer(this, 0, 0); ++ this.boatSides[3] = new ModelRenderer(this, 0, 0); ++ this.boatSides[4] = new ModelRenderer(this, 0, 0); ++ byte var1 = 24; ++ byte var2 = 6; ++ byte var3 = 20; ++ byte var4 = 4; ++ this.boatSides[0].addBox((float)(-var1 / 2), (float)(-var3 / 2 + 2), -3.0F, var1, var3 - 4, 4, 0.0F); ++ this.boatSides[0].setRotationPoint(0.0F, (float)var4, 0.0F); ++ this.boatSides[1].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F); ++ this.boatSides[1].setRotationPoint((float)(-var1 / 2 + 1), (float)var4, 0.0F); ++ this.boatSides[2].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F); ++ this.boatSides[2].setRotationPoint((float)(var1 / 2 - 1), (float)var4, 0.0F); ++ this.boatSides[3].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F); ++ this.boatSides[3].setRotationPoint(0.0F, (float)var4, (float)(-var3 / 2 + 1)); ++ this.boatSides[4].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F); ++ this.boatSides[4].setRotationPoint(0.0F, (float)var4, (float)(var3 / 2 - 1)); ++ this.boatSides[0].rotateAngleX = ((float)Math.PI / 2F); ++ this.boatSides[1].rotateAngleY = ((float)Math.PI * 3F / 2F); ++ this.boatSides[2].rotateAngleY = ((float)Math.PI / 2F); ++ this.boatSides[3].rotateAngleY = (float)Math.PI; ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ for (int var8 = 0; var8 < 5; ++var8) ++ { ++ this.boatSides[var8].render(par7); ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelBook.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,67 ---- ++ package net.minecraft.src; ++ ++ public class ModelBook extends ModelBase ++ { ++ /** Right cover renderer (when facing the book) */ ++ public ModelRenderer coverRight = (new ModelRenderer(this)).setTextureOffset(0, 0).addBox(-6.0F, -5.0F, 0.0F, 6, 10, 0); ++ ++ /** Left cover renderer (when facing the book) */ ++ public ModelRenderer coverLeft = (new ModelRenderer(this)).setTextureOffset(16, 0).addBox(0.0F, -5.0F, 0.0F, 6, 10, 0); ++ ++ /** The right pages renderer (when facing the book) */ ++ public ModelRenderer pagesRight = (new ModelRenderer(this)).setTextureOffset(0, 10).addBox(0.0F, -4.0F, -0.99F, 5, 8, 1); ++ ++ /** The left pages renderer (when facing the book) */ ++ public ModelRenderer pagesLeft = (new ModelRenderer(this)).setTextureOffset(12, 10).addBox(0.0F, -4.0F, -0.01F, 5, 8, 1); ++ ++ /** Right cover renderer (when facing the book) */ ++ public ModelRenderer flippingPageRight = (new ModelRenderer(this)).setTextureOffset(24, 10).addBox(0.0F, -4.0F, 0.0F, 5, 8, 0); ++ ++ /** Right cover renderer (when facing the book) */ ++ public ModelRenderer flippingPageLeft = (new ModelRenderer(this)).setTextureOffset(24, 10).addBox(0.0F, -4.0F, 0.0F, 5, 8, 0); ++ ++ /** The renderer of spine of the book */ ++ public ModelRenderer bookSpine = (new ModelRenderer(this)).setTextureOffset(12, 0).addBox(-1.0F, -5.0F, 0.0F, 2, 10, 0); ++ ++ public ModelBook() ++ { ++ this.coverRight.setRotationPoint(0.0F, 0.0F, -1.0F); ++ this.coverLeft.setRotationPoint(0.0F, 0.0F, 1.0F); ++ this.bookSpine.rotateAngleY = ((float)Math.PI / 2F); ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ this.coverRight.render(par7); ++ this.coverLeft.render(par7); ++ this.bookSpine.render(par7); ++ this.pagesRight.render(par7); ++ this.pagesLeft.render(par7); ++ this.flippingPageRight.render(par7); ++ this.flippingPageLeft.render(par7); ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ float var8 = (MathHelper.sin(par1 * 0.02F) * 0.1F + 1.25F) * par4; ++ this.coverRight.rotateAngleY = (float)Math.PI + var8; ++ this.coverLeft.rotateAngleY = -var8; ++ this.pagesRight.rotateAngleY = var8; ++ this.pagesLeft.rotateAngleY = -var8; ++ this.flippingPageRight.rotateAngleY = var8 - var8 * 2.0F * par2; ++ this.flippingPageLeft.rotateAngleY = var8 - var8 * 2.0F * par3; ++ this.pagesRight.rotationPointX = MathHelper.sin(var8); ++ this.pagesLeft.rotationPointX = MathHelper.sin(var8); ++ this.flippingPageRight.rotationPointX = MathHelper.sin(var8); ++ this.flippingPageLeft.rotationPointX = MathHelper.sin(var8); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelBox.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,107 ---- ++ package net.minecraft.src; ++ ++ public class ModelBox ++ { ++ /** ++ * The (x,y,z) vertex positions and (u,v) texture coordinates for each of the 8 points on a cube ++ */ ++ private PositionTextureVertex[] vertexPositions; ++ ++ /** An array of 6 TexturedQuads, one for each face of a cube */ ++ private TexturedQuad[] quadList; ++ ++ /** X vertex coordinate of lower box corner */ ++ public final float posX1; ++ ++ /** Y vertex coordinate of lower box corner */ ++ public final float posY1; ++ ++ /** Z vertex coordinate of lower box corner */ ++ public final float posZ1; ++ ++ /** X vertex coordinate of upper box corner */ ++ public final float posX2; ++ ++ /** Y vertex coordinate of upper box corner */ ++ public final float posY2; ++ ++ /** Z vertex coordinate of upper box corner */ ++ public final float posZ2; ++ public String field_78247_g; ++ ++ public ModelBox(ModelRenderer par1ModelRenderer, int par2, int par3, float par4, float par5, float par6, int par7, int par8, int par9, float par10) ++ { ++ this.posX1 = par4; ++ this.posY1 = par5; ++ this.posZ1 = par6; ++ this.posX2 = par4 + (float)par7; ++ this.posY2 = par5 + (float)par8; ++ this.posZ2 = par6 + (float)par9; ++ this.vertexPositions = new PositionTextureVertex[8]; ++ this.quadList = new TexturedQuad[6]; ++ float var11 = par4 + (float)par7; ++ float var12 = par5 + (float)par8; ++ float var13 = par6 + (float)par9; ++ par4 -= par10; ++ par5 -= par10; ++ par6 -= par10; ++ var11 += par10; ++ var12 += par10; ++ var13 += par10; ++ ++ if (par1ModelRenderer.mirror) ++ { ++ float var14 = var11; ++ var11 = par4; ++ par4 = var14; ++ } ++ ++ PositionTextureVertex var23 = new PositionTextureVertex(par4, par5, par6, 0.0F, 0.0F); ++ PositionTextureVertex var15 = new PositionTextureVertex(var11, par5, par6, 0.0F, 8.0F); ++ PositionTextureVertex var16 = new PositionTextureVertex(var11, var12, par6, 8.0F, 8.0F); ++ PositionTextureVertex var17 = new PositionTextureVertex(par4, var12, par6, 8.0F, 0.0F); ++ PositionTextureVertex var18 = new PositionTextureVertex(par4, par5, var13, 0.0F, 0.0F); ++ PositionTextureVertex var19 = new PositionTextureVertex(var11, par5, var13, 0.0F, 8.0F); ++ PositionTextureVertex var20 = new PositionTextureVertex(var11, var12, var13, 8.0F, 8.0F); ++ PositionTextureVertex var21 = new PositionTextureVertex(par4, var12, var13, 8.0F, 0.0F); ++ this.vertexPositions[0] = var23; ++ this.vertexPositions[1] = var15; ++ this.vertexPositions[2] = var16; ++ this.vertexPositions[3] = var17; ++ this.vertexPositions[4] = var18; ++ this.vertexPositions[5] = var19; ++ this.vertexPositions[6] = var20; ++ this.vertexPositions[7] = var21; ++ this.quadList[0] = new TexturedQuad(new PositionTextureVertex[] {var19, var15, var16, var20}, par2 + par9 + par7, par3 + par9, par2 + par9 + par7 + par9, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); ++ this.quadList[1] = new TexturedQuad(new PositionTextureVertex[] {var23, var18, var21, var17}, par2, par3 + par9, par2 + par9, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); ++ this.quadList[2] = new TexturedQuad(new PositionTextureVertex[] {var19, var18, var23, var15}, par2 + par9, par3, par2 + par9 + par7, par3 + par9, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); ++ this.quadList[3] = new TexturedQuad(new PositionTextureVertex[] {var16, var17, var21, var20}, par2 + par9 + par7, par3 + par9, par2 + par9 + par7 + par7, par3, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); ++ this.quadList[4] = new TexturedQuad(new PositionTextureVertex[] {var15, var23, var17, var16}, par2 + par9, par3 + par9, par2 + par9 + par7, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); ++ this.quadList[5] = new TexturedQuad(new PositionTextureVertex[] {var18, var19, var20, var21}, par2 + par9 + par7 + par9, par3 + par9, par2 + par9 + par7 + par9 + par7, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); ++ ++ if (par1ModelRenderer.mirror) ++ { ++ for (int var22 = 0; var22 < this.quadList.length; ++var22) ++ { ++ this.quadList[var22].flipFace(); ++ } ++ } ++ } ++ ++ /** ++ * Draw the six sided box defined by this ModelBox ++ */ ++ public void render(Tessellator par1Tessellator, float par2) ++ { ++ for (int var3 = 0; var3 < this.quadList.length; ++var3) ++ { ++ this.quadList[var3].draw(par1Tessellator, par2); ++ } ++ } ++ ++ public ModelBox func_78244_a(String par1Str) ++ { ++ this.field_78247_g = par1Str; ++ return this; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelChest.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,42 ---- ++ package net.minecraft.src; ++ ++ public class ModelChest extends ModelBase ++ { ++ /** The chest lid in the chest's model. */ ++ public ModelRenderer chestLid = (new ModelRenderer(this, 0, 0)).setTextureSize(64, 64); ++ ++ /** The model of the bottom of the chest. */ ++ public ModelRenderer chestBelow; ++ ++ /** The chest's knob in the chest model. */ ++ public ModelRenderer chestKnob; ++ ++ public ModelChest() ++ { ++ this.chestLid.addBox(0.0F, -5.0F, -14.0F, 14, 5, 14, 0.0F); ++ this.chestLid.rotationPointX = 1.0F; ++ this.chestLid.rotationPointY = 7.0F; ++ this.chestLid.rotationPointZ = 15.0F; ++ this.chestKnob = (new ModelRenderer(this, 0, 0)).setTextureSize(64, 64); ++ this.chestKnob.addBox(-1.0F, -2.0F, -15.0F, 2, 4, 1, 0.0F); ++ this.chestKnob.rotationPointX = 8.0F; ++ this.chestKnob.rotationPointY = 7.0F; ++ this.chestKnob.rotationPointZ = 15.0F; ++ this.chestBelow = (new ModelRenderer(this, 0, 19)).setTextureSize(64, 64); ++ this.chestBelow.addBox(0.0F, 0.0F, 0.0F, 14, 10, 14, 0.0F); ++ this.chestBelow.rotationPointX = 1.0F; ++ this.chestBelow.rotationPointY = 6.0F; ++ this.chestBelow.rotationPointZ = 1.0F; ++ } ++ ++ /** ++ * This method renders out all parts of the chest model. ++ */ ++ public void renderAll() ++ { ++ this.chestKnob.rotateAngleX = this.chestLid.rotateAngleX; ++ this.chestLid.render(0.0625F); ++ this.chestKnob.render(0.0625F); ++ this.chestBelow.render(0.0625F); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelChicken.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,103 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class ModelChicken extends ModelBase ++ { ++ public ModelRenderer head; ++ public ModelRenderer body; ++ public ModelRenderer rightLeg; ++ public ModelRenderer leftLeg; ++ public ModelRenderer rightWing; ++ public ModelRenderer leftWing; ++ public ModelRenderer bill; ++ public ModelRenderer chin; ++ ++ public ModelChicken() ++ { ++ byte var1 = 16; ++ this.head = new ModelRenderer(this, 0, 0); ++ this.head.addBox(-2.0F, -6.0F, -2.0F, 4, 6, 3, 0.0F); ++ this.head.setRotationPoint(0.0F, (float)(-1 + var1), -4.0F); ++ this.bill = new ModelRenderer(this, 14, 0); ++ this.bill.addBox(-2.0F, -4.0F, -4.0F, 4, 2, 2, 0.0F); ++ this.bill.setRotationPoint(0.0F, (float)(-1 + var1), -4.0F); ++ this.chin = new ModelRenderer(this, 14, 4); ++ this.chin.addBox(-1.0F, -2.0F, -3.0F, 2, 2, 2, 0.0F); ++ this.chin.setRotationPoint(0.0F, (float)(-1 + var1), -4.0F); ++ this.body = new ModelRenderer(this, 0, 9); ++ this.body.addBox(-3.0F, -4.0F, -3.0F, 6, 8, 6, 0.0F); ++ this.body.setRotationPoint(0.0F, (float)var1, 0.0F); ++ this.rightLeg = new ModelRenderer(this, 26, 0); ++ this.rightLeg.addBox(-1.0F, 0.0F, -3.0F, 3, 5, 3); ++ this.rightLeg.setRotationPoint(-2.0F, (float)(3 + var1), 1.0F); ++ this.leftLeg = new ModelRenderer(this, 26, 0); ++ this.leftLeg.addBox(-1.0F, 0.0F, -3.0F, 3, 5, 3); ++ this.leftLeg.setRotationPoint(1.0F, (float)(3 + var1), 1.0F); ++ this.rightWing = new ModelRenderer(this, 24, 13); ++ this.rightWing.addBox(0.0F, 0.0F, -3.0F, 1, 4, 6); ++ this.rightWing.setRotationPoint(-4.0F, (float)(-3 + var1), 0.0F); ++ this.leftWing = new ModelRenderer(this, 24, 13); ++ this.leftWing.addBox(-1.0F, 0.0F, -3.0F, 1, 4, 6); ++ this.leftWing.setRotationPoint(4.0F, (float)(-3 + var1), 0.0F); ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ ++ if (this.isChild) ++ { ++ float var8 = 2.0F; ++ GL11.glPushMatrix(); ++ GL11.glTranslatef(0.0F, 5.0F * par7, 2.0F * par7); ++ this.head.render(par7); ++ this.bill.render(par7); ++ this.chin.render(par7); ++ GL11.glPopMatrix(); ++ GL11.glPushMatrix(); ++ GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); ++ GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); ++ this.body.render(par7); ++ this.rightLeg.render(par7); ++ this.leftLeg.render(par7); ++ this.rightWing.render(par7); ++ this.leftWing.render(par7); ++ GL11.glPopMatrix(); ++ } ++ else ++ { ++ this.head.render(par7); ++ this.bill.render(par7); ++ this.chin.render(par7); ++ this.body.render(par7); ++ this.rightLeg.render(par7); ++ this.leftLeg.render(par7); ++ this.rightWing.render(par7); ++ this.leftWing.render(par7); ++ } ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ this.head.rotateAngleX = par5 / (180F / (float)Math.PI); ++ this.head.rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.bill.rotateAngleX = this.head.rotateAngleX; ++ this.bill.rotateAngleY = this.head.rotateAngleY; ++ this.chin.rotateAngleX = this.head.rotateAngleX; ++ this.chin.rotateAngleY = this.head.rotateAngleY; ++ this.body.rotateAngleX = ((float)Math.PI / 2F); ++ this.rightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2; ++ this.leftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2; ++ this.rightWing.rotateAngleZ = par3; ++ this.leftWing.rotateAngleZ = -par3; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelCow.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,27 ---- ++ package net.minecraft.src; ++ ++ public class ModelCow extends ModelQuadruped ++ { ++ public ModelCow() ++ { ++ super(12, 0.0F); ++ this.head = new ModelRenderer(this, 0, 0); ++ this.head.addBox(-4.0F, -4.0F, -6.0F, 8, 8, 6, 0.0F); ++ this.head.setRotationPoint(0.0F, 4.0F, -8.0F); ++ this.head.setTextureOffset(22, 0).addBox(-5.0F, -5.0F, -4.0F, 1, 3, 1, 0.0F); ++ this.head.setTextureOffset(22, 0).addBox(4.0F, -5.0F, -4.0F, 1, 3, 1, 0.0F); ++ this.body = new ModelRenderer(this, 18, 4); ++ this.body.addBox(-6.0F, -10.0F, -7.0F, 12, 18, 10, 0.0F); ++ this.body.setRotationPoint(0.0F, 5.0F, 2.0F); ++ this.body.setTextureOffset(52, 0).addBox(-2.0F, 2.0F, -8.0F, 4, 6, 1); ++ --this.leg1.rotationPointX; ++ ++this.leg2.rotationPointX; ++ this.leg1.rotationPointZ += 0.0F; ++ this.leg2.rotationPointZ += 0.0F; ++ --this.leg3.rotationPointX; ++ ++this.leg4.rotationPointX; ++ --this.leg3.rotationPointZ; ++ --this.leg4.rotationPointZ; ++ this.field_78151_h += 2.0F; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelCreeper.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,72 ---- ++ package net.minecraft.src; ++ ++ public class ModelCreeper extends ModelBase ++ { ++ public ModelRenderer head; ++ public ModelRenderer field_78133_b; ++ public ModelRenderer body; ++ public ModelRenderer leg1; ++ public ModelRenderer leg2; ++ public ModelRenderer leg3; ++ public ModelRenderer leg4; ++ ++ public ModelCreeper() ++ { ++ this(0.0F); ++ } ++ ++ public ModelCreeper(float par1) ++ { ++ byte var2 = 4; ++ this.head = new ModelRenderer(this, 0, 0); ++ this.head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1); ++ this.head.setRotationPoint(0.0F, (float)var2, 0.0F); ++ this.field_78133_b = new ModelRenderer(this, 32, 0); ++ this.field_78133_b.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1 + 0.5F); ++ this.field_78133_b.setRotationPoint(0.0F, (float)var2, 0.0F); ++ this.body = new ModelRenderer(this, 16, 16); ++ this.body.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1); ++ this.body.setRotationPoint(0.0F, (float)var2, 0.0F); ++ this.leg1 = new ModelRenderer(this, 0, 16); ++ this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, par1); ++ this.leg1.setRotationPoint(-2.0F, (float)(12 + var2), 4.0F); ++ this.leg2 = new ModelRenderer(this, 0, 16); ++ this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, par1); ++ this.leg2.setRotationPoint(2.0F, (float)(12 + var2), 4.0F); ++ this.leg3 = new ModelRenderer(this, 0, 16); ++ this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, par1); ++ this.leg3.setRotationPoint(-2.0F, (float)(12 + var2), -4.0F); ++ this.leg4 = new ModelRenderer(this, 0, 16); ++ this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, par1); ++ this.leg4.setRotationPoint(2.0F, (float)(12 + var2), -4.0F); ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ this.head.render(par7); ++ this.body.render(par7); ++ this.leg1.render(par7); ++ this.leg2.render(par7); ++ this.leg3.render(par7); ++ this.leg4.render(par7); ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ this.head.rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.head.rotateAngleX = par5 / (180F / (float)Math.PI); ++ this.leg1.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2; ++ this.leg2.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2; ++ this.leg3.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2; ++ this.leg4.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelDragon.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,260 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class ModelDragon extends ModelBase ++ { ++ /** The head Model renderer of the dragon */ ++ private ModelRenderer head; ++ ++ /** The spine Model renderer of the dragon */ ++ private ModelRenderer spine; ++ ++ /** The jaw Model renderer of the dragon */ ++ private ModelRenderer jaw; ++ ++ /** The body Model renderer of the dragon */ ++ private ModelRenderer body; ++ ++ /** The rear leg Model renderer of the dragon */ ++ private ModelRenderer rearLeg; ++ ++ /** The front leg Model renderer of the dragon */ ++ private ModelRenderer frontLeg; ++ ++ /** The rear leg tip Model renderer of the dragon */ ++ private ModelRenderer rearLegTip; ++ ++ /** The front leg tip Model renderer of the dragon */ ++ private ModelRenderer frontLegTip; ++ ++ /** The rear foot Model renderer of the dragon */ ++ private ModelRenderer rearFoot; ++ ++ /** The front foot Model renderer of the dragon */ ++ private ModelRenderer frontFoot; ++ ++ /** The wing Model renderer of the dragon */ ++ private ModelRenderer wing; ++ ++ /** The wing tip Model renderer of the dragon */ ++ private ModelRenderer wingTip; ++ private float partialTicks; ++ ++ public ModelDragon(float par1) ++ { ++ this.textureWidth = 256; ++ this.textureHeight = 256; ++ this.setTextureOffset("body.body", 0, 0); ++ this.setTextureOffset("wing.skin", -56, 88); ++ this.setTextureOffset("wingtip.skin", -56, 144); ++ this.setTextureOffset("rearleg.main", 0, 0); ++ this.setTextureOffset("rearfoot.main", 112, 0); ++ this.setTextureOffset("rearlegtip.main", 196, 0); ++ this.setTextureOffset("head.upperhead", 112, 30); ++ this.setTextureOffset("wing.bone", 112, 88); ++ this.setTextureOffset("head.upperlip", 176, 44); ++ this.setTextureOffset("jaw.jaw", 176, 65); ++ this.setTextureOffset("frontleg.main", 112, 104); ++ this.setTextureOffset("wingtip.bone", 112, 136); ++ this.setTextureOffset("frontfoot.main", 144, 104); ++ this.setTextureOffset("neck.box", 192, 104); ++ this.setTextureOffset("frontlegtip.main", 226, 138); ++ this.setTextureOffset("body.scale", 220, 53); ++ this.setTextureOffset("head.scale", 0, 0); ++ this.setTextureOffset("neck.scale", 48, 0); ++ this.setTextureOffset("head.nostril", 112, 0); ++ float var2 = -16.0F; ++ this.head = new ModelRenderer(this, "head"); ++ this.head.addBox("upperlip", -6.0F, -1.0F, -8.0F + var2, 12, 5, 16); ++ this.head.addBox("upperhead", -8.0F, -8.0F, 6.0F + var2, 16, 16, 16); ++ this.head.mirror = true; ++ this.head.addBox("scale", -5.0F, -12.0F, 12.0F + var2, 2, 4, 6); ++ this.head.addBox("nostril", -5.0F, -3.0F, -6.0F + var2, 2, 2, 4); ++ this.head.mirror = false; ++ this.head.addBox("scale", 3.0F, -12.0F, 12.0F + var2, 2, 4, 6); ++ this.head.addBox("nostril", 3.0F, -3.0F, -6.0F + var2, 2, 2, 4); ++ this.jaw = new ModelRenderer(this, "jaw"); ++ this.jaw.setRotationPoint(0.0F, 4.0F, 8.0F + var2); ++ this.jaw.addBox("jaw", -6.0F, 0.0F, -16.0F, 12, 4, 16); ++ this.head.addChild(this.jaw); ++ this.spine = new ModelRenderer(this, "neck"); ++ this.spine.addBox("box", -5.0F, -5.0F, -5.0F, 10, 10, 10); ++ this.spine.addBox("scale", -1.0F, -9.0F, -3.0F, 2, 4, 6); ++ this.body = new ModelRenderer(this, "body"); ++ this.body.setRotationPoint(0.0F, 4.0F, 8.0F); ++ this.body.addBox("body", -12.0F, 0.0F, -16.0F, 24, 24, 64); ++ this.body.addBox("scale", -1.0F, -6.0F, -10.0F, 2, 6, 12); ++ this.body.addBox("scale", -1.0F, -6.0F, 10.0F, 2, 6, 12); ++ this.body.addBox("scale", -1.0F, -6.0F, 30.0F, 2, 6, 12); ++ this.wing = new ModelRenderer(this, "wing"); ++ this.wing.setRotationPoint(-12.0F, 5.0F, 2.0F); ++ this.wing.addBox("bone", -56.0F, -4.0F, -4.0F, 56, 8, 8); ++ this.wing.addBox("skin", -56.0F, 0.0F, 2.0F, 56, 0, 56); ++ this.wingTip = new ModelRenderer(this, "wingtip"); ++ this.wingTip.setRotationPoint(-56.0F, 0.0F, 0.0F); ++ this.wingTip.addBox("bone", -56.0F, -2.0F, -2.0F, 56, 4, 4); ++ this.wingTip.addBox("skin", -56.0F, 0.0F, 2.0F, 56, 0, 56); ++ this.wing.addChild(this.wingTip); ++ this.frontLeg = new ModelRenderer(this, "frontleg"); ++ this.frontLeg.setRotationPoint(-12.0F, 20.0F, 2.0F); ++ this.frontLeg.addBox("main", -4.0F, -4.0F, -4.0F, 8, 24, 8); ++ this.frontLegTip = new ModelRenderer(this, "frontlegtip"); ++ this.frontLegTip.setRotationPoint(0.0F, 20.0F, -1.0F); ++ this.frontLegTip.addBox("main", -3.0F, -1.0F, -3.0F, 6, 24, 6); ++ this.frontLeg.addChild(this.frontLegTip); ++ this.frontFoot = new ModelRenderer(this, "frontfoot"); ++ this.frontFoot.setRotationPoint(0.0F, 23.0F, 0.0F); ++ this.frontFoot.addBox("main", -4.0F, 0.0F, -12.0F, 8, 4, 16); ++ this.frontLegTip.addChild(this.frontFoot); ++ this.rearLeg = new ModelRenderer(this, "rearleg"); ++ this.rearLeg.setRotationPoint(-16.0F, 16.0F, 42.0F); ++ this.rearLeg.addBox("main", -8.0F, -4.0F, -8.0F, 16, 32, 16); ++ this.rearLegTip = new ModelRenderer(this, "rearlegtip"); ++ this.rearLegTip.setRotationPoint(0.0F, 32.0F, -4.0F); ++ this.rearLegTip.addBox("main", -6.0F, -2.0F, 0.0F, 12, 32, 12); ++ this.rearLeg.addChild(this.rearLegTip); ++ this.rearFoot = new ModelRenderer(this, "rearfoot"); ++ this.rearFoot.setRotationPoint(0.0F, 31.0F, 4.0F); ++ this.rearFoot.addBox("main", -9.0F, 0.0F, -20.0F, 18, 6, 24); ++ this.rearLegTip.addChild(this.rearFoot); ++ } ++ ++ /** ++ * Used for easily adding entity-dependent animations. The second and third float params here are the same second ++ * and third as in the setRotationAngles method. ++ */ ++ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) ++ { ++ this.partialTicks = par4; ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ GL11.glPushMatrix(); ++ EntityDragon var8 = (EntityDragon)par1Entity; ++ float var9 = var8.prevAnimTime + (var8.animTime - var8.prevAnimTime) * this.partialTicks; ++ this.jaw.rotateAngleX = (float)(Math.sin((double)(var9 * (float)Math.PI * 2.0F)) + 1.0D) * 0.2F; ++ float var10 = (float)(Math.sin((double)(var9 * (float)Math.PI * 2.0F - 1.0F)) + 1.0D); ++ var10 = (var10 * var10 * 1.0F + var10 * 2.0F) * 0.05F; ++ GL11.glTranslatef(0.0F, var10 - 2.0F, -3.0F); ++ GL11.glRotatef(var10 * 2.0F, 1.0F, 0.0F, 0.0F); ++ float var11 = -30.0F; ++ float var13 = 0.0F; ++ float var14 = 1.5F; ++ double[] var15 = var8.getMovementOffsets(6, this.partialTicks); ++ float var16 = this.updateRotations(var8.getMovementOffsets(5, this.partialTicks)[0] - var8.getMovementOffsets(10, this.partialTicks)[0]); ++ float var17 = this.updateRotations(var8.getMovementOffsets(5, this.partialTicks)[0] + (double)(var16 / 2.0F)); ++ var11 += 2.0F; ++ float var18 = var9 * (float)Math.PI * 2.0F; ++ var11 = 20.0F; ++ float var12 = -12.0F; ++ float var21; ++ ++ for (int var19 = 0; var19 < 5; ++var19) ++ { ++ double[] var20 = var8.getMovementOffsets(5 - var19, this.partialTicks); ++ var21 = (float)Math.cos((double)((float)var19 * 0.45F + var18)) * 0.15F; ++ this.spine.rotateAngleY = this.updateRotations(var20[0] - var15[0]) * (float)Math.PI / 180.0F * var14; ++ this.spine.rotateAngleX = var21 + (float)(var20[1] - var15[1]) * (float)Math.PI / 180.0F * var14 * 5.0F; ++ this.spine.rotateAngleZ = -this.updateRotations(var20[0] - (double)var17) * (float)Math.PI / 180.0F * var14; ++ this.spine.rotationPointY = var11; ++ this.spine.rotationPointZ = var12; ++ this.spine.rotationPointX = var13; ++ var11 = (float)((double)var11 + Math.sin((double)this.spine.rotateAngleX) * 10.0D); ++ var12 = (float)((double)var12 - Math.cos((double)this.spine.rotateAngleY) * Math.cos((double)this.spine.rotateAngleX) * 10.0D); ++ var13 = (float)((double)var13 - Math.sin((double)this.spine.rotateAngleY) * Math.cos((double)this.spine.rotateAngleX) * 10.0D); ++ this.spine.render(par7); ++ } ++ ++ this.head.rotationPointY = var11; ++ this.head.rotationPointZ = var12; ++ this.head.rotationPointX = var13; ++ double[] var22 = var8.getMovementOffsets(0, this.partialTicks); ++ this.head.rotateAngleY = this.updateRotations(var22[0] - var15[0]) * (float)Math.PI / 180.0F * 1.0F; ++ this.head.rotateAngleZ = -this.updateRotations(var22[0] - (double)var17) * (float)Math.PI / 180.0F * 1.0F; ++ this.head.render(par7); ++ GL11.glPushMatrix(); ++ GL11.glTranslatef(0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(-var16 * var14 * 1.0F, 0.0F, 0.0F, 1.0F); ++ GL11.glTranslatef(0.0F, -1.0F, 0.0F); ++ this.body.rotateAngleZ = 0.0F; ++ this.body.render(par7); ++ ++ for (int var23 = 0; var23 < 2; ++var23) ++ { ++ GL11.glEnable(GL11.GL_CULL_FACE); ++ var21 = var9 * (float)Math.PI * 2.0F; ++ this.wing.rotateAngleX = 0.125F - (float)Math.cos((double)var21) * 0.2F; ++ this.wing.rotateAngleY = 0.25F; ++ this.wing.rotateAngleZ = (float)(Math.sin((double)var21) + 0.125D) * 0.8F; ++ this.wingTip.rotateAngleZ = -((float)(Math.sin((double)(var21 + 2.0F)) + 0.5D)) * 0.75F; ++ this.rearLeg.rotateAngleX = 1.0F + var10 * 0.1F; ++ this.rearLegTip.rotateAngleX = 0.5F + var10 * 0.1F; ++ this.rearFoot.rotateAngleX = 0.75F + var10 * 0.1F; ++ this.frontLeg.rotateAngleX = 1.3F + var10 * 0.1F; ++ this.frontLegTip.rotateAngleX = -0.5F - var10 * 0.1F; ++ this.frontFoot.rotateAngleX = 0.75F + var10 * 0.1F; ++ this.wing.render(par7); ++ this.frontLeg.render(par7); ++ this.rearLeg.render(par7); ++ GL11.glScalef(-1.0F, 1.0F, 1.0F); ++ ++ if (var23 == 0) ++ { ++ GL11.glCullFace(GL11.GL_FRONT); ++ } ++ } ++ ++ GL11.glPopMatrix(); ++ GL11.glCullFace(GL11.GL_BACK); ++ GL11.glDisable(GL11.GL_CULL_FACE); ++ float var24 = -((float)Math.sin((double)(var9 * (float)Math.PI * 2.0F))) * 0.0F; ++ var18 = var9 * (float)Math.PI * 2.0F; ++ var11 = 10.0F; ++ var12 = 60.0F; ++ var13 = 0.0F; ++ var15 = var8.getMovementOffsets(11, this.partialTicks); ++ ++ for (int var25 = 0; var25 < 12; ++var25) ++ { ++ var22 = var8.getMovementOffsets(12 + var25, this.partialTicks); ++ var24 = (float)((double)var24 + Math.sin((double)((float)var25 * 0.45F + var18)) * 0.05000000074505806D); ++ this.spine.rotateAngleY = (this.updateRotations(var22[0] - var15[0]) * var14 + 180.0F) * (float)Math.PI / 180.0F; ++ this.spine.rotateAngleX = var24 + (float)(var22[1] - var15[1]) * (float)Math.PI / 180.0F * var14 * 5.0F; ++ this.spine.rotateAngleZ = this.updateRotations(var22[0] - (double)var17) * (float)Math.PI / 180.0F * var14; ++ this.spine.rotationPointY = var11; ++ this.spine.rotationPointZ = var12; ++ this.spine.rotationPointX = var13; ++ var11 = (float)((double)var11 + Math.sin((double)this.spine.rotateAngleX) * 10.0D); ++ var12 = (float)((double)var12 - Math.cos((double)this.spine.rotateAngleY) * Math.cos((double)this.spine.rotateAngleX) * 10.0D); ++ var13 = (float)((double)var13 - Math.sin((double)this.spine.rotateAngleY) * Math.cos((double)this.spine.rotateAngleX) * 10.0D); ++ this.spine.render(par7); ++ } ++ ++ GL11.glPopMatrix(); ++ } ++ ++ /** ++ * Updates the rotations in the parameters for rotations greater than 180 degrees or less than -180 degrees. It adds ++ * or subtracts 360 degrees, so that the appearance is the same, although the numbers are then simplified to range ++ * -180 to 180 ++ */ ++ private float updateRotations(double par1) ++ { ++ while (par1 >= 180.0D) ++ { ++ par1 -= 360.0D; ++ } ++ ++ while (par1 < -180.0D) ++ { ++ par1 += 360.0D; ++ } ++ ++ return (float)par1; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelEnderCrystal.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,58 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class ModelEnderCrystal extends ModelBase ++ { ++ /** The cube model for the Ender Crystal. */ ++ private ModelRenderer cube; ++ ++ /** The glass model for the Ender Crystal. */ ++ private ModelRenderer glass = new ModelRenderer(this, "glass"); ++ ++ /** The base model for the Ender Crystal. */ ++ private ModelRenderer base; ++ ++ public ModelEnderCrystal(float par1, boolean par2) ++ { ++ this.glass.setTextureOffset(0, 0).addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8); ++ this.cube = new ModelRenderer(this, "cube"); ++ this.cube.setTextureOffset(32, 0).addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8); ++ ++ if (par2) ++ { ++ this.base = new ModelRenderer(this, "base"); ++ this.base.setTextureOffset(0, 16).addBox(-6.0F, 0.0F, -6.0F, 12, 4, 12); ++ } ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ GL11.glPushMatrix(); ++ GL11.glScalef(2.0F, 2.0F, 2.0F); ++ GL11.glTranslatef(0.0F, -0.5F, 0.0F); ++ ++ if (this.base != null) ++ { ++ this.base.render(par7); ++ } ++ ++ GL11.glRotatef(par3, 0.0F, 1.0F, 0.0F); ++ GL11.glTranslatef(0.0F, 0.8F + par4, 0.0F); ++ GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); ++ this.glass.render(par7); ++ float var8 = 0.875F; ++ GL11.glScalef(var8, var8, var8); ++ GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); ++ GL11.glRotatef(par3, 0.0F, 1.0F, 0.0F); ++ this.glass.render(par7); ++ GL11.glScalef(var8, var8, var8); ++ GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); ++ GL11.glRotatef(par3, 0.0F, 1.0F, 0.0F); ++ this.cube.render(par7); ++ GL11.glPopMatrix(); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelEnderman.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,128 ---- ++ package net.minecraft.src; ++ ++ public class ModelEnderman extends ModelBiped ++ { ++ /** Is the enderman carrying a block? */ ++ public boolean isCarrying; ++ ++ /** Is the enderman attacking an entity? */ ++ public boolean isAttacking; ++ ++ public ModelEnderman() ++ { ++ super(0.0F, -14.0F, 64, 32); ++ float var1 = -14.0F; ++ float var2 = 0.0F; ++ this.bipedHeadwear = new ModelRenderer(this, 0, 16); ++ this.bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, var2 - 0.5F); ++ this.bipedHeadwear.setRotationPoint(0.0F, 0.0F + var1, 0.0F); ++ this.bipedBody = new ModelRenderer(this, 32, 16); ++ this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, var2); ++ this.bipedBody.setRotationPoint(0.0F, 0.0F + var1, 0.0F); ++ this.bipedRightArm = new ModelRenderer(this, 56, 0); ++ this.bipedRightArm.addBox(-1.0F, -2.0F, -1.0F, 2, 30, 2, var2); ++ this.bipedRightArm.setRotationPoint(-3.0F, 2.0F + var1, 0.0F); ++ this.bipedLeftArm = new ModelRenderer(this, 56, 0); ++ this.bipedLeftArm.mirror = true; ++ this.bipedLeftArm.addBox(-1.0F, -2.0F, -1.0F, 2, 30, 2, var2); ++ this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + var1, 0.0F); ++ this.bipedRightLeg = new ModelRenderer(this, 56, 0); ++ this.bipedRightLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 30, 2, var2); ++ this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F + var1, 0.0F); ++ this.bipedLeftLeg = new ModelRenderer(this, 56, 0); ++ this.bipedLeftLeg.mirror = true; ++ this.bipedLeftLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 30, 2, var2); ++ this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F + var1, 0.0F); ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); ++ this.bipedHead.showModel = true; ++ float var8 = -14.0F; ++ this.bipedBody.rotateAngleX = 0.0F; ++ this.bipedBody.rotationPointY = var8; ++ this.bipedBody.rotationPointZ = -0.0F; ++ this.bipedRightLeg.rotateAngleX -= 0.0F; ++ this.bipedLeftLeg.rotateAngleX -= 0.0F; ++ this.bipedRightArm.rotateAngleX = (float)((double)this.bipedRightArm.rotateAngleX * 0.5D); ++ this.bipedLeftArm.rotateAngleX = (float)((double)this.bipedLeftArm.rotateAngleX * 0.5D); ++ this.bipedRightLeg.rotateAngleX = (float)((double)this.bipedRightLeg.rotateAngleX * 0.5D); ++ this.bipedLeftLeg.rotateAngleX = (float)((double)this.bipedLeftLeg.rotateAngleX * 0.5D); ++ float var9 = 0.4F; ++ ++ if (this.bipedRightArm.rotateAngleX > var9) ++ { ++ this.bipedRightArm.rotateAngleX = var9; ++ } ++ ++ if (this.bipedLeftArm.rotateAngleX > var9) ++ { ++ this.bipedLeftArm.rotateAngleX = var9; ++ } ++ ++ if (this.bipedRightArm.rotateAngleX < -var9) ++ { ++ this.bipedRightArm.rotateAngleX = -var9; ++ } ++ ++ if (this.bipedLeftArm.rotateAngleX < -var9) ++ { ++ this.bipedLeftArm.rotateAngleX = -var9; ++ } ++ ++ if (this.bipedRightLeg.rotateAngleX > var9) ++ { ++ this.bipedRightLeg.rotateAngleX = var9; ++ } ++ ++ if (this.bipedLeftLeg.rotateAngleX > var9) ++ { ++ this.bipedLeftLeg.rotateAngleX = var9; ++ } ++ ++ if (this.bipedRightLeg.rotateAngleX < -var9) ++ { ++ this.bipedRightLeg.rotateAngleX = -var9; ++ } ++ ++ if (this.bipedLeftLeg.rotateAngleX < -var9) ++ { ++ this.bipedLeftLeg.rotateAngleX = -var9; ++ } ++ ++ if (this.isCarrying) ++ { ++ this.bipedRightArm.rotateAngleX = -0.5F; ++ this.bipedLeftArm.rotateAngleX = -0.5F; ++ this.bipedRightArm.rotateAngleZ = 0.05F; ++ this.bipedLeftArm.rotateAngleZ = -0.05F; ++ } ++ ++ this.bipedRightArm.rotationPointZ = 0.0F; ++ this.bipedLeftArm.rotationPointZ = 0.0F; ++ this.bipedRightLeg.rotationPointZ = 0.0F; ++ this.bipedLeftLeg.rotationPointZ = 0.0F; ++ this.bipedRightLeg.rotationPointY = 9.0F + var8; ++ this.bipedLeftLeg.rotationPointY = 9.0F + var8; ++ this.bipedHead.rotationPointZ = -0.0F; ++ this.bipedHead.rotationPointY = var8 + 1.0F; ++ this.bipedHeadwear.rotationPointX = this.bipedHead.rotationPointX; ++ this.bipedHeadwear.rotationPointY = this.bipedHead.rotationPointY; ++ this.bipedHeadwear.rotationPointZ = this.bipedHead.rotationPointZ; ++ this.bipedHeadwear.rotateAngleX = this.bipedHead.rotateAngleX; ++ this.bipedHeadwear.rotateAngleY = this.bipedHead.rotateAngleY; ++ this.bipedHeadwear.rotateAngleZ = this.bipedHead.rotateAngleZ; ++ ++ if (this.isAttacking) ++ { ++ float var10 = 1.0F; ++ this.bipedHead.rotationPointY -= var10 * 5.0F; ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelGhast.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,65 ---- ++ package net.minecraft.src; ++ ++ import java.util.Random; ++ import org.lwjgl.opengl.GL11; ++ ++ public class ModelGhast extends ModelBase ++ { ++ ModelRenderer body; ++ ModelRenderer[] tentacles = new ModelRenderer[9]; ++ ++ public ModelGhast() ++ { ++ byte var1 = -16; ++ this.body = new ModelRenderer(this, 0, 0); ++ this.body.addBox(-8.0F, -8.0F, -8.0F, 16, 16, 16); ++ this.body.rotationPointY += (float)(24 + var1); ++ Random var2 = new Random(1660L); ++ ++ for (int var3 = 0; var3 < this.tentacles.length; ++var3) ++ { ++ this.tentacles[var3] = new ModelRenderer(this, 0, 0); ++ float var4 = (((float)(var3 % 3) - (float)(var3 / 3 % 2) * 0.5F + 0.25F) / 2.0F * 2.0F - 1.0F) * 5.0F; ++ float var5 = ((float)(var3 / 3) / 2.0F * 2.0F - 1.0F) * 5.0F; ++ int var6 = var2.nextInt(7) + 8; ++ this.tentacles[var3].addBox(-1.0F, 0.0F, -1.0F, 2, var6, 2); ++ this.tentacles[var3].rotationPointX = var4; ++ this.tentacles[var3].rotationPointZ = var5; ++ this.tentacles[var3].rotationPointY = (float)(31 + var1); ++ } ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ for (int var8 = 0; var8 < this.tentacles.length; ++var8) ++ { ++ this.tentacles[var8].rotateAngleX = 0.2F * MathHelper.sin(par3 * 0.3F + (float)var8) + 0.4F; ++ } ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ GL11.glPushMatrix(); ++ GL11.glTranslatef(0.0F, 0.6F, 0.0F); ++ this.body.render(par7); ++ ModelRenderer[] var8 = this.tentacles; ++ int var9 = var8.length; ++ ++ for (int var10 = 0; var10 < var9; ++var10) ++ { ++ ModelRenderer var11 = var8[var10]; ++ var11.render(par7); ++ } ++ ++ GL11.glPopMatrix(); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelHorse.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,549 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class ModelHorse extends ModelBase ++ { ++ private ModelRenderer head; ++ private ModelRenderer mouthTop; ++ private ModelRenderer mouthBottom; ++ private ModelRenderer horseLeftEar; ++ private ModelRenderer horseRightEar; ++ private ModelRenderer field_110703_f; ++ private ModelRenderer field_110704_g; ++ private ModelRenderer neck; ++ private ModelRenderer field_110717_i; ++ private ModelRenderer mane; ++ private ModelRenderer body; ++ private ModelRenderer tailBase; ++ private ModelRenderer tailMiddle; ++ private ModelRenderer tailTip; ++ private ModelRenderer backLeftLeg; ++ private ModelRenderer backLeftShin; ++ private ModelRenderer backLeftHoof; ++ private ModelRenderer backRightLeg; ++ private ModelRenderer backRightShin; ++ private ModelRenderer backRightHoof; ++ private ModelRenderer frontRightLeg; ++ private ModelRenderer frontLeftShin; ++ private ModelRenderer frontLeftHoof; ++ private ModelRenderer field_110684_D; ++ private ModelRenderer frontRightShin; ++ private ModelRenderer frontRightHoof; ++ private ModelRenderer field_110687_G; ++ private ModelRenderer field_110695_H; ++ private ModelRenderer field_110696_I; ++ private ModelRenderer field_110697_J; ++ private ModelRenderer field_110698_K; ++ private ModelRenderer field_110691_L; ++ private ModelRenderer field_110692_M; ++ private ModelRenderer field_110693_N; ++ private ModelRenderer field_110694_O; ++ private ModelRenderer field_110700_P; ++ private ModelRenderer field_110699_Q; ++ private ModelRenderer field_110702_R; ++ private ModelRenderer field_110701_S; ++ ++ public ModelHorse() ++ { ++ this.textureWidth = 128; ++ this.textureHeight = 128; ++ this.body = new ModelRenderer(this, 0, 34); ++ this.body.addBox(-5.0F, -8.0F, -19.0F, 10, 10, 24); ++ this.body.setRotationPoint(0.0F, 11.0F, 9.0F); ++ this.tailBase = new ModelRenderer(this, 44, 0); ++ this.tailBase.addBox(-1.0F, -1.0F, 0.0F, 2, 2, 3); ++ this.tailBase.setRotationPoint(0.0F, 3.0F, 14.0F); ++ this.func_110682_a(this.tailBase, -1.134464F, 0.0F, 0.0F); ++ this.tailMiddle = new ModelRenderer(this, 38, 7); ++ this.tailMiddle.addBox(-1.5F, -2.0F, 3.0F, 3, 4, 7); ++ this.tailMiddle.setRotationPoint(0.0F, 3.0F, 14.0F); ++ this.func_110682_a(this.tailMiddle, -1.134464F, 0.0F, 0.0F); ++ this.tailTip = new ModelRenderer(this, 24, 3); ++ this.tailTip.addBox(-1.5F, -4.5F, 9.0F, 3, 4, 7); ++ this.tailTip.setRotationPoint(0.0F, 3.0F, 14.0F); ++ this.func_110682_a(this.tailTip, -1.40215F, 0.0F, 0.0F); ++ this.backLeftLeg = new ModelRenderer(this, 78, 29); ++ this.backLeftLeg.addBox(-2.5F, -2.0F, -2.5F, 4, 9, 5); ++ this.backLeftLeg.setRotationPoint(4.0F, 9.0F, 11.0F); ++ this.backLeftShin = new ModelRenderer(this, 78, 43); ++ this.backLeftShin.addBox(-2.0F, 0.0F, -1.5F, 3, 5, 3); ++ this.backLeftShin.setRotationPoint(4.0F, 16.0F, 11.0F); ++ this.backLeftHoof = new ModelRenderer(this, 78, 51); ++ this.backLeftHoof.addBox(-2.5F, 5.1F, -2.0F, 4, 3, 4); ++ this.backLeftHoof.setRotationPoint(4.0F, 16.0F, 11.0F); ++ this.backRightLeg = new ModelRenderer(this, 96, 29); ++ this.backRightLeg.addBox(-1.5F, -2.0F, -2.5F, 4, 9, 5); ++ this.backRightLeg.setRotationPoint(-4.0F, 9.0F, 11.0F); ++ this.backRightShin = new ModelRenderer(this, 96, 43); ++ this.backRightShin.addBox(-1.0F, 0.0F, -1.5F, 3, 5, 3); ++ this.backRightShin.setRotationPoint(-4.0F, 16.0F, 11.0F); ++ this.backRightHoof = new ModelRenderer(this, 96, 51); ++ this.backRightHoof.addBox(-1.5F, 5.1F, -2.0F, 4, 3, 4); ++ this.backRightHoof.setRotationPoint(-4.0F, 16.0F, 11.0F); ++ this.frontRightLeg = new ModelRenderer(this, 44, 29); ++ this.frontRightLeg.addBox(-1.9F, -1.0F, -2.1F, 3, 8, 4); ++ this.frontRightLeg.setRotationPoint(4.0F, 9.0F, -8.0F); ++ this.frontLeftShin = new ModelRenderer(this, 44, 41); ++ this.frontLeftShin.addBox(-1.9F, 0.0F, -1.6F, 3, 5, 3); ++ this.frontLeftShin.setRotationPoint(4.0F, 16.0F, -8.0F); ++ this.frontLeftHoof = new ModelRenderer(this, 44, 51); ++ this.frontLeftHoof.addBox(-2.4F, 5.1F, -2.1F, 4, 3, 4); ++ this.frontLeftHoof.setRotationPoint(4.0F, 16.0F, -8.0F); ++ this.field_110684_D = new ModelRenderer(this, 60, 29); ++ this.field_110684_D.addBox(-1.1F, -1.0F, -2.1F, 3, 8, 4); ++ this.field_110684_D.setRotationPoint(-4.0F, 9.0F, -8.0F); ++ this.frontRightShin = new ModelRenderer(this, 60, 41); ++ this.frontRightShin.addBox(-1.1F, 0.0F, -1.6F, 3, 5, 3); ++ this.frontRightShin.setRotationPoint(-4.0F, 16.0F, -8.0F); ++ this.frontRightHoof = new ModelRenderer(this, 60, 51); ++ this.frontRightHoof.addBox(-1.6F, 5.1F, -2.1F, 4, 3, 4); ++ this.frontRightHoof.setRotationPoint(-4.0F, 16.0F, -8.0F); ++ this.head = new ModelRenderer(this, 0, 0); ++ this.head.addBox(-2.5F, -10.0F, -1.5F, 5, 5, 7); ++ this.head.setRotationPoint(0.0F, 4.0F, -10.0F); ++ this.func_110682_a(this.head, 0.5235988F, 0.0F, 0.0F); ++ this.mouthTop = new ModelRenderer(this, 24, 18); ++ this.mouthTop.addBox(-2.0F, -10.0F, -7.0F, 4, 3, 6); ++ this.mouthTop.setRotationPoint(0.0F, 3.95F, -10.0F); ++ this.func_110682_a(this.mouthTop, 0.5235988F, 0.0F, 0.0F); ++ this.mouthBottom = new ModelRenderer(this, 24, 27); ++ this.mouthBottom.addBox(-2.0F, -7.0F, -6.5F, 4, 2, 5); ++ this.mouthBottom.setRotationPoint(0.0F, 4.0F, -10.0F); ++ this.func_110682_a(this.mouthBottom, 0.5235988F, 0.0F, 0.0F); ++ this.head.addChild(this.mouthTop); ++ this.head.addChild(this.mouthBottom); ++ this.horseLeftEar = new ModelRenderer(this, 0, 0); ++ this.horseLeftEar.addBox(0.45F, -12.0F, 4.0F, 2, 3, 1); ++ this.horseLeftEar.setRotationPoint(0.0F, 4.0F, -10.0F); ++ this.func_110682_a(this.horseLeftEar, 0.5235988F, 0.0F, 0.0F); ++ this.horseRightEar = new ModelRenderer(this, 0, 0); ++ this.horseRightEar.addBox(-2.45F, -12.0F, 4.0F, 2, 3, 1); ++ this.horseRightEar.setRotationPoint(0.0F, 4.0F, -10.0F); ++ this.func_110682_a(this.horseRightEar, 0.5235988F, 0.0F, 0.0F); ++ this.field_110703_f = new ModelRenderer(this, 0, 12); ++ this.field_110703_f.addBox(-2.0F, -16.0F, 4.0F, 2, 7, 1); ++ this.field_110703_f.setRotationPoint(0.0F, 4.0F, -10.0F); ++ this.func_110682_a(this.field_110703_f, 0.5235988F, 0.0F, 0.2617994F); ++ this.field_110704_g = new ModelRenderer(this, 0, 12); ++ this.field_110704_g.addBox(0.0F, -16.0F, 4.0F, 2, 7, 1); ++ this.field_110704_g.setRotationPoint(0.0F, 4.0F, -10.0F); ++ this.func_110682_a(this.field_110704_g, 0.5235988F, 0.0F, -0.2617994F); ++ this.neck = new ModelRenderer(this, 0, 12); ++ this.neck.addBox(-2.05F, -9.8F, -2.0F, 4, 14, 8); ++ this.neck.setRotationPoint(0.0F, 4.0F, -10.0F); ++ this.func_110682_a(this.neck, 0.5235988F, 0.0F, 0.0F); ++ this.field_110687_G = new ModelRenderer(this, 0, 34); ++ this.field_110687_G.addBox(-3.0F, 0.0F, 0.0F, 8, 8, 3); ++ this.field_110687_G.setRotationPoint(-7.5F, 3.0F, 10.0F); ++ this.func_110682_a(this.field_110687_G, 0.0F, ((float)Math.PI / 2F), 0.0F); ++ this.field_110695_H = new ModelRenderer(this, 0, 47); ++ this.field_110695_H.addBox(-3.0F, 0.0F, 0.0F, 8, 8, 3); ++ this.field_110695_H.setRotationPoint(4.5F, 3.0F, 10.0F); ++ this.func_110682_a(this.field_110695_H, 0.0F, ((float)Math.PI / 2F), 0.0F); ++ this.field_110696_I = new ModelRenderer(this, 80, 0); ++ this.field_110696_I.addBox(-5.0F, 0.0F, -3.0F, 10, 1, 8); ++ this.field_110696_I.setRotationPoint(0.0F, 2.0F, 2.0F); ++ this.field_110697_J = new ModelRenderer(this, 106, 9); ++ this.field_110697_J.addBox(-1.5F, -1.0F, -3.0F, 3, 1, 2); ++ this.field_110697_J.setRotationPoint(0.0F, 2.0F, 2.0F); ++ this.field_110698_K = new ModelRenderer(this, 80, 9); ++ this.field_110698_K.addBox(-4.0F, -1.0F, 3.0F, 8, 1, 2); ++ this.field_110698_K.setRotationPoint(0.0F, 2.0F, 2.0F); ++ this.field_110692_M = new ModelRenderer(this, 74, 0); ++ this.field_110692_M.addBox(-0.5F, 6.0F, -1.0F, 1, 2, 2); ++ this.field_110692_M.setRotationPoint(5.0F, 3.0F, 2.0F); ++ this.field_110691_L = new ModelRenderer(this, 70, 0); ++ this.field_110691_L.addBox(-0.5F, 0.0F, -0.5F, 1, 6, 1); ++ this.field_110691_L.setRotationPoint(5.0F, 3.0F, 2.0F); ++ this.field_110694_O = new ModelRenderer(this, 74, 4); ++ this.field_110694_O.addBox(-0.5F, 6.0F, -1.0F, 1, 2, 2); ++ this.field_110694_O.setRotationPoint(-5.0F, 3.0F, 2.0F); ++ this.field_110693_N = new ModelRenderer(this, 80, 0); ++ this.field_110693_N.addBox(-0.5F, 0.0F, -0.5F, 1, 6, 1); ++ this.field_110693_N.setRotationPoint(-5.0F, 3.0F, 2.0F); ++ this.field_110700_P = new ModelRenderer(this, 74, 13); ++ this.field_110700_P.addBox(1.5F, -8.0F, -4.0F, 1, 2, 2); ++ this.field_110700_P.setRotationPoint(0.0F, 4.0F, -10.0F); ++ this.func_110682_a(this.field_110700_P, 0.5235988F, 0.0F, 0.0F); ++ this.field_110699_Q = new ModelRenderer(this, 74, 13); ++ this.field_110699_Q.addBox(-2.5F, -8.0F, -4.0F, 1, 2, 2); ++ this.field_110699_Q.setRotationPoint(0.0F, 4.0F, -10.0F); ++ this.func_110682_a(this.field_110699_Q, 0.5235988F, 0.0F, 0.0F); ++ this.field_110702_R = new ModelRenderer(this, 44, 10); ++ this.field_110702_R.addBox(2.6F, -6.0F, -6.0F, 0, 3, 16); ++ this.field_110702_R.setRotationPoint(0.0F, 4.0F, -10.0F); ++ this.field_110701_S = new ModelRenderer(this, 44, 5); ++ this.field_110701_S.addBox(-2.6F, -6.0F, -6.0F, 0, 3, 16); ++ this.field_110701_S.setRotationPoint(0.0F, 4.0F, -10.0F); ++ this.mane = new ModelRenderer(this, 58, 0); ++ this.mane.addBox(-1.0F, -11.5F, 5.0F, 2, 16, 4); ++ this.mane.setRotationPoint(0.0F, 4.0F, -10.0F); ++ this.func_110682_a(this.mane, 0.5235988F, 0.0F, 0.0F); ++ this.field_110717_i = new ModelRenderer(this, 80, 12); ++ this.field_110717_i.addBox(-2.5F, -10.1F, -7.0F, 5, 5, 12, 0.2F); ++ this.field_110717_i.setRotationPoint(0.0F, 4.0F, -10.0F); ++ this.func_110682_a(this.field_110717_i, 0.5235988F, 0.0F, 0.0F); ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ EntityHorse var8 = (EntityHorse)par1Entity; ++ int var9 = var8.getHorseType(); ++ float var10 = var8.getGrassEatingAmount(0.0F); ++ boolean var11 = var8.isAdultHorse(); ++ boolean var12 = var11 && var8.isHorseSaddled(); ++ boolean var13 = var11 && var8.isChested(); ++ boolean var14 = var9 == 1 || var9 == 2; ++ float var15 = var8.getHorseSize(); ++ boolean var16 = var8.riddenByEntity != null; ++ ++ if (var12) ++ { ++ this.field_110717_i.render(par7); ++ this.field_110696_I.render(par7); ++ this.field_110697_J.render(par7); ++ this.field_110698_K.render(par7); ++ this.field_110691_L.render(par7); ++ this.field_110692_M.render(par7); ++ this.field_110693_N.render(par7); ++ this.field_110694_O.render(par7); ++ this.field_110700_P.render(par7); ++ this.field_110699_Q.render(par7); ++ ++ if (var16) ++ { ++ this.field_110702_R.render(par7); ++ this.field_110701_S.render(par7); ++ } ++ } ++ ++ if (!var11) ++ { ++ GL11.glPushMatrix(); ++ GL11.glScalef(var15, 0.5F + var15 * 0.5F, var15); ++ GL11.glTranslatef(0.0F, 0.95F * (1.0F - var15), 0.0F); ++ } ++ ++ this.backLeftLeg.render(par7); ++ this.backLeftShin.render(par7); ++ this.backLeftHoof.render(par7); ++ this.backRightLeg.render(par7); ++ this.backRightShin.render(par7); ++ this.backRightHoof.render(par7); ++ this.frontRightLeg.render(par7); ++ this.frontLeftShin.render(par7); ++ this.frontLeftHoof.render(par7); ++ this.field_110684_D.render(par7); ++ this.frontRightShin.render(par7); ++ this.frontRightHoof.render(par7); ++ ++ if (!var11) ++ { ++ GL11.glPopMatrix(); ++ GL11.glPushMatrix(); ++ GL11.glScalef(var15, var15, var15); ++ GL11.glTranslatef(0.0F, 1.35F * (1.0F - var15), 0.0F); ++ } ++ ++ this.body.render(par7); ++ this.tailBase.render(par7); ++ this.tailMiddle.render(par7); ++ this.tailTip.render(par7); ++ this.neck.render(par7); ++ this.mane.render(par7); ++ ++ if (!var11) ++ { ++ GL11.glPopMatrix(); ++ GL11.glPushMatrix(); ++ float var17 = 0.5F + var15 * var15 * 0.5F; ++ GL11.glScalef(var17, var17, var17); ++ ++ if (var10 <= 0.0F) ++ { ++ GL11.glTranslatef(0.0F, 1.35F * (1.0F - var15), 0.0F); ++ } ++ else ++ { ++ GL11.glTranslatef(0.0F, 0.9F * (1.0F - var15) * var10 + 1.35F * (1.0F - var15) * (1.0F - var10), 0.15F * (1.0F - var15) * var10); ++ } ++ } ++ ++ if (var14) ++ { ++ this.field_110703_f.render(par7); ++ this.field_110704_g.render(par7); ++ } ++ else ++ { ++ this.horseLeftEar.render(par7); ++ this.horseRightEar.render(par7); ++ } ++ ++ this.head.render(par7); ++ ++ if (!var11) ++ { ++ GL11.glPopMatrix(); ++ } ++ ++ if (var13) ++ { ++ this.field_110687_G.render(par7); ++ this.field_110695_H.render(par7); ++ } ++ } ++ ++ private void func_110682_a(ModelRenderer par1ModelRenderer, float par2, float par3, float par4) ++ { ++ par1ModelRenderer.rotateAngleX = par2; ++ par1ModelRenderer.rotateAngleY = par3; ++ par1ModelRenderer.rotateAngleZ = par4; ++ } ++ ++ private float func_110683_a(float par1, float par2, float par3) ++ { ++ float var4; ++ ++ for (var4 = par2 - par1; var4 < -180.0F; var4 += 360.0F) ++ { ++ ; ++ } ++ ++ while (var4 >= 180.0F) ++ { ++ var4 -= 360.0F; ++ } ++ ++ return par1 + par3 * var4; ++ } ++ ++ /** ++ * Used for easily adding entity-dependent animations. The second and third float params here are the same second ++ * and third as in the setRotationAngles method. ++ */ ++ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) ++ { ++ super.setLivingAnimations(par1EntityLivingBase, par2, par3, par4); ++ float var5 = this.func_110683_a(par1EntityLivingBase.prevRenderYawOffset, par1EntityLivingBase.renderYawOffset, par4); ++ float var6 = this.func_110683_a(par1EntityLivingBase.prevRotationYawHead, par1EntityLivingBase.rotationYawHead, par4); ++ float var7 = par1EntityLivingBase.prevRotationPitch + (par1EntityLivingBase.rotationPitch - par1EntityLivingBase.prevRotationPitch) * par4; ++ float var8 = var6 - var5; ++ float var9 = var7 / (180F / (float)Math.PI); ++ ++ if (var8 > 20.0F) ++ { ++ var8 = 20.0F; ++ } ++ ++ if (var8 < -20.0F) ++ { ++ var8 = -20.0F; ++ } ++ ++ if (par3 > 0.2F) ++ { ++ var9 += MathHelper.cos(par2 * 0.4F) * 0.15F * par3; ++ } ++ ++ EntityHorse var10 = (EntityHorse)par1EntityLivingBase; ++ float var11 = var10.getGrassEatingAmount(par4); ++ float var12 = var10.getRearingAmount(par4); ++ float var13 = 1.0F - var12; ++ float var14 = var10.func_110201_q(par4); ++ boolean var15 = var10.field_110278_bp != 0; ++ boolean var16 = var10.isHorseSaddled(); ++ boolean var17 = var10.riddenByEntity != null; ++ float var18 = (float)par1EntityLivingBase.ticksExisted + par4; ++ float var19 = MathHelper.cos(par2 * 0.6662F + (float)Math.PI); ++ float var20 = var19 * 0.8F * par3; ++ this.head.rotationPointY = 4.0F; ++ this.head.rotationPointZ = -10.0F; ++ this.tailBase.rotationPointY = 3.0F; ++ this.tailMiddle.rotationPointZ = 14.0F; ++ this.field_110695_H.rotationPointY = 3.0F; ++ this.field_110695_H.rotationPointZ = 10.0F; ++ this.body.rotateAngleX = 0.0F; ++ this.head.rotateAngleX = 0.5235988F + var9; ++ this.head.rotateAngleY = var8 / (180F / (float)Math.PI); ++ this.head.rotateAngleX = var12 * (0.2617994F + var9) + var11 * 2.18166F + (1.0F - Math.max(var12, var11)) * this.head.rotateAngleX; ++ this.head.rotateAngleY = var12 * (var8 / (180F / (float)Math.PI)) + (1.0F - Math.max(var12, var11)) * this.head.rotateAngleY; ++ this.head.rotationPointY = var12 * -6.0F + var11 * 11.0F + (1.0F - Math.max(var12, var11)) * this.head.rotationPointY; ++ this.head.rotationPointZ = var12 * -1.0F + var11 * -10.0F + (1.0F - Math.max(var12, var11)) * this.head.rotationPointZ; ++ this.tailBase.rotationPointY = var12 * 9.0F + var13 * this.tailBase.rotationPointY; ++ this.tailMiddle.rotationPointZ = var12 * 18.0F + var13 * this.tailMiddle.rotationPointZ; ++ this.field_110695_H.rotationPointY = var12 * 5.5F + var13 * this.field_110695_H.rotationPointY; ++ this.field_110695_H.rotationPointZ = var12 * 15.0F + var13 * this.field_110695_H.rotationPointZ; ++ this.body.rotateAngleX = var12 * -((float)Math.PI / 4F) + var13 * this.body.rotateAngleX; ++ this.horseLeftEar.rotationPointY = this.head.rotationPointY; ++ this.horseRightEar.rotationPointY = this.head.rotationPointY; ++ this.field_110703_f.rotationPointY = this.head.rotationPointY; ++ this.field_110704_g.rotationPointY = this.head.rotationPointY; ++ this.neck.rotationPointY = this.head.rotationPointY; ++ this.mouthTop.rotationPointY = 0.02F; ++ this.mouthBottom.rotationPointY = 0.0F; ++ this.mane.rotationPointY = this.head.rotationPointY; ++ this.horseLeftEar.rotationPointZ = this.head.rotationPointZ; ++ this.horseRightEar.rotationPointZ = this.head.rotationPointZ; ++ this.field_110703_f.rotationPointZ = this.head.rotationPointZ; ++ this.field_110704_g.rotationPointZ = this.head.rotationPointZ; ++ this.neck.rotationPointZ = this.head.rotationPointZ; ++ this.mouthTop.rotationPointZ = 0.02F - var14 * 1.0F; ++ this.mouthBottom.rotationPointZ = 0.0F + var14 * 1.0F; ++ this.mane.rotationPointZ = this.head.rotationPointZ; ++ this.horseLeftEar.rotateAngleX = this.head.rotateAngleX; ++ this.horseRightEar.rotateAngleX = this.head.rotateAngleX; ++ this.field_110703_f.rotateAngleX = this.head.rotateAngleX; ++ this.field_110704_g.rotateAngleX = this.head.rotateAngleX; ++ this.neck.rotateAngleX = this.head.rotateAngleX; ++ this.mouthTop.rotateAngleX = 0.0F - 0.09424778F * var14; ++ this.mouthBottom.rotateAngleX = 0.0F + 0.15707964F * var14; ++ this.mane.rotateAngleX = this.head.rotateAngleX; ++ this.horseLeftEar.rotateAngleY = this.head.rotateAngleY; ++ this.horseRightEar.rotateAngleY = this.head.rotateAngleY; ++ this.field_110703_f.rotateAngleY = this.head.rotateAngleY; ++ this.field_110704_g.rotateAngleY = this.head.rotateAngleY; ++ this.neck.rotateAngleY = this.head.rotateAngleY; ++ this.mouthTop.rotateAngleY = 0.0F; ++ this.mouthBottom.rotateAngleY = 0.0F; ++ this.mane.rotateAngleY = this.head.rotateAngleY; ++ this.field_110687_G.rotateAngleX = var20 / 5.0F; ++ this.field_110695_H.rotateAngleX = -var20 / 5.0F; ++ float var21 = ((float)Math.PI / 2F); ++ float var22 = ((float)Math.PI * 3F / 2F); ++ float var23 = -1.0471976F; ++ float var24 = 0.2617994F * var12; ++ float var25 = MathHelper.cos(var18 * 0.6F + (float)Math.PI); ++ this.frontRightLeg.rotationPointY = -2.0F * var12 + 9.0F * var13; ++ this.frontRightLeg.rotationPointZ = -2.0F * var12 + -8.0F * var13; ++ this.field_110684_D.rotationPointY = this.frontRightLeg.rotationPointY; ++ this.field_110684_D.rotationPointZ = this.frontRightLeg.rotationPointZ; ++ this.backLeftShin.rotationPointY = this.backLeftLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + var24 + var13 * -var19 * 0.5F * par3) * 7.0F; ++ this.backLeftShin.rotationPointZ = this.backLeftLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + var24 + var13 * -var19 * 0.5F * par3) * 7.0F; ++ this.backRightShin.rotationPointY = this.backRightLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + var24 + var13 * var19 * 0.5F * par3) * 7.0F; ++ this.backRightShin.rotationPointZ = this.backRightLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + var24 + var13 * var19 * 0.5F * par3) * 7.0F; ++ float var26 = (-1.0471976F + var25) * var12 + var20 * var13; ++ float var27 = (-1.0471976F + -var25) * var12 + -var20 * var13; ++ this.frontLeftShin.rotationPointY = this.frontRightLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + var26) * 7.0F; ++ this.frontLeftShin.rotationPointZ = this.frontRightLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + var26) * 7.0F; ++ this.frontRightShin.rotationPointY = this.field_110684_D.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + var27) * 7.0F; ++ this.frontRightShin.rotationPointZ = this.field_110684_D.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + var27) * 7.0F; ++ this.backLeftLeg.rotateAngleX = var24 + -var19 * 0.5F * par3 * var13; ++ this.backLeftShin.rotateAngleX = -0.08726646F * var12 + (-var19 * 0.5F * par3 - Math.max(0.0F, var19 * 0.5F * par3)) * var13; ++ this.backLeftHoof.rotateAngleX = this.backLeftShin.rotateAngleX; ++ this.backRightLeg.rotateAngleX = var24 + var19 * 0.5F * par3 * var13; ++ this.backRightShin.rotateAngleX = -0.08726646F * var12 + (var19 * 0.5F * par3 - Math.max(0.0F, -var19 * 0.5F * par3)) * var13; ++ this.backRightHoof.rotateAngleX = this.backRightShin.rotateAngleX; ++ this.frontRightLeg.rotateAngleX = var26; ++ this.frontLeftShin.rotateAngleX = (this.frontRightLeg.rotateAngleX + (float)Math.PI * Math.max(0.0F, 0.2F + var25 * 0.2F)) * var12 + (var20 + Math.max(0.0F, var19 * 0.5F * par3)) * var13; ++ this.frontLeftHoof.rotateAngleX = this.frontLeftShin.rotateAngleX; ++ this.field_110684_D.rotateAngleX = var27; ++ this.frontRightShin.rotateAngleX = (this.field_110684_D.rotateAngleX + (float)Math.PI * Math.max(0.0F, 0.2F - var25 * 0.2F)) * var12 + (-var20 + Math.max(0.0F, -var19 * 0.5F * par3)) * var13; ++ this.frontRightHoof.rotateAngleX = this.frontRightShin.rotateAngleX; ++ this.backLeftHoof.rotationPointY = this.backLeftShin.rotationPointY; ++ this.backLeftHoof.rotationPointZ = this.backLeftShin.rotationPointZ; ++ this.backRightHoof.rotationPointY = this.backRightShin.rotationPointY; ++ this.backRightHoof.rotationPointZ = this.backRightShin.rotationPointZ; ++ this.frontLeftHoof.rotationPointY = this.frontLeftShin.rotationPointY; ++ this.frontLeftHoof.rotationPointZ = this.frontLeftShin.rotationPointZ; ++ this.frontRightHoof.rotationPointY = this.frontRightShin.rotationPointY; ++ this.frontRightHoof.rotationPointZ = this.frontRightShin.rotationPointZ; ++ ++ if (var16) ++ { ++ this.field_110696_I.rotationPointY = var12 * 0.5F + var13 * 2.0F; ++ this.field_110696_I.rotationPointZ = var12 * 11.0F + var13 * 2.0F; ++ this.field_110697_J.rotationPointY = this.field_110696_I.rotationPointY; ++ this.field_110698_K.rotationPointY = this.field_110696_I.rotationPointY; ++ this.field_110691_L.rotationPointY = this.field_110696_I.rotationPointY; ++ this.field_110693_N.rotationPointY = this.field_110696_I.rotationPointY; ++ this.field_110692_M.rotationPointY = this.field_110696_I.rotationPointY; ++ this.field_110694_O.rotationPointY = this.field_110696_I.rotationPointY; ++ this.field_110687_G.rotationPointY = this.field_110695_H.rotationPointY; ++ this.field_110697_J.rotationPointZ = this.field_110696_I.rotationPointZ; ++ this.field_110698_K.rotationPointZ = this.field_110696_I.rotationPointZ; ++ this.field_110691_L.rotationPointZ = this.field_110696_I.rotationPointZ; ++ this.field_110693_N.rotationPointZ = this.field_110696_I.rotationPointZ; ++ this.field_110692_M.rotationPointZ = this.field_110696_I.rotationPointZ; ++ this.field_110694_O.rotationPointZ = this.field_110696_I.rotationPointZ; ++ this.field_110687_G.rotationPointZ = this.field_110695_H.rotationPointZ; ++ this.field_110696_I.rotateAngleX = this.body.rotateAngleX; ++ this.field_110697_J.rotateAngleX = this.body.rotateAngleX; ++ this.field_110698_K.rotateAngleX = this.body.rotateAngleX; ++ this.field_110702_R.rotationPointY = this.head.rotationPointY; ++ this.field_110701_S.rotationPointY = this.head.rotationPointY; ++ this.field_110717_i.rotationPointY = this.head.rotationPointY; ++ this.field_110700_P.rotationPointY = this.head.rotationPointY; ++ this.field_110699_Q.rotationPointY = this.head.rotationPointY; ++ this.field_110702_R.rotationPointZ = this.head.rotationPointZ; ++ this.field_110701_S.rotationPointZ = this.head.rotationPointZ; ++ this.field_110717_i.rotationPointZ = this.head.rotationPointZ; ++ this.field_110700_P.rotationPointZ = this.head.rotationPointZ; ++ this.field_110699_Q.rotationPointZ = this.head.rotationPointZ; ++ this.field_110702_R.rotateAngleX = var9; ++ this.field_110701_S.rotateAngleX = var9; ++ this.field_110717_i.rotateAngleX = this.head.rotateAngleX; ++ this.field_110700_P.rotateAngleX = this.head.rotateAngleX; ++ this.field_110699_Q.rotateAngleX = this.head.rotateAngleX; ++ this.field_110717_i.rotateAngleY = this.head.rotateAngleY; ++ this.field_110700_P.rotateAngleY = this.head.rotateAngleY; ++ this.field_110702_R.rotateAngleY = this.head.rotateAngleY; ++ this.field_110699_Q.rotateAngleY = this.head.rotateAngleY; ++ this.field_110701_S.rotateAngleY = this.head.rotateAngleY; ++ ++ if (var17) ++ { ++ this.field_110691_L.rotateAngleX = -1.0471976F; ++ this.field_110692_M.rotateAngleX = -1.0471976F; ++ this.field_110693_N.rotateAngleX = -1.0471976F; ++ this.field_110694_O.rotateAngleX = -1.0471976F; ++ this.field_110691_L.rotateAngleZ = 0.0F; ++ this.field_110692_M.rotateAngleZ = 0.0F; ++ this.field_110693_N.rotateAngleZ = 0.0F; ++ this.field_110694_O.rotateAngleZ = 0.0F; ++ } ++ else ++ { ++ this.field_110691_L.rotateAngleX = var20 / 3.0F; ++ this.field_110692_M.rotateAngleX = var20 / 3.0F; ++ this.field_110693_N.rotateAngleX = var20 / 3.0F; ++ this.field_110694_O.rotateAngleX = var20 / 3.0F; ++ this.field_110691_L.rotateAngleZ = var20 / 5.0F; ++ this.field_110692_M.rotateAngleZ = var20 / 5.0F; ++ this.field_110693_N.rotateAngleZ = -var20 / 5.0F; ++ this.field_110694_O.rotateAngleZ = -var20 / 5.0F; ++ } ++ } ++ ++ var21 = -1.3089F + par3 * 1.5F; ++ ++ if (var21 > 0.0F) ++ { ++ var21 = 0.0F; ++ } ++ ++ if (var15) ++ { ++ this.tailBase.rotateAngleY = MathHelper.cos(var18 * 0.7F); ++ var21 = 0.0F; ++ } ++ else ++ { ++ this.tailBase.rotateAngleY = 0.0F; ++ } ++ ++ this.tailMiddle.rotateAngleY = this.tailBase.rotateAngleY; ++ this.tailTip.rotateAngleY = this.tailBase.rotateAngleY; ++ this.tailMiddle.rotationPointY = this.tailBase.rotationPointY; ++ this.tailTip.rotationPointY = this.tailBase.rotationPointY; ++ this.tailMiddle.rotationPointZ = this.tailBase.rotationPointZ; ++ this.tailTip.rotationPointZ = this.tailBase.rotationPointZ; ++ this.tailBase.rotateAngleX = var21; ++ this.tailMiddle.rotateAngleX = var21; ++ this.tailTip.rotateAngleX = -0.2618F + var21; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelIronGolem.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,124 ---- ++ package net.minecraft.src; ++ ++ public class ModelIronGolem extends ModelBase ++ { ++ /** The head model for the iron golem. */ ++ public ModelRenderer ironGolemHead; ++ ++ /** The body model for the iron golem. */ ++ public ModelRenderer ironGolemBody; ++ ++ /** The right arm model for the iron golem. */ ++ public ModelRenderer ironGolemRightArm; ++ ++ /** The left arm model for the iron golem. */ ++ public ModelRenderer ironGolemLeftArm; ++ ++ /** The left leg model for the Iron Golem. */ ++ public ModelRenderer ironGolemLeftLeg; ++ ++ /** The right leg model for the Iron Golem. */ ++ public ModelRenderer ironGolemRightLeg; ++ ++ public ModelIronGolem() ++ { ++ this(0.0F); ++ } ++ ++ public ModelIronGolem(float par1) ++ { ++ this(par1, -7.0F); ++ } ++ ++ public ModelIronGolem(float par1, float par2) ++ { ++ short var3 = 128; ++ short var4 = 128; ++ this.ironGolemHead = (new ModelRenderer(this)).setTextureSize(var3, var4); ++ this.ironGolemHead.setRotationPoint(0.0F, 0.0F + par2, -2.0F); ++ this.ironGolemHead.setTextureOffset(0, 0).addBox(-4.0F, -12.0F, -5.5F, 8, 10, 8, par1); ++ this.ironGolemHead.setTextureOffset(24, 0).addBox(-1.0F, -5.0F, -7.5F, 2, 4, 2, par1); ++ this.ironGolemBody = (new ModelRenderer(this)).setTextureSize(var3, var4); ++ this.ironGolemBody.setRotationPoint(0.0F, 0.0F + par2, 0.0F); ++ this.ironGolemBody.setTextureOffset(0, 40).addBox(-9.0F, -2.0F, -6.0F, 18, 12, 11, par1); ++ this.ironGolemBody.setTextureOffset(0, 70).addBox(-4.5F, 10.0F, -3.0F, 9, 5, 6, par1 + 0.5F); ++ this.ironGolemRightArm = (new ModelRenderer(this)).setTextureSize(var3, var4); ++ this.ironGolemRightArm.setRotationPoint(0.0F, -7.0F, 0.0F); ++ this.ironGolemRightArm.setTextureOffset(60, 21).addBox(-13.0F, -2.5F, -3.0F, 4, 30, 6, par1); ++ this.ironGolemLeftArm = (new ModelRenderer(this)).setTextureSize(var3, var4); ++ this.ironGolemLeftArm.setRotationPoint(0.0F, -7.0F, 0.0F); ++ this.ironGolemLeftArm.setTextureOffset(60, 58).addBox(9.0F, -2.5F, -3.0F, 4, 30, 6, par1); ++ this.ironGolemLeftLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(var3, var4); ++ this.ironGolemLeftLeg.setRotationPoint(-4.0F, 18.0F + par2, 0.0F); ++ this.ironGolemLeftLeg.setTextureOffset(37, 0).addBox(-3.5F, -3.0F, -3.0F, 6, 16, 5, par1); ++ this.ironGolemRightLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(var3, var4); ++ this.ironGolemRightLeg.mirror = true; ++ this.ironGolemRightLeg.setTextureOffset(60, 0).setRotationPoint(5.0F, 18.0F + par2, 0.0F); ++ this.ironGolemRightLeg.addBox(-3.5F, -3.0F, -3.0F, 6, 16, 5, par1); ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ this.ironGolemHead.render(par7); ++ this.ironGolemBody.render(par7); ++ this.ironGolemLeftLeg.render(par7); ++ this.ironGolemRightLeg.render(par7); ++ this.ironGolemRightArm.render(par7); ++ this.ironGolemLeftArm.render(par7); ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ this.ironGolemHead.rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.ironGolemHead.rotateAngleX = par5 / (180F / (float)Math.PI); ++ this.ironGolemLeftLeg.rotateAngleX = -1.5F * this.func_78172_a(par1, 13.0F) * par2; ++ this.ironGolemRightLeg.rotateAngleX = 1.5F * this.func_78172_a(par1, 13.0F) * par2; ++ this.ironGolemLeftLeg.rotateAngleY = 0.0F; ++ this.ironGolemRightLeg.rotateAngleY = 0.0F; ++ } ++ ++ /** ++ * Used for easily adding entity-dependent animations. The second and third float params here are the same second ++ * and third as in the setRotationAngles method. ++ */ ++ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) ++ { ++ EntityIronGolem var5 = (EntityIronGolem)par1EntityLivingBase; ++ int var6 = var5.getAttackTimer(); ++ ++ if (var6 > 0) ++ { ++ this.ironGolemRightArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float)var6 - par4, 10.0F); ++ this.ironGolemLeftArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float)var6 - par4, 10.0F); ++ } ++ else ++ { ++ int var7 = var5.getHoldRoseTick(); ++ ++ if (var7 > 0) ++ { ++ this.ironGolemRightArm.rotateAngleX = -0.8F + 0.025F * this.func_78172_a((float)var7, 70.0F); ++ this.ironGolemLeftArm.rotateAngleX = 0.0F; ++ } ++ else ++ { ++ this.ironGolemRightArm.rotateAngleX = (-0.2F + 1.5F * this.func_78172_a(par2, 13.0F)) * par3; ++ this.ironGolemLeftArm.rotateAngleX = (-0.2F - 1.5F * this.func_78172_a(par2, 13.0F)) * par3; ++ } ++ } ++ } ++ ++ private float func_78172_a(float par1, float par2) ++ { ++ return (Math.abs(par1 % par2 - par2 * 0.5F) - par2 * 0.25F) / (par2 * 0.25F); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelLargeChest.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,23 ---- ++ package net.minecraft.src; ++ ++ public class ModelLargeChest extends ModelChest ++ { ++ public ModelLargeChest() ++ { ++ this.chestLid = (new ModelRenderer(this, 0, 0)).setTextureSize(128, 64); ++ this.chestLid.addBox(0.0F, -5.0F, -14.0F, 30, 5, 14, 0.0F); ++ this.chestLid.rotationPointX = 1.0F; ++ this.chestLid.rotationPointY = 7.0F; ++ this.chestLid.rotationPointZ = 15.0F; ++ this.chestKnob = (new ModelRenderer(this, 0, 0)).setTextureSize(128, 64); ++ this.chestKnob.addBox(-1.0F, -2.0F, -15.0F, 2, 4, 1, 0.0F); ++ this.chestKnob.rotationPointX = 16.0F; ++ this.chestKnob.rotationPointY = 7.0F; ++ this.chestKnob.rotationPointZ = 15.0F; ++ this.chestBelow = (new ModelRenderer(this, 0, 19)).setTextureSize(128, 64); ++ this.chestBelow.addBox(0.0F, 0.0F, 0.0F, 30, 10, 14, 0.0F); ++ this.chestBelow.rotationPointX = 1.0F; ++ this.chestBelow.rotationPointY = 6.0F; ++ this.chestBelow.rotationPointZ = 1.0F; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelLeashKnot.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,41 ---- ++ package net.minecraft.src; ++ ++ public class ModelLeashKnot extends ModelBase ++ { ++ public ModelRenderer field_110723_a; ++ ++ public ModelLeashKnot() ++ { ++ this(0, 0, 32, 32); ++ } ++ ++ public ModelLeashKnot(int par1, int par2, int par3, int par4) ++ { ++ this.textureWidth = par3; ++ this.textureHeight = par4; ++ this.field_110723_a = new ModelRenderer(this, par1, par2); ++ this.field_110723_a.addBox(-3.0F, -6.0F, -3.0F, 6, 8, 6, 0.0F); ++ this.field_110723_a.setRotationPoint(0.0F, 0.0F, 0.0F); ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ this.field_110723_a.render(par7); ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); ++ this.field_110723_a.rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.field_110723_a.rotateAngleX = par5 / (180F / (float)Math.PI); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelMagmaCube.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,67 ---- ++ package net.minecraft.src; ++ ++ public class ModelMagmaCube extends ModelBase ++ { ++ ModelRenderer[] field_78109_a = new ModelRenderer[8]; ++ ModelRenderer field_78108_b; ++ ++ public ModelMagmaCube() ++ { ++ for (int var1 = 0; var1 < this.field_78109_a.length; ++var1) ++ { ++ byte var2 = 0; ++ int var3 = var1; ++ ++ if (var1 == 2) ++ { ++ var2 = 24; ++ var3 = 10; ++ } ++ else if (var1 == 3) ++ { ++ var2 = 24; ++ var3 = 19; ++ } ++ ++ this.field_78109_a[var1] = new ModelRenderer(this, var2, var3); ++ this.field_78109_a[var1].addBox(-4.0F, (float)(16 + var1), -4.0F, 8, 1, 8); ++ } ++ ++ this.field_78108_b = new ModelRenderer(this, 0, 16); ++ this.field_78108_b.addBox(-2.0F, 18.0F, -2.0F, 4, 4, 4); ++ } ++ ++ /** ++ * Used for easily adding entity-dependent animations. The second and third float params here are the same second ++ * and third as in the setRotationAngles method. ++ */ ++ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) ++ { ++ EntityMagmaCube var5 = (EntityMagmaCube)par1EntityLivingBase; ++ float var6 = var5.prevSquishFactor + (var5.squishFactor - var5.prevSquishFactor) * par4; ++ ++ if (var6 < 0.0F) ++ { ++ var6 = 0.0F; ++ } ++ ++ for (int var7 = 0; var7 < this.field_78109_a.length; ++var7) ++ { ++ this.field_78109_a[var7].rotationPointY = (float)(-(4 - var7)) * var6 * 1.7F; ++ } ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ this.field_78108_b.render(par7); ++ ++ for (int var8 = 0; var8 < this.field_78109_a.length; ++var8) ++ { ++ this.field_78109_a[var8].render(par7); ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelMinecart.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,50 ---- ++ package net.minecraft.src; ++ ++ public class ModelMinecart extends ModelBase ++ { ++ public ModelRenderer[] sideModels = new ModelRenderer[7]; ++ ++ public ModelMinecart() ++ { ++ this.sideModels[0] = new ModelRenderer(this, 0, 10); ++ this.sideModels[1] = new ModelRenderer(this, 0, 0); ++ this.sideModels[2] = new ModelRenderer(this, 0, 0); ++ this.sideModels[3] = new ModelRenderer(this, 0, 0); ++ this.sideModels[4] = new ModelRenderer(this, 0, 0); ++ this.sideModels[5] = new ModelRenderer(this, 44, 10); ++ byte var1 = 20; ++ byte var2 = 8; ++ byte var3 = 16; ++ byte var4 = 4; ++ this.sideModels[0].addBox((float)(-var1 / 2), (float)(-var3 / 2), -1.0F, var1, var3, 2, 0.0F); ++ this.sideModels[0].setRotationPoint(0.0F, (float)var4, 0.0F); ++ this.sideModels[5].addBox((float)(-var1 / 2 + 1), (float)(-var3 / 2 + 1), -1.0F, var1 - 2, var3 - 2, 1, 0.0F); ++ this.sideModels[5].setRotationPoint(0.0F, (float)var4, 0.0F); ++ this.sideModels[1].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F); ++ this.sideModels[1].setRotationPoint((float)(-var1 / 2 + 1), (float)var4, 0.0F); ++ this.sideModels[2].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F); ++ this.sideModels[2].setRotationPoint((float)(var1 / 2 - 1), (float)var4, 0.0F); ++ this.sideModels[3].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F); ++ this.sideModels[3].setRotationPoint(0.0F, (float)var4, (float)(-var3 / 2 + 1)); ++ this.sideModels[4].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F); ++ this.sideModels[4].setRotationPoint(0.0F, (float)var4, (float)(var3 / 2 - 1)); ++ this.sideModels[0].rotateAngleX = ((float)Math.PI / 2F); ++ this.sideModels[1].rotateAngleY = ((float)Math.PI * 3F / 2F); ++ this.sideModels[2].rotateAngleY = ((float)Math.PI / 2F); ++ this.sideModels[3].rotateAngleY = (float)Math.PI; ++ this.sideModels[5].rotateAngleX = -((float)Math.PI / 2F); ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ this.sideModels[5].rotationPointY = 4.0F - par4; ++ ++ for (int var8 = 0; var8 < 6; ++var8) ++ { ++ this.sideModels[var8].render(par7); ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelOcelot.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,215 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class ModelOcelot extends ModelBase ++ { ++ /** The back left leg model for the Ocelot. */ ++ ModelRenderer ocelotBackLeftLeg; ++ ++ /** The back right leg model for the Ocelot. */ ++ ModelRenderer ocelotBackRightLeg; ++ ++ /** The front left leg model for the Ocelot. */ ++ ModelRenderer ocelotFrontLeftLeg; ++ ++ /** The front right leg model for the Ocelot. */ ++ ModelRenderer ocelotFrontRightLeg; ++ ++ /** The tail model for the Ocelot. */ ++ ModelRenderer ocelotTail; ++ ++ /** The second part of tail model for the Ocelot. */ ++ ModelRenderer ocelotTail2; ++ ++ /** The head model for the Ocelot. */ ++ ModelRenderer ocelotHead; ++ ++ /** The body model for the Ocelot. */ ++ ModelRenderer ocelotBody; ++ int field_78163_i = 1; ++ ++ public ModelOcelot() ++ { ++ this.setTextureOffset("head.main", 0, 0); ++ this.setTextureOffset("head.nose", 0, 24); ++ this.setTextureOffset("head.ear1", 0, 10); ++ this.setTextureOffset("head.ear2", 6, 10); ++ this.ocelotHead = new ModelRenderer(this, "head"); ++ this.ocelotHead.addBox("main", -2.5F, -2.0F, -3.0F, 5, 4, 5); ++ this.ocelotHead.addBox("nose", -1.5F, 0.0F, -4.0F, 3, 2, 2); ++ this.ocelotHead.addBox("ear1", -2.0F, -3.0F, 0.0F, 1, 1, 2); ++ this.ocelotHead.addBox("ear2", 1.0F, -3.0F, 0.0F, 1, 1, 2); ++ this.ocelotHead.setRotationPoint(0.0F, 15.0F, -9.0F); ++ this.ocelotBody = new ModelRenderer(this, 20, 0); ++ this.ocelotBody.addBox(-2.0F, 3.0F, -8.0F, 4, 16, 6, 0.0F); ++ this.ocelotBody.setRotationPoint(0.0F, 12.0F, -10.0F); ++ this.ocelotTail = new ModelRenderer(this, 0, 15); ++ this.ocelotTail.addBox(-0.5F, 0.0F, 0.0F, 1, 8, 1); ++ this.ocelotTail.rotateAngleX = 0.9F; ++ this.ocelotTail.setRotationPoint(0.0F, 15.0F, 8.0F); ++ this.ocelotTail2 = new ModelRenderer(this, 4, 15); ++ this.ocelotTail2.addBox(-0.5F, 0.0F, 0.0F, 1, 8, 1); ++ this.ocelotTail2.setRotationPoint(0.0F, 20.0F, 14.0F); ++ this.ocelotBackLeftLeg = new ModelRenderer(this, 8, 13); ++ this.ocelotBackLeftLeg.addBox(-1.0F, 0.0F, 1.0F, 2, 6, 2); ++ this.ocelotBackLeftLeg.setRotationPoint(1.1F, 18.0F, 5.0F); ++ this.ocelotBackRightLeg = new ModelRenderer(this, 8, 13); ++ this.ocelotBackRightLeg.addBox(-1.0F, 0.0F, 1.0F, 2, 6, 2); ++ this.ocelotBackRightLeg.setRotationPoint(-1.1F, 18.0F, 5.0F); ++ this.ocelotFrontLeftLeg = new ModelRenderer(this, 40, 0); ++ this.ocelotFrontLeftLeg.addBox(-1.0F, 0.0F, 0.0F, 2, 10, 2); ++ this.ocelotFrontLeftLeg.setRotationPoint(1.2F, 13.8F, -5.0F); ++ this.ocelotFrontRightLeg = new ModelRenderer(this, 40, 0); ++ this.ocelotFrontRightLeg.addBox(-1.0F, 0.0F, 0.0F, 2, 10, 2); ++ this.ocelotFrontRightLeg.setRotationPoint(-1.2F, 13.8F, -5.0F); ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ ++ if (this.isChild) ++ { ++ float var8 = 2.0F; ++ GL11.glPushMatrix(); ++ GL11.glScalef(1.5F / var8, 1.5F / var8, 1.5F / var8); ++ GL11.glTranslatef(0.0F, 10.0F * par7, 4.0F * par7); ++ this.ocelotHead.render(par7); ++ GL11.glPopMatrix(); ++ GL11.glPushMatrix(); ++ GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); ++ GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); ++ this.ocelotBody.render(par7); ++ this.ocelotBackLeftLeg.render(par7); ++ this.ocelotBackRightLeg.render(par7); ++ this.ocelotFrontLeftLeg.render(par7); ++ this.ocelotFrontRightLeg.render(par7); ++ this.ocelotTail.render(par7); ++ this.ocelotTail2.render(par7); ++ GL11.glPopMatrix(); ++ } ++ else ++ { ++ this.ocelotHead.render(par7); ++ this.ocelotBody.render(par7); ++ this.ocelotTail.render(par7); ++ this.ocelotTail2.render(par7); ++ this.ocelotBackLeftLeg.render(par7); ++ this.ocelotBackRightLeg.render(par7); ++ this.ocelotFrontLeftLeg.render(par7); ++ this.ocelotFrontRightLeg.render(par7); ++ } ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ this.ocelotHead.rotateAngleX = par5 / (180F / (float)Math.PI); ++ this.ocelotHead.rotateAngleY = par4 / (180F / (float)Math.PI); ++ ++ if (this.field_78163_i != 3) ++ { ++ this.ocelotBody.rotateAngleX = ((float)Math.PI / 2F); ++ ++ if (this.field_78163_i == 2) ++ { ++ this.ocelotBackLeftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.0F * par2; ++ this.ocelotBackRightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + 0.3F) * 1.0F * par2; ++ this.ocelotFrontLeftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI + 0.3F) * 1.0F * par2; ++ this.ocelotFrontRightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.0F * par2; ++ this.ocelotTail2.rotateAngleX = 1.7278761F + ((float)Math.PI / 10F) * MathHelper.cos(par1) * par2; ++ } ++ else ++ { ++ this.ocelotBackLeftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.0F * par2; ++ this.ocelotBackRightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.0F * par2; ++ this.ocelotFrontLeftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.0F * par2; ++ this.ocelotFrontRightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.0F * par2; ++ ++ if (this.field_78163_i == 1) ++ { ++ this.ocelotTail2.rotateAngleX = 1.7278761F + ((float)Math.PI / 4F) * MathHelper.cos(par1) * par2; ++ } ++ else ++ { ++ this.ocelotTail2.rotateAngleX = 1.7278761F + 0.47123894F * MathHelper.cos(par1) * par2; ++ } ++ } ++ } ++ } ++ ++ /** ++ * Used for easily adding entity-dependent animations. The second and third float params here are the same second ++ * and third as in the setRotationAngles method. ++ */ ++ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) ++ { ++ EntityOcelot var5 = (EntityOcelot)par1EntityLivingBase; ++ this.ocelotBody.rotationPointY = 12.0F; ++ this.ocelotBody.rotationPointZ = -10.0F; ++ this.ocelotHead.rotationPointY = 15.0F; ++ this.ocelotHead.rotationPointZ = -9.0F; ++ this.ocelotTail.rotationPointY = 15.0F; ++ this.ocelotTail.rotationPointZ = 8.0F; ++ this.ocelotTail2.rotationPointY = 20.0F; ++ this.ocelotTail2.rotationPointZ = 14.0F; ++ this.ocelotFrontLeftLeg.rotationPointY = this.ocelotFrontRightLeg.rotationPointY = 13.8F; ++ this.ocelotFrontLeftLeg.rotationPointZ = this.ocelotFrontRightLeg.rotationPointZ = -5.0F; ++ this.ocelotBackLeftLeg.rotationPointY = this.ocelotBackRightLeg.rotationPointY = 18.0F; ++ this.ocelotBackLeftLeg.rotationPointZ = this.ocelotBackRightLeg.rotationPointZ = 5.0F; ++ this.ocelotTail.rotateAngleX = 0.9F; ++ ++ if (var5.isSneaking()) ++ { ++ ++this.ocelotBody.rotationPointY; ++ this.ocelotHead.rotationPointY += 2.0F; ++ ++this.ocelotTail.rotationPointY; ++ this.ocelotTail2.rotationPointY += -4.0F; ++ this.ocelotTail2.rotationPointZ += 2.0F; ++ this.ocelotTail.rotateAngleX = ((float)Math.PI / 2F); ++ this.ocelotTail2.rotateAngleX = ((float)Math.PI / 2F); ++ this.field_78163_i = 0; ++ } ++ else if (var5.isSprinting()) ++ { ++ this.ocelotTail2.rotationPointY = this.ocelotTail.rotationPointY; ++ this.ocelotTail2.rotationPointZ += 2.0F; ++ this.ocelotTail.rotateAngleX = ((float)Math.PI / 2F); ++ this.ocelotTail2.rotateAngleX = ((float)Math.PI / 2F); ++ this.field_78163_i = 2; ++ } ++ else if (var5.isSitting()) ++ { ++ this.ocelotBody.rotateAngleX = ((float)Math.PI / 4F); ++ this.ocelotBody.rotationPointY += -4.0F; ++ this.ocelotBody.rotationPointZ += 5.0F; ++ this.ocelotHead.rotationPointY += -3.3F; ++ ++this.ocelotHead.rotationPointZ; ++ this.ocelotTail.rotationPointY += 8.0F; ++ this.ocelotTail.rotationPointZ += -2.0F; ++ this.ocelotTail2.rotationPointY += 2.0F; ++ this.ocelotTail2.rotationPointZ += -0.8F; ++ this.ocelotTail.rotateAngleX = 1.7278761F; ++ this.ocelotTail2.rotateAngleX = 2.670354F; ++ this.ocelotFrontLeftLeg.rotateAngleX = this.ocelotFrontRightLeg.rotateAngleX = -0.15707964F; ++ this.ocelotFrontLeftLeg.rotationPointY = this.ocelotFrontRightLeg.rotationPointY = 15.8F; ++ this.ocelotFrontLeftLeg.rotationPointZ = this.ocelotFrontRightLeg.rotationPointZ = -7.0F; ++ this.ocelotBackLeftLeg.rotateAngleX = this.ocelotBackRightLeg.rotateAngleX = -((float)Math.PI / 2F); ++ this.ocelotBackLeftLeg.rotationPointY = this.ocelotBackRightLeg.rotationPointY = 21.0F; ++ this.ocelotBackLeftLeg.rotationPointZ = this.ocelotBackRightLeg.rotationPointZ = 1.0F; ++ this.field_78163_i = 3; ++ } ++ else ++ { ++ this.field_78163_i = 1; ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelPig.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,16 ---- ++ package net.minecraft.src; ++ ++ public class ModelPig extends ModelQuadruped ++ { ++ public ModelPig() ++ { ++ this(0.0F); ++ } ++ ++ public ModelPig(float par1) ++ { ++ super(6, par1); ++ this.head.setTextureOffset(16, 16).addBox(-2.0F, 0.0F, -9.0F, 4, 3, 1, par1); ++ this.field_78145_g = 4.0F; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelQuadruped.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,88 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class ModelQuadruped extends ModelBase ++ { ++ public ModelRenderer head = new ModelRenderer(this, 0, 0); ++ public ModelRenderer body; ++ public ModelRenderer leg1; ++ public ModelRenderer leg2; ++ public ModelRenderer leg3; ++ public ModelRenderer leg4; ++ protected float field_78145_g = 8.0F; ++ protected float field_78151_h = 4.0F; ++ ++ public ModelQuadruped(int par1, float par2) ++ { ++ this.head.addBox(-4.0F, -4.0F, -8.0F, 8, 8, 8, par2); ++ this.head.setRotationPoint(0.0F, (float)(18 - par1), -6.0F); ++ this.body = new ModelRenderer(this, 28, 8); ++ this.body.addBox(-5.0F, -10.0F, -7.0F, 10, 16, 8, par2); ++ this.body.setRotationPoint(0.0F, (float)(17 - par1), 2.0F); ++ this.leg1 = new ModelRenderer(this, 0, 16); ++ this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, par1, 4, par2); ++ this.leg1.setRotationPoint(-3.0F, (float)(24 - par1), 7.0F); ++ this.leg2 = new ModelRenderer(this, 0, 16); ++ this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, par1, 4, par2); ++ this.leg2.setRotationPoint(3.0F, (float)(24 - par1), 7.0F); ++ this.leg3 = new ModelRenderer(this, 0, 16); ++ this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, par1, 4, par2); ++ this.leg3.setRotationPoint(-3.0F, (float)(24 - par1), -5.0F); ++ this.leg4 = new ModelRenderer(this, 0, 16); ++ this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, par1, 4, par2); ++ this.leg4.setRotationPoint(3.0F, (float)(24 - par1), -5.0F); ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ ++ if (this.isChild) ++ { ++ float var8 = 2.0F; ++ GL11.glPushMatrix(); ++ GL11.glTranslatef(0.0F, this.field_78145_g * par7, this.field_78151_h * par7); ++ this.head.render(par7); ++ GL11.glPopMatrix(); ++ GL11.glPushMatrix(); ++ GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); ++ GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); ++ this.body.render(par7); ++ this.leg1.render(par7); ++ this.leg2.render(par7); ++ this.leg3.render(par7); ++ this.leg4.render(par7); ++ GL11.glPopMatrix(); ++ } ++ else ++ { ++ this.head.render(par7); ++ this.body.render(par7); ++ this.leg1.render(par7); ++ this.leg2.render(par7); ++ this.leg3.render(par7); ++ this.leg4.render(par7); ++ } ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ float var8 = (180F / (float)Math.PI); ++ this.head.rotateAngleX = par5 / (180F / (float)Math.PI); ++ this.head.rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.body.rotateAngleX = ((float)Math.PI / 2F); ++ this.leg1.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2; ++ this.leg2.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2; ++ this.leg3.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2; ++ this.leg4.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelRenderer.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,304 ---- ++ package net.minecraft.src; ++ ++ import java.util.ArrayList; ++ import java.util.List; ++ import org.lwjgl.opengl.GL11; ++ ++ public class ModelRenderer ++ { ++ /** The size of the texture file's width in pixels. */ ++ public float textureWidth; ++ ++ /** The size of the texture file's height in pixels. */ ++ public float textureHeight; ++ ++ /** The X offset into the texture used for displaying this model */ ++ private int textureOffsetX; ++ ++ /** The Y offset into the texture used for displaying this model */ ++ private int textureOffsetY; ++ public float rotationPointX; ++ public float rotationPointY; ++ public float rotationPointZ; ++ public float rotateAngleX; ++ public float rotateAngleY; ++ public float rotateAngleZ; ++ private boolean compiled; ++ ++ /** The GL display list rendered by the Tessellator for this model */ ++ private int displayList; ++ public boolean mirror; ++ public boolean showModel; ++ ++ /** Hides the model. */ ++ public boolean isHidden; ++ public List cubeList; ++ public List childModels; ++ public final String boxName; ++ private ModelBase baseModel; ++ public float offsetX; ++ public float offsetY; ++ public float offsetZ; ++ ++ public ModelRenderer(ModelBase par1ModelBase, String par2Str) ++ { ++ this.textureWidth = 64.0F; ++ this.textureHeight = 32.0F; ++ this.showModel = true; ++ this.cubeList = new ArrayList(); ++ this.baseModel = par1ModelBase; ++ par1ModelBase.boxList.add(this); ++ this.boxName = par2Str; ++ this.setTextureSize(par1ModelBase.textureWidth, par1ModelBase.textureHeight); ++ } ++ ++ public ModelRenderer(ModelBase par1ModelBase) ++ { ++ this(par1ModelBase, (String)null); ++ } ++ ++ public ModelRenderer(ModelBase par1ModelBase, int par2, int par3) ++ { ++ this(par1ModelBase); ++ this.setTextureOffset(par2, par3); ++ } ++ ++ /** ++ * Sets the current box's rotation points and rotation angles to another box. ++ */ ++ public void addChild(ModelRenderer par1ModelRenderer) ++ { ++ if (this.childModels == null) ++ { ++ this.childModels = new ArrayList(); ++ } ++ ++ this.childModels.add(par1ModelRenderer); ++ } ++ ++ public ModelRenderer setTextureOffset(int par1, int par2) ++ { ++ this.textureOffsetX = par1; ++ this.textureOffsetY = par2; ++ return this; ++ } ++ ++ public ModelRenderer addBox(String par1Str, float par2, float par3, float par4, int par5, int par6, int par7) ++ { ++ par1Str = this.boxName + "." + par1Str; ++ TextureOffset var8 = this.baseModel.getTextureOffset(par1Str); ++ this.setTextureOffset(var8.textureOffsetX, var8.textureOffsetY); ++ this.cubeList.add((new ModelBox(this, this.textureOffsetX, this.textureOffsetY, par2, par3, par4, par5, par6, par7, 0.0F)).func_78244_a(par1Str)); ++ return this; ++ } ++ ++ public ModelRenderer addBox(float par1, float par2, float par3, int par4, int par5, int par6) ++ { ++ this.cubeList.add(new ModelBox(this, this.textureOffsetX, this.textureOffsetY, par1, par2, par3, par4, par5, par6, 0.0F)); ++ return this; ++ } ++ ++ /** ++ * Creates a textured box. Args: originX, originY, originZ, width, height, depth, scaleFactor. ++ */ ++ public void addBox(float par1, float par2, float par3, int par4, int par5, int par6, float par7) ++ { ++ this.cubeList.add(new ModelBox(this, this.textureOffsetX, this.textureOffsetY, par1, par2, par3, par4, par5, par6, par7)); ++ } ++ ++ public void setRotationPoint(float par1, float par2, float par3) ++ { ++ this.rotationPointX = par1; ++ this.rotationPointY = par2; ++ this.rotationPointZ = par3; ++ } ++ ++ public void render(float par1) ++ { ++ if (!this.isHidden) ++ { ++ if (this.showModel) ++ { ++ if (!this.compiled) ++ { ++ this.compileDisplayList(par1); ++ } ++ ++ GL11.glTranslatef(this.offsetX, this.offsetY, this.offsetZ); ++ int var2; ++ ++ if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) ++ { ++ if (this.rotationPointX == 0.0F && this.rotationPointY == 0.0F && this.rotationPointZ == 0.0F) ++ { ++ GL11.glCallList(this.displayList); ++ ++ if (this.childModels != null) ++ { ++ for (var2 = 0; var2 < this.childModels.size(); ++var2) ++ { ++ ((ModelRenderer)this.childModels.get(var2)).render(par1); ++ } ++ } ++ } ++ else ++ { ++ GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); ++ GL11.glCallList(this.displayList); ++ ++ if (this.childModels != null) ++ { ++ for (var2 = 0; var2 < this.childModels.size(); ++var2) ++ { ++ ((ModelRenderer)this.childModels.get(var2)).render(par1); ++ } ++ } ++ ++ GL11.glTranslatef(-this.rotationPointX * par1, -this.rotationPointY * par1, -this.rotationPointZ * par1); ++ } ++ } ++ else ++ { ++ GL11.glPushMatrix(); ++ GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); ++ ++ if (this.rotateAngleZ != 0.0F) ++ { ++ GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); ++ } ++ ++ if (this.rotateAngleY != 0.0F) ++ { ++ GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); ++ } ++ ++ if (this.rotateAngleX != 0.0F) ++ { ++ GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); ++ } ++ ++ GL11.glCallList(this.displayList); ++ ++ if (this.childModels != null) ++ { ++ for (var2 = 0; var2 < this.childModels.size(); ++var2) ++ { ++ ((ModelRenderer)this.childModels.get(var2)).render(par1); ++ } ++ } ++ ++ GL11.glPopMatrix(); ++ } ++ ++ GL11.glTranslatef(-this.offsetX, -this.offsetY, -this.offsetZ); ++ } ++ } ++ } ++ ++ public void renderWithRotation(float par1) ++ { ++ if (!this.isHidden) ++ { ++ if (this.showModel) ++ { ++ if (!this.compiled) ++ { ++ this.compileDisplayList(par1); ++ } ++ ++ GL11.glPushMatrix(); ++ GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); ++ ++ if (this.rotateAngleY != 0.0F) ++ { ++ GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); ++ } ++ ++ if (this.rotateAngleX != 0.0F) ++ { ++ GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); ++ } ++ ++ if (this.rotateAngleZ != 0.0F) ++ { ++ GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); ++ } ++ ++ GL11.glCallList(this.displayList); ++ GL11.glPopMatrix(); ++ } ++ } ++ } ++ ++ /** ++ * Allows the changing of Angles after a box has been rendered ++ */ ++ public void postRender(float par1) ++ { ++ if (!this.isHidden) ++ { ++ if (this.showModel) ++ { ++ if (!this.compiled) ++ { ++ this.compileDisplayList(par1); ++ } ++ ++ if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) ++ { ++ if (this.rotationPointX != 0.0F || this.rotationPointY != 0.0F || this.rotationPointZ != 0.0F) ++ { ++ GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); ++ } ++ } ++ else ++ { ++ GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); ++ ++ if (this.rotateAngleZ != 0.0F) ++ { ++ GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); ++ } ++ ++ if (this.rotateAngleY != 0.0F) ++ { ++ GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); ++ } ++ ++ if (this.rotateAngleX != 0.0F) ++ { ++ GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); ++ } ++ } ++ } ++ } ++ } ++ ++ /** ++ * Compiles a GL display list for this model ++ */ ++ private void compileDisplayList(float par1) ++ { ++ this.displayList = GLAllocation.generateDisplayLists(1); ++ GL11.glNewList(this.displayList, GL11.GL_COMPILE); ++ Tessellator var2 = Tessellator.instance; ++ ++ for (int var3 = 0; var3 < this.cubeList.size(); ++var3) ++ { ++ ((ModelBox)this.cubeList.get(var3)).render(var2, par1); ++ } ++ ++ GL11.glEndList(); ++ this.compiled = true; ++ } ++ ++ /** ++ * Returns the model renderer with the new texture parameters. ++ */ ++ public ModelRenderer setTextureSize(int par1, int par2) ++ { ++ this.textureWidth = (float)par1; ++ this.textureHeight = (float)par2; ++ return this; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelSheep1.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,52 ---- ++ package net.minecraft.src; ++ ++ public class ModelSheep1 extends ModelQuadruped ++ { ++ private float field_78152_i; ++ ++ public ModelSheep1() ++ { ++ super(12, 0.0F); ++ this.head = new ModelRenderer(this, 0, 0); ++ this.head.addBox(-3.0F, -4.0F, -4.0F, 6, 6, 6, 0.6F); ++ this.head.setRotationPoint(0.0F, 6.0F, -8.0F); ++ this.body = new ModelRenderer(this, 28, 8); ++ this.body.addBox(-4.0F, -10.0F, -7.0F, 8, 16, 6, 1.75F); ++ this.body.setRotationPoint(0.0F, 5.0F, 2.0F); ++ float var1 = 0.5F; ++ this.leg1 = new ModelRenderer(this, 0, 16); ++ this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1); ++ this.leg1.setRotationPoint(-3.0F, 12.0F, 7.0F); ++ this.leg2 = new ModelRenderer(this, 0, 16); ++ this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1); ++ this.leg2.setRotationPoint(3.0F, 12.0F, 7.0F); ++ this.leg3 = new ModelRenderer(this, 0, 16); ++ this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1); ++ this.leg3.setRotationPoint(-3.0F, 12.0F, -5.0F); ++ this.leg4 = new ModelRenderer(this, 0, 16); ++ this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1); ++ this.leg4.setRotationPoint(3.0F, 12.0F, -5.0F); ++ } ++ ++ /** ++ * Used for easily adding entity-dependent animations. The second and third float params here are the same second ++ * and third as in the setRotationAngles method. ++ */ ++ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) ++ { ++ super.setLivingAnimations(par1EntityLivingBase, par2, par3, par4); ++ this.head.rotationPointY = 6.0F + ((EntitySheep)par1EntityLivingBase).func_70894_j(par4) * 9.0F; ++ this.field_78152_i = ((EntitySheep)par1EntityLivingBase).func_70890_k(par4); ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); ++ this.head.rotateAngleX = this.field_78152_i; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelSheep2.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,39 ---- ++ package net.minecraft.src; ++ ++ public class ModelSheep2 extends ModelQuadruped ++ { ++ private float field_78153_i; ++ ++ public ModelSheep2() ++ { ++ super(12, 0.0F); ++ this.head = new ModelRenderer(this, 0, 0); ++ this.head.addBox(-3.0F, -4.0F, -6.0F, 6, 6, 8, 0.0F); ++ this.head.setRotationPoint(0.0F, 6.0F, -8.0F); ++ this.body = new ModelRenderer(this, 28, 8); ++ this.body.addBox(-4.0F, -10.0F, -7.0F, 8, 16, 6, 0.0F); ++ this.body.setRotationPoint(0.0F, 5.0F, 2.0F); ++ } ++ ++ /** ++ * Used for easily adding entity-dependent animations. The second and third float params here are the same second ++ * and third as in the setRotationAngles method. ++ */ ++ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) ++ { ++ super.setLivingAnimations(par1EntityLivingBase, par2, par3, par4); ++ this.head.rotationPointY = 6.0F + ((EntitySheep)par1EntityLivingBase).func_70894_j(par4) * 9.0F; ++ this.field_78153_i = ((EntitySheep)par1EntityLivingBase).func_70890_k(par4); ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); ++ this.head.rotateAngleX = this.field_78153_i; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelSign.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,26 ---- ++ package net.minecraft.src; ++ ++ public class ModelSign extends ModelBase ++ { ++ /** The board on a sign that has the writing on it. */ ++ public ModelRenderer signBoard = new ModelRenderer(this, 0, 0); ++ ++ /** The stick a sign stands on. */ ++ public ModelRenderer signStick; ++ ++ public ModelSign() ++ { ++ this.signBoard.addBox(-12.0F, -14.0F, -1.0F, 24, 12, 2, 0.0F); ++ this.signStick = new ModelRenderer(this, 0, 14); ++ this.signStick.addBox(-1.0F, -2.0F, -1.0F, 2, 14, 2, 0.0F); ++ } ++ ++ /** ++ * Renders the sign model through TileEntitySignRenderer ++ */ ++ public void renderSign() ++ { ++ this.signBoard.render(0.0625F); ++ this.signStick.render(0.0625F); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelSilverfish.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,85 ---- ++ package net.minecraft.src; ++ ++ public class ModelSilverfish extends ModelBase ++ { ++ /** The body parts of the silverfish's model. */ ++ private ModelRenderer[] silverfishBodyParts = new ModelRenderer[7]; ++ ++ /** The wings (dust-looking sprites) on the silverfish's model. */ ++ private ModelRenderer[] silverfishWings; ++ private float[] field_78170_c = new float[7]; ++ ++ /** The widths, heights, and lengths for the silverfish model boxes. */ ++ private static final int[][] silverfishBoxLength = new int[][] {{3, 2, 2}, {4, 3, 2}, {6, 4, 3}, {3, 3, 3}, {2, 2, 3}, {2, 1, 2}, {1, 1, 2}}; ++ ++ /** The texture positions for the silverfish's model's boxes. */ ++ private static final int[][] silverfishTexturePositions = new int[][] {{0, 0}, {0, 4}, {0, 9}, {0, 16}, {0, 22}, {11, 0}, {13, 4}}; ++ ++ public ModelSilverfish() ++ { ++ float var1 = -3.5F; ++ ++ for (int var2 = 0; var2 < this.silverfishBodyParts.length; ++var2) ++ { ++ this.silverfishBodyParts[var2] = new ModelRenderer(this, silverfishTexturePositions[var2][0], silverfishTexturePositions[var2][1]); ++ this.silverfishBodyParts[var2].addBox((float)silverfishBoxLength[var2][0] * -0.5F, 0.0F, (float)silverfishBoxLength[var2][2] * -0.5F, silverfishBoxLength[var2][0], silverfishBoxLength[var2][1], silverfishBoxLength[var2][2]); ++ this.silverfishBodyParts[var2].setRotationPoint(0.0F, (float)(24 - silverfishBoxLength[var2][1]), var1); ++ this.field_78170_c[var2] = var1; ++ ++ if (var2 < this.silverfishBodyParts.length - 1) ++ { ++ var1 += (float)(silverfishBoxLength[var2][2] + silverfishBoxLength[var2 + 1][2]) * 0.5F; ++ } ++ } ++ ++ this.silverfishWings = new ModelRenderer[3]; ++ this.silverfishWings[0] = new ModelRenderer(this, 20, 0); ++ this.silverfishWings[0].addBox(-5.0F, 0.0F, (float)silverfishBoxLength[2][2] * -0.5F, 10, 8, silverfishBoxLength[2][2]); ++ this.silverfishWings[0].setRotationPoint(0.0F, 16.0F, this.field_78170_c[2]); ++ this.silverfishWings[1] = new ModelRenderer(this, 20, 11); ++ this.silverfishWings[1].addBox(-3.0F, 0.0F, (float)silverfishBoxLength[4][2] * -0.5F, 6, 4, silverfishBoxLength[4][2]); ++ this.silverfishWings[1].setRotationPoint(0.0F, 20.0F, this.field_78170_c[4]); ++ this.silverfishWings[2] = new ModelRenderer(this, 20, 18); ++ this.silverfishWings[2].addBox(-3.0F, 0.0F, (float)silverfishBoxLength[4][2] * -0.5F, 6, 5, silverfishBoxLength[1][2]); ++ this.silverfishWings[2].setRotationPoint(0.0F, 19.0F, this.field_78170_c[1]); ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ int var8; ++ ++ for (var8 = 0; var8 < this.silverfishBodyParts.length; ++var8) ++ { ++ this.silverfishBodyParts[var8].render(par7); ++ } ++ ++ for (var8 = 0; var8 < this.silverfishWings.length; ++var8) ++ { ++ this.silverfishWings[var8].render(par7); ++ } ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ for (int var8 = 0; var8 < this.silverfishBodyParts.length; ++var8) ++ { ++ this.silverfishBodyParts[var8].rotateAngleY = MathHelper.cos(par3 * 0.9F + (float)var8 * 0.15F * (float)Math.PI) * (float)Math.PI * 0.05F * (float)(1 + Math.abs(var8 - 2)); ++ this.silverfishBodyParts[var8].rotationPointX = MathHelper.sin(par3 * 0.9F + (float)var8 * 0.15F * (float)Math.PI) * (float)Math.PI * 0.2F * (float)Math.abs(var8 - 2); ++ } ++ ++ this.silverfishWings[0].rotateAngleY = this.silverfishBodyParts[2].rotateAngleY; ++ this.silverfishWings[1].rotateAngleY = this.silverfishBodyParts[4].rotateAngleY; ++ this.silverfishWings[1].rotationPointX = this.silverfishBodyParts[4].rotationPointX; ++ this.silverfishWings[2].rotateAngleY = this.silverfishBodyParts[1].rotateAngleY; ++ this.silverfishWings[2].rotationPointX = this.silverfishBodyParts[1].rotationPointX; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelSkeleton.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,48 ---- ++ package net.minecraft.src; ++ ++ public class ModelSkeleton extends ModelZombie ++ { ++ public ModelSkeleton() ++ { ++ this(0.0F); ++ } ++ ++ public ModelSkeleton(float par1) ++ { ++ super(par1, 0.0F, 64, 32); ++ this.bipedRightArm = new ModelRenderer(this, 40, 16); ++ this.bipedRightArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, par1); ++ this.bipedRightArm.setRotationPoint(-5.0F, 2.0F, 0.0F); ++ this.bipedLeftArm = new ModelRenderer(this, 40, 16); ++ this.bipedLeftArm.mirror = true; ++ this.bipedLeftArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, par1); ++ this.bipedLeftArm.setRotationPoint(5.0F, 2.0F, 0.0F); ++ this.bipedRightLeg = new ModelRenderer(this, 0, 16); ++ this.bipedRightLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, par1); ++ this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F, 0.0F); ++ this.bipedLeftLeg = new ModelRenderer(this, 0, 16); ++ this.bipedLeftLeg.mirror = true; ++ this.bipedLeftLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, par1); ++ this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F, 0.0F); ++ } ++ ++ /** ++ * Used for easily adding entity-dependent animations. The second and third float params here are the same second ++ * and third as in the setRotationAngles method. ++ */ ++ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) ++ { ++ this.aimedBow = ((EntitySkeleton)par1EntityLivingBase).getSkeletonType() == 1; ++ super.setLivingAnimations(par1EntityLivingBase, par2, par3, par4); ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelSkeletonHead.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,41 ---- ++ package net.minecraft.src; ++ ++ public class ModelSkeletonHead extends ModelBase ++ { ++ public ModelRenderer skeletonHead; ++ ++ public ModelSkeletonHead() ++ { ++ this(0, 35, 64, 64); ++ } ++ ++ public ModelSkeletonHead(int par1, int par2, int par3, int par4) ++ { ++ this.textureWidth = par3; ++ this.textureHeight = par4; ++ this.skeletonHead = new ModelRenderer(this, par1, par2); ++ this.skeletonHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.0F); ++ this.skeletonHead.setRotationPoint(0.0F, 0.0F, 0.0F); ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ this.skeletonHead.render(par7); ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); ++ this.skeletonHead.rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.skeletonHead.rotateAngleX = par5 / (180F / (float)Math.PI); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelSlime.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,50 ---- ++ package net.minecraft.src; ++ ++ public class ModelSlime extends ModelBase ++ { ++ /** The slime's bodies, both the inside box and the outside box */ ++ ModelRenderer slimeBodies; ++ ++ /** The slime's right eye */ ++ ModelRenderer slimeRightEye; ++ ++ /** The slime's left eye */ ++ ModelRenderer slimeLeftEye; ++ ++ /** The slime's mouth */ ++ ModelRenderer slimeMouth; ++ ++ public ModelSlime(int par1) ++ { ++ this.slimeBodies = new ModelRenderer(this, 0, par1); ++ this.slimeBodies.addBox(-4.0F, 16.0F, -4.0F, 8, 8, 8); ++ ++ if (par1 > 0) ++ { ++ this.slimeBodies = new ModelRenderer(this, 0, par1); ++ this.slimeBodies.addBox(-3.0F, 17.0F, -3.0F, 6, 6, 6); ++ this.slimeRightEye = new ModelRenderer(this, 32, 0); ++ this.slimeRightEye.addBox(-3.25F, 18.0F, -3.5F, 2, 2, 2); ++ this.slimeLeftEye = new ModelRenderer(this, 32, 4); ++ this.slimeLeftEye.addBox(1.25F, 18.0F, -3.5F, 2, 2, 2); ++ this.slimeMouth = new ModelRenderer(this, 32, 8); ++ this.slimeMouth.addBox(0.0F, 21.0F, -3.5F, 1, 1, 1); ++ } ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ this.slimeBodies.render(par7); ++ ++ if (this.slimeRightEye != null) ++ { ++ this.slimeRightEye.render(par7); ++ this.slimeLeftEye.render(par7); ++ this.slimeMouth.render(par7); ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelSnowMan.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,67 ---- ++ package net.minecraft.src; ++ ++ public class ModelSnowMan extends ModelBase ++ { ++ public ModelRenderer body; ++ public ModelRenderer bottomBody; ++ public ModelRenderer head; ++ public ModelRenderer rightHand; ++ public ModelRenderer leftHand; ++ ++ public ModelSnowMan() ++ { ++ float var1 = 4.0F; ++ float var2 = 0.0F; ++ this.head = (new ModelRenderer(this, 0, 0)).setTextureSize(64, 64); ++ this.head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, var2 - 0.5F); ++ this.head.setRotationPoint(0.0F, 0.0F + var1, 0.0F); ++ this.rightHand = (new ModelRenderer(this, 32, 0)).setTextureSize(64, 64); ++ this.rightHand.addBox(-1.0F, 0.0F, -1.0F, 12, 2, 2, var2 - 0.5F); ++ this.rightHand.setRotationPoint(0.0F, 0.0F + var1 + 9.0F - 7.0F, 0.0F); ++ this.leftHand = (new ModelRenderer(this, 32, 0)).setTextureSize(64, 64); ++ this.leftHand.addBox(-1.0F, 0.0F, -1.0F, 12, 2, 2, var2 - 0.5F); ++ this.leftHand.setRotationPoint(0.0F, 0.0F + var1 + 9.0F - 7.0F, 0.0F); ++ this.body = (new ModelRenderer(this, 0, 16)).setTextureSize(64, 64); ++ this.body.addBox(-5.0F, -10.0F, -5.0F, 10, 10, 10, var2 - 0.5F); ++ this.body.setRotationPoint(0.0F, 0.0F + var1 + 9.0F, 0.0F); ++ this.bottomBody = (new ModelRenderer(this, 0, 36)).setTextureSize(64, 64); ++ this.bottomBody.addBox(-6.0F, -12.0F, -6.0F, 12, 12, 12, var2 - 0.5F); ++ this.bottomBody.setRotationPoint(0.0F, 0.0F + var1 + 20.0F, 0.0F); ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); ++ this.head.rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.head.rotateAngleX = par5 / (180F / (float)Math.PI); ++ this.body.rotateAngleY = par4 / (180F / (float)Math.PI) * 0.25F; ++ float var8 = MathHelper.sin(this.body.rotateAngleY); ++ float var9 = MathHelper.cos(this.body.rotateAngleY); ++ this.rightHand.rotateAngleZ = 1.0F; ++ this.leftHand.rotateAngleZ = -1.0F; ++ this.rightHand.rotateAngleY = 0.0F + this.body.rotateAngleY; ++ this.leftHand.rotateAngleY = (float)Math.PI + this.body.rotateAngleY; ++ this.rightHand.rotationPointX = var9 * 5.0F; ++ this.rightHand.rotationPointZ = -var8 * 5.0F; ++ this.leftHand.rotationPointX = -var9 * 5.0F; ++ this.leftHand.rotationPointZ = var8 * 5.0F; ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ this.body.render(par7); ++ this.bottomBody.render(par7); ++ this.head.render(par7); ++ this.rightHand.render(par7); ++ this.leftHand.render(par7); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelSpider.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,149 ---- ++ package net.minecraft.src; ++ ++ public class ModelSpider extends ModelBase ++ { ++ /** The spider's head box */ ++ public ModelRenderer spiderHead; ++ ++ /** The spider's neck box */ ++ public ModelRenderer spiderNeck; ++ ++ /** The spider's body box */ ++ public ModelRenderer spiderBody; ++ ++ /** Spider's first leg */ ++ public ModelRenderer spiderLeg1; ++ ++ /** Spider's second leg */ ++ public ModelRenderer spiderLeg2; ++ ++ /** Spider's third leg */ ++ public ModelRenderer spiderLeg3; ++ ++ /** Spider's fourth leg */ ++ public ModelRenderer spiderLeg4; ++ ++ /** Spider's fifth leg */ ++ public ModelRenderer spiderLeg5; ++ ++ /** Spider's sixth leg */ ++ public ModelRenderer spiderLeg6; ++ ++ /** Spider's seventh leg */ ++ public ModelRenderer spiderLeg7; ++ ++ /** Spider's eight leg */ ++ public ModelRenderer spiderLeg8; ++ ++ public ModelSpider() ++ { ++ float var1 = 0.0F; ++ byte var2 = 15; ++ this.spiderHead = new ModelRenderer(this, 32, 4); ++ this.spiderHead.addBox(-4.0F, -4.0F, -8.0F, 8, 8, 8, var1); ++ this.spiderHead.setRotationPoint(0.0F, (float)var2, -3.0F); ++ this.spiderNeck = new ModelRenderer(this, 0, 0); ++ this.spiderNeck.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6, var1); ++ this.spiderNeck.setRotationPoint(0.0F, (float)var2, 0.0F); ++ this.spiderBody = new ModelRenderer(this, 0, 12); ++ this.spiderBody.addBox(-5.0F, -4.0F, -6.0F, 10, 8, 12, var1); ++ this.spiderBody.setRotationPoint(0.0F, (float)var2, 9.0F); ++ this.spiderLeg1 = new ModelRenderer(this, 18, 0); ++ this.spiderLeg1.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1); ++ this.spiderLeg1.setRotationPoint(-4.0F, (float)var2, 2.0F); ++ this.spiderLeg2 = new ModelRenderer(this, 18, 0); ++ this.spiderLeg2.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1); ++ this.spiderLeg2.setRotationPoint(4.0F, (float)var2, 2.0F); ++ this.spiderLeg3 = new ModelRenderer(this, 18, 0); ++ this.spiderLeg3.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1); ++ this.spiderLeg3.setRotationPoint(-4.0F, (float)var2, 1.0F); ++ this.spiderLeg4 = new ModelRenderer(this, 18, 0); ++ this.spiderLeg4.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1); ++ this.spiderLeg4.setRotationPoint(4.0F, (float)var2, 1.0F); ++ this.spiderLeg5 = new ModelRenderer(this, 18, 0); ++ this.spiderLeg5.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1); ++ this.spiderLeg5.setRotationPoint(-4.0F, (float)var2, 0.0F); ++ this.spiderLeg6 = new ModelRenderer(this, 18, 0); ++ this.spiderLeg6.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1); ++ this.spiderLeg6.setRotationPoint(4.0F, (float)var2, 0.0F); ++ this.spiderLeg7 = new ModelRenderer(this, 18, 0); ++ this.spiderLeg7.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1); ++ this.spiderLeg7.setRotationPoint(-4.0F, (float)var2, -1.0F); ++ this.spiderLeg8 = new ModelRenderer(this, 18, 0); ++ this.spiderLeg8.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1); ++ this.spiderLeg8.setRotationPoint(4.0F, (float)var2, -1.0F); ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ this.spiderHead.render(par7); ++ this.spiderNeck.render(par7); ++ this.spiderBody.render(par7); ++ this.spiderLeg1.render(par7); ++ this.spiderLeg2.render(par7); ++ this.spiderLeg3.render(par7); ++ this.spiderLeg4.render(par7); ++ this.spiderLeg5.render(par7); ++ this.spiderLeg6.render(par7); ++ this.spiderLeg7.render(par7); ++ this.spiderLeg8.render(par7); ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ this.spiderHead.rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.spiderHead.rotateAngleX = par5 / (180F / (float)Math.PI); ++ float var8 = ((float)Math.PI / 4F); ++ this.spiderLeg1.rotateAngleZ = -var8; ++ this.spiderLeg2.rotateAngleZ = var8; ++ this.spiderLeg3.rotateAngleZ = -var8 * 0.74F; ++ this.spiderLeg4.rotateAngleZ = var8 * 0.74F; ++ this.spiderLeg5.rotateAngleZ = -var8 * 0.74F; ++ this.spiderLeg6.rotateAngleZ = var8 * 0.74F; ++ this.spiderLeg7.rotateAngleZ = -var8; ++ this.spiderLeg8.rotateAngleZ = var8; ++ float var9 = -0.0F; ++ float var10 = 0.3926991F; ++ this.spiderLeg1.rotateAngleY = var10 * 2.0F + var9; ++ this.spiderLeg2.rotateAngleY = -var10 * 2.0F - var9; ++ this.spiderLeg3.rotateAngleY = var10 * 1.0F + var9; ++ this.spiderLeg4.rotateAngleY = -var10 * 1.0F - var9; ++ this.spiderLeg5.rotateAngleY = -var10 * 1.0F + var9; ++ this.spiderLeg6.rotateAngleY = var10 * 1.0F - var9; ++ this.spiderLeg7.rotateAngleY = -var10 * 2.0F + var9; ++ this.spiderLeg8.rotateAngleY = var10 * 2.0F - var9; ++ float var11 = -(MathHelper.cos(par1 * 0.6662F * 2.0F + 0.0F) * 0.4F) * par2; ++ float var12 = -(MathHelper.cos(par1 * 0.6662F * 2.0F + (float)Math.PI) * 0.4F) * par2; ++ float var13 = -(MathHelper.cos(par1 * 0.6662F * 2.0F + ((float)Math.PI / 2F)) * 0.4F) * par2; ++ float var14 = -(MathHelper.cos(par1 * 0.6662F * 2.0F + ((float)Math.PI * 3F / 2F)) * 0.4F) * par2; ++ float var15 = Math.abs(MathHelper.sin(par1 * 0.6662F + 0.0F) * 0.4F) * par2; ++ float var16 = Math.abs(MathHelper.sin(par1 * 0.6662F + (float)Math.PI) * 0.4F) * par2; ++ float var17 = Math.abs(MathHelper.sin(par1 * 0.6662F + ((float)Math.PI / 2F)) * 0.4F) * par2; ++ float var18 = Math.abs(MathHelper.sin(par1 * 0.6662F + ((float)Math.PI * 3F / 2F)) * 0.4F) * par2; ++ this.spiderLeg1.rotateAngleY += var11; ++ this.spiderLeg2.rotateAngleY += -var11; ++ this.spiderLeg3.rotateAngleY += var12; ++ this.spiderLeg4.rotateAngleY += -var12; ++ this.spiderLeg5.rotateAngleY += var13; ++ this.spiderLeg6.rotateAngleY += -var13; ++ this.spiderLeg7.rotateAngleY += var14; ++ this.spiderLeg8.rotateAngleY += -var14; ++ this.spiderLeg1.rotateAngleZ += var15; ++ this.spiderLeg2.rotateAngleZ += -var15; ++ this.spiderLeg3.rotateAngleZ += var16; ++ this.spiderLeg4.rotateAngleZ += -var16; ++ this.spiderLeg5.rotateAngleZ += var17; ++ this.spiderLeg6.rotateAngleZ += -var17; ++ this.spiderLeg7.rotateAngleZ += var18; ++ this.spiderLeg8.rotateAngleZ += -var18; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelSquid.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,63 ---- ++ package net.minecraft.src; ++ ++ public class ModelSquid extends ModelBase ++ { ++ /** The squid's body */ ++ ModelRenderer squidBody; ++ ++ /** The squid's tentacles */ ++ ModelRenderer[] squidTentacles = new ModelRenderer[8]; ++ ++ public ModelSquid() ++ { ++ byte var1 = -16; ++ this.squidBody = new ModelRenderer(this, 0, 0); ++ this.squidBody.addBox(-6.0F, -8.0F, -6.0F, 12, 16, 12); ++ this.squidBody.rotationPointY += (float)(24 + var1); ++ ++ for (int var2 = 0; var2 < this.squidTentacles.length; ++var2) ++ { ++ this.squidTentacles[var2] = new ModelRenderer(this, 48, 0); ++ double var3 = (double)var2 * Math.PI * 2.0D / (double)this.squidTentacles.length; ++ float var5 = (float)Math.cos(var3) * 5.0F; ++ float var6 = (float)Math.sin(var3) * 5.0F; ++ this.squidTentacles[var2].addBox(-1.0F, 0.0F, -1.0F, 2, 18, 2); ++ this.squidTentacles[var2].rotationPointX = var5; ++ this.squidTentacles[var2].rotationPointZ = var6; ++ this.squidTentacles[var2].rotationPointY = (float)(31 + var1); ++ var3 = (double)var2 * Math.PI * -2.0D / (double)this.squidTentacles.length + (Math.PI / 2D); ++ this.squidTentacles[var2].rotateAngleY = (float)var3; ++ } ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ ModelRenderer[] var8 = this.squidTentacles; ++ int var9 = var8.length; ++ ++ for (int var10 = 0; var10 < var9; ++var10) ++ { ++ ModelRenderer var11 = var8[var10]; ++ var11.rotateAngleX = par3; ++ } ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ this.squidBody.render(par7); ++ ++ for (int var8 = 0; var8 < this.squidTentacles.length; ++var8) ++ { ++ this.squidTentacles[var8].render(par7); ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelVillager.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,83 ---- ++ package net.minecraft.src; ++ ++ public class ModelVillager extends ModelBase ++ { ++ /** The head box of the VillagerModel */ ++ public ModelRenderer villagerHead; ++ ++ /** The body of the VillagerModel */ ++ public ModelRenderer villagerBody; ++ ++ /** The arms of the VillagerModel */ ++ public ModelRenderer villagerArms; ++ ++ /** The right leg of the VillagerModel */ ++ public ModelRenderer rightVillagerLeg; ++ ++ /** The left leg of the VillagerModel */ ++ public ModelRenderer leftVillagerLeg; ++ public ModelRenderer villagerNose; ++ ++ public ModelVillager(float par1) ++ { ++ this(par1, 0.0F, 64, 64); ++ } ++ ++ public ModelVillager(float par1, float par2, int par3, int par4) ++ { ++ this.villagerHead = (new ModelRenderer(this)).setTextureSize(par3, par4); ++ this.villagerHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F); ++ this.villagerHead.setTextureOffset(0, 0).addBox(-4.0F, -10.0F, -4.0F, 8, 10, 8, par1); ++ this.villagerNose = (new ModelRenderer(this)).setTextureSize(par3, par4); ++ this.villagerNose.setRotationPoint(0.0F, par2 - 2.0F, 0.0F); ++ this.villagerNose.setTextureOffset(24, 0).addBox(-1.0F, -1.0F, -6.0F, 2, 4, 2, par1); ++ this.villagerHead.addChild(this.villagerNose); ++ this.villagerBody = (new ModelRenderer(this)).setTextureSize(par3, par4); ++ this.villagerBody.setRotationPoint(0.0F, 0.0F + par2, 0.0F); ++ this.villagerBody.setTextureOffset(16, 20).addBox(-4.0F, 0.0F, -3.0F, 8, 12, 6, par1); ++ this.villagerBody.setTextureOffset(0, 38).addBox(-4.0F, 0.0F, -3.0F, 8, 18, 6, par1 + 0.5F); ++ this.villagerArms = (new ModelRenderer(this)).setTextureSize(par3, par4); ++ this.villagerArms.setRotationPoint(0.0F, 0.0F + par2 + 2.0F, 0.0F); ++ this.villagerArms.setTextureOffset(44, 22).addBox(-8.0F, -2.0F, -2.0F, 4, 8, 4, par1); ++ this.villagerArms.setTextureOffset(44, 22).addBox(4.0F, -2.0F, -2.0F, 4, 8, 4, par1); ++ this.villagerArms.setTextureOffset(40, 38).addBox(-4.0F, 2.0F, -2.0F, 8, 4, 4, par1); ++ this.rightVillagerLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(par3, par4); ++ this.rightVillagerLeg.setRotationPoint(-2.0F, 12.0F + par2, 0.0F); ++ this.rightVillagerLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); ++ this.leftVillagerLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(par3, par4); ++ this.leftVillagerLeg.mirror = true; ++ this.leftVillagerLeg.setRotationPoint(2.0F, 12.0F + par2, 0.0F); ++ this.leftVillagerLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ this.villagerHead.render(par7); ++ this.villagerBody.render(par7); ++ this.rightVillagerLeg.render(par7); ++ this.leftVillagerLeg.render(par7); ++ this.villagerArms.render(par7); ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ this.villagerHead.rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.villagerHead.rotateAngleX = par5 / (180F / (float)Math.PI); ++ this.villagerArms.rotationPointY = 3.0F; ++ this.villagerArms.rotationPointZ = -1.0F; ++ this.villagerArms.rotateAngleX = -0.75F; ++ this.rightVillagerLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2 * 0.5F; ++ this.leftVillagerLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2 * 0.5F; ++ this.rightVillagerLeg.rotateAngleY = 0.0F; ++ this.leftVillagerLeg.rotateAngleY = 0.0F; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelWitch.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,60 ---- ++ package net.minecraft.src; ++ ++ public class ModelWitch extends ModelVillager ++ { ++ public boolean field_82900_g; ++ private ModelRenderer field_82901_h = (new ModelRenderer(this)).setTextureSize(64, 128); ++ private ModelRenderer witchHat; ++ ++ public ModelWitch(float par1) ++ { ++ super(par1, 0.0F, 64, 128); ++ this.field_82901_h.setRotationPoint(0.0F, -2.0F, 0.0F); ++ this.field_82901_h.setTextureOffset(0, 0).addBox(0.0F, 3.0F, -6.75F, 1, 1, 1, -0.25F); ++ this.villagerNose.addChild(this.field_82901_h); ++ this.witchHat = (new ModelRenderer(this)).setTextureSize(64, 128); ++ this.witchHat.setRotationPoint(-5.0F, -10.03125F, -5.0F); ++ this.witchHat.setTextureOffset(0, 64).addBox(0.0F, 0.0F, 0.0F, 10, 2, 10); ++ this.villagerHead.addChild(this.witchHat); ++ ModelRenderer var2 = (new ModelRenderer(this)).setTextureSize(64, 128); ++ var2.setRotationPoint(1.75F, -4.0F, 2.0F); ++ var2.setTextureOffset(0, 76).addBox(0.0F, 0.0F, 0.0F, 7, 4, 7); ++ var2.rotateAngleX = -0.05235988F; ++ var2.rotateAngleZ = 0.02617994F; ++ this.witchHat.addChild(var2); ++ ModelRenderer var3 = (new ModelRenderer(this)).setTextureSize(64, 128); ++ var3.setRotationPoint(1.75F, -4.0F, 2.0F); ++ var3.setTextureOffset(0, 87).addBox(0.0F, 0.0F, 0.0F, 4, 4, 4); ++ var3.rotateAngleX = -0.10471976F; ++ var3.rotateAngleZ = 0.05235988F; ++ var2.addChild(var3); ++ ModelRenderer var4 = (new ModelRenderer(this)).setTextureSize(64, 128); ++ var4.setRotationPoint(1.75F, -2.0F, 2.0F); ++ var4.setTextureOffset(0, 95).addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.25F); ++ var4.rotateAngleX = -0.20943952F; ++ var4.rotateAngleZ = 0.10471976F; ++ var3.addChild(var4); ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); ++ this.villagerNose.offsetX = this.villagerNose.offsetY = this.villagerNose.offsetZ = 0.0F; ++ float var8 = 0.01F * (float)(par7Entity.entityId % 10); ++ this.villagerNose.rotateAngleX = MathHelper.sin((float)par7Entity.ticksExisted * var8) * 4.5F * (float)Math.PI / 180.0F; ++ this.villagerNose.rotateAngleY = 0.0F; ++ this.villagerNose.rotateAngleZ = MathHelper.cos((float)par7Entity.ticksExisted * var8) * 2.5F * (float)Math.PI / 180.0F; ++ ++ if (this.field_82900_g) ++ { ++ this.villagerNose.rotateAngleX = -0.9F; ++ this.villagerNose.offsetZ = -0.09375F; ++ this.villagerNose.offsetY = 0.1875F; ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelWither.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,97 ---- ++ package net.minecraft.src; ++ ++ public class ModelWither extends ModelBase ++ { ++ private ModelRenderer[] field_82905_a; ++ private ModelRenderer[] field_82904_b; ++ ++ public ModelWither() ++ { ++ this.textureWidth = 64; ++ this.textureHeight = 64; ++ this.field_82905_a = new ModelRenderer[3]; ++ this.field_82905_a[0] = new ModelRenderer(this, 0, 16); ++ this.field_82905_a[0].addBox(-10.0F, 3.9F, -0.5F, 20, 3, 3); ++ this.field_82905_a[1] = (new ModelRenderer(this)).setTextureSize(this.textureWidth, this.textureHeight); ++ this.field_82905_a[1].setRotationPoint(-2.0F, 6.9F, -0.5F); ++ this.field_82905_a[1].setTextureOffset(0, 22).addBox(0.0F, 0.0F, 0.0F, 3, 10, 3); ++ this.field_82905_a[1].setTextureOffset(24, 22).addBox(-4.0F, 1.5F, 0.5F, 11, 2, 2); ++ this.field_82905_a[1].setTextureOffset(24, 22).addBox(-4.0F, 4.0F, 0.5F, 11, 2, 2); ++ this.field_82905_a[1].setTextureOffset(24, 22).addBox(-4.0F, 6.5F, 0.5F, 11, 2, 2); ++ this.field_82905_a[2] = new ModelRenderer(this, 12, 22); ++ this.field_82905_a[2].addBox(0.0F, 0.0F, 0.0F, 3, 6, 3); ++ this.field_82904_b = new ModelRenderer[3]; ++ this.field_82904_b[0] = new ModelRenderer(this, 0, 0); ++ this.field_82904_b[0].addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8); ++ this.field_82904_b[1] = new ModelRenderer(this, 32, 0); ++ this.field_82904_b[1].addBox(-4.0F, -4.0F, -4.0F, 6, 6, 6); ++ this.field_82904_b[1].rotationPointX = -8.0F; ++ this.field_82904_b[1].rotationPointY = 4.0F; ++ this.field_82904_b[2] = new ModelRenderer(this, 32, 0); ++ this.field_82904_b[2].addBox(-4.0F, -4.0F, -4.0F, 6, 6, 6); ++ this.field_82904_b[2].rotationPointX = 10.0F; ++ this.field_82904_b[2].rotationPointY = 4.0F; ++ } ++ ++ public int func_82903_a() ++ { ++ return 32; ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ ModelRenderer[] var8 = this.field_82904_b; ++ int var9 = var8.length; ++ int var10; ++ ModelRenderer var11; ++ ++ for (var10 = 0; var10 < var9; ++var10) ++ { ++ var11 = var8[var10]; ++ var11.render(par7); ++ } ++ ++ var8 = this.field_82905_a; ++ var9 = var8.length; ++ ++ for (var10 = 0; var10 < var9; ++var10) ++ { ++ var11 = var8[var10]; ++ var11.render(par7); ++ } ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ float var8 = MathHelper.cos(par3 * 0.1F); ++ this.field_82905_a[1].rotateAngleX = (0.065F + 0.05F * var8) * (float)Math.PI; ++ this.field_82905_a[2].setRotationPoint(-2.0F, 6.9F + MathHelper.cos(this.field_82905_a[1].rotateAngleX) * 10.0F, -0.5F + MathHelper.sin(this.field_82905_a[1].rotateAngleX) * 10.0F); ++ this.field_82905_a[2].rotateAngleX = (0.265F + 0.1F * var8) * (float)Math.PI; ++ this.field_82904_b[0].rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.field_82904_b[0].rotateAngleX = par5 / (180F / (float)Math.PI); ++ } ++ ++ /** ++ * Used for easily adding entity-dependent animations. The second and third float params here are the same second ++ * and third as in the setRotationAngles method. ++ */ ++ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) ++ { ++ EntityWither var5 = (EntityWither)par1EntityLivingBase; ++ ++ for (int var6 = 1; var6 < 3; ++var6) ++ { ++ this.field_82904_b[var6].rotateAngleY = (var5.func_82207_a(var6 - 1) - par1EntityLivingBase.renderYawOffset) / (180F / (float)Math.PI); ++ this.field_82904_b[var6].rotateAngleX = var5.func_82210_r(var6 - 1) / (180F / (float)Math.PI); ++ } ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelWolf.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,173 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class ModelWolf extends ModelBase ++ { ++ /** main box for the wolf head */ ++ public ModelRenderer wolfHeadMain; ++ ++ /** The wolf's body */ ++ public ModelRenderer wolfBody; ++ ++ /** Wolf'se first leg */ ++ public ModelRenderer wolfLeg1; ++ ++ /** Wolf's second leg */ ++ public ModelRenderer wolfLeg2; ++ ++ /** Wolf's third leg */ ++ public ModelRenderer wolfLeg3; ++ ++ /** Wolf's fourth leg */ ++ public ModelRenderer wolfLeg4; ++ ++ /** The wolf's tail */ ++ ModelRenderer wolfTail; ++ ++ /** The wolf's mane */ ++ ModelRenderer wolfMane; ++ ++ public ModelWolf() ++ { ++ float var1 = 0.0F; ++ float var2 = 13.5F; ++ this.wolfHeadMain = new ModelRenderer(this, 0, 0); ++ this.wolfHeadMain.addBox(-3.0F, -3.0F, -2.0F, 6, 6, 4, var1); ++ this.wolfHeadMain.setRotationPoint(-1.0F, var2, -7.0F); ++ this.wolfBody = new ModelRenderer(this, 18, 14); ++ this.wolfBody.addBox(-4.0F, -2.0F, -3.0F, 6, 9, 6, var1); ++ this.wolfBody.setRotationPoint(0.0F, 14.0F, 2.0F); ++ this.wolfMane = new ModelRenderer(this, 21, 0); ++ this.wolfMane.addBox(-4.0F, -3.0F, -3.0F, 8, 6, 7, var1); ++ this.wolfMane.setRotationPoint(-1.0F, 14.0F, 2.0F); ++ this.wolfLeg1 = new ModelRenderer(this, 0, 18); ++ this.wolfLeg1.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, var1); ++ this.wolfLeg1.setRotationPoint(-2.5F, 16.0F, 7.0F); ++ this.wolfLeg2 = new ModelRenderer(this, 0, 18); ++ this.wolfLeg2.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, var1); ++ this.wolfLeg2.setRotationPoint(0.5F, 16.0F, 7.0F); ++ this.wolfLeg3 = new ModelRenderer(this, 0, 18); ++ this.wolfLeg3.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, var1); ++ this.wolfLeg3.setRotationPoint(-2.5F, 16.0F, -4.0F); ++ this.wolfLeg4 = new ModelRenderer(this, 0, 18); ++ this.wolfLeg4.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, var1); ++ this.wolfLeg4.setRotationPoint(0.5F, 16.0F, -4.0F); ++ this.wolfTail = new ModelRenderer(this, 9, 18); ++ this.wolfTail.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, var1); ++ this.wolfTail.setRotationPoint(-1.0F, 12.0F, 8.0F); ++ this.wolfHeadMain.setTextureOffset(16, 14).addBox(-3.0F, -5.0F, 0.0F, 2, 2, 1, var1); ++ this.wolfHeadMain.setTextureOffset(16, 14).addBox(1.0F, -5.0F, 0.0F, 2, 2, 1, var1); ++ this.wolfHeadMain.setTextureOffset(0, 10).addBox(-1.5F, 0.0F, -5.0F, 3, 3, 4, var1); ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ super.render(par1Entity, par2, par3, par4, par5, par6, par7); ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ ++ if (this.isChild) ++ { ++ float var8 = 2.0F; ++ GL11.glPushMatrix(); ++ GL11.glTranslatef(0.0F, 5.0F * par7, 2.0F * par7); ++ this.wolfHeadMain.renderWithRotation(par7); ++ GL11.glPopMatrix(); ++ GL11.glPushMatrix(); ++ GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); ++ GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); ++ this.wolfBody.render(par7); ++ this.wolfLeg1.render(par7); ++ this.wolfLeg2.render(par7); ++ this.wolfLeg3.render(par7); ++ this.wolfLeg4.render(par7); ++ this.wolfTail.renderWithRotation(par7); ++ this.wolfMane.render(par7); ++ GL11.glPopMatrix(); ++ } ++ else ++ { ++ this.wolfHeadMain.renderWithRotation(par7); ++ this.wolfBody.render(par7); ++ this.wolfLeg1.render(par7); ++ this.wolfLeg2.render(par7); ++ this.wolfLeg3.render(par7); ++ this.wolfLeg4.render(par7); ++ this.wolfTail.renderWithRotation(par7); ++ this.wolfMane.render(par7); ++ } ++ } ++ ++ /** ++ * Used for easily adding entity-dependent animations. The second and third float params here are the same second ++ * and third as in the setRotationAngles method. ++ */ ++ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) ++ { ++ EntityWolf var5 = (EntityWolf)par1EntityLivingBase; ++ ++ if (var5.isAngry()) ++ { ++ this.wolfTail.rotateAngleY = 0.0F; ++ } ++ else ++ { ++ this.wolfTail.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; ++ } ++ ++ if (var5.isSitting()) ++ { ++ this.wolfMane.setRotationPoint(-1.0F, 16.0F, -3.0F); ++ this.wolfMane.rotateAngleX = ((float)Math.PI * 2F / 5F); ++ this.wolfMane.rotateAngleY = 0.0F; ++ this.wolfBody.setRotationPoint(0.0F, 18.0F, 0.0F); ++ this.wolfBody.rotateAngleX = ((float)Math.PI / 4F); ++ this.wolfTail.setRotationPoint(-1.0F, 21.0F, 6.0F); ++ this.wolfLeg1.setRotationPoint(-2.5F, 22.0F, 2.0F); ++ this.wolfLeg1.rotateAngleX = ((float)Math.PI * 3F / 2F); ++ this.wolfLeg2.setRotationPoint(0.5F, 22.0F, 2.0F); ++ this.wolfLeg2.rotateAngleX = ((float)Math.PI * 3F / 2F); ++ this.wolfLeg3.rotateAngleX = 5.811947F; ++ this.wolfLeg3.setRotationPoint(-2.49F, 17.0F, -4.0F); ++ this.wolfLeg4.rotateAngleX = 5.811947F; ++ this.wolfLeg4.setRotationPoint(0.51F, 17.0F, -4.0F); ++ } ++ else ++ { ++ this.wolfBody.setRotationPoint(0.0F, 14.0F, 2.0F); ++ this.wolfBody.rotateAngleX = ((float)Math.PI / 2F); ++ this.wolfMane.setRotationPoint(-1.0F, 14.0F, -3.0F); ++ this.wolfMane.rotateAngleX = this.wolfBody.rotateAngleX; ++ this.wolfTail.setRotationPoint(-1.0F, 12.0F, 8.0F); ++ this.wolfLeg1.setRotationPoint(-2.5F, 16.0F, 7.0F); ++ this.wolfLeg2.setRotationPoint(0.5F, 16.0F, 7.0F); ++ this.wolfLeg3.setRotationPoint(-2.5F, 16.0F, -4.0F); ++ this.wolfLeg4.setRotationPoint(0.5F, 16.0F, -4.0F); ++ this.wolfLeg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; ++ this.wolfLeg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F + (float)Math.PI) * 1.4F * par3; ++ this.wolfLeg3.rotateAngleX = MathHelper.cos(par2 * 0.6662F + (float)Math.PI) * 1.4F * par3; ++ this.wolfLeg4.rotateAngleX = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; ++ } ++ ++ this.wolfHeadMain.rotateAngleZ = var5.getInterestedAngle(par4) + var5.getShakeAngle(par4, 0.0F); ++ this.wolfMane.rotateAngleZ = var5.getShakeAngle(par4, -0.08F); ++ this.wolfBody.rotateAngleZ = var5.getShakeAngle(par4, -0.16F); ++ this.wolfTail.rotateAngleZ = var5.getShakeAngle(par4, -0.2F); ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); ++ this.wolfHeadMain.rotateAngleX = par5 / (180F / (float)Math.PI); ++ this.wolfHeadMain.rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.wolfTail.rotateAngleX = par3; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelZombie.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,43 ---- ++ package net.minecraft.src; ++ ++ public class ModelZombie extends ModelBiped ++ { ++ public ModelZombie() ++ { ++ this(0.0F, false); ++ } ++ ++ protected ModelZombie(float par1, float par2, int par3, int par4) ++ { ++ super(par1, par2, par3, par4); ++ } ++ ++ public ModelZombie(float par1, boolean par2) ++ { ++ super(par1, 0.0F, 64, par2 ? 32 : 64); ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); ++ float var8 = MathHelper.sin(this.onGround * (float)Math.PI); ++ float var9 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float)Math.PI); ++ this.bipedRightArm.rotateAngleZ = 0.0F; ++ this.bipedLeftArm.rotateAngleZ = 0.0F; ++ this.bipedRightArm.rotateAngleY = -(0.1F - var8 * 0.6F); ++ this.bipedLeftArm.rotateAngleY = 0.1F - var8 * 0.6F; ++ this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F); ++ this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F); ++ this.bipedRightArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; ++ this.bipedLeftArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; ++ this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; ++ this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; ++ this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; ++ this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ModelZombieVillager.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,57 ---- ++ package net.minecraft.src; ++ ++ public class ModelZombieVillager extends ModelBiped ++ { ++ public ModelZombieVillager() ++ { ++ this(0.0F, 0.0F, false); ++ } ++ ++ public ModelZombieVillager(float par1, float par2, boolean par3) ++ { ++ super(par1, 0.0F, 64, par3 ? 32 : 64); ++ ++ if (par3) ++ { ++ this.bipedHead = new ModelRenderer(this, 0, 0); ++ this.bipedHead.addBox(-4.0F, -10.0F, -4.0F, 8, 6, 8, par1); ++ this.bipedHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F); ++ } ++ else ++ { ++ this.bipedHead = new ModelRenderer(this); ++ this.bipedHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F); ++ this.bipedHead.setTextureOffset(0, 32).addBox(-4.0F, -10.0F, -4.0F, 8, 10, 8, par1); ++ this.bipedHead.setTextureOffset(24, 32).addBox(-1.0F, -3.0F, -6.0F, 2, 4, 2, par1); ++ } ++ } ++ ++ public int func_82897_a() ++ { ++ return 10; ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms ++ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how ++ * "far" arms and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) ++ { ++ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); ++ float var8 = MathHelper.sin(this.onGround * (float)Math.PI); ++ float var9 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float)Math.PI); ++ this.bipedRightArm.rotateAngleZ = 0.0F; ++ this.bipedLeftArm.rotateAngleZ = 0.0F; ++ this.bipedRightArm.rotateAngleY = -(0.1F - var8 * 0.6F); ++ this.bipedLeftArm.rotateAngleY = 0.1F - var8 * 0.6F; ++ this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F); ++ this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F); ++ this.bipedRightArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; ++ this.bipedLeftArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; ++ this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; ++ this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; ++ this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; ++ this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; ++ } ++ } +*** ModifiableAttributeInstance.java Sat Feb 5 04:13:14 2022 +--- ModifiableAttributeInstance.java Sat Feb 5 04:12:35 2022 +*************** +*** 1,8 **** +--- 1,9 ---- + package net.minecraft.src; + + import com.google.common.collect.Maps; ++ import java.util.ArrayList; + import java.util.Collection; + import java.util.HashSet; + import java.util.Iterator; + import java.util.Map; + import java.util.Set; +*************** +*** 124,133 **** +--- 125,151 ---- + } + } + + this.field_111135_e.remove(par1AttributeModifier.getID()); + this.func_111131_f(); ++ } ++ ++ public void func_142049_d() ++ { ++ Collection var1 = this.func_111122_c(); ++ ++ if (var1 != null) ++ { ++ ArrayList var4 = new ArrayList(var1); ++ Iterator var2 = var4.iterator(); ++ ++ while (var2.hasNext()) ++ { ++ AttributeModifier var3 = (AttributeModifier)var2.next(); ++ this.removeModifier(var3); ++ } ++ } + } + + public double getAttributeValue() + { + if (this.field_111133_g) +*** /dev/null Thu Jan 1 01:00:00 1970 +--- MouseFilter.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,26 ---- ++ package net.minecraft.src; ++ ++ public class MouseFilter ++ { ++ private float field_76336_a; ++ private float field_76334_b; ++ private float field_76335_c; ++ ++ /** ++ * Smooths mouse input ++ */ ++ public float smooth(float par1, float par2) ++ { ++ this.field_76336_a += par1; ++ par1 = (this.field_76336_a - this.field_76334_b) * par2; ++ this.field_76335_c += (par1 - this.field_76335_c) * 0.5F; ++ ++ if (par1 > 0.0F && par1 > this.field_76335_c || par1 < 0.0F && par1 < this.field_76335_c) ++ { ++ par1 = this.field_76335_c; ++ } ++ ++ this.field_76334_b += par1; ++ return par1; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- MouseHelper.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,38 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.input.Mouse; ++ import org.lwjgl.opengl.Display; ++ ++ public class MouseHelper ++ { ++ /** Mouse delta X this frame */ ++ public int deltaX; ++ ++ /** Mouse delta Y this frame */ ++ public int deltaY; ++ ++ /** ++ * Grabs the mouse cursor it doesn't move and isn't seen. ++ */ ++ public void grabMouseCursor() ++ { ++ Mouse.setGrabbed(true); ++ this.deltaX = 0; ++ this.deltaY = 0; ++ } ++ ++ /** ++ * Ungrabs the mouse cursor so it can be moved and set it to the center of the screen ++ */ ++ public void ungrabMouseCursor() ++ { ++ Mouse.setCursorPosition(Display.getWidth() / 2, Display.getHeight() / 2); ++ Mouse.setGrabbed(false); ++ } ++ ++ public void mouseXYChange() ++ { ++ this.deltaX = Mouse.getDX(); ++ this.deltaY = Mouse.getDY(); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- MovementInput.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,18 ---- ++ package net.minecraft.src; ++ ++ public class MovementInput ++ { ++ /** ++ * The speed at which the player is strafing. Postive numbers to the left and negative to the right. ++ */ ++ public float moveStrafe; ++ ++ /** ++ * The speed at which the player is moving forward. Negative numbers will move backwards. ++ */ ++ public float moveForward; ++ public boolean jump; ++ public boolean sneak; ++ ++ public void updatePlayerMoveState() {} ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- MovementInputFromOptions.java Sat Feb 5 04:12:35 2022 +*************** +*** 0 **** +--- 1,46 ---- ++ package net.minecraft.src; ++ ++ public class MovementInputFromOptions extends MovementInput ++ { ++ private GameSettings gameSettings; ++ ++ public MovementInputFromOptions(GameSettings par1GameSettings) ++ { ++ this.gameSettings = par1GameSettings; ++ } ++ ++ public void updatePlayerMoveState() ++ { ++ this.moveStrafe = 0.0F; ++ this.moveForward = 0.0F; ++ ++ if (this.gameSettings.keyBindForward.pressed) ++ { ++ ++this.moveForward; ++ } ++ ++ if (this.gameSettings.keyBindBack.pressed) ++ { ++ --this.moveForward; ++ } ++ ++ if (this.gameSettings.keyBindLeft.pressed) ++ { ++ ++this.moveStrafe; ++ } ++ ++ if (this.gameSettings.keyBindRight.pressed) ++ { ++ --this.moveStrafe; ++ } ++ ++ this.jump = this.gameSettings.keyBindJump.pressed; ++ this.sneak = this.gameSettings.keyBindSneak.pressed; ++ ++ if (this.sneak) ++ { ++ this.moveStrafe = (float)((double)this.moveStrafe * 0.3D); ++ this.moveForward = (float)((double)this.moveForward * 0.3D); ++ } ++ } ++ } +*** MovingObjectPosition.java Sat Feb 5 04:13:14 2022 +--- MovingObjectPosition.java Sat Feb 5 04:12:35 2022 +*** NBTBase.java Sat Feb 5 04:13:14 2022 +--- NBTBase.java Sat Feb 5 04:12:35 2022 +*** NBTTagByte.java Sat Feb 5 04:13:14 2022 +--- NBTTagByte.java Sat Feb 5 04:12:35 2022 +*** NBTTagByteArray.java Sat Feb 5 04:13:14 2022 +--- NBTTagByteArray.java Sat Feb 5 04:12:35 2022 +*** NBTTagCompound.java Sat Feb 5 04:13:14 2022 +--- NBTTagCompound.java Sat Feb 5 04:12:35 2022 +*** NBTTagDouble.java Sat Feb 5 04:13:14 2022 +--- NBTTagDouble.java Sat Feb 5 04:12:35 2022 +*** NBTTagEnd.java Sat Feb 5 04:13:14 2022 +--- NBTTagEnd.java Sat Feb 5 04:12:35 2022 +*** NBTTagFloat.java Sat Feb 5 04:13:14 2022 +--- NBTTagFloat.java Sat Feb 5 04:12:35 2022 +*** NBTTagInt.java Sat Feb 5 04:13:14 2022 +--- NBTTagInt.java Sat Feb 5 04:12:35 2022 +*** NBTTagIntArray.java Sat Feb 5 04:13:14 2022 +--- NBTTagIntArray.java Sat Feb 5 04:12:35 2022 +*** NBTTagList.java Sat Feb 5 04:13:14 2022 +--- NBTTagList.java Sat Feb 5 04:12:35 2022 +*************** +*** 96,105 **** +--- 96,113 ---- + this.tagType = par1NBTBase.getId(); + this.tagList.add(par1NBTBase); + } + + /** ++ * Removes a tag at the given index. ++ */ ++ public NBTBase removeTag(int par1) ++ { ++ return (NBTBase)this.tagList.remove(par1); ++ } ++ ++ /** + * Retrieves the tag at the specified index from the list. + */ + public NBTBase tagAt(int par1) + { + return (NBTBase)this.tagList.get(par1); +*** NBTTagLong.java Sat Feb 5 04:13:14 2022 +--- NBTTagLong.java Sat Feb 5 04:12:36 2022 +*** NBTTagShort.java Sat Feb 5 04:13:14 2022 +--- NBTTagShort.java Sat Feb 5 04:12:36 2022 +*** NBTTagString.java Sat Feb 5 04:13:14 2022 +--- NBTTagString.java Sat Feb 5 04:12:36 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- NetClientHandler.java Sat Feb 5 04:12:36 2022 +*************** +*** 0 **** +--- 1,1673 ---- ++ package net.minecraft.src; ++ ++ import com.google.common.base.Charsets; ++ import java.io.BufferedReader; ++ import java.io.ByteArrayInputStream; ++ import java.io.DataInputStream; ++ import java.io.IOException; ++ import java.io.InputStream; ++ import java.io.InputStreamReader; ++ import java.math.BigInteger; ++ import java.net.InetAddress; ++ import java.net.Socket; ++ import java.net.URL; ++ import java.net.URLEncoder; ++ import java.security.PublicKey; ++ import java.util.ArrayList; ++ import java.util.HashMap; ++ import java.util.Iterator; ++ import java.util.List; ++ import java.util.Map; ++ import java.util.Random; ++ import javax.crypto.SecretKey; ++ import net.minecraft.client.ClientBrandRetriever; ++ import org.lwjgl.input.Keyboard; ++ ++ public class NetClientHandler extends NetHandler ++ { ++ /** True if kicked or disconnected from the server. */ ++ private boolean disconnected; ++ ++ /** Reference to the NetworkManager object. */ ++ private INetworkManager netManager; ++ public String field_72560_a; ++ ++ /** Reference to the Minecraft object. */ ++ private Minecraft mc; ++ private WorldClient worldClient; ++ ++ /** ++ * True if the client has finished downloading terrain and may spawn. Set upon receipt of a player position packet, ++ * reset upon respawning. ++ */ ++ private boolean doneLoadingTerrain; ++ public MapStorage mapStorage = new MapStorage((ISaveHandler)null); ++ ++ /** A HashMap of all player names and their player information objects */ ++ private Map playerInfoMap = new HashMap(); ++ ++ /** ++ * An ArrayList of GuiPlayerInfo (includes all the players' GuiPlayerInfo on the current server) ++ */ ++ public List playerInfoList = new ArrayList(); ++ public int currentServerMaxPlayers = 20; ++ private GuiScreen field_98183_l; ++ ++ /** RNG. */ ++ Random rand = new Random(); ++ ++ public NetClientHandler(Minecraft par1Minecraft, String par2Str, int par3) throws IOException ++ { ++ this.mc = par1Minecraft; ++ Socket var4 = new Socket(InetAddress.getByName(par2Str), par3); ++ this.netManager = new TcpConnection(par1Minecraft.getLogAgent(), var4, "Client", this); ++ } ++ ++ public NetClientHandler(Minecraft par1Minecraft, String par2Str, int par3, GuiScreen par4GuiScreen) throws IOException ++ { ++ this.mc = par1Minecraft; ++ this.field_98183_l = par4GuiScreen; ++ Socket var5 = new Socket(InetAddress.getByName(par2Str), par3); ++ this.netManager = new TcpConnection(par1Minecraft.getLogAgent(), var5, "Client", this); ++ } ++ ++ public NetClientHandler(Minecraft par1Minecraft, IntegratedServer par2IntegratedServer) throws IOException ++ { ++ this.mc = par1Minecraft; ++ this.netManager = new MemoryConnection(par1Minecraft.getLogAgent(), this); ++ par2IntegratedServer.getServerListeningThread().func_71754_a((MemoryConnection)this.netManager, par1Minecraft.getSession().getUsername()); ++ } ++ ++ /** ++ * sets netManager and worldClient to null ++ */ ++ public void cleanup() ++ { ++ if (this.netManager != null) ++ { ++ this.netManager.wakeThreads(); ++ } ++ ++ this.netManager = null; ++ this.worldClient = null; ++ } ++ ++ /** ++ * Processes the packets that have been read since the last call to this function. ++ */ ++ public void processReadPackets() ++ { ++ if (!this.disconnected && this.netManager != null) ++ { ++ this.netManager.processReadPackets(); ++ } ++ ++ if (this.netManager != null) ++ { ++ this.netManager.wakeThreads(); ++ } ++ } ++ ++ public void handleServerAuthData(Packet253ServerAuthData par1Packet253ServerAuthData) ++ { ++ String var2 = par1Packet253ServerAuthData.getServerId().trim(); ++ PublicKey var3 = par1Packet253ServerAuthData.getPublicKey(); ++ SecretKey var4 = CryptManager.createNewSharedKey(); ++ ++ if (!"-".equals(var2)) ++ { ++ String var5 = (new BigInteger(CryptManager.getServerIdHash(var2, var3, var4))).toString(16); ++ String var6 = this.sendSessionRequest(this.mc.getSession().getUsername(), this.mc.getSession().getSessionID(), var5); ++ ++ if (!"ok".equalsIgnoreCase(var6)) ++ { ++ this.netManager.networkShutdown("disconnect.loginFailedInfo", new Object[] {var6}); ++ return; ++ } ++ } ++ ++ this.addToSendQueue(new Packet252SharedKey(var4, var3, par1Packet253ServerAuthData.getVerifyToken())); ++ } ++ ++ /** ++ * Send request to http://session.minecraft.net with user's sessionId and serverId hash ++ */ ++ private String sendSessionRequest(String par1Str, String par2Str, String par3Str) ++ { ++ try ++ { ++ URL var4 = new URL("http://session.minecraft.net/game/joinserver.jsp?user=" + urlEncode(par1Str) + "&sessionId=" + urlEncode(par2Str) + "&serverId=" + urlEncode(par3Str)); ++ InputStream var5 = var4.openConnection(this.mc.getProxy()).getInputStream(); ++ BufferedReader var6 = new BufferedReader(new InputStreamReader(var5)); ++ String var7 = var6.readLine(); ++ var6.close(); ++ return var7; ++ } ++ catch (IOException var8) ++ { ++ return var8.toString(); ++ } ++ } ++ ++ /** ++ * Encode the given string for insertion into a URL ++ */ ++ private static String urlEncode(String par0Str) throws IOException ++ { ++ return URLEncoder.encode(par0Str, "UTF-8"); ++ } ++ ++ public void handleSharedKey(Packet252SharedKey par1Packet252SharedKey) ++ { ++ this.addToSendQueue(new Packet205ClientCommand(0)); ++ } ++ ++ public void handleLogin(Packet1Login par1Packet1Login) ++ { ++ this.mc.playerController = new PlayerControllerMP(this.mc, this); ++ this.mc.statFileWriter.readStat(StatList.joinMultiplayerStat, 1); ++ this.worldClient = new WorldClient(this, new WorldSettings(0L, par1Packet1Login.gameType, false, par1Packet1Login.hardcoreMode, par1Packet1Login.terrainType), par1Packet1Login.dimension, par1Packet1Login.difficultySetting, this.mc.mcProfiler, this.mc.getLogAgent()); ++ this.worldClient.isRemote = true; ++ this.mc.loadWorld(this.worldClient); ++ this.mc.thePlayer.dimension = par1Packet1Login.dimension; ++ this.mc.displayGuiScreen(new GuiDownloadTerrain(this)); ++ this.mc.thePlayer.entityId = par1Packet1Login.clientEntityId; ++ this.currentServerMaxPlayers = par1Packet1Login.maxPlayers; ++ this.mc.playerController.setGameType(par1Packet1Login.gameType); ++ this.mc.gameSettings.sendSettingsToServer(); ++ this.netManager.addToSendQueue(new Packet250CustomPayload("MC|Brand", ClientBrandRetriever.getClientModName().getBytes(Charsets.UTF_8))); ++ } ++ ++ public void handleVehicleSpawn(Packet23VehicleSpawn par1Packet23VehicleSpawn) ++ { ++ double var2 = (double)par1Packet23VehicleSpawn.xPosition / 32.0D; ++ double var4 = (double)par1Packet23VehicleSpawn.yPosition / 32.0D; ++ double var6 = (double)par1Packet23VehicleSpawn.zPosition / 32.0D; ++ Object var8 = null; ++ ++ if (par1Packet23VehicleSpawn.type == 10) ++ { ++ var8 = EntityMinecart.createMinecart(this.worldClient, var2, var4, var6, par1Packet23VehicleSpawn.throwerEntityId); ++ } ++ else if (par1Packet23VehicleSpawn.type == 90) ++ { ++ Entity var9 = this.getEntityByID(par1Packet23VehicleSpawn.throwerEntityId); ++ ++ if (var9 instanceof EntityPlayer) ++ { ++ var8 = new EntityFishHook(this.worldClient, var2, var4, var6, (EntityPlayer)var9); ++ } ++ ++ par1Packet23VehicleSpawn.throwerEntityId = 0; ++ } ++ else if (par1Packet23VehicleSpawn.type == 60) ++ { ++ var8 = new EntityArrow(this.worldClient, var2, var4, var6); ++ } ++ else if (par1Packet23VehicleSpawn.type == 61) ++ { ++ var8 = new EntitySnowball(this.worldClient, var2, var4, var6); ++ } ++ else if (par1Packet23VehicleSpawn.type == 71) ++ { ++ var8 = new EntityItemFrame(this.worldClient, (int)var2, (int)var4, (int)var6, par1Packet23VehicleSpawn.throwerEntityId); ++ par1Packet23VehicleSpawn.throwerEntityId = 0; ++ } ++ else if (par1Packet23VehicleSpawn.type == 77) ++ { ++ var8 = new EntityLeashKnot(this.worldClient, (int)var2, (int)var4, (int)var6); ++ par1Packet23VehicleSpawn.throwerEntityId = 0; ++ } ++ else if (par1Packet23VehicleSpawn.type == 65) ++ { ++ var8 = new EntityEnderPearl(this.worldClient, var2, var4, var6); ++ } ++ else if (par1Packet23VehicleSpawn.type == 72) ++ { ++ var8 = new EntityEnderEye(this.worldClient, var2, var4, var6); ++ } ++ else if (par1Packet23VehicleSpawn.type == 76) ++ { ++ var8 = new EntityFireworkRocket(this.worldClient, var2, var4, var6, (ItemStack)null); ++ } ++ else if (par1Packet23VehicleSpawn.type == 63) ++ { ++ var8 = new EntityLargeFireball(this.worldClient, var2, var4, var6, (double)par1Packet23VehicleSpawn.speedX / 8000.0D, (double)par1Packet23VehicleSpawn.speedY / 8000.0D, (double)par1Packet23VehicleSpawn.speedZ / 8000.0D); ++ par1Packet23VehicleSpawn.throwerEntityId = 0; ++ } ++ else if (par1Packet23VehicleSpawn.type == 64) ++ { ++ var8 = new EntitySmallFireball(this.worldClient, var2, var4, var6, (double)par1Packet23VehicleSpawn.speedX / 8000.0D, (double)par1Packet23VehicleSpawn.speedY / 8000.0D, (double)par1Packet23VehicleSpawn.speedZ / 8000.0D); ++ par1Packet23VehicleSpawn.throwerEntityId = 0; ++ } ++ else if (par1Packet23VehicleSpawn.type == 66) ++ { ++ var8 = new EntityWitherSkull(this.worldClient, var2, var4, var6, (double)par1Packet23VehicleSpawn.speedX / 8000.0D, (double)par1Packet23VehicleSpawn.speedY / 8000.0D, (double)par1Packet23VehicleSpawn.speedZ / 8000.0D); ++ par1Packet23VehicleSpawn.throwerEntityId = 0; ++ } ++ else if (par1Packet23VehicleSpawn.type == 62) ++ { ++ var8 = new EntityEgg(this.worldClient, var2, var4, var6); ++ } ++ else if (par1Packet23VehicleSpawn.type == 73) ++ { ++ var8 = new EntityPotion(this.worldClient, var2, var4, var6, par1Packet23VehicleSpawn.throwerEntityId); ++ par1Packet23VehicleSpawn.throwerEntityId = 0; ++ } ++ else if (par1Packet23VehicleSpawn.type == 75) ++ { ++ var8 = new EntityExpBottle(this.worldClient, var2, var4, var6); ++ par1Packet23VehicleSpawn.throwerEntityId = 0; ++ } ++ else if (par1Packet23VehicleSpawn.type == 1) ++ { ++ var8 = new EntityBoat(this.worldClient, var2, var4, var6); ++ } ++ else if (par1Packet23VehicleSpawn.type == 50) ++ { ++ var8 = new EntityTNTPrimed(this.worldClient, var2, var4, var6, (EntityLivingBase)null); ++ } ++ else if (par1Packet23VehicleSpawn.type == 51) ++ { ++ var8 = new EntityEnderCrystal(this.worldClient, var2, var4, var6); ++ } ++ else if (par1Packet23VehicleSpawn.type == 2) ++ { ++ var8 = new EntityItem(this.worldClient, var2, var4, var6); ++ } ++ else if (par1Packet23VehicleSpawn.type == 70) ++ { ++ var8 = new EntityFallingSand(this.worldClient, var2, var4, var6, par1Packet23VehicleSpawn.throwerEntityId & 65535, par1Packet23VehicleSpawn.throwerEntityId >> 16); ++ par1Packet23VehicleSpawn.throwerEntityId = 0; ++ } ++ ++ if (var8 != null) ++ { ++ ((Entity)var8).serverPosX = par1Packet23VehicleSpawn.xPosition; ++ ((Entity)var8).serverPosY = par1Packet23VehicleSpawn.yPosition; ++ ((Entity)var8).serverPosZ = par1Packet23VehicleSpawn.zPosition; ++ ((Entity)var8).rotationPitch = (float)(par1Packet23VehicleSpawn.pitch * 360) / 256.0F; ++ ((Entity)var8).rotationYaw = (float)(par1Packet23VehicleSpawn.yaw * 360) / 256.0F; ++ Entity[] var12 = ((Entity)var8).getParts(); ++ ++ if (var12 != null) ++ { ++ int var10 = par1Packet23VehicleSpawn.entityId - ((Entity)var8).entityId; ++ ++ for (int var11 = 0; var11 < var12.length; ++var11) ++ { ++ var12[var11].entityId += var10; ++ } ++ } ++ ++ ((Entity)var8).entityId = par1Packet23VehicleSpawn.entityId; ++ this.worldClient.addEntityToWorld(par1Packet23VehicleSpawn.entityId, (Entity)var8); ++ ++ if (par1Packet23VehicleSpawn.throwerEntityId > 0) ++ { ++ if (par1Packet23VehicleSpawn.type == 60) ++ { ++ Entity var13 = this.getEntityByID(par1Packet23VehicleSpawn.throwerEntityId); ++ ++ if (var13 instanceof EntityLivingBase) ++ { ++ EntityArrow var14 = (EntityArrow)var8; ++ var14.shootingEntity = var13; ++ } ++ } ++ ++ ((Entity)var8).setVelocity((double)par1Packet23VehicleSpawn.speedX / 8000.0D, (double)par1Packet23VehicleSpawn.speedY / 8000.0D, (double)par1Packet23VehicleSpawn.speedZ / 8000.0D); ++ } ++ } ++ } ++ ++ /** ++ * Handle a entity experience orb packet. ++ */ ++ public void handleEntityExpOrb(Packet26EntityExpOrb par1Packet26EntityExpOrb) ++ { ++ EntityXPOrb var2 = new EntityXPOrb(this.worldClient, (double)par1Packet26EntityExpOrb.posX, (double)par1Packet26EntityExpOrb.posY, (double)par1Packet26EntityExpOrb.posZ, par1Packet26EntityExpOrb.xpValue); ++ var2.serverPosX = par1Packet26EntityExpOrb.posX; ++ var2.serverPosY = par1Packet26EntityExpOrb.posY; ++ var2.serverPosZ = par1Packet26EntityExpOrb.posZ; ++ var2.rotationYaw = 0.0F; ++ var2.rotationPitch = 0.0F; ++ var2.entityId = par1Packet26EntityExpOrb.entityId; ++ this.worldClient.addEntityToWorld(par1Packet26EntityExpOrb.entityId, var2); ++ } ++ ++ /** ++ * Handles weather packet ++ */ ++ public void handleWeather(Packet71Weather par1Packet71Weather) ++ { ++ double var2 = (double)par1Packet71Weather.posX / 32.0D; ++ double var4 = (double)par1Packet71Weather.posY / 32.0D; ++ double var6 = (double)par1Packet71Weather.posZ / 32.0D; ++ EntityLightningBolt var8 = null; ++ ++ if (par1Packet71Weather.isLightningBolt == 1) ++ { ++ var8 = new EntityLightningBolt(this.worldClient, var2, var4, var6); ++ } ++ ++ if (var8 != null) ++ { ++ var8.serverPosX = par1Packet71Weather.posX; ++ var8.serverPosY = par1Packet71Weather.posY; ++ var8.serverPosZ = par1Packet71Weather.posZ; ++ var8.rotationYaw = 0.0F; ++ var8.rotationPitch = 0.0F; ++ var8.entityId = par1Packet71Weather.entityID; ++ this.worldClient.addWeatherEffect(var8); ++ } ++ } ++ ++ /** ++ * Packet handler ++ */ ++ public void handleEntityPainting(Packet25EntityPainting par1Packet25EntityPainting) ++ { ++ EntityPainting var2 = new EntityPainting(this.worldClient, par1Packet25EntityPainting.xPosition, par1Packet25EntityPainting.yPosition, par1Packet25EntityPainting.zPosition, par1Packet25EntityPainting.direction, par1Packet25EntityPainting.title); ++ this.worldClient.addEntityToWorld(par1Packet25EntityPainting.entityId, var2); ++ } ++ ++ /** ++ * Packet handler ++ */ ++ public void handleEntityVelocity(Packet28EntityVelocity par1Packet28EntityVelocity) ++ { ++ Entity var2 = this.getEntityByID(par1Packet28EntityVelocity.entityId); ++ ++ if (var2 != null) ++ { ++ var2.setVelocity((double)par1Packet28EntityVelocity.motionX / 8000.0D, (double)par1Packet28EntityVelocity.motionY / 8000.0D, (double)par1Packet28EntityVelocity.motionZ / 8000.0D); ++ } ++ } ++ ++ /** ++ * Packet handler ++ */ ++ public void handleEntityMetadata(Packet40EntityMetadata par1Packet40EntityMetadata) ++ { ++ Entity var2 = this.getEntityByID(par1Packet40EntityMetadata.entityId); ++ ++ if (var2 != null && par1Packet40EntityMetadata.getMetadata() != null) ++ { ++ var2.getDataWatcher().updateWatchedObjectsFromList(par1Packet40EntityMetadata.getMetadata()); ++ } ++ } ++ ++ public void handleNamedEntitySpawn(Packet20NamedEntitySpawn par1Packet20NamedEntitySpawn) ++ { ++ double var2 = (double)par1Packet20NamedEntitySpawn.xPosition / 32.0D; ++ double var4 = (double)par1Packet20NamedEntitySpawn.yPosition / 32.0D; ++ double var6 = (double)par1Packet20NamedEntitySpawn.zPosition / 32.0D; ++ float var8 = (float)(par1Packet20NamedEntitySpawn.rotation * 360) / 256.0F; ++ float var9 = (float)(par1Packet20NamedEntitySpawn.pitch * 360) / 256.0F; ++ EntityOtherPlayerMP var10 = new EntityOtherPlayerMP(this.mc.theWorld, par1Packet20NamedEntitySpawn.name); ++ var10.prevPosX = var10.lastTickPosX = (double)(var10.serverPosX = par1Packet20NamedEntitySpawn.xPosition); ++ var10.prevPosY = var10.lastTickPosY = (double)(var10.serverPosY = par1Packet20NamedEntitySpawn.yPosition); ++ var10.prevPosZ = var10.lastTickPosZ = (double)(var10.serverPosZ = par1Packet20NamedEntitySpawn.zPosition); ++ int var11 = par1Packet20NamedEntitySpawn.currentItem; ++ ++ if (var11 == 0) ++ { ++ var10.inventory.mainInventory[var10.inventory.currentItem] = null; ++ } ++ else ++ { ++ var10.inventory.mainInventory[var10.inventory.currentItem] = new ItemStack(var11, 1, 0); ++ } ++ ++ var10.setPositionAndRotation(var2, var4, var6, var8, var9); ++ this.worldClient.addEntityToWorld(par1Packet20NamedEntitySpawn.entityId, var10); ++ List var12 = par1Packet20NamedEntitySpawn.getWatchedMetadata(); ++ ++ if (var12 != null) ++ { ++ var10.getDataWatcher().updateWatchedObjectsFromList(var12); ++ } ++ } ++ ++ public void handleEntityTeleport(Packet34EntityTeleport par1Packet34EntityTeleport) ++ { ++ Entity var2 = this.getEntityByID(par1Packet34EntityTeleport.entityId); ++ ++ if (var2 != null) ++ { ++ var2.serverPosX = par1Packet34EntityTeleport.xPosition; ++ var2.serverPosY = par1Packet34EntityTeleport.yPosition; ++ var2.serverPosZ = par1Packet34EntityTeleport.zPosition; ++ double var3 = (double)var2.serverPosX / 32.0D; ++ double var5 = (double)var2.serverPosY / 32.0D + 0.015625D; ++ double var7 = (double)var2.serverPosZ / 32.0D; ++ float var9 = (float)(par1Packet34EntityTeleport.yaw * 360) / 256.0F; ++ float var10 = (float)(par1Packet34EntityTeleport.pitch * 360) / 256.0F; ++ var2.setPositionAndRotation2(var3, var5, var7, var9, var10, 3); ++ } ++ } ++ ++ public void handleBlockItemSwitch(Packet16BlockItemSwitch par1Packet16BlockItemSwitch) ++ { ++ if (par1Packet16BlockItemSwitch.id >= 0 && par1Packet16BlockItemSwitch.id < InventoryPlayer.getHotbarSize()) ++ { ++ this.mc.thePlayer.inventory.currentItem = par1Packet16BlockItemSwitch.id; ++ } ++ } ++ ++ public void handleEntity(Packet30Entity par1Packet30Entity) ++ { ++ Entity var2 = this.getEntityByID(par1Packet30Entity.entityId); ++ ++ if (var2 != null) ++ { ++ var2.serverPosX += par1Packet30Entity.xPosition; ++ var2.serverPosY += par1Packet30Entity.yPosition; ++ var2.serverPosZ += par1Packet30Entity.zPosition; ++ double var3 = (double)var2.serverPosX / 32.0D; ++ double var5 = (double)var2.serverPosY / 32.0D; ++ double var7 = (double)var2.serverPosZ / 32.0D; ++ float var9 = par1Packet30Entity.rotating ? (float)(par1Packet30Entity.yaw * 360) / 256.0F : var2.rotationYaw; ++ float var10 = par1Packet30Entity.rotating ? (float)(par1Packet30Entity.pitch * 360) / 256.0F : var2.rotationPitch; ++ var2.setPositionAndRotation2(var3, var5, var7, var9, var10, 3); ++ } ++ } ++ ++ public void handleEntityHeadRotation(Packet35EntityHeadRotation par1Packet35EntityHeadRotation) ++ { ++ Entity var2 = this.getEntityByID(par1Packet35EntityHeadRotation.entityId); ++ ++ if (var2 != null) ++ { ++ float var3 = (float)(par1Packet35EntityHeadRotation.headRotationYaw * 360) / 256.0F; ++ var2.setRotationYawHead(var3); ++ } ++ } ++ ++ public void handleDestroyEntity(Packet29DestroyEntity par1Packet29DestroyEntity) ++ { ++ for (int var2 = 0; var2 < par1Packet29DestroyEntity.entityId.length; ++var2) ++ { ++ this.worldClient.removeEntityFromWorld(par1Packet29DestroyEntity.entityId[var2]); ++ } ++ } ++ ++ public void handleFlying(Packet10Flying par1Packet10Flying) ++ { ++ EntityClientPlayerMP var2 = this.mc.thePlayer; ++ double var3 = var2.posX; ++ double var5 = var2.posY; ++ double var7 = var2.posZ; ++ float var9 = var2.rotationYaw; ++ float var10 = var2.rotationPitch; ++ ++ if (par1Packet10Flying.moving) ++ { ++ var3 = par1Packet10Flying.xPosition; ++ var5 = par1Packet10Flying.yPosition; ++ var7 = par1Packet10Flying.zPosition; ++ } ++ ++ if (par1Packet10Flying.rotating) ++ { ++ var9 = par1Packet10Flying.yaw; ++ var10 = par1Packet10Flying.pitch; ++ } ++ ++ var2.ySize = 0.0F; ++ var2.motionX = var2.motionY = var2.motionZ = 0.0D; ++ var2.setPositionAndRotation(var3, var5, var7, var9, var10); ++ par1Packet10Flying.xPosition = var2.posX; ++ par1Packet10Flying.yPosition = var2.boundingBox.minY; ++ par1Packet10Flying.zPosition = var2.posZ; ++ par1Packet10Flying.stance = var2.posY; ++ this.netManager.addToSendQueue(par1Packet10Flying); ++ ++ if (!this.doneLoadingTerrain) ++ { ++ this.mc.thePlayer.prevPosX = this.mc.thePlayer.posX; ++ this.mc.thePlayer.prevPosY = this.mc.thePlayer.posY; ++ this.mc.thePlayer.prevPosZ = this.mc.thePlayer.posZ; ++ this.doneLoadingTerrain = true; ++ this.mc.displayGuiScreen((GuiScreen)null); ++ } ++ } ++ ++ public void handleMultiBlockChange(Packet52MultiBlockChange par1Packet52MultiBlockChange) ++ { ++ int var2 = par1Packet52MultiBlockChange.xPosition * 16; ++ int var3 = par1Packet52MultiBlockChange.zPosition * 16; ++ ++ if (par1Packet52MultiBlockChange.metadataArray != null) ++ { ++ DataInputStream var4 = new DataInputStream(new ByteArrayInputStream(par1Packet52MultiBlockChange.metadataArray)); ++ ++ try ++ { ++ for (int var5 = 0; var5 < par1Packet52MultiBlockChange.size; ++var5) ++ { ++ short var6 = var4.readShort(); ++ short var7 = var4.readShort(); ++ int var8 = var7 >> 4 & 4095; ++ int var9 = var7 & 15; ++ int var10 = var6 >> 12 & 15; ++ int var11 = var6 >> 8 & 15; ++ int var12 = var6 & 255; ++ this.worldClient.setBlockAndMetadataAndInvalidate(var10 + var2, var12, var11 + var3, var8, var9); ++ } ++ } ++ catch (IOException var13) ++ { ++ ; ++ } ++ } ++ } ++ ++ /** ++ * Handle Packet51MapChunk (full chunk update of blocks, metadata, light levels, and optionally biome data) ++ */ ++ public void handleMapChunk(Packet51MapChunk par1Packet51MapChunk) ++ { ++ if (par1Packet51MapChunk.includeInitialize) ++ { ++ if (par1Packet51MapChunk.yChMin == 0) ++ { ++ this.worldClient.doPreChunk(par1Packet51MapChunk.xCh, par1Packet51MapChunk.zCh, false); ++ return; ++ } ++ ++ this.worldClient.doPreChunk(par1Packet51MapChunk.xCh, par1Packet51MapChunk.zCh, true); ++ } ++ ++ this.worldClient.invalidateBlockReceiveRegion(par1Packet51MapChunk.xCh << 4, 0, par1Packet51MapChunk.zCh << 4, (par1Packet51MapChunk.xCh << 4) + 15, 256, (par1Packet51MapChunk.zCh << 4) + 15); ++ Chunk var2 = this.worldClient.getChunkFromChunkCoords(par1Packet51MapChunk.xCh, par1Packet51MapChunk.zCh); ++ ++ if (par1Packet51MapChunk.includeInitialize && var2 == null) ++ { ++ this.worldClient.doPreChunk(par1Packet51MapChunk.xCh, par1Packet51MapChunk.zCh, true); ++ var2 = this.worldClient.getChunkFromChunkCoords(par1Packet51MapChunk.xCh, par1Packet51MapChunk.zCh); ++ } ++ ++ if (var2 != null) ++ { ++ var2.fillChunk(par1Packet51MapChunk.getCompressedChunkData(), par1Packet51MapChunk.yChMin, par1Packet51MapChunk.yChMax, par1Packet51MapChunk.includeInitialize); ++ this.worldClient.markBlockRangeForRenderUpdate(par1Packet51MapChunk.xCh << 4, 0, par1Packet51MapChunk.zCh << 4, (par1Packet51MapChunk.xCh << 4) + 15, 256, (par1Packet51MapChunk.zCh << 4) + 15); ++ ++ if (!par1Packet51MapChunk.includeInitialize || !(this.worldClient.provider instanceof WorldProviderSurface)) ++ { ++ var2.resetRelightChecks(); ++ } ++ } ++ } ++ ++ public void handleBlockChange(Packet53BlockChange par1Packet53BlockChange) ++ { ++ this.worldClient.setBlockAndMetadataAndInvalidate(par1Packet53BlockChange.xPosition, par1Packet53BlockChange.yPosition, par1Packet53BlockChange.zPosition, par1Packet53BlockChange.type, par1Packet53BlockChange.metadata); ++ } ++ ++ public void handleKickDisconnect(Packet255KickDisconnect par1Packet255KickDisconnect) ++ { ++ this.netManager.networkShutdown("disconnect.kicked", new Object[0]); ++ this.disconnected = true; ++ this.mc.loadWorld((WorldClient)null); ++ ++ if (this.field_98183_l != null) ++ { ++ this.mc.displayGuiScreen(new GuiScreenDisconnectedOnline(this.field_98183_l, "disconnect.disconnected", "disconnect.genericReason", new Object[] {par1Packet255KickDisconnect.reason})); ++ } ++ else ++ { ++ this.mc.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.disconnected", "disconnect.genericReason", new Object[] {par1Packet255KickDisconnect.reason})); ++ } ++ } ++ ++ public void handleErrorMessage(String par1Str, Object[] par2ArrayOfObj) ++ { ++ if (!this.disconnected) ++ { ++ this.disconnected = true; ++ this.mc.loadWorld((WorldClient)null); ++ ++ if (this.field_98183_l != null) ++ { ++ this.mc.displayGuiScreen(new GuiScreenDisconnectedOnline(this.field_98183_l, "disconnect.lost", par1Str, par2ArrayOfObj)); ++ } ++ else ++ { ++ this.mc.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.lost", par1Str, par2ArrayOfObj)); ++ } ++ } ++ } ++ ++ public void quitWithPacket(Packet par1Packet) ++ { ++ if (!this.disconnected) ++ { ++ this.netManager.addToSendQueue(par1Packet); ++ this.netManager.serverShutdown(); ++ } ++ } ++ ++ /** ++ * Adds the packet to the send queue ++ */ ++ public void addToSendQueue(Packet par1Packet) ++ { ++ if (!this.disconnected) ++ { ++ this.netManager.addToSendQueue(par1Packet); ++ } ++ } ++ ++ public void handleCollect(Packet22Collect par1Packet22Collect) ++ { ++ Entity var2 = this.getEntityByID(par1Packet22Collect.collectedEntityId); ++ Object var3 = (EntityLivingBase)this.getEntityByID(par1Packet22Collect.collectorEntityId); ++ ++ if (var3 == null) ++ { ++ var3 = this.mc.thePlayer; ++ } ++ ++ if (var2 != null) ++ { ++ if (var2 instanceof EntityXPOrb) ++ { ++ this.worldClient.playSoundAtEntity(var2, "random.orb", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); ++ } ++ else ++ { ++ this.worldClient.playSoundAtEntity(var2, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); ++ } ++ ++ this.mc.effectRenderer.addEffect(new EntityPickupFX(this.mc.theWorld, var2, (Entity)var3, -0.5F)); ++ this.worldClient.removeEntityFromWorld(par1Packet22Collect.collectedEntityId); ++ } ++ } ++ ++ public void handleChat(Packet3Chat par1Packet3Chat) ++ { ++ this.mc.ingameGUI.getChatGUI().printChatMessage(ChatMessageComponent.createFromJson(par1Packet3Chat.message).toStringWithFormatting(true)); ++ } ++ ++ public void handleAnimation(Packet18Animation par1Packet18Animation) ++ { ++ Entity var2 = this.getEntityByID(par1Packet18Animation.entityId); ++ ++ if (var2 != null) ++ { ++ if (par1Packet18Animation.animate == 1) ++ { ++ EntityLivingBase var3 = (EntityLivingBase)var2; ++ var3.swingItem(); ++ } ++ else if (par1Packet18Animation.animate == 2) ++ { ++ var2.performHurtAnimation(); ++ } ++ else if (par1Packet18Animation.animate == 3) ++ { ++ EntityPlayer var4 = (EntityPlayer)var2; ++ var4.wakeUpPlayer(false, false, false); ++ } ++ else if (par1Packet18Animation.animate != 4) ++ { ++ if (par1Packet18Animation.animate == 6) ++ { ++ this.mc.effectRenderer.addEffect(new EntityCrit2FX(this.mc.theWorld, var2)); ++ } ++ else if (par1Packet18Animation.animate == 7) ++ { ++ EntityCrit2FX var5 = new EntityCrit2FX(this.mc.theWorld, var2, "magicCrit"); ++ this.mc.effectRenderer.addEffect(var5); ++ } ++ else if (par1Packet18Animation.animate == 5 && var2 instanceof EntityOtherPlayerMP) ++ { ++ ; ++ } ++ } ++ } ++ } ++ ++ public void handleSleep(Packet17Sleep par1Packet17Sleep) ++ { ++ Entity var2 = this.getEntityByID(par1Packet17Sleep.entityID); ++ ++ if (var2 != null) ++ { ++ if (par1Packet17Sleep.field_73622_e == 0) ++ { ++ EntityPlayer var3 = (EntityPlayer)var2; ++ var3.sleepInBedAt(par1Packet17Sleep.bedX, par1Packet17Sleep.bedY, par1Packet17Sleep.bedZ); ++ } ++ } ++ } ++ ++ /** ++ * Disconnects the network connection. ++ */ ++ public void disconnect() ++ { ++ this.disconnected = true; ++ this.netManager.wakeThreads(); ++ this.netManager.networkShutdown("disconnect.closed", new Object[0]); ++ } ++ ++ public void handleMobSpawn(Packet24MobSpawn par1Packet24MobSpawn) ++ { ++ double var2 = (double)par1Packet24MobSpawn.xPosition / 32.0D; ++ double var4 = (double)par1Packet24MobSpawn.yPosition / 32.0D; ++ double var6 = (double)par1Packet24MobSpawn.zPosition / 32.0D; ++ float var8 = (float)(par1Packet24MobSpawn.yaw * 360) / 256.0F; ++ float var9 = (float)(par1Packet24MobSpawn.pitch * 360) / 256.0F; ++ EntityLivingBase var10 = (EntityLivingBase)EntityList.createEntityByID(par1Packet24MobSpawn.type, this.mc.theWorld); ++ var10.serverPosX = par1Packet24MobSpawn.xPosition; ++ var10.serverPosY = par1Packet24MobSpawn.yPosition; ++ var10.serverPosZ = par1Packet24MobSpawn.zPosition; ++ var10.rotationYawHead = (float)(par1Packet24MobSpawn.headYaw * 360) / 256.0F; ++ Entity[] var11 = var10.getParts(); ++ ++ if (var11 != null) ++ { ++ int var12 = par1Packet24MobSpawn.entityId - var10.entityId; ++ ++ for (int var13 = 0; var13 < var11.length; ++var13) ++ { ++ var11[var13].entityId += var12; ++ } ++ } ++ ++ var10.entityId = par1Packet24MobSpawn.entityId; ++ var10.setPositionAndRotation(var2, var4, var6, var8, var9); ++ var10.motionX = (double)((float)par1Packet24MobSpawn.velocityX / 8000.0F); ++ var10.motionY = (double)((float)par1Packet24MobSpawn.velocityY / 8000.0F); ++ var10.motionZ = (double)((float)par1Packet24MobSpawn.velocityZ / 8000.0F); ++ this.worldClient.addEntityToWorld(par1Packet24MobSpawn.entityId, var10); ++ List var14 = par1Packet24MobSpawn.getMetadata(); ++ ++ if (var14 != null) ++ { ++ var10.getDataWatcher().updateWatchedObjectsFromList(var14); ++ } ++ } ++ ++ public void handleUpdateTime(Packet4UpdateTime par1Packet4UpdateTime) ++ { ++ this.mc.theWorld.func_82738_a(par1Packet4UpdateTime.worldAge); ++ this.mc.theWorld.setWorldTime(par1Packet4UpdateTime.time); ++ } ++ ++ public void handleSpawnPosition(Packet6SpawnPosition par1Packet6SpawnPosition) ++ { ++ this.mc.thePlayer.setSpawnChunk(new ChunkCoordinates(par1Packet6SpawnPosition.xPosition, par1Packet6SpawnPosition.yPosition, par1Packet6SpawnPosition.zPosition), true); ++ this.mc.theWorld.getWorldInfo().setSpawnPosition(par1Packet6SpawnPosition.xPosition, par1Packet6SpawnPosition.yPosition, par1Packet6SpawnPosition.zPosition); ++ } ++ ++ /** ++ * Packet handler ++ */ ++ public void handleAttachEntity(Packet39AttachEntity par1Packet39AttachEntity) ++ { ++ Object var2 = this.getEntityByID(par1Packet39AttachEntity.ridingEntityId); ++ Entity var3 = this.getEntityByID(par1Packet39AttachEntity.vehicleEntityId); ++ ++ if (par1Packet39AttachEntity.attachState == 0) ++ { ++ boolean var4 = false; ++ ++ if (par1Packet39AttachEntity.ridingEntityId == this.mc.thePlayer.entityId) ++ { ++ var2 = this.mc.thePlayer; ++ ++ if (var3 instanceof EntityBoat) ++ { ++ ((EntityBoat)var3).func_70270_d(false); ++ } ++ ++ var4 = ((Entity)var2).ridingEntity == null && var3 != null; ++ } ++ else if (var3 instanceof EntityBoat) ++ { ++ ((EntityBoat)var3).func_70270_d(true); ++ } ++ ++ if (var2 == null) ++ { ++ return; ++ } ++ ++ ((Entity)var2).mountEntity(var3); ++ ++ if (var4) ++ { ++ GameSettings var5 = this.mc.gameSettings; ++ this.mc.ingameGUI.func_110326_a(I18n.getStringParams("mount.onboard", new Object[] {GameSettings.getKeyDisplayString(var5.keyBindSneak.keyCode)}), false); ++ } ++ } ++ else if (par1Packet39AttachEntity.attachState == 1 && var2 != null && var2 instanceof EntityLiving) ++ { ++ if (var3 != null) ++ { ++ ((EntityLiving)var2).setLeashedToEntity(var3, false); ++ } ++ else ++ { ++ ((EntityLiving)var2).clearLeashed(false, false); ++ } ++ } ++ } ++ ++ /** ++ * Packet handler ++ */ ++ public void handleEntityStatus(Packet38EntityStatus par1Packet38EntityStatus) ++ { ++ Entity var2 = this.getEntityByID(par1Packet38EntityStatus.entityId); ++ ++ if (var2 != null) ++ { ++ var2.handleHealthUpdate(par1Packet38EntityStatus.entityStatus); ++ } ++ } ++ ++ private Entity getEntityByID(int par1) ++ { ++ return (Entity)(par1 == this.mc.thePlayer.entityId ? this.mc.thePlayer : this.worldClient.getEntityByID(par1)); ++ } ++ ++ /** ++ * Recieves player health from the server and then proceeds to set it locally on the client. ++ */ ++ public void handleUpdateHealth(Packet8UpdateHealth par1Packet8UpdateHealth) ++ { ++ this.mc.thePlayer.setPlayerSPHealth(par1Packet8UpdateHealth.healthMP); ++ this.mc.thePlayer.getFoodStats().setFoodLevel(par1Packet8UpdateHealth.food); ++ this.mc.thePlayer.getFoodStats().setFoodSaturationLevel(par1Packet8UpdateHealth.foodSaturation); ++ } ++ ++ /** ++ * Handle an experience packet. ++ */ ++ public void handleExperience(Packet43Experience par1Packet43Experience) ++ { ++ this.mc.thePlayer.setXPStats(par1Packet43Experience.experience, par1Packet43Experience.experienceTotal, par1Packet43Experience.experienceLevel); ++ } ++ ++ /** ++ * respawns the player ++ */ ++ public void handleRespawn(Packet9Respawn par1Packet9Respawn) ++ { ++ if (par1Packet9Respawn.respawnDimension != this.mc.thePlayer.dimension) ++ { ++ this.doneLoadingTerrain = false; ++ Scoreboard var2 = this.worldClient.getScoreboard(); ++ this.worldClient = new WorldClient(this, new WorldSettings(0L, par1Packet9Respawn.gameType, false, this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled(), par1Packet9Respawn.terrainType), par1Packet9Respawn.respawnDimension, par1Packet9Respawn.difficulty, this.mc.mcProfiler, this.mc.getLogAgent()); ++ this.worldClient.func_96443_a(var2); ++ this.worldClient.isRemote = true; ++ this.mc.loadWorld(this.worldClient); ++ this.mc.thePlayer.dimension = par1Packet9Respawn.respawnDimension; ++ this.mc.displayGuiScreen(new GuiDownloadTerrain(this)); ++ } ++ ++ this.mc.setDimensionAndSpawnPlayer(par1Packet9Respawn.respawnDimension); ++ this.mc.playerController.setGameType(par1Packet9Respawn.gameType); ++ } ++ ++ public void handleExplosion(Packet60Explosion par1Packet60Explosion) ++ { ++ Explosion var2 = new Explosion(this.mc.theWorld, (Entity)null, par1Packet60Explosion.explosionX, par1Packet60Explosion.explosionY, par1Packet60Explosion.explosionZ, par1Packet60Explosion.explosionSize); ++ var2.affectedBlockPositions = par1Packet60Explosion.chunkPositionRecords; ++ var2.doExplosionB(true); ++ this.mc.thePlayer.motionX += (double)par1Packet60Explosion.getPlayerVelocityX(); ++ this.mc.thePlayer.motionY += (double)par1Packet60Explosion.getPlayerVelocityY(); ++ this.mc.thePlayer.motionZ += (double)par1Packet60Explosion.getPlayerVelocityZ(); ++ } ++ ++ public void handleOpenWindow(Packet100OpenWindow par1Packet100OpenWindow) ++ { ++ EntityClientPlayerMP var2 = this.mc.thePlayer; ++ ++ switch (par1Packet100OpenWindow.inventoryType) ++ { ++ case 0: ++ var2.displayGUIChest(new InventoryBasic(par1Packet100OpenWindow.windowTitle, par1Packet100OpenWindow.useProvidedWindowTitle, par1Packet100OpenWindow.slotsCount)); ++ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; ++ break; ++ ++ case 1: ++ var2.displayGUIWorkbench(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ)); ++ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; ++ break; ++ ++ case 2: ++ TileEntityFurnace var4 = new TileEntityFurnace(); ++ ++ if (par1Packet100OpenWindow.useProvidedWindowTitle) ++ { ++ var4.setGuiDisplayName(par1Packet100OpenWindow.windowTitle); ++ } ++ ++ var2.displayGUIFurnace(var4); ++ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; ++ break; ++ ++ case 3: ++ TileEntityDispenser var7 = new TileEntityDispenser(); ++ ++ if (par1Packet100OpenWindow.useProvidedWindowTitle) ++ { ++ var7.setCustomName(par1Packet100OpenWindow.windowTitle); ++ } ++ ++ var2.displayGUIDispenser(var7); ++ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; ++ break; ++ ++ case 4: ++ var2.displayGUIEnchantment(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ), par1Packet100OpenWindow.useProvidedWindowTitle ? par1Packet100OpenWindow.windowTitle : null); ++ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; ++ break; ++ ++ case 5: ++ TileEntityBrewingStand var5 = new TileEntityBrewingStand(); ++ ++ if (par1Packet100OpenWindow.useProvidedWindowTitle) ++ { ++ var5.func_94131_a(par1Packet100OpenWindow.windowTitle); ++ } ++ ++ var2.displayGUIBrewingStand(var5); ++ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; ++ break; ++ ++ case 6: ++ var2.displayGUIMerchant(new NpcMerchant(var2), par1Packet100OpenWindow.useProvidedWindowTitle ? par1Packet100OpenWindow.windowTitle : null); ++ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; ++ break; ++ ++ case 7: ++ TileEntityBeacon var8 = new TileEntityBeacon(); ++ var2.displayGUIBeacon(var8); ++ ++ if (par1Packet100OpenWindow.useProvidedWindowTitle) ++ { ++ var8.func_94047_a(par1Packet100OpenWindow.windowTitle); ++ } ++ ++ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; ++ break; ++ ++ case 8: ++ var2.displayGUIAnvil(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ)); ++ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; ++ break; ++ ++ case 9: ++ TileEntityHopper var3 = new TileEntityHopper(); ++ ++ if (par1Packet100OpenWindow.useProvidedWindowTitle) ++ { ++ var3.setInventoryName(par1Packet100OpenWindow.windowTitle); ++ } ++ ++ var2.displayGUIHopper(var3); ++ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; ++ break; ++ ++ case 10: ++ TileEntityDropper var6 = new TileEntityDropper(); ++ ++ if (par1Packet100OpenWindow.useProvidedWindowTitle) ++ { ++ var6.setCustomName(par1Packet100OpenWindow.windowTitle); ++ } ++ ++ var2.displayGUIDispenser(var6); ++ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; ++ break; ++ ++ case 11: ++ Entity var9 = this.getEntityByID(par1Packet100OpenWindow.field_111008_f); ++ ++ if (var9 != null && var9 instanceof EntityHorse) ++ { ++ var2.displayGUIHorse((EntityHorse)var9, new AnimalChest(par1Packet100OpenWindow.windowTitle, par1Packet100OpenWindow.useProvidedWindowTitle, par1Packet100OpenWindow.slotsCount)); ++ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; ++ } ++ } ++ } ++ ++ public void handleSetSlot(Packet103SetSlot par1Packet103SetSlot) ++ { ++ EntityClientPlayerMP var2 = this.mc.thePlayer; ++ ++ if (par1Packet103SetSlot.windowId == -1) ++ { ++ var2.inventory.setItemStack(par1Packet103SetSlot.myItemStack); ++ } ++ else ++ { ++ boolean var3 = false; ++ ++ if (this.mc.currentScreen instanceof GuiContainerCreative) ++ { ++ GuiContainerCreative var4 = (GuiContainerCreative)this.mc.currentScreen; ++ var3 = var4.getCurrentTabIndex() != CreativeTabs.tabInventory.getTabIndex(); ++ } ++ ++ if (par1Packet103SetSlot.windowId == 0 && par1Packet103SetSlot.itemSlot >= 36 && par1Packet103SetSlot.itemSlot < 45) ++ { ++ ItemStack var5 = var2.inventoryContainer.getSlot(par1Packet103SetSlot.itemSlot).getStack(); ++ ++ if (par1Packet103SetSlot.myItemStack != null && (var5 == null || var5.stackSize < par1Packet103SetSlot.myItemStack.stackSize)) ++ { ++ par1Packet103SetSlot.myItemStack.animationsToGo = 5; ++ } ++ ++ var2.inventoryContainer.putStackInSlot(par1Packet103SetSlot.itemSlot, par1Packet103SetSlot.myItemStack); ++ } ++ else if (par1Packet103SetSlot.windowId == var2.openContainer.windowId && (par1Packet103SetSlot.windowId != 0 || !var3)) ++ { ++ var2.openContainer.putStackInSlot(par1Packet103SetSlot.itemSlot, par1Packet103SetSlot.myItemStack); ++ } ++ } ++ } ++ ++ public void handleTransaction(Packet106Transaction par1Packet106Transaction) ++ { ++ Container var2 = null; ++ EntityClientPlayerMP var3 = this.mc.thePlayer; ++ ++ if (par1Packet106Transaction.windowId == 0) ++ { ++ var2 = var3.inventoryContainer; ++ } ++ else if (par1Packet106Transaction.windowId == var3.openContainer.windowId) ++ { ++ var2 = var3.openContainer; ++ } ++ ++ if (var2 != null && !par1Packet106Transaction.accepted) ++ { ++ this.addToSendQueue(new Packet106Transaction(par1Packet106Transaction.windowId, par1Packet106Transaction.shortWindowId, true)); ++ } ++ } ++ ++ public void handleWindowItems(Packet104WindowItems par1Packet104WindowItems) ++ { ++ EntityClientPlayerMP var2 = this.mc.thePlayer; ++ ++ if (par1Packet104WindowItems.windowId == 0) ++ { ++ var2.inventoryContainer.putStacksInSlots(par1Packet104WindowItems.itemStack); ++ } ++ else if (par1Packet104WindowItems.windowId == var2.openContainer.windowId) ++ { ++ var2.openContainer.putStacksInSlots(par1Packet104WindowItems.itemStack); ++ } ++ } ++ ++ public void func_142031_a(Packet133TileEditorOpen par1Packet133TileEditorOpen) ++ { ++ TileEntity var2 = this.worldClient.getBlockTileEntity(par1Packet133TileEditorOpen.field_142035_b, par1Packet133TileEditorOpen.field_142036_c, par1Packet133TileEditorOpen.field_142034_d); ++ ++ if (var2 != null) ++ { ++ this.mc.thePlayer.displayGUIEditSign(var2); ++ } ++ else if (par1Packet133TileEditorOpen.field_142037_a == 0) ++ { ++ TileEntitySign var3 = new TileEntitySign(); ++ var3.setWorldObj(this.worldClient); ++ var3.xCoord = par1Packet133TileEditorOpen.field_142035_b; ++ var3.yCoord = par1Packet133TileEditorOpen.field_142036_c; ++ var3.zCoord = par1Packet133TileEditorOpen.field_142034_d; ++ this.mc.thePlayer.displayGUIEditSign(var3); ++ } ++ } ++ ++ /** ++ * Updates Client side signs ++ */ ++ public void handleUpdateSign(Packet130UpdateSign par1Packet130UpdateSign) ++ { ++ boolean var2 = false; ++ ++ if (this.mc.theWorld.blockExists(par1Packet130UpdateSign.xPosition, par1Packet130UpdateSign.yPosition, par1Packet130UpdateSign.zPosition)) ++ { ++ TileEntity var3 = this.mc.theWorld.getBlockTileEntity(par1Packet130UpdateSign.xPosition, par1Packet130UpdateSign.yPosition, par1Packet130UpdateSign.zPosition); ++ ++ if (var3 instanceof TileEntitySign) ++ { ++ TileEntitySign var4 = (TileEntitySign)var3; ++ ++ if (var4.isEditable()) ++ { ++ for (int var5 = 0; var5 < 4; ++var5) ++ { ++ var4.signText[var5] = par1Packet130UpdateSign.signLines[var5]; ++ } ++ ++ var4.onInventoryChanged(); ++ } ++ ++ var2 = true; ++ } ++ } ++ ++ if (!var2 && this.mc.thePlayer != null) ++ { ++ this.mc.thePlayer.sendChatToPlayer(ChatMessageComponent.createFromText("Unable to locate sign at " + par1Packet130UpdateSign.xPosition + ", " + par1Packet130UpdateSign.yPosition + ", " + par1Packet130UpdateSign.zPosition)); ++ } ++ } ++ ++ public void handleTileEntityData(Packet132TileEntityData par1Packet132TileEntityData) ++ { ++ if (this.mc.theWorld.blockExists(par1Packet132TileEntityData.xPosition, par1Packet132TileEntityData.yPosition, par1Packet132TileEntityData.zPosition)) ++ { ++ TileEntity var2 = this.mc.theWorld.getBlockTileEntity(par1Packet132TileEntityData.xPosition, par1Packet132TileEntityData.yPosition, par1Packet132TileEntityData.zPosition); ++ ++ if (var2 != null) ++ { ++ if (par1Packet132TileEntityData.actionType == 1 && var2 instanceof TileEntityMobSpawner) ++ { ++ var2.readFromNBT(par1Packet132TileEntityData.data); ++ } ++ else if (par1Packet132TileEntityData.actionType == 2 && var2 instanceof TileEntityCommandBlock) ++ { ++ var2.readFromNBT(par1Packet132TileEntityData.data); ++ } ++ else if (par1Packet132TileEntityData.actionType == 3 && var2 instanceof TileEntityBeacon) ++ { ++ var2.readFromNBT(par1Packet132TileEntityData.data); ++ } ++ else if (par1Packet132TileEntityData.actionType == 4 && var2 instanceof TileEntitySkull) ++ { ++ var2.readFromNBT(par1Packet132TileEntityData.data); ++ } ++ } ++ } ++ } ++ ++ public void handleUpdateProgressbar(Packet105UpdateProgressbar par1Packet105UpdateProgressbar) ++ { ++ EntityClientPlayerMP var2 = this.mc.thePlayer; ++ this.unexpectedPacket(par1Packet105UpdateProgressbar); ++ ++ if (var2.openContainer != null && var2.openContainer.windowId == par1Packet105UpdateProgressbar.windowId) ++ { ++ var2.openContainer.updateProgressBar(par1Packet105UpdateProgressbar.progressBar, par1Packet105UpdateProgressbar.progressBarValue); ++ } ++ } ++ ++ public void handlePlayerInventory(Packet5PlayerInventory par1Packet5PlayerInventory) ++ { ++ Entity var2 = this.getEntityByID(par1Packet5PlayerInventory.entityID); ++ ++ if (var2 != null) ++ { ++ var2.setCurrentItemOrArmor(par1Packet5PlayerInventory.slot, par1Packet5PlayerInventory.getItemSlot()); ++ } ++ } ++ ++ public void handleCloseWindow(Packet101CloseWindow par1Packet101CloseWindow) ++ { ++ this.mc.thePlayer.func_92015_f(); ++ } ++ ++ public void handleBlockEvent(Packet54PlayNoteBlock par1Packet54PlayNoteBlock) ++ { ++ this.mc.theWorld.addBlockEvent(par1Packet54PlayNoteBlock.xLocation, par1Packet54PlayNoteBlock.yLocation, par1Packet54PlayNoteBlock.zLocation, par1Packet54PlayNoteBlock.blockId, par1Packet54PlayNoteBlock.instrumentType, par1Packet54PlayNoteBlock.pitch); ++ } ++ ++ public void handleBlockDestroy(Packet55BlockDestroy par1Packet55BlockDestroy) ++ { ++ this.mc.theWorld.destroyBlockInWorldPartially(par1Packet55BlockDestroy.getEntityId(), par1Packet55BlockDestroy.getPosX(), par1Packet55BlockDestroy.getPosY(), par1Packet55BlockDestroy.getPosZ(), par1Packet55BlockDestroy.getDestroyedStage()); ++ } ++ ++ public void handleMapChunks(Packet56MapChunks par1Packet56MapChunks) ++ { ++ for (int var2 = 0; var2 < par1Packet56MapChunks.getNumberOfChunkInPacket(); ++var2) ++ { ++ int var3 = par1Packet56MapChunks.getChunkPosX(var2); ++ int var4 = par1Packet56MapChunks.getChunkPosZ(var2); ++ this.worldClient.doPreChunk(var3, var4, true); ++ this.worldClient.invalidateBlockReceiveRegion(var3 << 4, 0, var4 << 4, (var3 << 4) + 15, 256, (var4 << 4) + 15); ++ Chunk var5 = this.worldClient.getChunkFromChunkCoords(var3, var4); ++ ++ if (var5 == null) ++ { ++ this.worldClient.doPreChunk(var3, var4, true); ++ var5 = this.worldClient.getChunkFromChunkCoords(var3, var4); ++ } ++ ++ if (var5 != null) ++ { ++ var5.fillChunk(par1Packet56MapChunks.getChunkCompressedData(var2), par1Packet56MapChunks.field_73590_a[var2], par1Packet56MapChunks.field_73588_b[var2], true); ++ this.worldClient.markBlockRangeForRenderUpdate(var3 << 4, 0, var4 << 4, (var3 << 4) + 15, 256, (var4 << 4) + 15); ++ ++ if (!(this.worldClient.provider instanceof WorldProviderSurface)) ++ { ++ var5.resetRelightChecks(); ++ } ++ } ++ } ++ } ++ ++ /** ++ * If this returns false, all packets will be queued for the main thread to handle, even if they would otherwise be ++ * processed asynchronously. Used to avoid processing packets on the client before the world has been downloaded ++ * (which happens on the main thread) ++ */ ++ public boolean canProcessPacketsAsync() ++ { ++ return this.mc != null && this.mc.theWorld != null && this.mc.thePlayer != null && this.worldClient != null; ++ } ++ ++ public void handleGameEvent(Packet70GameEvent par1Packet70GameEvent) ++ { ++ EntityClientPlayerMP var2 = this.mc.thePlayer; ++ int var3 = par1Packet70GameEvent.eventType; ++ int var4 = par1Packet70GameEvent.gameMode; ++ ++ if (var3 >= 0 && var3 < Packet70GameEvent.clientMessage.length && Packet70GameEvent.clientMessage[var3] != null) ++ { ++ var2.addChatMessage(Packet70GameEvent.clientMessage[var3]); ++ } ++ ++ if (var3 == 1) ++ { ++ this.worldClient.getWorldInfo().setRaining(true); ++ this.worldClient.setRainStrength(0.0F); ++ } ++ else if (var3 == 2) ++ { ++ this.worldClient.getWorldInfo().setRaining(false); ++ this.worldClient.setRainStrength(1.0F); ++ } ++ else if (var3 == 3) ++ { ++ this.mc.playerController.setGameType(EnumGameType.getByID(var4)); ++ } ++ else if (var3 == 4) ++ { ++ this.mc.displayGuiScreen(new GuiWinGame()); ++ } ++ else if (var3 == 5) ++ { ++ GameSettings var5 = this.mc.gameSettings; ++ ++ if (var4 == 0) ++ { ++ this.mc.displayGuiScreen(new GuiScreenDemo()); ++ } ++ else if (var4 == 101) ++ { ++ this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.movement", new Object[] {Keyboard.getKeyName(var5.keyBindForward.keyCode), Keyboard.getKeyName(var5.keyBindLeft.keyCode), Keyboard.getKeyName(var5.keyBindBack.keyCode), Keyboard.getKeyName(var5.keyBindRight.keyCode)}); ++ } ++ else if (var4 == 102) ++ { ++ this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.jump", new Object[] {Keyboard.getKeyName(var5.keyBindJump.keyCode)}); ++ } ++ else if (var4 == 103) ++ { ++ this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.inventory", new Object[] {Keyboard.getKeyName(var5.keyBindInventory.keyCode)}); ++ } ++ } ++ else if (var3 == 6) ++ { ++ this.worldClient.playSound(var2.posX, var2.posY + (double)var2.getEyeHeight(), var2.posZ, "random.successful_hit", 0.18F, 0.45F, false); ++ } ++ } ++ ++ /** ++ * Contains logic for handling packets containing arbitrary unique item data. Currently this is only for maps. ++ */ ++ public void handleMapData(Packet131MapData par1Packet131MapData) ++ { ++ if (par1Packet131MapData.itemID == Item.map.itemID) ++ { ++ ItemMap.getMPMapData(par1Packet131MapData.uniqueID, this.mc.theWorld).updateMPMapData(par1Packet131MapData.itemData); ++ } ++ else ++ { ++ this.mc.getLogAgent().logWarning("Unknown itemid: " + par1Packet131MapData.uniqueID); ++ } ++ } ++ ++ public void handleDoorChange(Packet61DoorChange par1Packet61DoorChange) ++ { ++ if (par1Packet61DoorChange.getRelativeVolumeDisabled()) ++ { ++ this.mc.theWorld.func_82739_e(par1Packet61DoorChange.sfxID, par1Packet61DoorChange.posX, par1Packet61DoorChange.posY, par1Packet61DoorChange.posZ, par1Packet61DoorChange.auxData); ++ } ++ else ++ { ++ this.mc.theWorld.playAuxSFX(par1Packet61DoorChange.sfxID, par1Packet61DoorChange.posX, par1Packet61DoorChange.posY, par1Packet61DoorChange.posZ, par1Packet61DoorChange.auxData); ++ } ++ } ++ ++ /** ++ * Increment player statistics ++ */ ++ public void handleStatistic(Packet200Statistic par1Packet200Statistic) ++ { ++ this.mc.thePlayer.incrementStat(StatList.getOneShotStat(par1Packet200Statistic.statisticId), par1Packet200Statistic.amount); ++ } ++ ++ /** ++ * Handle an entity effect packet. ++ */ ++ public void handleEntityEffect(Packet41EntityEffect par1Packet41EntityEffect) ++ { ++ Entity var2 = this.getEntityByID(par1Packet41EntityEffect.entityId); ++ ++ if (var2 instanceof EntityLivingBase) ++ { ++ PotionEffect var3 = new PotionEffect(par1Packet41EntityEffect.effectId, par1Packet41EntityEffect.duration, par1Packet41EntityEffect.effectAmplifier); ++ var3.setPotionDurationMax(par1Packet41EntityEffect.isDurationMax()); ++ ((EntityLivingBase)var2).addPotionEffect(var3); ++ } ++ } ++ ++ /** ++ * Handle a remove entity effect packet. ++ */ ++ public void handleRemoveEntityEffect(Packet42RemoveEntityEffect par1Packet42RemoveEntityEffect) ++ { ++ Entity var2 = this.getEntityByID(par1Packet42RemoveEntityEffect.entityId); ++ ++ if (var2 instanceof EntityLivingBase) ++ { ++ ((EntityLivingBase)var2).removePotionEffectClient(par1Packet42RemoveEntityEffect.effectId); ++ } ++ } ++ ++ /** ++ * determine if it is a server handler ++ */ ++ public boolean isServerHandler() ++ { ++ return false; ++ } ++ ++ /** ++ * Handle a player information packet. ++ */ ++ public void handlePlayerInfo(Packet201PlayerInfo par1Packet201PlayerInfo) ++ { ++ GuiPlayerInfo var2 = (GuiPlayerInfo)this.playerInfoMap.get(par1Packet201PlayerInfo.playerName); ++ ++ if (var2 == null && par1Packet201PlayerInfo.isConnected) ++ { ++ var2 = new GuiPlayerInfo(par1Packet201PlayerInfo.playerName); ++ this.playerInfoMap.put(par1Packet201PlayerInfo.playerName, var2); ++ this.playerInfoList.add(var2); ++ } ++ ++ if (var2 != null && !par1Packet201PlayerInfo.isConnected) ++ { ++ this.playerInfoMap.remove(par1Packet201PlayerInfo.playerName); ++ this.playerInfoList.remove(var2); ++ } ++ ++ if (par1Packet201PlayerInfo.isConnected && var2 != null) ++ { ++ var2.responseTime = par1Packet201PlayerInfo.ping; ++ } ++ } ++ ++ /** ++ * Handle a keep alive packet. ++ */ ++ public void handleKeepAlive(Packet0KeepAlive par1Packet0KeepAlive) ++ { ++ this.addToSendQueue(new Packet0KeepAlive(par1Packet0KeepAlive.randomId)); ++ } ++ ++ /** ++ * Handle a player abilities packet. ++ */ ++ public void handlePlayerAbilities(Packet202PlayerAbilities par1Packet202PlayerAbilities) ++ { ++ EntityClientPlayerMP var2 = this.mc.thePlayer; ++ var2.capabilities.isFlying = par1Packet202PlayerAbilities.getFlying(); ++ var2.capabilities.isCreativeMode = par1Packet202PlayerAbilities.isCreativeMode(); ++ var2.capabilities.disableDamage = par1Packet202PlayerAbilities.getDisableDamage(); ++ var2.capabilities.allowFlying = par1Packet202PlayerAbilities.getAllowFlying(); ++ var2.capabilities.setFlySpeed(par1Packet202PlayerAbilities.getFlySpeed()); ++ var2.capabilities.setPlayerWalkSpeed(par1Packet202PlayerAbilities.getWalkSpeed()); ++ } ++ ++ public void handleAutoComplete(Packet203AutoComplete par1Packet203AutoComplete) ++ { ++ String[] var2 = par1Packet203AutoComplete.getText().split("\u0000"); ++ ++ if (this.mc.currentScreen instanceof GuiChat) ++ { ++ GuiChat var3 = (GuiChat)this.mc.currentScreen; ++ var3.func_73894_a(var2); ++ } ++ } ++ ++ public void handleLevelSound(Packet62LevelSound par1Packet62LevelSound) ++ { ++ this.mc.theWorld.playSound(par1Packet62LevelSound.getEffectX(), par1Packet62LevelSound.getEffectY(), par1Packet62LevelSound.getEffectZ(), par1Packet62LevelSound.getSoundName(), par1Packet62LevelSound.getVolume(), par1Packet62LevelSound.getPitch(), false); ++ } ++ ++ public void handleCustomPayload(Packet250CustomPayload par1Packet250CustomPayload) ++ { ++ if ("MC|TrList".equals(par1Packet250CustomPayload.channel)) ++ { ++ DataInputStream var2 = new DataInputStream(new ByteArrayInputStream(par1Packet250CustomPayload.data)); ++ ++ try ++ { ++ int var3 = var2.readInt(); ++ GuiScreen var4 = this.mc.currentScreen; ++ ++ if (var4 != null && var4 instanceof GuiMerchant && var3 == this.mc.thePlayer.openContainer.windowId) ++ { ++ IMerchant var5 = ((GuiMerchant)var4).getIMerchant(); ++ MerchantRecipeList var6 = MerchantRecipeList.readRecipiesFromStream(var2); ++ var5.setRecipes(var6); ++ } ++ } ++ catch (IOException var7) ++ { ++ var7.printStackTrace(); ++ } ++ } ++ else if ("MC|Brand".equals(par1Packet250CustomPayload.channel)) ++ { ++ this.mc.thePlayer.func_142020_c(new String(par1Packet250CustomPayload.data, Charsets.UTF_8)); ++ } ++ } ++ ++ /** ++ * Handle a set objective packet. ++ */ ++ public void handleSetObjective(Packet206SetObjective par1Packet206SetObjective) ++ { ++ Scoreboard var2 = this.worldClient.getScoreboard(); ++ ScoreObjective var3; ++ ++ if (par1Packet206SetObjective.change == 0) ++ { ++ var3 = var2.func_96535_a(par1Packet206SetObjective.objectiveName, ScoreObjectiveCriteria.field_96641_b); ++ var3.setDisplayName(par1Packet206SetObjective.objectiveDisplayName); ++ } ++ else ++ { ++ var3 = var2.getObjective(par1Packet206SetObjective.objectiveName); ++ ++ if (par1Packet206SetObjective.change == 1) ++ { ++ var2.func_96519_k(var3); ++ } ++ else if (par1Packet206SetObjective.change == 2) ++ { ++ var3.setDisplayName(par1Packet206SetObjective.objectiveDisplayName); ++ } ++ } ++ } ++ ++ /** ++ * Handle a set score packet. ++ */ ++ public void handleSetScore(Packet207SetScore par1Packet207SetScore) ++ { ++ Scoreboard var2 = this.worldClient.getScoreboard(); ++ ScoreObjective var3 = var2.getObjective(par1Packet207SetScore.scoreName); ++ ++ if (par1Packet207SetScore.updateOrRemove == 0) ++ { ++ Score var4 = var2.func_96529_a(par1Packet207SetScore.itemName, var3); ++ var4.func_96647_c(par1Packet207SetScore.value); ++ } ++ else if (par1Packet207SetScore.updateOrRemove == 1) ++ { ++ var2.func_96515_c(par1Packet207SetScore.itemName); ++ } ++ } ++ ++ /** ++ * Handle a set display objective packet. ++ */ ++ public void handleSetDisplayObjective(Packet208SetDisplayObjective par1Packet208SetDisplayObjective) ++ { ++ Scoreboard var2 = this.worldClient.getScoreboard(); ++ ++ if (par1Packet208SetDisplayObjective.scoreName.length() == 0) ++ { ++ var2.func_96530_a(par1Packet208SetDisplayObjective.scoreboardPosition, (ScoreObjective)null); ++ } ++ else ++ { ++ ScoreObjective var3 = var2.getObjective(par1Packet208SetDisplayObjective.scoreName); ++ var2.func_96530_a(par1Packet208SetDisplayObjective.scoreboardPosition, var3); ++ } ++ } ++ ++ /** ++ * Handle a set player team packet. ++ */ ++ public void handleSetPlayerTeam(Packet209SetPlayerTeam par1Packet209SetPlayerTeam) ++ { ++ Scoreboard var2 = this.worldClient.getScoreboard(); ++ ScorePlayerTeam var3; ++ ++ if (par1Packet209SetPlayerTeam.mode == 0) ++ { ++ var3 = var2.func_96527_f(par1Packet209SetPlayerTeam.teamName); ++ } ++ else ++ { ++ var3 = var2.func_96508_e(par1Packet209SetPlayerTeam.teamName); ++ } ++ ++ if (par1Packet209SetPlayerTeam.mode == 0 || par1Packet209SetPlayerTeam.mode == 2) ++ { ++ var3.func_96664_a(par1Packet209SetPlayerTeam.teamDisplayName); ++ var3.func_96666_b(par1Packet209SetPlayerTeam.teamPrefix); ++ var3.func_96662_c(par1Packet209SetPlayerTeam.teamSuffix); ++ var3.func_98298_a(par1Packet209SetPlayerTeam.friendlyFire); ++ } ++ ++ Iterator var4; ++ String var5; ++ ++ if (par1Packet209SetPlayerTeam.mode == 0 || par1Packet209SetPlayerTeam.mode == 3) ++ { ++ var4 = par1Packet209SetPlayerTeam.playerNames.iterator(); ++ ++ while (var4.hasNext()) ++ { ++ var5 = (String)var4.next(); ++ var2.func_96521_a(var5, var3); ++ } ++ } ++ ++ if (par1Packet209SetPlayerTeam.mode == 4) ++ { ++ var4 = par1Packet209SetPlayerTeam.playerNames.iterator(); ++ ++ while (var4.hasNext()) ++ { ++ var5 = (String)var4.next(); ++ var2.removePlayerFromTeam(var5, var3); ++ } ++ } ++ ++ if (par1Packet209SetPlayerTeam.mode == 1) ++ { ++ var2.func_96511_d(var3); ++ } ++ } ++ ++ /** ++ * Handle a world particles packet. ++ */ ++ public void handleWorldParticles(Packet63WorldParticles par1Packet63WorldParticles) ++ { ++ for (int var2 = 0; var2 < par1Packet63WorldParticles.getQuantity(); ++var2) ++ { ++ double var3 = this.rand.nextGaussian() * (double)par1Packet63WorldParticles.getOffsetX(); ++ double var5 = this.rand.nextGaussian() * (double)par1Packet63WorldParticles.getOffsetY(); ++ double var7 = this.rand.nextGaussian() * (double)par1Packet63WorldParticles.getOffsetZ(); ++ double var9 = this.rand.nextGaussian() * (double)par1Packet63WorldParticles.getSpeed(); ++ double var11 = this.rand.nextGaussian() * (double)par1Packet63WorldParticles.getSpeed(); ++ double var13 = this.rand.nextGaussian() * (double)par1Packet63WorldParticles.getSpeed(); ++ this.worldClient.spawnParticle(par1Packet63WorldParticles.getParticleName(), par1Packet63WorldParticles.getPositionX() + var3, par1Packet63WorldParticles.getPositionY() + var5, par1Packet63WorldParticles.getPositionZ() + var7, var9, var11, var13); ++ } ++ } ++ ++ public void func_110773_a(Packet44UpdateAttributes par1Packet44UpdateAttributes) ++ { ++ Entity var2 = this.getEntityByID(par1Packet44UpdateAttributes.func_111002_d()); ++ ++ if (var2 != null) ++ { ++ if (!(var2 instanceof EntityLivingBase)) ++ { ++ throw new IllegalStateException("Server tried to update attributes of a non-living entity (actually: " + var2 + ")"); ++ } ++ else ++ { ++ BaseAttributeMap var3 = ((EntityLivingBase)var2).getAttributeMap(); ++ Iterator var4 = par1Packet44UpdateAttributes.func_111003_f().iterator(); ++ ++ while (var4.hasNext()) ++ { ++ Packet44UpdateAttributesSnapshot var5 = (Packet44UpdateAttributesSnapshot)var4.next(); ++ AttributeInstance var6 = var3.getAttributeInstanceByName(var5.func_142040_a()); ++ ++ if (var6 == null) ++ { ++ var6 = var3.func_111150_b(new RangedAttribute(var5.func_142040_a(), 0.0D, 2.2250738585072014E-308D, Double.MAX_VALUE)); ++ } ++ ++ var6.setAttribute(var5.func_142041_b()); ++ var6.func_142049_d(); ++ Iterator var7 = var5.func_142039_c().iterator(); ++ ++ while (var7.hasNext()) ++ { ++ AttributeModifier var8 = (AttributeModifier)var7.next(); ++ var6.applyModifier(var8); ++ } ++ } ++ } ++ } ++ } ++ ++ /** ++ * Return the NetworkManager instance used by this NetClientHandler ++ */ ++ public INetworkManager getNetManager() ++ { ++ return this.netManager; ++ } ++ } +*** NetHandler.java Sat Feb 5 04:13:14 2022 +--- NetHandler.java Sat Feb 5 04:12:36 2022 +*************** +*** 11,22 **** + * Handle Packet51MapChunk (full chunk update of blocks, metadata, light levels, and optionally biome data) + */ + public void handleMapChunk(Packet51MapChunk par1Packet51MapChunk) {} + + /** +! * Default handler called for packets that don't have their own handlers in NetServerHandler; kicks player from the +! * server. + */ + public void unexpectedPacket(Packet par1Packet) {} + + public void handleErrorMessage(String par1Str, Object[] par2ArrayOfObj) {} + +--- 11,22 ---- + * Handle Packet51MapChunk (full chunk update of blocks, metadata, light levels, and optionally biome data) + */ + public void handleMapChunk(Packet51MapChunk par1Packet51MapChunk) {} + + /** +! * Default handler called for packets that don't have their own handlers in NetClientHandler; currentlly does +! * nothing. + */ + public void unexpectedPacket(Packet par1Packet) {} + + public void handleErrorMessage(String par1Str, Object[] par2ArrayOfObj) {} + +*************** +*** 256,266 **** + { + this.unexpectedPacket(par1Packet54PlayNoteBlock); + } + + /** +! * runs registerPacket on the given Packet200Statistic + */ + public void handleStatistic(Packet200Statistic par1Packet200Statistic) + { + this.unexpectedPacket(par1Packet200Statistic); + } +--- 256,266 ---- + { + this.unexpectedPacket(par1Packet54PlayNoteBlock); + } + + /** +! * Increment player statistics + */ + public void handleStatistic(Packet200Statistic par1Packet200Statistic) + { + this.unexpectedPacket(par1Packet200Statistic); + } +*** NetLoginHandler.java Sat Feb 5 04:13:14 2022 +--- NetLoginHandler.java Sat Feb 5 04:12:36 2022 +*************** +*** 22,40 **** + private byte[] verifyToken; + + /** Reference to the MinecraftServer object. */ + private final MinecraftServer mcServer; + public final TcpConnection myTCPConnection; +! +! /** +! * Returns if the login handler is finished and can be removed. It is set to true on either error or successful +! * login. +! */ +! public boolean finishedProcessing; +! +! /** While waiting to login, if this field ++'s to 600 it will kick you. */ +! private int loginTimer; + private String clientUsername; + private volatile boolean field_72544_i; + + /** server ID that is randomly generated by this login handler. */ + private String loginServerId = ""; +--- 22,33 ---- + private byte[] verifyToken; + + /** Reference to the MinecraftServer object. */ + private final MinecraftServer mcServer; + public final TcpConnection myTCPConnection; +! public boolean connectionComplete; +! private int connectionTimer; + private String clientUsername; + private volatile boolean field_72544_i; + + /** server ID that is randomly generated by this login handler. */ + private String loginServerId = ""; +*************** +*** 59,89 **** + if (this.field_72544_i) + { + this.initializePlayerConnection(); + } + +! if (this.loginTimer++ == 600) + { +! this.kickUser("Took too long to log in"); + } + else + { + this.myTCPConnection.processReadPackets(); + } + } + +! /** +! * Disconnects the user with the given reason. +! */ +! public void kickUser(String par1Str) + { + try + { + this.mcServer.getLogAgent().logInfo("Disconnecting " + this.getUsernameAndAddress() + ": " + par1Str); + this.myTCPConnection.addToSendQueue(new Packet255KickDisconnect(par1Str)); + this.myTCPConnection.serverShutdown(); +! this.finishedProcessing = true; + } + catch (Exception var3) + { + var3.printStackTrace(); + } +--- 52,79 ---- + if (this.field_72544_i) + { + this.initializePlayerConnection(); + } + +! if (this.connectionTimer++ == 600) + { +! this.raiseErrorAndDisconnect("Took too long to log in"); + } + else + { + this.myTCPConnection.processReadPackets(); + } + } + +! public void raiseErrorAndDisconnect(String par1Str) + { + try + { + this.mcServer.getLogAgent().logInfo("Disconnecting " + this.getUsernameAndAddress() + ": " + par1Str); + this.myTCPConnection.addToSendQueue(new Packet255KickDisconnect(par1Str)); + this.myTCPConnection.serverShutdown(); +! this.connectionComplete = true; + } + catch (Exception var3) + { + var3.printStackTrace(); + } +*************** +*** 91,123 **** + + public void handleClientProtocol(Packet2ClientProtocol par1Packet2ClientProtocol) + { + if (this.clientUsername != null) + { +! this.kickUser("Quit repeating yourself!"); + } + else + { + this.clientUsername = par1Packet2ClientProtocol.getUsername(); + + if (!this.clientUsername.equals(StringUtils.stripControlCodes(this.clientUsername))) + { +! this.kickUser("Invalid username!"); + } + else + { + PublicKey var2 = this.mcServer.getKeyPair().getPublic(); + + if (par1Packet2ClientProtocol.getProtocolVersion() != 78) + { + if (par1Packet2ClientProtocol.getProtocolVersion() > 78) + { +! this.kickUser("Outdated server!"); + } + else + { +! this.kickUser("Outdated client!"); + } + } + else + { + this.loginServerId = this.mcServer.isServerInOnlineMode() ? Long.toString(rand.nextLong(), 16) : "-"; +--- 81,113 ---- + + public void handleClientProtocol(Packet2ClientProtocol par1Packet2ClientProtocol) + { + if (this.clientUsername != null) + { +! this.raiseErrorAndDisconnect("Quit repeating yourself!"); + } + else + { + this.clientUsername = par1Packet2ClientProtocol.getUsername(); + + if (!this.clientUsername.equals(StringUtils.stripControlCodes(this.clientUsername))) + { +! this.raiseErrorAndDisconnect("Invalid username!"); + } + else + { + PublicKey var2 = this.mcServer.getKeyPair().getPublic(); + + if (par1Packet2ClientProtocol.getProtocolVersion() != 78) + { + if (par1Packet2ClientProtocol.getProtocolVersion() > 78) + { +! this.raiseErrorAndDisconnect("Outdated server!"); + } + else + { +! this.raiseErrorAndDisconnect("Outdated client!"); + } + } + else + { + this.loginServerId = this.mcServer.isServerInOnlineMode() ? Long.toString(rand.nextLong(), 16) : "-"; +*************** +*** 134,144 **** + PrivateKey var2 = this.mcServer.getKeyPair().getPrivate(); + this.sharedKey = par1Packet252SharedKey.getSharedKey(var2); + + if (!Arrays.equals(this.verifyToken, par1Packet252SharedKey.getVerifyToken(var2))) + { +! this.kickUser("Invalid client reply"); + } + + this.myTCPConnection.addToSendQueue(new Packet252SharedKey()); + } + +--- 124,134 ---- + PrivateKey var2 = this.mcServer.getKeyPair().getPrivate(); + this.sharedKey = par1Packet252SharedKey.getSharedKey(var2); + + if (!Arrays.equals(this.verifyToken, par1Packet252SharedKey.getVerifyToken(var2))) + { +! this.raiseErrorAndDisconnect("Invalid client reply"); + } + + this.myTCPConnection.addToSendQueue(new Packet252SharedKey()); + } + +*************** +*** 146,156 **** + { + if (par1Packet205ClientCommand.forceRespawn == 0) + { + if (this.field_92079_k) + { +! this.kickUser("Duplicate login"); + return; + } + + this.field_92079_k = true; + +--- 136,146 ---- + { + if (par1Packet205ClientCommand.forceRespawn == 0) + { + if (this.field_92079_k) + { +! this.raiseErrorAndDisconnect("Duplicate login"); + return; + } + + this.field_92079_k = true; + +*************** +*** 170,184 **** + /** + * on success the specified username is connected to the minecraftInstance, otherwise they are packet255'd + */ + public void initializePlayerConnection() + { +! String var1 = this.mcServer.getConfigurationManager().allowUserToConnect(this.myTCPConnection.getRemoteAddress(), this.clientUsername); + + if (var1 != null) + { +! this.kickUser(var1); + } + else + { + EntityPlayerMP var2 = this.mcServer.getConfigurationManager().createPlayerForUser(this.clientUsername); + +--- 160,174 ---- + /** + * on success the specified username is connected to the minecraftInstance, otherwise they are packet255'd + */ + public void initializePlayerConnection() + { +! String var1 = this.mcServer.getConfigurationManager().allowUserToConnect(this.myTCPConnection.getSocketAddress(), this.clientUsername); + + if (var1 != null) + { +! this.raiseErrorAndDisconnect(var1); + } + else + { + EntityPlayerMP var2 = this.mcServer.getConfigurationManager().createPlayerForUser(this.clientUsername); + +*************** +*** 186,202 **** + { + this.mcServer.getConfigurationManager().initializeConnectionToPlayer(this.myTCPConnection, var2); + } + } + +! this.finishedProcessing = true; + } + + public void handleErrorMessage(String par1Str, Object[] par2ArrayOfObj) + { + this.mcServer.getLogAgent().logInfo(this.getUsernameAndAddress() + " lost connection"); +! this.finishedProcessing = true; + } + + /** + * Handle a server ping packet. + */ +--- 176,192 ---- + { + this.mcServer.getConfigurationManager().initializeConnectionToPlayer(this.myTCPConnection, var2); + } + } + +! this.connectionComplete = true; + } + + public void handleErrorMessage(String par1Str, Object[] par2ArrayOfObj) + { + this.mcServer.getLogAgent().logInfo(this.getUsernameAndAddress() + " lost connection"); +! this.connectionComplete = true; + } + + /** + * Handle a server ping packet. + */ +*************** +*** 244,273 **** + if (var8 != null && this.mcServer.getNetworkThread() instanceof DedicatedServerListenThread) + { + ((DedicatedServerListenThread)this.mcServer.getNetworkThread()).func_71761_a(var8); + } + +! this.finishedProcessing = true; + } + catch (Exception var7) + { + var7.printStackTrace(); + } + } + + /** +! * Default handler called for packets that don't have their own handlers in NetServerHandler; kicks player from the +! * server. + */ + public void unexpectedPacket(Packet par1Packet) + { +! this.kickUser("Protocol error"); + } + + public String getUsernameAndAddress() + { +! return this.clientUsername != null ? this.clientUsername + " [" + this.myTCPConnection.getRemoteAddress().toString() + "]" : this.myTCPConnection.getRemoteAddress().toString(); + } + + /** + * determine if it is a server handler + */ +--- 234,263 ---- + if (var8 != null && this.mcServer.getNetworkThread() instanceof DedicatedServerListenThread) + { + ((DedicatedServerListenThread)this.mcServer.getNetworkThread()).func_71761_a(var8); + } + +! this.connectionComplete = true; + } + catch (Exception var7) + { + var7.printStackTrace(); + } + } + + /** +! * Default handler called for packets that don't have their own handlers in NetClientHandler; currentlly does +! * nothing. + */ + public void unexpectedPacket(Packet par1Packet) + { +! this.raiseErrorAndDisconnect("Protocol error"); + } + + public String getUsernameAndAddress() + { +! return this.clientUsername != null ? this.clientUsername + " [" + this.myTCPConnection.getSocketAddress().toString() + "]" : this.myTCPConnection.getSocketAddress().toString(); + } + + /** + * determine if it is a server handler + */ +*************** +*** 276,286 **** + return true; + } + + public boolean isConnectionClosed() + { +! return this.finishedProcessing; + } + + /** + * Returns the server Id randomly generated by this login handler. + */ +--- 266,276 ---- + return true; + } + + public boolean isConnectionClosed() + { +! return this.connectionComplete; + } + + /** + * Returns the server Id randomly generated by this login handler. + */ +*** NetServerHandler.java Sat Feb 5 04:13:14 2022 +--- NetServerHandler.java Sat Feb 5 04:12:36 2022 +*************** +*** 23,40 **** + public EntityPlayerMP playerEntity; + + /** incremented each tick */ + private int currentTicks; + +! /** holds the amount of tick the player is floating */ +! private int playerInAirTime; + private boolean field_72584_h; + private int keepAliveRandomID; + private long keepAliveTimeSent; +! +! /** The Java Random object. */ +! private static Random rndmObj = new Random(); + private long ticksOfLastKeepAlive; + private int chatSpamThresholdCount; + private int creativeItemCreationSpamThresholdTally; + + /** The last known x position for this connection. */ +--- 23,40 ---- + public EntityPlayerMP playerEntity; + + /** incremented each tick */ + private int currentTicks; + +! /** +! * player is kicked if they float for over 80 ticks without flying enabled +! */ +! private int ticksForFloatKick; + private boolean field_72584_h; + private int keepAliveRandomID; + private long keepAliveTimeSent; +! private static Random randomGenerator = new Random(); + private long ticksOfLastKeepAlive; + private int chatSpamThresholdCount; + private int creativeItemCreationSpamThresholdTally; + + /** The last known x position for this connection. */ +*************** +*** 58,70 **** + this.playerEntity = par3EntityPlayerMP; + par3EntityPlayerMP.playerNetServerHandler = this; + } + + /** +! * handle all the packets for the connection + */ +! public void handlePackets() + { + this.field_72584_h = false; + ++this.currentTicks; + this.mcServer.theProfiler.startSection("packetflow"); + this.netManager.processReadPackets(); +--- 58,70 ---- + this.playerEntity = par3EntityPlayerMP; + par3EntityPlayerMP.playerNetServerHandler = this; + } + + /** +! * run once each game tick + */ +! public void networkTick() + { + this.field_72584_h = false; + ++this.currentTicks; + this.mcServer.theProfiler.startSection("packetflow"); + this.netManager.processReadPackets(); +*************** +*** 72,83 **** + + if ((long)this.currentTicks - this.ticksOfLastKeepAlive > 20L) + { + this.ticksOfLastKeepAlive = (long)this.currentTicks; + this.keepAliveTimeSent = System.nanoTime() / 1000000L; +! this.keepAliveRandomID = rndmObj.nextInt(); +! this.sendPacket(new Packet0KeepAlive(this.keepAliveRandomID)); + } + + if (this.chatSpamThresholdCount > 0) + { + --this.chatSpamThresholdCount; +--- 72,83 ---- + + if ((long)this.currentTicks - this.ticksOfLastKeepAlive > 20L) + { + this.ticksOfLastKeepAlive = (long)this.currentTicks; + this.keepAliveTimeSent = System.nanoTime() / 1000000L; +! this.keepAliveRandomID = randomGenerator.nextInt(); +! this.sendPacketToPlayer(new Packet0KeepAlive(this.keepAliveRandomID)); + } + + if (this.chatSpamThresholdCount > 0) + { + --this.chatSpamThresholdCount; +*************** +*** 90,108 **** + + this.mcServer.theProfiler.endStartSection("playerTick"); + this.mcServer.theProfiler.endSection(); + } + +! /** +! * Kick the offending player and give a reason why +! */ +! public void kickPlayer(String par1Str) + { + if (!this.connectionClosed) + { + this.playerEntity.mountEntityAndWakeUp(); +! this.sendPacket(new Packet255KickDisconnect(par1Str)); + this.netManager.serverShutdown(); + this.mcServer.getConfigurationManager().sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("multiplayer.player.left", new Object[] {this.playerEntity.getTranslatedEntityName()}).setColor(EnumChatFormatting.YELLOW)); + this.mcServer.getConfigurationManager().playerLoggedOut(this.playerEntity); + this.connectionClosed = true; + } +--- 90,105 ---- + + this.mcServer.theProfiler.endStartSection("playerTick"); + this.mcServer.theProfiler.endSection(); + } + +! public void kickPlayerFromServer(String par1Str) + { + if (!this.connectionClosed) + { + this.playerEntity.mountEntityAndWakeUp(); +! this.sendPacketToPlayer(new Packet255KickDisconnect(par1Str)); + this.netManager.serverShutdown(); + this.mcServer.getConfigurationManager().sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("multiplayer.player.left", new Object[] {this.playerEntity.getTranslatedEntityName()}).setColor(EnumChatFormatting.YELLOW)); + this.mcServer.getConfigurationManager().playerLoggedOut(this.playerEntity); + this.connectionClosed = true; + } +*************** +*** 208,225 **** + var9 = par1Packet10Flying.zPosition; + var13 = par1Packet10Flying.stance - par1Packet10Flying.yPosition; + + if (!this.playerEntity.isPlayerSleeping() && (var13 > 1.65D || var13 < 0.1D)) + { +! this.kickPlayer("Illegal stance"); + this.mcServer.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " had an illegal stance: " + var13); + return; + } + + if (Math.abs(par1Packet10Flying.xPosition) > 3.2E7D || Math.abs(par1Packet10Flying.zPosition) > 3.2E7D) + { +! this.kickPlayer("Illegal position"); + return; + } + } + + if (par1Packet10Flying.rotating) +--- 205,222 ---- + var9 = par1Packet10Flying.zPosition; + var13 = par1Packet10Flying.stance - par1Packet10Flying.yPosition; + + if (!this.playerEntity.isPlayerSleeping() && (var13 > 1.65D || var13 < 0.1D)) + { +! this.kickPlayerFromServer("Illegal stance"); + this.mcServer.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " had an illegal stance: " + var13); + return; + } + + if (Math.abs(par1Packet10Flying.xPosition) > 3.2E7D || Math.abs(par1Packet10Flying.zPosition) > 3.2E7D) + { +! this.kickPlayerFromServer("Illegal position"); + return; + } + } + + if (par1Packet10Flying.rotating) +*************** +*** 295,322 **** + + if (!this.mcServer.isFlightAllowed() && !this.playerEntity.theItemInWorldManager.isCreative() && !var2.checkBlockCollision(var33)) + { + if (var29 >= -0.03125D) + { +! ++this.playerInAirTime; + +! if (this.playerInAirTime > 80) + { + this.mcServer.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " was kicked for floating too long!"); +! this.kickPlayer("Flying is not enabled on this server"); + return; + } + } + } + else + { +! this.playerInAirTime = 0; + } + + this.playerEntity.onGround = par1Packet10Flying.onGround; + this.mcServer.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); +! this.playerEntity.handleFalling(this.playerEntity.posY - var3, par1Packet10Flying.onGround); + } + else if (this.currentTicks % 20 == 0) + { + this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, this.playerEntity.rotationYaw, this.playerEntity.rotationPitch); + } +--- 292,319 ---- + + if (!this.mcServer.isFlightAllowed() && !this.playerEntity.theItemInWorldManager.isCreative() && !var2.checkBlockCollision(var33)) + { + if (var29 >= -0.03125D) + { +! ++this.ticksForFloatKick; + +! if (this.ticksForFloatKick > 80) + { + this.mcServer.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " was kicked for floating too long!"); +! this.kickPlayerFromServer("Flying is not enabled on this server"); + return; + } + } + } + else + { +! this.ticksForFloatKick = 0; + } + + this.playerEntity.onGround = par1Packet10Flying.onGround; + this.mcServer.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); +! this.playerEntity.updateFlyingState(this.playerEntity.posY - var3, par1Packet10Flying.onGround); + } + else if (this.currentTicks % 20 == 0) + { + this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, this.playerEntity.rotationYaw, this.playerEntity.rotationPitch); + } +*************** +*** 331,341 **** + this.hasMoved = false; + this.lastPosX = par1; + this.lastPosY = par3; + this.lastPosZ = par5; + this.playerEntity.setPositionAndRotation(par1, par3, par5, par7, par8); +! this.playerEntity.playerNetServerHandler.sendPacket(new Packet13PlayerLookMove(par1, par3 + 1.6200000047683716D, par3, par5, par7, par8, false)); + } + + public void handleBlockDig(Packet14BlockDig par1Packet14BlockDig) + { + WorldServer var2 = this.mcServer.worldServerForDimension(this.playerEntity.dimension); +--- 328,338 ---- + this.hasMoved = false; + this.lastPosX = par1; + this.lastPosY = par3; + this.lastPosZ = par5; + this.playerEntity.setPositionAndRotation(par1, par3, par5, par7, par8); +! this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet13PlayerLookMove(par1, par3 + 1.6200000047683716D, par3, par5, par7, par8, false)); + } + + public void handleBlockDig(Packet14BlockDig par1Packet14BlockDig) + { + WorldServer var2 = this.mcServer.worldServerForDimension(this.playerEntity.dimension); +*************** +*** 400,428 **** + { + this.playerEntity.theItemInWorldManager.onBlockClicked(var4, var5, var6, par1Packet14BlockDig.face); + } + else + { +! this.playerEntity.playerNetServerHandler.sendPacket(new Packet53BlockChange(var4, var5, var6, var2)); + } + } + else if (par1Packet14BlockDig.status == 2) + { +! this.playerEntity.theItemInWorldManager.blockRemoving(var4, var5, var6); + + if (var2.getBlockId(var4, var5, var6) != 0) + { +! this.playerEntity.playerNetServerHandler.sendPacket(new Packet53BlockChange(var4, var5, var6, var2)); + } + } + else if (par1Packet14BlockDig.status == 1) + { + this.playerEntity.theItemInWorldManager.cancelDestroyingBlock(var4, var5, var6); + + if (var2.getBlockId(var4, var5, var6) != 0) + { +! this.playerEntity.playerNetServerHandler.sendPacket(new Packet53BlockChange(var4, var5, var6, var2)); + } + } + } + } + +--- 397,425 ---- + { + this.playerEntity.theItemInWorldManager.onBlockClicked(var4, var5, var6, par1Packet14BlockDig.face); + } + else + { +! this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(var4, var5, var6, var2)); + } + } + else if (par1Packet14BlockDig.status == 2) + { +! this.playerEntity.theItemInWorldManager.uncheckedTryHarvestBlock(var4, var5, var6); + + if (var2.getBlockId(var4, var5, var6) != 0) + { +! this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(var4, var5, var6, var2)); + } + } + else if (par1Packet14BlockDig.status == 1) + { + this.playerEntity.theItemInWorldManager.cancelDestroyingBlock(var4, var5, var6); + + if (var2.getBlockId(var4, var5, var6) != 0) + { +! this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(var4, var5, var6, var2)); + } + } + } + } + +*************** +*** 446,456 **** + + this.playerEntity.theItemInWorldManager.tryUseItem(this.playerEntity, var2, var3); + } + else if (par1Packet15Place.getYPosition() >= this.mcServer.getBuildLimit() - 1 && (par1Packet15Place.getDirection() == 1 || par1Packet15Place.getYPosition() >= this.mcServer.getBuildLimit())) + { +! this.playerEntity.playerNetServerHandler.sendPacket(new Packet3Chat(ChatMessageComponent.createFromTranslationWithSubstitutions("build.tooHigh", new Object[] {Integer.valueOf(this.mcServer.getBuildLimit())}).setColor(EnumChatFormatting.RED))); + var4 = true; + } + else + { + if (this.hasMoved && this.playerEntity.getDistanceSq((double)var5 + 0.5D, (double)var6 + 0.5D, (double)var7 + 0.5D) < 64.0D && !this.mcServer.isBlockProtected(var2, var5, var6, var7, this.playerEntity)) +--- 443,453 ---- + + this.playerEntity.theItemInWorldManager.tryUseItem(this.playerEntity, var2, var3); + } + else if (par1Packet15Place.getYPosition() >= this.mcServer.getBuildLimit() - 1 && (par1Packet15Place.getDirection() == 1 || par1Packet15Place.getYPosition() >= this.mcServer.getBuildLimit())) + { +! this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet3Chat(ChatMessageComponent.createFromTranslationWithSubstitutions("build.tooHigh", new Object[] {Integer.valueOf(this.mcServer.getBuildLimit())}).setColor(EnumChatFormatting.RED))); + var4 = true; + } + else + { + if (this.hasMoved && this.playerEntity.getDistanceSq((double)var5 + 0.5D, (double)var6 + 0.5D, (double)var7 + 0.5D) < 64.0D && !this.mcServer.isBlockProtected(var2, var5, var6, var7, this.playerEntity)) +*************** +*** 461,471 **** + var4 = true; + } + + if (var4) + { +! this.playerEntity.playerNetServerHandler.sendPacket(new Packet53BlockChange(var5, var6, var7, var2)); + + if (var8 == 0) + { + --var6; + } +--- 458,468 ---- + var4 = true; + } + + if (var4) + { +! this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(var5, var6, var7, var2)); + + if (var8 == 0) + { + --var6; + } +*************** +*** 493,503 **** + if (var8 == 5) + { + ++var5; + } + +! this.playerEntity.playerNetServerHandler.sendPacket(new Packet53BlockChange(var5, var6, var7, var2)); + } + + var3 = this.playerEntity.inventory.getCurrentItem(); + + if (var3 != null && var3.stackSize == 0) +--- 490,500 ---- + if (var8 == 5) + { + ++var5; + } + +! this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(var5, var6, var7, var2)); + } + + var3 = this.playerEntity.inventory.getCurrentItem(); + + if (var3 != null && var3.stackSize == 0) +*************** +*** 506,524 **** + var3 = null; + } + + if (var3 == null || var3.getMaxItemUseDuration() == 0) + { +! this.playerEntity.isChangingQuantityOnly = true; + this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem] = ItemStack.copyItemStack(this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem]); + Slot var9 = this.playerEntity.openContainer.getSlotFromInventory(this.playerEntity.inventory, this.playerEntity.inventory.currentItem); + this.playerEntity.openContainer.detectAndSendChanges(); +! this.playerEntity.isChangingQuantityOnly = false; + + if (!ItemStack.areItemStacksEqual(this.playerEntity.inventory.getCurrentItem(), par1Packet15Place.getItemStack())) + { +! this.sendPacket(new Packet103SetSlot(this.playerEntity.openContainer.windowId, var9.slotNumber, this.playerEntity.inventory.getCurrentItem())); + } + } + } + + public void handleErrorMessage(String par1Str, Object[] par2ArrayOfObj) +--- 503,521 ---- + var3 = null; + } + + if (var3 == null || var3.getMaxItemUseDuration() == 0) + { +! this.playerEntity.playerInventoryBeingManipulated = true; + this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem] = ItemStack.copyItemStack(this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem]); + Slot var9 = this.playerEntity.openContainer.getSlotFromInventory(this.playerEntity.inventory, this.playerEntity.inventory.currentItem); + this.playerEntity.openContainer.detectAndSendChanges(); +! this.playerEntity.playerInventoryBeingManipulated = false; + + if (!ItemStack.areItemStacksEqual(this.playerEntity.inventory.getCurrentItem(), par1Packet15Place.getItemStack())) + { +! this.sendPacketToPlayer(new Packet103SetSlot(this.playerEntity.openContainer.windowId, var9.slotNumber, this.playerEntity.inventory.getCurrentItem())); + } + } + } + + public void handleErrorMessage(String par1Str, Object[] par2ArrayOfObj) +*************** +*** 534,556 **** + this.mcServer.initiateShutdown(); + } + } + + /** +! * Default handler called for packets that don't have their own handlers in NetServerHandler; kicks player from the +! * server. + */ + public void unexpectedPacket(Packet par1Packet) + { + this.mcServer.getLogAgent().logWarning(this.getClass() + " wasn\'t prepared to deal with a " + par1Packet.getClass()); +! this.kickPlayer("Protocol error, unexpected packet"); + } + + /** +! * Adds the packet to the underlying network manager's send queue. + */ +! public void sendPacket(Packet par1Packet) + { + if (par1Packet instanceof Packet3Chat) + { + Packet3Chat var2 = (Packet3Chat)par1Packet; + int var3 = this.playerEntity.getChatVisibility(); +--- 531,553 ---- + this.mcServer.initiateShutdown(); + } + } + + /** +! * Default handler called for packets that don't have their own handlers in NetClientHandler; currentlly does +! * nothing. + */ + public void unexpectedPacket(Packet par1Packet) + { + this.mcServer.getLogAgent().logWarning(this.getClass() + " wasn\'t prepared to deal with a " + par1Packet.getClass()); +! this.kickPlayerFromServer("Protocol error, unexpected packet"); + } + + /** +! * addToSendQueue. if it is a chat packet, check before sending it + */ +! public void sendPacketToPlayer(Packet par1Packet) + { + if (par1Packet instanceof Packet3Chat) + { + Packet3Chat var2 = (Packet3Chat)par1Packet; + int var3 = this.playerEntity.getChatVisibility(); +*************** +*** 595,624 **** + + public void handleChat(Packet3Chat par1Packet3Chat) + { + if (this.playerEntity.getChatVisibility() == 2) + { +! this.sendPacket(new Packet3Chat(ChatMessageComponent.createFromTranslationKey("chat.cannotSend").setColor(EnumChatFormatting.RED))); + } + else + { + this.playerEntity.func_143004_u(); + String var2 = par1Packet3Chat.message; + + if (var2.length() > 100) + { +! this.kickPlayer("Chat message too long"); + } + else + { + var2 = org.apache.commons.lang3.StringUtils.normalizeSpace(var2); + + for (int var3 = 0; var3 < var2.length(); ++var3) + { + if (!ChatAllowedCharacters.isAllowedCharacter(var2.charAt(var3))) + { +! this.kickPlayer("Illegal characters in chat"); + return; + } + } + + if (var2.startsWith("/")) +--- 592,621 ---- + + public void handleChat(Packet3Chat par1Packet3Chat) + { + if (this.playerEntity.getChatVisibility() == 2) + { +! this.sendPacketToPlayer(new Packet3Chat(ChatMessageComponent.createFromTranslationKey("chat.cannotSend").setColor(EnumChatFormatting.RED))); + } + else + { + this.playerEntity.func_143004_u(); + String var2 = par1Packet3Chat.message; + + if (var2.length() > 100) + { +! this.kickPlayerFromServer("Chat message too long"); + } + else + { + var2 = org.apache.commons.lang3.StringUtils.normalizeSpace(var2); + + for (int var3 = 0; var3 < var2.length(); ++var3) + { + if (!ChatAllowedCharacters.isAllowedCharacter(var2.charAt(var3))) + { +! this.kickPlayerFromServer("Illegal characters in chat"); + return; + } + } + + if (var2.startsWith("/")) +*************** +*** 627,637 **** + } + else + { + if (this.playerEntity.getChatVisibility() == 1) + { +! this.sendPacket(new Packet3Chat(ChatMessageComponent.createFromTranslationKey("chat.cannotSend").setColor(EnumChatFormatting.RED))); + return; + } + + ChatMessageComponent var4 = ChatMessageComponent.createFromTranslationWithSubstitutions("chat.type.text", new Object[] {this.playerEntity.getTranslatedEntityName(), var2}); + this.mcServer.getConfigurationManager().func_110459_a(var4, false); +--- 624,634 ---- + } + else + { + if (this.playerEntity.getChatVisibility() == 1) + { +! this.sendPacketToPlayer(new Packet3Chat(ChatMessageComponent.createFromTranslationKey("chat.cannotSend").setColor(EnumChatFormatting.RED))); + return; + } + + ChatMessageComponent var4 = ChatMessageComponent.createFromTranslationWithSubstitutions("chat.type.text", new Object[] {this.playerEntity.getTranslatedEntityName(), var2}); + this.mcServer.getConfigurationManager().func_110459_a(var4, false); +*************** +*** 639,649 **** + + this.chatSpamThresholdCount += 20; + + if (this.chatSpamThresholdCount > 200 && !this.mcServer.getConfigurationManager().isPlayerOpped(this.playerEntity.getCommandSenderName())) + { +! this.kickPlayer("disconnect.spam"); + } + } + } + } + +--- 636,646 ---- + + this.chatSpamThresholdCount += 20; + + if (this.chatSpamThresholdCount > 200 && !this.mcServer.getConfigurationManager().isPlayerOpped(this.playerEntity.getCommandSenderName())) + { +! this.kickPlayerFromServer("disconnect.spam"); + } + } + } + } + +*************** +*** 710,724 **** + { + this.netManager.networkShutdown("disconnect.quitting", new Object[0]); + } + + /** +! * return the number of chuckDataPackets from the netManager + */ +! public int getNumChunkDataPackets() + { +! return this.netManager.getNumChunkDataPackets(); + } + + public void handleUseEntity(Packet7UseEntity par1Packet7UseEntity) + { + WorldServer var2 = this.mcServer.worldServerForDimension(this.playerEntity.dimension); +--- 707,721 ---- + { + this.netManager.networkShutdown("disconnect.quitting", new Object[0]); + } + + /** +! * returns 0 for memoryMapped connections + */ +! public int packetSize() + { +! return this.netManager.packetSize(); + } + + public void handleUseEntity(Packet7UseEntity par1Packet7UseEntity) + { + WorldServer var2 = this.mcServer.worldServerForDimension(this.playerEntity.dimension); +*************** +*** 743,753 **** + } + else if (par1Packet7UseEntity.isLeftClick == 1) + { + if (var3 instanceof EntityItem || var3 instanceof EntityXPOrb || var3 instanceof EntityArrow || var3 == this.playerEntity) + { +! this.kickPlayer("Attempting to attack an invalid entity"); + this.mcServer.logWarning("Player " + this.playerEntity.getCommandSenderName() + " tried to attack an invalid entity"); + return; + } + + this.playerEntity.attackTargetEntityWithCurrentItem(var3); +--- 740,750 ---- + } + else if (par1Packet7UseEntity.isLeftClick == 1) + { + if (var3 instanceof EntityItem || var3 instanceof EntityXPOrb || var3 instanceof EntityArrow || var3 == this.playerEntity) + { +! this.kickPlayerFromServer("Attempting to attack an invalid entity"); + this.mcServer.logWarning("Player " + this.playerEntity.getCommandSenderName() + " tried to attack an invalid entity"); + return; + } + + this.playerEntity.attackTargetEntityWithCurrentItem(var3); +*************** +*** 762,796 **** + + if (par1Packet205ClientCommand.forceRespawn == 1) + { + if (this.playerEntity.playerConqueredTheEnd) + { +! this.playerEntity = this.mcServer.getConfigurationManager().recreatePlayerEntity(this.playerEntity, 0, true); + } + else if (this.playerEntity.getServerForPlayer().getWorldInfo().isHardcoreModeEnabled()) + { + if (this.mcServer.isSinglePlayer() && this.playerEntity.getCommandSenderName().equals(this.mcServer.getServerOwner())) + { +! this.playerEntity.playerNetServerHandler.kickPlayer("You have died. Game over, man, it\'s game over!"); + this.mcServer.deleteWorldAndStopServer(); + } + else + { + BanEntry var2 = new BanEntry(this.playerEntity.getCommandSenderName()); + var2.setBanReason("Death in Hardcore"); + this.mcServer.getConfigurationManager().getBannedPlayers().put(var2); +! this.playerEntity.playerNetServerHandler.kickPlayer("You have died. Game over, man, it\'s game over!"); + } + } + else + { + if (this.playerEntity.getHealth() > 0.0F) + { + return; + } + +! this.playerEntity = this.mcServer.getConfigurationManager().recreatePlayerEntity(this.playerEntity, 0, false); + } + } + } + + /** +--- 759,793 ---- + + if (par1Packet205ClientCommand.forceRespawn == 1) + { + if (this.playerEntity.playerConqueredTheEnd) + { +! this.playerEntity = this.mcServer.getConfigurationManager().respawnPlayer(this.playerEntity, 0, true); + } + else if (this.playerEntity.getServerForPlayer().getWorldInfo().isHardcoreModeEnabled()) + { + if (this.mcServer.isSinglePlayer() && this.playerEntity.getCommandSenderName().equals(this.mcServer.getServerOwner())) + { +! this.playerEntity.playerNetServerHandler.kickPlayerFromServer("You have died. Game over, man, it\'s game over!"); + this.mcServer.deleteWorldAndStopServer(); + } + else + { + BanEntry var2 = new BanEntry(this.playerEntity.getCommandSenderName()); + var2.setBanReason("Death in Hardcore"); + this.mcServer.getConfigurationManager().getBannedPlayers().put(var2); +! this.playerEntity.playerNetServerHandler.kickPlayerFromServer("You have died. Game over, man, it\'s game over!"); + } + } + else + { + if (this.playerEntity.getHealth() > 0.0F) + { + return; + } + +! this.playerEntity = this.mcServer.getConfigurationManager().respawnPlayer(this.playerEntity, 0, false); + } + } + } + + /** +*************** +*** 815,858 **** + + public void handleWindowClick(Packet102WindowClick par1Packet102WindowClick) + { + this.playerEntity.func_143004_u(); + +! if (this.playerEntity.openContainer.windowId == par1Packet102WindowClick.window_Id && this.playerEntity.openContainer.getCanCraft(this.playerEntity)) + { + ItemStack var2 = this.playerEntity.openContainer.slotClick(par1Packet102WindowClick.inventorySlot, par1Packet102WindowClick.mouseClick, par1Packet102WindowClick.holdingShift, this.playerEntity); + + if (ItemStack.areItemStacksEqual(par1Packet102WindowClick.itemStack, var2)) + { +! this.playerEntity.playerNetServerHandler.sendPacket(new Packet106Transaction(par1Packet102WindowClick.window_Id, par1Packet102WindowClick.action, true)); +! this.playerEntity.isChangingQuantityOnly = true; + this.playerEntity.openContainer.detectAndSendChanges(); + this.playerEntity.updateHeldItem(); +! this.playerEntity.isChangingQuantityOnly = false; + } + else + { + this.field_72586_s.addKey(this.playerEntity.openContainer.windowId, Short.valueOf(par1Packet102WindowClick.action)); +! this.playerEntity.playerNetServerHandler.sendPacket(new Packet106Transaction(par1Packet102WindowClick.window_Id, par1Packet102WindowClick.action, false)); +! this.playerEntity.openContainer.setCanCraft(this.playerEntity, false); + ArrayList var3 = new ArrayList(); + + for (int var4 = 0; var4 < this.playerEntity.openContainer.inventorySlots.size(); ++var4) + { + var3.add(((Slot)this.playerEntity.openContainer.inventorySlots.get(var4)).getStack()); + } + +! this.playerEntity.updateCraftingInventory(this.playerEntity.openContainer, var3); + } + } + } + + public void handleEnchantItem(Packet108EnchantItem par1Packet108EnchantItem) + { + this.playerEntity.func_143004_u(); + +! if (this.playerEntity.openContainer.windowId == par1Packet108EnchantItem.windowId && this.playerEntity.openContainer.getCanCraft(this.playerEntity)) + { + this.playerEntity.openContainer.enchantItem(this.playerEntity, par1Packet108EnchantItem.enchantment); + this.playerEntity.openContainer.detectAndSendChanges(); + } + } +--- 812,855 ---- + + public void handleWindowClick(Packet102WindowClick par1Packet102WindowClick) + { + this.playerEntity.func_143004_u(); + +! if (this.playerEntity.openContainer.windowId == par1Packet102WindowClick.window_Id && this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity)) + { + ItemStack var2 = this.playerEntity.openContainer.slotClick(par1Packet102WindowClick.inventorySlot, par1Packet102WindowClick.mouseClick, par1Packet102WindowClick.holdingShift, this.playerEntity); + + if (ItemStack.areItemStacksEqual(par1Packet102WindowClick.itemStack, var2)) + { +! this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet106Transaction(par1Packet102WindowClick.window_Id, par1Packet102WindowClick.action, true)); +! this.playerEntity.playerInventoryBeingManipulated = true; + this.playerEntity.openContainer.detectAndSendChanges(); + this.playerEntity.updateHeldItem(); +! this.playerEntity.playerInventoryBeingManipulated = false; + } + else + { + this.field_72586_s.addKey(this.playerEntity.openContainer.windowId, Short.valueOf(par1Packet102WindowClick.action)); +! this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet106Transaction(par1Packet102WindowClick.window_Id, par1Packet102WindowClick.action, false)); +! this.playerEntity.openContainer.setPlayerIsPresent(this.playerEntity, false); + ArrayList var3 = new ArrayList(); + + for (int var4 = 0; var4 < this.playerEntity.openContainer.inventorySlots.size(); ++var4) + { + var3.add(((Slot)this.playerEntity.openContainer.inventorySlots.get(var4)).getStack()); + } + +! this.playerEntity.sendContainerAndContentsToPlayer(this.playerEntity.openContainer, var3); + } + } + } + + public void handleEnchantItem(Packet108EnchantItem par1Packet108EnchantItem) + { + this.playerEntity.func_143004_u(); + +! if (this.playerEntity.openContainer.windowId == par1Packet108EnchantItem.windowId && this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity)) + { + this.playerEntity.openContainer.enchantItem(this.playerEntity, par1Packet108EnchantItem.enchantment); + this.playerEntity.openContainer.detectAndSendChanges(); + } + } +*************** +*** 879,889 **** + else + { + this.playerEntity.inventoryContainer.putStackInSlot(par1Packet107CreativeSetSlot.slot, var3); + } + +! this.playerEntity.inventoryContainer.setCanCraft(this.playerEntity, true); + } + else if (var2 && var5 && var6 && this.creativeItemCreationSpamThresholdTally < 200) + { + this.creativeItemCreationSpamThresholdTally += 20; + EntityItem var7 = this.playerEntity.dropPlayerItem(var3); +--- 876,886 ---- + else + { + this.playerEntity.inventoryContainer.putStackInSlot(par1Packet107CreativeSetSlot.slot, var3); + } + +! this.playerEntity.inventoryContainer.setPlayerIsPresent(this.playerEntity, true); + } + else if (var2 && var5 && var6 && this.creativeItemCreationSpamThresholdTally < 200) + { + this.creativeItemCreationSpamThresholdTally += 20; + EntityItem var7 = this.playerEntity.dropPlayerItem(var3); +*************** +*** 898,910 **** + + public void handleTransaction(Packet106Transaction par1Packet106Transaction) + { + Short var2 = (Short)this.field_72586_s.lookup(this.playerEntity.openContainer.windowId); + +! if (var2 != null && par1Packet106Transaction.shortWindowId == var2.shortValue() && this.playerEntity.openContainer.windowId == par1Packet106Transaction.windowId && !this.playerEntity.openContainer.getCanCraft(this.playerEntity)) + { +! this.playerEntity.openContainer.setCanCraft(this.playerEntity, true); + } + } + + /** + * Updates Client side signs +--- 895,907 ---- + + public void handleTransaction(Packet106Transaction par1Packet106Transaction) + { + Short var2 = (Short)this.field_72586_s.lookup(this.playerEntity.openContainer.windowId); + +! if (var2 != null && par1Packet106Transaction.shortWindowId == var2.shortValue() && this.playerEntity.openContainer.windowId == par1Packet106Transaction.windowId && !this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity)) + { +! this.playerEntity.openContainer.setPlayerIsPresent(this.playerEntity, true); + } + } + + /** + * Updates Client side signs +*************** +*** 1011,1021 **** + { + var2.append("\u0000"); + } + } + +! this.playerEntity.playerNetServerHandler.sendPacket(new Packet203AutoComplete(var2.toString())); + } + + public void handleClientInfo(Packet204ClientInfo par1Packet204ClientInfo) + { + this.playerEntity.updateClientInfo(par1Packet204ClientInfo); +--- 1008,1018 ---- + { + var2.append("\u0000"); + } + } + +! this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet203AutoComplete(var2.toString())); + } + + public void handleClientInfo(Packet204ClientInfo par1Packet204ClientInfo) + { + this.playerEntity.updateClientInfo(par1Packet204ClientInfo); +*** NetworkListenThread.java Sat Feb 5 04:13:14 2022 +--- NetworkListenThread.java Sat Feb 5 04:12:36 2022 +*************** +*** 33,53 **** + { + this.isListening = false; + } + + /** +! * Handles all incoming connections and packets + */ +! public void handleNetworkListenThread() + { + for (int var1 = 0; var1 < this.connections.size(); ++var1) + { + NetServerHandler var2 = (NetServerHandler)this.connections.get(var1); + + try + { +! var2.handlePackets(); + } + catch (Exception var6) + { + if (var2.netManager instanceof MemoryConnection) + { +--- 33,53 ---- + { + this.isListening = false; + } + + /** +! * processes packets and pending connections + */ +! public void networkTick() + { + for (int var1 = 0; var1 < this.connections.size(); ++var1) + { + NetServerHandler var2 = (NetServerHandler)this.connections.get(var1); + + try + { +! var2.networkTick(); + } + catch (Exception var6) + { + if (var2.netManager instanceof MemoryConnection) + { +*************** +*** 56,66 **** + var5.addCrashSectionCallable("Connection", new CallableConnectionName(this, var2)); + throw new ReportedException(var4); + } + + this.mcServer.getLogAgent().logWarningException("Failed to handle packet for " + var2.playerEntity.getEntityName() + "/" + var2.playerEntity.getPlayerIP() + ": " + var6, var6); +! var2.kickPlayer("Internal server error"); + } + + if (var2.connectionClosed) + { + this.connections.remove(var1--); +--- 56,66 ---- + var5.addCrashSectionCallable("Connection", new CallableConnectionName(this, var2)); + throw new ReportedException(var4); + } + + this.mcServer.getLogAgent().logWarningException("Failed to handle packet for " + var2.playerEntity.getEntityName() + "/" + var2.playerEntity.getPlayerIP() + ": " + var6, var6); +! var2.kickPlayerFromServer("Internal server error"); + } + + if (var2.connectionClosed) + { + this.connections.remove(var1--); +*** NextTickListEntry.java Sat Feb 5 04:13:14 2022 +--- NextTickListEntry.java Sat Feb 5 04:12:36 2022 +*** NibbleArray.java Sat Feb 5 04:13:14 2022 +--- NibbleArray.java Sat Feb 5 04:12:36 2022 +*** NibbleArrayReader.java Sat Feb 5 04:13:14 2022 +--- NibbleArrayReader.java Sat Feb 5 04:12:36 2022 +*** NoiseGenerator.java Sat Feb 5 04:13:14 2022 +--- NoiseGenerator.java Sat Feb 5 04:12:36 2022 +*** NoiseGeneratorOctaves.java Sat Feb 5 04:13:14 2022 +--- NoiseGeneratorOctaves.java Sat Feb 5 04:12:36 2022 +*** NoiseGeneratorPerlin.java Sat Feb 5 04:13:14 2022 +--- NoiseGeneratorPerlin.java Sat Feb 5 04:12:36 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- NpcMerchant.java Sat Feb 5 04:12:36 2022 +*************** +*** 0 **** +--- 1,40 ---- ++ package net.minecraft.src; ++ ++ public class NpcMerchant implements IMerchant ++ { ++ /** Instance of Merchants Inventory. */ ++ private InventoryMerchant theMerchantInventory; ++ ++ /** This merchant's current player customer. */ ++ private EntityPlayer customer; ++ ++ /** The MerchantRecipeList instance. */ ++ private MerchantRecipeList recipeList; ++ ++ public NpcMerchant(EntityPlayer par1EntityPlayer) ++ { ++ this.customer = par1EntityPlayer; ++ this.theMerchantInventory = new InventoryMerchant(par1EntityPlayer, this); ++ } ++ ++ public EntityPlayer getCustomer() ++ { ++ return this.customer; ++ } ++ ++ public void setCustomer(EntityPlayer par1EntityPlayer) {} ++ ++ public MerchantRecipeList getRecipes(EntityPlayer par1EntityPlayer) ++ { ++ return this.recipeList; ++ } ++ ++ public void setRecipes(MerchantRecipeList par1MerchantRecipeList) ++ { ++ this.recipeList = par1MerchantRecipeList; ++ } ++ ++ public void useRecipe(MerchantRecipe par1MerchantRecipe) {} ++ ++ public void func_110297_a_(ItemStack par1ItemStack) {} ++ } +*** NumberInvalidException.java Sat Feb 5 04:13:14 2022 +--- NumberInvalidException.java Sat Feb 5 04:12:36 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- OpenGlCapsChecker.java Sat Feb 5 04:12:36 2022 +*************** +*** 0 **** +--- 1,14 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GLContext; ++ ++ public class OpenGlCapsChecker ++ { ++ /** ++ * Checks if we support OpenGL occlusion. ++ */ ++ public static boolean checkARBOcclusion() ++ { ++ return GLContext.getCapabilities().GL_ARB_occlusion_query; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- OpenGlHelper.java Sat Feb 5 04:12:36 2022 +*************** +*** 0 **** +--- 1,89 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.ARBMultitexture; ++ import org.lwjgl.opengl.GL13; ++ import org.lwjgl.opengl.GLContext; ++ ++ public class OpenGlHelper ++ { ++ /** ++ * An OpenGL constant corresponding to GL_TEXTURE0, used when setting data pertaining to auxiliary OpenGL texture ++ * units. ++ */ ++ public static int defaultTexUnit; ++ ++ /** ++ * An OpenGL constant corresponding to GL_TEXTURE1, used when setting data pertaining to auxiliary OpenGL texture ++ * units. ++ */ ++ public static int lightmapTexUnit; ++ ++ /** ++ * True if the renderer supports multitextures and the OpenGL version != 1.3 ++ */ ++ private static boolean useMultitextureARB; ++ ++ /** ++ * Initializes the texture constants to be used when rendering lightmap values ++ */ ++ public static void initializeTextures() ++ { ++ useMultitextureARB = GLContext.getCapabilities().GL_ARB_multitexture && !GLContext.getCapabilities().OpenGL13; ++ ++ if (useMultitextureARB) ++ { ++ defaultTexUnit = 33984; ++ lightmapTexUnit = 33985; ++ } ++ else ++ { ++ defaultTexUnit = 33984; ++ lightmapTexUnit = 33985; ++ } ++ } ++ ++ /** ++ * Sets the current lightmap texture to the specified OpenGL constant ++ */ ++ public static void setActiveTexture(int par0) ++ { ++ if (useMultitextureARB) ++ { ++ ARBMultitexture.glActiveTextureARB(par0); ++ } ++ else ++ { ++ GL13.glActiveTexture(par0); ++ } ++ } ++ ++ /** ++ * Sets the current lightmap texture to the specified OpenGL constant ++ */ ++ public static void setClientActiveTexture(int par0) ++ { ++ if (useMultitextureARB) ++ { ++ ARBMultitexture.glClientActiveTextureARB(par0); ++ } ++ else ++ { ++ GL13.glClientActiveTexture(par0); ++ } ++ } ++ ++ /** ++ * Sets the current coordinates of the given lightmap texture ++ */ ++ public static void setLightmapTextureCoords(int par0, float par1, float par2) ++ { ++ if (useMultitextureARB) ++ { ++ ARBMultitexture.glMultiTexCoord2fARB(par0, par1, par2); ++ } ++ else ++ { ++ GL13.glMultiTexCoord2f(par0, par1, par2); ++ } ++ } ++ } +*** Packet.java Sat Feb 5 04:13:14 2022 +--- Packet.java Sat Feb 5 04:12:36 2022 +*************** +*** 25,35 **** + /** List of the server's packet IDs. */ + private static Set serverPacketIdList = new HashSet(); + protected ILogAgent field_98193_m; + + /** the system time in milliseconds when this packet was created. */ +! public final long creationTimeMillis = MinecraftServer.getCurrentTimeMillis(); + public static long receivedID; + public static long receivedSize; + + /** Assumed to be sequential by the profiler. */ + public static long sentID; +--- 25,35 ---- + /** List of the server's packet IDs. */ + private static Set serverPacketIdList = new HashSet(); + protected ILogAgent field_98193_m; + + /** the system time in milliseconds when this packet was created. */ +! public final long creationTimeMillis = MinecraftServer.getSystemTimeMillis(); + public static long receivedID; + public static long receivedSize; + + /** Assumed to be sequential by the profiler. */ + public static long sentID; +*** Packet0KeepAlive.java Sat Feb 5 04:13:14 2022 +--- Packet0KeepAlive.java Sat Feb 5 04:12:36 2022 +*** Packet100OpenWindow.java Sat Feb 5 04:13:14 2022 +--- Packet100OpenWindow.java Sat Feb 5 04:12:36 2022 +*** Packet101CloseWindow.java Sat Feb 5 04:13:14 2022 +--- Packet101CloseWindow.java Sat Feb 5 04:12:36 2022 +*** Packet102WindowClick.java Sat Feb 5 04:13:14 2022 +--- Packet102WindowClick.java Sat Feb 5 04:12:36 2022 +*************** +*** 20,29 **** +--- 20,41 ---- + + /** Item stack for inventory */ + public ItemStack itemStack; + public int holdingShift; + ++ public Packet102WindowClick() {} ++ ++ public Packet102WindowClick(int par1, int par2, int par3, int par4, ItemStack par5ItemStack, short par6) ++ { ++ this.window_Id = par1; ++ this.inventorySlot = par2; ++ this.mouseClick = par3; ++ this.itemStack = par5ItemStack != null ? par5ItemStack.copy() : null; ++ this.action = par6; ++ this.holdingShift = par4; ++ } ++ + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(NetHandler par1NetHandler) + { +*** Packet103SetSlot.java Sat Feb 5 04:13:14 2022 +--- Packet103SetSlot.java Sat Feb 5 04:12:36 2022 +*** Packet104WindowItems.java Sat Feb 5 04:13:14 2022 +--- Packet104WindowItems.java Sat Feb 5 04:12:36 2022 +*** Packet105UpdateProgressbar.java Sat Feb 5 04:13:14 2022 +--- Packet105UpdateProgressbar.java Sat Feb 5 04:12:36 2022 +*** Packet106Transaction.java Sat Feb 5 04:13:14 2022 +--- Packet106Transaction.java Sat Feb 5 04:12:36 2022 +*** Packet107CreativeSetSlot.java Sat Feb 5 04:13:14 2022 +--- Packet107CreativeSetSlot.java Sat Feb 5 04:12:36 2022 +*************** +*** 7,16 **** +--- 7,24 ---- + public class Packet107CreativeSetSlot extends Packet + { + public int slot; + public ItemStack itemStack; + ++ public Packet107CreativeSetSlot() {} ++ ++ public Packet107CreativeSetSlot(int par1, ItemStack par2ItemStack) ++ { ++ this.slot = par1; ++ this.itemStack = par2ItemStack != null ? par2ItemStack.copy() : null; ++ } ++ + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(NetHandler par1NetHandler) + { +*** Packet108EnchantItem.java Sat Feb 5 04:13:14 2022 +--- Packet108EnchantItem.java Sat Feb 5 04:12:36 2022 +*************** +*** 11,20 **** +--- 11,28 ---- + /** + * The position of the enchantment on the enchantment table window, starting with 0 as the topmost one. + */ + public int enchantment; + ++ public Packet108EnchantItem() {} ++ ++ public Packet108EnchantItem(int par1, int par2) ++ { ++ this.windowId = par1; ++ this.enchantment = par2; ++ } ++ + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(NetHandler par1NetHandler) + { +*** Packet10Flying.java Sat Feb 5 04:13:14 2022 +--- Packet10Flying.java Sat Feb 5 04:12:36 2022 +*************** +*** 31,40 **** +--- 31,47 ---- + public boolean moving; + + /** Boolean set to true if the player is rotating. */ + public boolean rotating; + ++ public Packet10Flying() {} ++ ++ public Packet10Flying(boolean par1) ++ { ++ this.onGround = par1; ++ } ++ + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(NetHandler par1NetHandler) + { +*** Packet11PlayerPosition.java Sat Feb 5 04:13:14 2022 +--- Packet11PlayerPosition.java Sat Feb 5 04:12:36 2022 +*************** +*** 9,18 **** +--- 9,28 ---- + public Packet11PlayerPosition() + { + this.moving = true; + } + ++ public Packet11PlayerPosition(double par1, double par3, double par5, double par7, boolean par9) ++ { ++ this.xPosition = par1; ++ this.yPosition = par3; ++ this.stance = par5; ++ this.zPosition = par7; ++ this.onGround = par9; ++ this.moving = true; ++ } ++ + /** + * Abstract. Reads the raw packet data from the data stream. + */ + public void readPacketData(DataInput par1DataInput) throws IOException + { +*** Packet12PlayerLook.java Sat Feb 5 04:13:14 2022 +--- Packet12PlayerLook.java Sat Feb 5 04:12:36 2022 +*************** +*** 9,18 **** +--- 9,26 ---- + public Packet12PlayerLook() + { + this.rotating = true; + } + ++ public Packet12PlayerLook(float par1, float par2, boolean par3) ++ { ++ this.yaw = par1; ++ this.pitch = par2; ++ this.onGround = par3; ++ this.rotating = true; ++ } ++ + /** + * Abstract. Reads the raw packet data from the data stream. + */ + public void readPacketData(DataInput par1DataInput) throws IOException + { +*** Packet130UpdateSign.java Sat Feb 5 04:13:14 2022 +--- Packet130UpdateSign.java Sat Feb 5 04:12:36 2022 +*** Packet131MapData.java Sat Feb 5 04:13:14 2022 +--- Packet131MapData.java Sat Feb 5 04:12:36 2022 +*** Packet132TileEntityData.java Sat Feb 5 04:13:14 2022 +--- Packet132TileEntityData.java Sat Feb 5 04:12:36 2022 +*** Packet133TileEditorOpen.java Sat Feb 5 04:13:14 2022 +--- Packet133TileEditorOpen.java Sat Feb 5 04:12:36 2022 +*** Packet13PlayerLookMove.java Sat Feb 5 04:13:14 2022 +--- Packet13PlayerLookMove.java Sat Feb 5 04:12:36 2022 +*** Packet14BlockDig.java Sat Feb 5 04:13:14 2022 +--- Packet14BlockDig.java Sat Feb 5 04:12:36 2022 +*************** +*** 19,28 **** +--- 19,39 ---- + public int face; + + /** Status of the digging (started, ongoing, broken). */ + public int status; + ++ public Packet14BlockDig() {} ++ ++ public Packet14BlockDig(int par1, int par2, int par3, int par4, int par5) ++ { ++ this.status = par1; ++ this.xPosition = par2; ++ this.yPosition = par3; ++ this.zPosition = par4; ++ this.face = par5; ++ } ++ + /** + * Abstract. Reads the raw packet data from the data stream. + */ + public void readPacketData(DataInput par1DataInput) throws IOException + { +*** Packet15Place.java Sat Feb 5 04:13:14 2022 +--- Packet15Place.java Sat Feb 5 04:12:36 2022 +*************** +*** 21,30 **** +--- 21,44 ---- + private float yOffset; + + /** The offset from zPosition where the actual click took place */ + private float zOffset; + ++ public Packet15Place() {} ++ ++ public Packet15Place(int par1, int par2, int par3, int par4, ItemStack par5ItemStack, float par6, float par7, float par8) ++ { ++ this.xPosition = par1; ++ this.yPosition = par2; ++ this.zPosition = par3; ++ this.direction = par4; ++ this.itemStack = par5ItemStack != null ? par5ItemStack.copy() : null; ++ this.xOffset = par6; ++ this.yOffset = par7; ++ this.zOffset = par8; ++ } ++ + /** + * Abstract. Reads the raw packet data from the data stream. + */ + public void readPacketData(DataInput par1DataInput) throws IOException + { +*** Packet16BlockItemSwitch.java Sat Feb 5 04:13:14 2022 +--- Packet16BlockItemSwitch.java Sat Feb 5 04:12:36 2022 +*** Packet17Sleep.java Sat Feb 5 04:13:14 2022 +--- Packet17Sleep.java Sat Feb 5 04:12:36 2022 +*** Packet18Animation.java Sat Feb 5 04:13:14 2022 +--- Packet18Animation.java Sat Feb 5 04:12:36 2022 +*** Packet19EntityAction.java Sat Feb 5 04:13:14 2022 +--- Packet19EntityAction.java Sat Feb 5 04:12:36 2022 +*************** +*** 14,23 **** +--- 14,37 ---- + * horse GUI + */ + public int action; + public int auxData; + ++ public Packet19EntityAction() {} ++ ++ public Packet19EntityAction(Entity par1Entity, int par2) ++ { ++ this(par1Entity, par2, 0); ++ } ++ ++ public Packet19EntityAction(Entity par1Entity, int par2, int par3) ++ { ++ this.entityId = par1Entity.entityId; ++ this.action = par2; ++ this.auxData = par3; ++ } ++ + /** + * Abstract. Reads the raw packet data from the data stream. + */ + public void readPacketData(DataInput par1DataInput) throws IOException + { +*** Packet1Login.java Sat Feb 5 04:13:14 2022 +--- Packet1Login.java Sat Feb 5 04:12:36 2022 +*** Packet200Statistic.java Sat Feb 5 04:13:14 2022 +--- Packet200Statistic.java Sat Feb 5 04:12:36 2022 +*** Packet201PlayerInfo.java Sat Feb 5 04:13:14 2022 +--- Packet201PlayerInfo.java Sat Feb 5 04:12:36 2022 +*** Packet202PlayerAbilities.java Sat Feb 5 04:13:14 2022 +--- Packet202PlayerAbilities.java Sat Feb 5 04:12:36 2022 +*************** +*** 140,155 **** +--- 140,165 ---- + public void setCreativeMode(boolean par1) + { + this.isCreativeMode = par1; + } + ++ public float getFlySpeed() ++ { ++ return this.flySpeed; ++ } ++ + /** + * Sets the flying speed. + */ + public void setFlySpeed(float par1) + { + this.flySpeed = par1; ++ } ++ ++ public float getWalkSpeed() ++ { ++ return this.walkSpeed; + } + + /** + * Sets the walking speed. + */ +*** Packet203AutoComplete.java Sat Feb 5 04:13:14 2022 +--- Packet203AutoComplete.java Sat Feb 5 04:12:36 2022 +*** Packet204ClientInfo.java Sat Feb 5 04:13:14 2022 +--- Packet204ClientInfo.java Sat Feb 5 04:12:36 2022 +*************** +*** 11,20 **** +--- 11,32 ---- + private int chatVisisble; + private boolean chatColours; + private int gameDifficulty; + private boolean showCape; + ++ public Packet204ClientInfo() {} ++ ++ public Packet204ClientInfo(String par1Str, int par2, int par3, boolean par4, int par5, boolean par6) ++ { ++ this.language = par1Str; ++ this.renderDistance = par2; ++ this.chatVisisble = par3; ++ this.chatColours = par4; ++ this.gameDifficulty = par5; ++ this.showCape = par6; ++ } ++ + /** + * Abstract. Reads the raw packet data from the data stream. + */ + public void readPacketData(DataInput par1DataInput) throws IOException + { +*** Packet205ClientCommand.java Sat Feb 5 04:13:14 2022 +--- Packet205ClientCommand.java Sat Feb 5 04:12:36 2022 +*************** +*** 9,18 **** +--- 9,25 ---- + /** + * 0 sent to a netLoginHandler starts the server, 1 sent to NetServerHandler forces a respawn + */ + public int forceRespawn; + ++ public Packet205ClientCommand() {} ++ ++ public Packet205ClientCommand(int par1) ++ { ++ this.forceRespawn = par1; ++ } ++ + /** + * Abstract. Reads the raw packet data from the data stream. + */ + public void readPacketData(DataInput par1DataInput) throws IOException + { +*** Packet206SetObjective.java Sat Feb 5 04:13:14 2022 +--- Packet206SetObjective.java Sat Feb 5 04:12:36 2022 +*** Packet207SetScore.java Sat Feb 5 04:13:14 2022 +--- Packet207SetScore.java Sat Feb 5 04:12:36 2022 +*** Packet208SetDisplayObjective.java Sat Feb 5 04:13:14 2022 +--- Packet208SetDisplayObjective.java Sat Feb 5 04:12:36 2022 +*** Packet209SetPlayerTeam.java Sat Feb 5 04:13:14 2022 +--- Packet209SetPlayerTeam.java Sat Feb 5 04:12:36 2022 +*** Packet20NamedEntitySpawn.java Sat Feb 5 04:13:14 2022 +--- Packet20NamedEntitySpawn.java Sat Feb 5 04:12:36 2022 +*************** +*** 94,99 **** +--- 94,109 ---- + */ + public int getPacketSize() + { + return 28; + } ++ ++ public List getWatchedMetadata() ++ { ++ if (this.metadataWatchableObjects == null) ++ { ++ this.metadataWatchableObjects = this.metadata.getAllWatched(); ++ } ++ ++ return this.metadataWatchableObjects; ++ } + } +*** Packet22Collect.java Sat Feb 5 04:13:14 2022 +--- Packet22Collect.java Sat Feb 5 04:12:36 2022 +*** Packet23VehicleSpawn.java Sat Feb 5 04:13:14 2022 +--- Packet23VehicleSpawn.java Sat Feb 5 04:12:36 2022 +*** Packet24MobSpawn.java Sat Feb 5 04:13:14 2022 +--- Packet24MobSpawn.java Sat Feb 5 04:12:36 2022 +*************** +*** 142,147 **** +--- 142,157 ---- + */ + public int getPacketSize() + { + return 26; + } ++ ++ public List getMetadata() ++ { ++ if (this.metadata == null) ++ { ++ this.metadata = this.metaData.getAllWatched(); ++ } ++ ++ return this.metadata; ++ } + } +*** Packet250CustomPayload.java Sat Feb 5 04:13:14 2022 +--- Packet250CustomPayload.java Sat Feb 5 04:12:36 2022 +*** Packet252SharedKey.java Sat Feb 5 04:13:14 2022 +--- Packet252SharedKey.java Sat Feb 5 04:12:36 2022 +*************** +*** 2,11 **** +--- 2,12 ---- + + import java.io.DataInput; + import java.io.DataOutput; + import java.io.IOException; + import java.security.PrivateKey; ++ import java.security.PublicKey; + import javax.crypto.SecretKey; + + public class Packet252SharedKey extends Packet + { + private byte[] sharedSecret = new byte[0]; +*************** +*** 14,23 **** +--- 15,33 ---- + /** + * Secret AES key decrypted from sharedSecret via the server's private RSA key + */ + private SecretKey sharedKey; + ++ public Packet252SharedKey() {} ++ ++ public Packet252SharedKey(SecretKey par1SecretKey, PublicKey par2PublicKey, byte[] par3ArrayOfByte) ++ { ++ this.sharedKey = par1SecretKey; ++ this.sharedSecret = CryptManager.encryptData(par2PublicKey, par1SecretKey.getEncoded()); ++ this.verifyToken = CryptManager.encryptData(par2PublicKey, par3ArrayOfByte); ++ } ++ + /** + * Abstract. Reads the raw packet data from the data stream. + */ + public void readPacketData(DataInput par1DataInput) throws IOException + { +*************** +*** 65,75 **** + { + return this.getSharedKey((PrivateKey)null); + } + + /** +! * Return verifyToken, decrypting it with the server's RSA private key + */ + public byte[] getVerifyToken(PrivateKey par1PrivateKey) + { + return par1PrivateKey == null ? this.verifyToken : CryptManager.decryptData(par1PrivateKey, this.verifyToken); + } +--- 75,85 ---- + { + return this.getSharedKey((PrivateKey)null); + } + + /** +! * Return verifyToken + */ + public byte[] getVerifyToken(PrivateKey par1PrivateKey) + { + return par1PrivateKey == null ? this.verifyToken : CryptManager.decryptData(par1PrivateKey, this.verifyToken); + } +*** Packet253ServerAuthData.java Sat Feb 5 04:13:14 2022 +--- Packet253ServerAuthData.java Sat Feb 5 04:12:36 2022 +*************** +*** 53,58 **** +--- 53,73 ---- + */ + public int getPacketSize() + { + return 2 + this.serverId.length() * 2 + 2 + this.publicKey.getEncoded().length + 2 + this.verifyToken.length; + } ++ ++ public String getServerId() ++ { ++ return this.serverId; ++ } ++ ++ public PublicKey getPublicKey() ++ { ++ return this.publicKey; ++ } ++ ++ public byte[] getVerifyToken() ++ { ++ return this.verifyToken; ++ } + } +*** Packet254ServerPing.java Sat Feb 5 04:13:14 2022 +--- Packet254ServerPing.java Sat Feb 5 04:12:36 2022 +*************** +*** 11,20 **** +--- 11,29 ---- + /** Always 1, unless readByte threw an exception. */ + public int readSuccessfully; + public String field_140052_b; + public int field_140053_c; + ++ public Packet254ServerPing() {} ++ ++ public Packet254ServerPing(int par1, String par2Str, int par3) ++ { ++ this.readSuccessfully = par1; ++ this.field_140052_b = par2Str; ++ this.field_140053_c = par3; ++ } ++ + /** + * Abstract. Reads the raw packet data from the data stream. + */ + public void readPacketData(DataInput par1DataInput) throws IOException + { +*** Packet255KickDisconnect.java Sat Feb 5 04:13:14 2022 +--- Packet255KickDisconnect.java Sat Feb 5 04:12:36 2022 +*** Packet25EntityPainting.java Sat Feb 5 04:13:14 2022 +--- Packet25EntityPainting.java Sat Feb 5 04:12:36 2022 +*** Packet26EntityExpOrb.java Sat Feb 5 04:13:14 2022 +--- Packet26EntityExpOrb.java Sat Feb 5 04:12:36 2022 +*** Packet27PlayerInput.java Sat Feb 5 04:13:14 2022 +--- Packet27PlayerInput.java Sat Feb 5 04:12:36 2022 +*************** +*** 9,18 **** +--- 9,28 ---- + private float field_111017_a; + private float field_111015_b; + private boolean field_111016_c; + private boolean field_111014_d; + ++ public Packet27PlayerInput() {} ++ ++ public Packet27PlayerInput(float par1, float par2, boolean par3, boolean par4) ++ { ++ this.field_111017_a = par1; ++ this.field_111015_b = par2; ++ this.field_111016_c = par3; ++ this.field_111014_d = par4; ++ } ++ + /** + * Abstract. Reads the raw packet data from the data stream. + */ + public void readPacketData(DataInput par1DataInput) throws IOException + { +*** Packet28EntityVelocity.java Sat Feb 5 04:13:14 2022 +--- Packet28EntityVelocity.java Sat Feb 5 04:12:36 2022 +*** Packet29DestroyEntity.java Sat Feb 5 04:13:14 2022 +--- Packet29DestroyEntity.java Sat Feb 5 04:12:36 2022 +*** Packet2ClientProtocol.java Sat Feb 5 04:13:14 2022 +--- Packet2ClientProtocol.java Sat Feb 5 04:12:36 2022 +*************** +*** 9,18 **** +--- 9,28 ---- + private int protocolVersion; + private String username; + private String serverHost; + private int serverPort; + ++ public Packet2ClientProtocol() {} ++ ++ public Packet2ClientProtocol(int par1, String par2Str, String par3Str, int par4) ++ { ++ this.protocolVersion = par1; ++ this.username = par2Str; ++ this.serverHost = par3Str; ++ this.serverPort = par4; ++ } ++ + /** + * Abstract. Reads the raw packet data from the data stream. + */ + public void readPacketData(DataInput par1DataInput) throws IOException + { +*** Packet30Entity.java Sat Feb 5 04:13:14 2022 +--- Packet30Entity.java Sat Feb 5 04:12:36 2022 +*** Packet31RelEntityMove.java Sat Feb 5 04:13:14 2022 +--- Packet31RelEntityMove.java Sat Feb 5 04:12:36 2022 +*** Packet32EntityLook.java Sat Feb 5 04:13:14 2022 +--- Packet32EntityLook.java Sat Feb 5 04:12:36 2022 +*** Packet33RelEntityMoveLook.java Sat Feb 5 04:13:14 2022 +--- Packet33RelEntityMoveLook.java Sat Feb 5 04:12:36 2022 +*** Packet34EntityTeleport.java Sat Feb 5 04:13:14 2022 +--- Packet34EntityTeleport.java Sat Feb 5 04:12:36 2022 +*** Packet35EntityHeadRotation.java Sat Feb 5 04:13:14 2022 +--- Packet35EntityHeadRotation.java Sat Feb 5 04:12:36 2022 +*** Packet38EntityStatus.java Sat Feb 5 04:13:14 2022 +--- Packet38EntityStatus.java Sat Feb 5 04:12:36 2022 +*** Packet39AttachEntity.java Sat Feb 5 04:13:14 2022 +--- Packet39AttachEntity.java Sat Feb 5 04:12:36 2022 +*** Packet3Chat.java Sat Feb 5 04:13:14 2022 +--- Packet3Chat.java Sat Feb 5 04:12:36 2022 +*** Packet40EntityMetadata.java Sat Feb 5 04:13:14 2022 +--- Packet40EntityMetadata.java Sat Feb 5 04:12:36 2022 +*************** +*** 57,62 **** +--- 57,67 ---- + */ + public int getPacketSize() + { + return 5; + } ++ ++ public List getMetadata() ++ { ++ return this.metadata; ++ } + } +*** Packet41EntityEffect.java Sat Feb 5 04:13:14 2022 +--- Packet41EntityEffect.java Sat Feb 5 04:12:36 2022 +*************** +*** 52,61 **** +--- 52,69 ---- + par1DataOutput.writeByte(this.effectAmplifier); + par1DataOutput.writeShort(this.duration); + } + + /** ++ * Returns true if duration is at maximum, false otherwise. ++ */ ++ public boolean isDurationMax() ++ { ++ return this.duration == 32767; ++ } ++ ++ /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(NetHandler par1NetHandler) + { + par1NetHandler.handleEntityEffect(this); +*** Packet42RemoveEntityEffect.java Sat Feb 5 04:13:14 2022 +--- Packet42RemoveEntityEffect.java Sat Feb 5 04:12:36 2022 +*** Packet43Experience.java Sat Feb 5 04:13:14 2022 +--- Packet43Experience.java Sat Feb 5 04:12:36 2022 +*** Packet44UpdateAttributes.java Sat Feb 5 04:13:14 2022 +--- Packet44UpdateAttributes.java Sat Feb 5 04:12:36 2022 +*************** +*** 94,99 **** +--- 94,109 ---- + */ + public int getPacketSize() + { + return 8 + this.field_111004_b.size() * 24; + } ++ ++ public int func_111002_d() ++ { ++ return this.field_111005_a; ++ } ++ ++ public List func_111003_f() ++ { ++ return this.field_111004_b; ++ } + } +*** Packet44UpdateAttributesSnapshot.java Sat Feb 5 04:13:14 2022 +--- Packet44UpdateAttributesSnapshot.java Sat Feb 5 04:12:36 2022 +*** Packet4UpdateTime.java Sat Feb 5 04:13:14 2022 +--- Packet4UpdateTime.java Sat Feb 5 04:12:36 2022 +*** Packet51MapChunk.java Sat Feb 5 04:13:14 2022 +--- Packet51MapChunk.java Sat Feb 5 04:12:36 2022 +*************** +*** 151,160 **** +--- 151,165 ---- + public int getPacketSize() + { + return 17 + this.tempLength; + } + ++ public byte[] getCompressedChunkData() ++ { ++ return this.compressedChunkData; ++ } ++ + public static Packet51MapChunkData getMapChunkData(Chunk par0Chunk, boolean par1, int par2) + { + int var3 = 0; + ExtendedBlockStorage[] var4 = par0Chunk.getBlockStorageArray(); + int var5 = 0; +*** Packet51MapChunkData.java Sat Feb 5 04:13:14 2022 +--- Packet51MapChunkData.java Sat Feb 5 04:12:36 2022 +*** Packet52MultiBlockChange.java Sat Feb 5 04:13:14 2022 +--- Packet52MultiBlockChange.java Sat Feb 5 04:12:36 2022 +*** Packet53BlockChange.java Sat Feb 5 04:13:14 2022 +--- Packet53BlockChange.java Sat Feb 5 04:12:36 2022 +*** Packet54PlayNoteBlock.java Sat Feb 5 04:13:14 2022 +--- Packet54PlayNoteBlock.java Sat Feb 5 04:12:36 2022 +*** Packet55BlockDestroy.java Sat Feb 5 04:13:14 2022 +--- Packet55BlockDestroy.java Sat Feb 5 04:12:36 2022 +*************** +*** 71,80 **** +--- 71,120 ---- + { + return 13; + } + + /** ++ * Gets the ID of the entity breaking the block ++ */ ++ public int getEntityId() ++ { ++ return this.entityId; ++ } ++ ++ /** ++ * Gets the X position of the block ++ */ ++ public int getPosX() ++ { ++ return this.posX; ++ } ++ ++ /** ++ * Gets the Y position of the block ++ */ ++ public int getPosY() ++ { ++ return this.posY; ++ } ++ ++ /** ++ * Gets the Z position of the block ++ */ ++ public int getPosZ() ++ { ++ return this.posZ; ++ } ++ ++ /** ++ * Gets how far destroyed this block is ++ */ ++ public int getDestroyedStage() ++ { ++ return this.destroyedStage; ++ } ++ ++ /** + * only false for the abstract Packet class, all real packets return true + */ + public boolean isRealPacket() + { + return true; +*** Packet56MapChunks.java Sat Feb 5 04:13:14 2022 +--- Packet56MapChunks.java Sat Feb 5 04:12:36 2022 +*************** +*** 180,189 **** +--- 180,204 ---- + public int getPacketSize() + { + return 6 + this.dataLength + 12 * this.getNumberOfChunkInPacket(); + } + ++ public int getChunkPosX(int par1) ++ { ++ return this.chunkPostX[par1]; ++ } ++ ++ public int getChunkPosZ(int par1) ++ { ++ return this.chunkPosZ[par1]; ++ } ++ + public int getNumberOfChunkInPacket() + { + return this.chunkPostX.length; ++ } ++ ++ public byte[] getChunkCompressedData(int par1) ++ { ++ return this.field_73584_f[par1]; + } + } +*** Packet5PlayerInventory.java Sat Feb 5 04:13:14 2022 +--- Packet5PlayerInventory.java Sat Feb 5 04:12:36 2022 +*************** +*** 59,68 **** +--- 59,76 ---- + { + return 8; + } + + /** ++ * Gets the item in the slot format (an ItemStack) ++ */ ++ public ItemStack getItemSlot() ++ { ++ return this.itemSlot; ++ } ++ ++ /** + * only false for the abstract Packet class, all real packets return true + */ + public boolean isRealPacket() + { + return true; +*** Packet60Explosion.java Sat Feb 5 04:13:14 2022 +--- Packet60Explosion.java Sat Feb 5 04:12:36 2022 +*************** +*** 114,119 **** +--- 114,143 ---- + */ + public int getPacketSize() + { + return 32 + this.chunkPositionRecords.size() * 3 + 3; + } ++ ++ /** ++ * Gets the X velocity of the player being pushed by the explosion. ++ */ ++ public float getPlayerVelocityX() ++ { ++ return this.playerVelocityX; ++ } ++ ++ /** ++ * Gets the Y velocity of the player being pushed by the explosion. ++ */ ++ public float getPlayerVelocityY() ++ { ++ return this.playerVelocityY; ++ } ++ ++ /** ++ * Gets the Z velocity of the player being pushed by the explosion. ++ */ ++ public float getPlayerVelocityZ() ++ { ++ return this.playerVelocityZ; ++ } + } +*** Packet61DoorChange.java Sat Feb 5 04:13:14 2022 +--- Packet61DoorChange.java Sat Feb 5 04:12:36 2022 +*************** +*** 64,69 **** +--- 64,74 ---- + */ + public int getPacketSize() + { + return 21; + } ++ ++ public boolean getRelativeVolumeDisabled() ++ { ++ return this.disableRelativeVolume; ++ } + } +*** Packet62LevelSound.java Sat Feb 5 04:13:14 2022 +--- Packet62LevelSound.java Sat Feb 5 04:12:36 2022 +*************** +*** 70,79 **** +--- 70,112 ---- + par1DataOutput.writeInt(this.effectZ); + par1DataOutput.writeFloat(this.volume); + par1DataOutput.writeByte(this.pitch); + } + ++ public String getSoundName() ++ { ++ return this.soundName; ++ } ++ ++ public double getEffectX() ++ { ++ return (double)((float)this.effectX / 8.0F); ++ } ++ ++ public double getEffectY() ++ { ++ return (double)((float)this.effectY / 8.0F); ++ } ++ ++ public double getEffectZ() ++ { ++ return (double)((float)this.effectZ / 8.0F); ++ } ++ ++ public float getVolume() ++ { ++ return this.volume; ++ } ++ ++ /** ++ * Gets the pitch divided by 63 (63 is 100%) ++ */ ++ public float getPitch() ++ { ++ return (float)this.pitch / 63.0F; ++ } ++ + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(NetHandler par1NetHandler) + { +*** Packet63WorldParticles.java Sat Feb 5 04:13:14 2022 +--- Packet63WorldParticles.java Sat Feb 5 04:12:36 2022 +*************** +*** 71,80 **** +--- 71,149 ---- + par1DataOutput.writeFloat(this.offsetZ); + par1DataOutput.writeFloat(this.speed); + par1DataOutput.writeInt(this.quantity); + } + ++ public String getParticleName() ++ { ++ return this.particleName; ++ } ++ ++ /** ++ * Gets the X position of the particle. ++ */ ++ public double getPositionX() ++ { ++ return (double)this.posX; ++ } ++ ++ /** ++ * Gets the Y position of the particle. ++ */ ++ public double getPositionY() ++ { ++ return (double)this.posY; ++ } ++ ++ /** ++ * Gets the Z position of the particle. ++ */ ++ public double getPositionZ() ++ { ++ return (double)this.posZ; ++ } ++ ++ /** ++ * This is added to the X position after being multiplied by random.nextGaussian() ++ */ ++ public float getOffsetX() ++ { ++ return this.offsetX; ++ } ++ ++ /** ++ * This is added to the Y position after being multiplied by random.nextGaussian() ++ */ ++ public float getOffsetY() ++ { ++ return this.offsetY; ++ } ++ ++ /** ++ * This is added to the Z position after being multiplied by random.nextGaussian() ++ */ ++ public float getOffsetZ() ++ { ++ return this.offsetZ; ++ } ++ ++ /** ++ * Gets the speed of the particles. ++ */ ++ public float getSpeed() ++ { ++ return this.speed; ++ } ++ ++ /** ++ * Gets the number of particles to create. ++ */ ++ public int getQuantity() ++ { ++ return this.quantity; ++ } ++ + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(NetHandler par1NetHandler) + { +*** Packet6SpawnPosition.java Sat Feb 5 04:13:14 2022 +--- Packet6SpawnPosition.java Sat Feb 5 04:12:36 2022 +*** Packet70GameEvent.java Sat Feb 5 04:13:14 2022 +--- Packet70GameEvent.java Sat Feb 5 04:12:36 2022 +*** Packet71Weather.java Sat Feb 5 04:13:14 2022 +--- Packet71Weather.java Sat Feb 5 04:12:36 2022 +*** Packet7UseEntity.java Sat Feb 5 04:13:14 2022 +--- Packet7UseEntity.java Sat Feb 5 04:12:36 2022 +*************** +*** 15,24 **** +--- 15,33 ---- + /** + * Seems to be true when the player is pointing at an entity and left-clicking and false when right-clicking. + */ + public int isLeftClick; + ++ public Packet7UseEntity() {} ++ ++ public Packet7UseEntity(int par1, int par2, int par3) ++ { ++ this.playerEntityId = par1; ++ this.targetEntity = par2; ++ this.isLeftClick = par3; ++ } ++ + /** + * Abstract. Reads the raw packet data from the data stream. + */ + public void readPacketData(DataInput par1DataInput) throws IOException + { +*** Packet8UpdateHealth.java Sat Feb 5 04:13:14 2022 +--- Packet8UpdateHealth.java Sat Feb 5 04:12:36 2022 +*** Packet9Respawn.java Sat Feb 5 04:13:14 2022 +--- Packet9Respawn.java Sat Feb 5 04:12:36 2022 +*** PacketCount.java Sat Feb 5 04:13:14 2022 +--- PacketCount.java Sat Feb 5 04:12:36 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- PackMetadataSection.java Sat Feb 5 04:12:36 2022 +*************** +*** 0 **** +--- 1,23 ---- ++ package net.minecraft.src; ++ ++ public class PackMetadataSection implements MetadataSection ++ { ++ private final String packDescription; ++ private final int packFormat; ++ ++ public PackMetadataSection(String par1Str, int par2) ++ { ++ this.packDescription = par1Str; ++ this.packFormat = par2; ++ } ++ ++ public String getPackDescription() ++ { ++ return this.packDescription; ++ } ++ ++ public int getPackFormat() ++ { ++ return this.packFormat; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- PackMetadataSectionSerializer.java Sat Feb 5 04:12:36 2022 +*************** +*** 0 **** +--- 1,45 ---- ++ package net.minecraft.src; ++ ++ import com.google.gson.JsonDeserializationContext; ++ import com.google.gson.JsonElement; ++ import com.google.gson.JsonObject; ++ import com.google.gson.JsonSerializationContext; ++ import com.google.gson.JsonSerializer; ++ import java.lang.reflect.Type; ++ ++ public class PackMetadataSectionSerializer extends BaseMetadataSectionSerializer implements JsonSerializer ++ { ++ public PackMetadataSection func_110489_a(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) ++ { ++ JsonObject var4 = par1JsonElement.getAsJsonObject(); ++ String var5 = this.func_110486_a(var4.get("description"), "description", (String)null, 1, Integer.MAX_VALUE); ++ int var6 = this.func_110485_a(var4.get("pack_format"), "pack_format", (Integer)null, 1, Integer.MAX_VALUE); ++ return new PackMetadataSection(var5, var6); ++ } ++ ++ public JsonElement func_110488_a(PackMetadataSection par1PackMetadataSection, Type par2Type, JsonSerializationContext par3JsonSerializationContext) ++ { ++ JsonObject var4 = new JsonObject(); ++ var4.addProperty("pack_format", Integer.valueOf(par1PackMetadataSection.getPackFormat())); ++ var4.addProperty("description", par1PackMetadataSection.getPackDescription()); ++ return var4; ++ } ++ ++ /** ++ * The name of this section type as it appears in JSON. ++ */ ++ public String getSectionName() ++ { ++ return "pack"; ++ } ++ ++ public Object deserialize(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) ++ { ++ return this.func_110489_a(par1JsonElement, par2Type, par3JsonDeserializationContext); ++ } ++ ++ public JsonElement serialize(Object par1Obj, Type par2Type, JsonSerializationContext par3JsonSerializationContext) ++ { ++ return this.func_110488_a((PackMetadataSection)par1Obj, par2Type, par3JsonSerializationContext); ++ } ++ } +*** Path.java Sat Feb 5 04:13:14 2022 +--- Path.java Sat Feb 5 04:12:36 2022 +*** PathEntity.java Sat Feb 5 04:13:14 2022 +--- PathEntity.java Sat Feb 5 04:12:36 2022 +*** PathFinder.java Sat Feb 5 04:13:14 2022 +--- PathFinder.java Sat Feb 5 04:12:36 2022 +*************** +*** 274,284 **** + + return var5; + } + + /** +! * Given an x y z, returns a vertical offset needed to search to find a block to stand on + */ + public int getVerticalOffset(Entity par1Entity, int par2, int par3, int par4, PathPoint par5PathPoint) + { + return func_82565_a(par1Entity, par2, par3, par4, par5PathPoint, this.isPathingInWater, this.isMovementBlockAllowed, this.isWoddenDoorAllowed); + } +--- 274,286 ---- + + return var5; + } + + /** +! * Checks if an entity collides with blocks at a position. Returns 1 if clear, 0 for colliding with any solid block, +! * -1 for water(if avoiding water) but otherwise clear, -2 for lava, -3 for fence, -4 for closed trapdoor, 2 if +! * otherwise clear except for open trapdoor or water(if not avoiding) + */ + public int getVerticalOffset(Entity par1Entity, int par2, int par3, int par4, PathPoint par5PathPoint) + { + return func_82565_a(par1Entity, par2, par3, par4, par5PathPoint, this.isPathingInWater, this.isMovementBlockAllowed, this.isWoddenDoorAllowed); + } +*** PathNavigate.java Sat Feb 5 04:13:14 2022 +--- PathNavigate.java Sat Feb 5 04:12:36 2022 +*************** +*** 105,128 **** + public void setCanSwim(boolean par1) + { + this.canSwim = par1; + } + +! /** +! * Gets the maximum distance that the path finding will search in. +! */ +! public float getPathSearchRange() + { + return (float)this.pathSearchRange.getAttributeValue(); + } + + /** + * Returns the path to the given coordinates + */ + public PathEntity getPathToXYZ(double par1, double par3, double par5) + { +! return !this.canNavigate() ? null : this.worldObj.getEntityPathToXYZ(this.theEntity, MathHelper.floor_double(par1), (int)par3, MathHelper.floor_double(par5), this.getPathSearchRange(), this.canPassOpenWoodenDoors, this.canPassClosedWoodenDoors, this.avoidsWater, this.canSwim); + } + + /** + * Try to find and set a path to XYZ. Returns true if successful. + */ +--- 105,125 ---- + public void setCanSwim(boolean par1) + { + this.canSwim = par1; + } + +! public float func_111269_d() + { + return (float)this.pathSearchRange.getAttributeValue(); + } + + /** + * Returns the path to the given coordinates + */ + public PathEntity getPathToXYZ(double par1, double par3, double par5) + { +! return !this.canNavigate() ? null : this.worldObj.getEntityPathToXYZ(this.theEntity, MathHelper.floor_double(par1), (int)par3, MathHelper.floor_double(par5), this.func_111269_d(), this.canPassOpenWoodenDoors, this.canPassClosedWoodenDoors, this.avoidsWater, this.canSwim); + } + + /** + * Try to find and set a path to XYZ. Returns true if successful. + */ +*************** +*** 135,145 **** + /** + * Returns the path to the given EntityLiving + */ + public PathEntity getPathToEntityLiving(Entity par1Entity) + { +! return !this.canNavigate() ? null : this.worldObj.getPathEntityToEntity(this.theEntity, par1Entity, this.getPathSearchRange(), this.canPassOpenWoodenDoors, this.canPassClosedWoodenDoors, this.avoidsWater, this.canSwim); + } + + /** + * Try to find and set a path to EntityLiving. Returns true if successful. + */ +--- 132,142 ---- + /** + * Returns the path to the given EntityLiving + */ + public PathEntity getPathToEntityLiving(Entity par1Entity) + { +! return !this.canNavigate() ? null : this.worldObj.getPathEntityToEntity(this.theEntity, par1Entity, this.func_111269_d(), this.canPassOpenWoodenDoors, this.canPassClosedWoodenDoors, this.avoidsWater, this.canSwim); + } + + /** + * Try to find and set a path to EntityLiving. Returns true if successful. + */ +*** PathPoint.java Sat Feb 5 04:13:14 2022 +--- PathPoint.java Sat Feb 5 04:12:36 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- PendingInvite.java Sat Feb 5 04:12:36 2022 +*************** +*** 0 **** +--- 1,28 ---- ++ package net.minecraft.src; ++ ++ import argo.jdom.JsonNode; ++ ++ public class PendingInvite extends ValueObject ++ { ++ public String field_130094_a; ++ public String field_130092_b; ++ public String field_130093_c; ++ ++ public static PendingInvite func_130091_a(JsonNode par0JsonNode) ++ { ++ PendingInvite var1 = new PendingInvite(); ++ ++ try ++ { ++ var1.field_130094_a = par0JsonNode.getStringValue(new Object[] {"invitationId"}); ++ var1.field_130092_b = par0JsonNode.getStringValue(new Object[] {"worldName"}); ++ var1.field_130093_c = par0JsonNode.getStringValue(new Object[] {"worldOwnerName"}); ++ } ++ catch (Exception var3) ++ { ++ ; ++ } ++ ++ return var1; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- PendingInvitesList.java Sat Feb 5 04:12:36 2022 +*************** +*** 0 **** +--- 1,41 ---- ++ package net.minecraft.src; ++ ++ import argo.jdom.JdomParser; ++ import argo.jdom.JsonNode; ++ import argo.jdom.JsonRootNode; ++ import argo.saj.InvalidSyntaxException; ++ import com.google.common.collect.Lists; ++ import java.util.Iterator; ++ import java.util.List; ++ ++ public class PendingInvitesList extends ValueObject ++ { ++ public List field_130096_a = Lists.newArrayList(); ++ ++ public static PendingInvitesList func_130095_a(String par0Str) ++ { ++ PendingInvitesList var1 = new PendingInvitesList(); ++ ++ try ++ { ++ JsonRootNode var2 = (new JdomParser()).parse(par0Str); ++ ++ if (var2.isArrayNode(new Object[] {"invites"})) ++ { ++ Iterator var3 = var2.getArrayNode(new Object[] {"invites"}).iterator(); ++ ++ while (var3.hasNext()) ++ { ++ JsonNode var4 = (JsonNode)var3.next(); ++ var1.field_130096_a.add(PendingInvite.func_130091_a(var4)); ++ } ++ } ++ } ++ catch (InvalidSyntaxException var5) ++ { ++ ; ++ } ++ ++ return var1; ++ } ++ } +*** PlayerCapabilities.java Sat Feb 5 04:13:14 2022 +--- PlayerCapabilities.java Sat Feb 5 04:12:36 2022 +*************** +*** 60,69 **** +--- 60,79 ---- + public float getFlySpeed() + { + return this.flySpeed; + } + ++ public void setFlySpeed(float par1) ++ { ++ this.flySpeed = par1; ++ } ++ + public float getWalkSpeed() + { + return this.walkSpeed; ++ } ++ ++ public void setPlayerWalkSpeed(float par1) ++ { ++ this.walkSpeed = par1; + } + } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- PlayerControllerMP.java Sat Feb 5 04:12:36 2022 +*************** +*** 0 **** +--- 1,498 ---- ++ package net.minecraft.src; ++ ++ public class PlayerControllerMP ++ { ++ /** The Minecraft instance. */ ++ private final Minecraft mc; ++ private final NetClientHandler netClientHandler; ++ ++ /** PosX of the current block being destroyed */ ++ private int currentBlockX = -1; ++ ++ /** PosY of the current block being destroyed */ ++ private int currentBlockY = -1; ++ ++ /** PosZ of the current block being destroyed */ ++ private int currentblockZ = -1; ++ private ItemStack field_85183_f; ++ ++ /** Current block damage (MP) */ ++ private float curBlockDamageMP; ++ ++ /** ++ * Tick counter, when it hits 4 it resets back to 0 and plays the step sound ++ */ ++ private float stepSoundTickCounter; ++ ++ /** ++ * Delays the first damage on the block after the first click on the block ++ */ ++ private int blockHitDelay; ++ ++ /** Tells if the player is hitting a block */ ++ private boolean isHittingBlock; ++ ++ /** Current game type for the player */ ++ private EnumGameType currentGameType; ++ ++ /** Index of the current item held by the player in the inventory hotbar */ ++ private int currentPlayerItem; ++ ++ public PlayerControllerMP(Minecraft par1Minecraft, NetClientHandler par2NetClientHandler) ++ { ++ this.currentGameType = EnumGameType.SURVIVAL; ++ this.mc = par1Minecraft; ++ this.netClientHandler = par2NetClientHandler; ++ } ++ ++ /** ++ * Block dig operation in creative mode (instantly digs the block). ++ */ ++ public static void clickBlockCreative(Minecraft par0Minecraft, PlayerControllerMP par1PlayerControllerMP, int par2, int par3, int par4, int par5) ++ { ++ if (!par0Minecraft.theWorld.extinguishFire(par0Minecraft.thePlayer, par2, par3, par4, par5)) ++ { ++ par1PlayerControllerMP.onPlayerDestroyBlock(par2, par3, par4, par5); ++ } ++ } ++ ++ /** ++ * Sets player capabilities depending on current gametype. params: player ++ */ ++ public void setPlayerCapabilities(EntityPlayer par1EntityPlayer) ++ { ++ this.currentGameType.configurePlayerCapabilities(par1EntityPlayer.capabilities); ++ } ++ ++ /** ++ * If modified to return true, the player spins around slowly around (0, 68.5, 0). The GUI is disabled, the view is ++ * set to first person, and both chat and menu are disabled. Unless the server is modified to ignore illegal ++ * stances, attempting to enter a world at all will result in an immediate kick due to an illegal stance. Appears to ++ * be left-over debug, or demo code. ++ */ ++ public boolean enableEverythingIsScrewedUpMode() ++ { ++ return false; ++ } ++ ++ /** ++ * Sets the game type for the player. ++ */ ++ public void setGameType(EnumGameType par1EnumGameType) ++ { ++ this.currentGameType = par1EnumGameType; ++ this.currentGameType.configurePlayerCapabilities(this.mc.thePlayer.capabilities); ++ } ++ ++ /** ++ * Flips the player around. Args: player ++ */ ++ public void flipPlayer(EntityPlayer par1EntityPlayer) ++ { ++ par1EntityPlayer.rotationYaw = -180.0F; ++ } ++ ++ public boolean shouldDrawHUD() ++ { ++ return this.currentGameType.isSurvivalOrAdventure(); ++ } ++ ++ /** ++ * Called when a player completes the destruction of a block ++ */ ++ public boolean onPlayerDestroyBlock(int par1, int par2, int par3, int par4) ++ { ++ if (this.currentGameType.isAdventure() && !this.mc.thePlayer.isCurrentToolAdventureModeExempt(par1, par2, par3)) ++ { ++ return false; ++ } ++ else if (this.currentGameType.isCreative() && this.mc.thePlayer.getHeldItem() != null && this.mc.thePlayer.getHeldItem().getItem() instanceof ItemSword) ++ { ++ return false; ++ } ++ else ++ { ++ WorldClient var5 = this.mc.theWorld; ++ Block var6 = Block.blocksList[var5.getBlockId(par1, par2, par3)]; ++ ++ if (var6 == null) ++ { ++ return false; ++ } ++ else ++ { ++ var5.playAuxSFX(2001, par1, par2, par3, var6.blockID + (var5.getBlockMetadata(par1, par2, par3) << 12)); ++ int var7 = var5.getBlockMetadata(par1, par2, par3); ++ boolean var8 = var5.setBlockToAir(par1, par2, par3); ++ ++ if (var8) ++ { ++ var6.onBlockDestroyedByPlayer(var5, par1, par2, par3, var7); ++ } ++ ++ this.currentBlockY = -1; ++ ++ if (!this.currentGameType.isCreative()) ++ { ++ ItemStack var9 = this.mc.thePlayer.getCurrentEquippedItem(); ++ ++ if (var9 != null) ++ { ++ var9.onBlockDestroyed(var5, var6.blockID, par1, par2, par3, this.mc.thePlayer); ++ ++ if (var9.stackSize == 0) ++ { ++ this.mc.thePlayer.destroyCurrentEquippedItem(); ++ } ++ } ++ } ++ ++ return var8; ++ } ++ } ++ } ++ ++ /** ++ * Called by Minecraft class when the player is hitting a block with an item. Args: x, y, z, side ++ */ ++ public void clickBlock(int par1, int par2, int par3, int par4) ++ { ++ if (!this.currentGameType.isAdventure() || this.mc.thePlayer.isCurrentToolAdventureModeExempt(par1, par2, par3)) ++ { ++ if (this.currentGameType.isCreative()) ++ { ++ this.netClientHandler.addToSendQueue(new Packet14BlockDig(0, par1, par2, par3, par4)); ++ clickBlockCreative(this.mc, this, par1, par2, par3, par4); ++ this.blockHitDelay = 5; ++ } ++ else if (!this.isHittingBlock || !this.sameToolAndBlock(par1, par2, par3)) ++ { ++ if (this.isHittingBlock) ++ { ++ this.netClientHandler.addToSendQueue(new Packet14BlockDig(1, this.currentBlockX, this.currentBlockY, this.currentblockZ, par4)); ++ } ++ ++ this.netClientHandler.addToSendQueue(new Packet14BlockDig(0, par1, par2, par3, par4)); ++ int var5 = this.mc.theWorld.getBlockId(par1, par2, par3); ++ ++ if (var5 > 0 && this.curBlockDamageMP == 0.0F) ++ { ++ Block.blocksList[var5].onBlockClicked(this.mc.theWorld, par1, par2, par3, this.mc.thePlayer); ++ } ++ ++ if (var5 > 0 && Block.blocksList[var5].getPlayerRelativeBlockHardness(this.mc.thePlayer, this.mc.thePlayer.worldObj, par1, par2, par3) >= 1.0F) ++ { ++ this.onPlayerDestroyBlock(par1, par2, par3, par4); ++ } ++ else ++ { ++ this.isHittingBlock = true; ++ this.currentBlockX = par1; ++ this.currentBlockY = par2; ++ this.currentblockZ = par3; ++ this.field_85183_f = this.mc.thePlayer.getHeldItem(); ++ this.curBlockDamageMP = 0.0F; ++ this.stepSoundTickCounter = 0.0F; ++ this.mc.theWorld.destroyBlockInWorldPartially(this.mc.thePlayer.entityId, this.currentBlockX, this.currentBlockY, this.currentblockZ, (int)(this.curBlockDamageMP * 10.0F) - 1); ++ } ++ } ++ } ++ } ++ ++ /** ++ * Resets current block damage and isHittingBlock ++ */ ++ public void resetBlockRemoving() ++ { ++ if (this.isHittingBlock) ++ { ++ this.netClientHandler.addToSendQueue(new Packet14BlockDig(1, this.currentBlockX, this.currentBlockY, this.currentblockZ, -1)); ++ } ++ ++ this.isHittingBlock = false; ++ this.curBlockDamageMP = 0.0F; ++ this.mc.theWorld.destroyBlockInWorldPartially(this.mc.thePlayer.entityId, this.currentBlockX, this.currentBlockY, this.currentblockZ, -1); ++ } ++ ++ /** ++ * Called when a player damages a block and updates damage counters ++ */ ++ public void onPlayerDamageBlock(int par1, int par2, int par3, int par4) ++ { ++ this.syncCurrentPlayItem(); ++ ++ if (this.blockHitDelay > 0) ++ { ++ --this.blockHitDelay; ++ } ++ else if (this.currentGameType.isCreative()) ++ { ++ this.blockHitDelay = 5; ++ this.netClientHandler.addToSendQueue(new Packet14BlockDig(0, par1, par2, par3, par4)); ++ clickBlockCreative(this.mc, this, par1, par2, par3, par4); ++ } ++ else ++ { ++ if (this.sameToolAndBlock(par1, par2, par3)) ++ { ++ int var5 = this.mc.theWorld.getBlockId(par1, par2, par3); ++ ++ if (var5 == 0) ++ { ++ this.isHittingBlock = false; ++ return; ++ } ++ ++ Block var6 = Block.blocksList[var5]; ++ this.curBlockDamageMP += var6.getPlayerRelativeBlockHardness(this.mc.thePlayer, this.mc.thePlayer.worldObj, par1, par2, par3); ++ ++ if (this.stepSoundTickCounter % 4.0F == 0.0F && var6 != null) ++ { ++ this.mc.sndManager.playSound(var6.stepSound.getStepSound(), (float)par1 + 0.5F, (float)par2 + 0.5F, (float)par3 + 0.5F, (var6.stepSound.getVolume() + 1.0F) / 8.0F, var6.stepSound.getPitch() * 0.5F); ++ } ++ ++ ++this.stepSoundTickCounter; ++ ++ if (this.curBlockDamageMP >= 1.0F) ++ { ++ this.isHittingBlock = false; ++ this.netClientHandler.addToSendQueue(new Packet14BlockDig(2, par1, par2, par3, par4)); ++ this.onPlayerDestroyBlock(par1, par2, par3, par4); ++ this.curBlockDamageMP = 0.0F; ++ this.stepSoundTickCounter = 0.0F; ++ this.blockHitDelay = 5; ++ } ++ ++ this.mc.theWorld.destroyBlockInWorldPartially(this.mc.thePlayer.entityId, this.currentBlockX, this.currentBlockY, this.currentblockZ, (int)(this.curBlockDamageMP * 10.0F) - 1); ++ } ++ else ++ { ++ this.clickBlock(par1, par2, par3, par4); ++ } ++ } ++ } ++ ++ /** ++ * player reach distance = 4F ++ */ ++ public float getBlockReachDistance() ++ { ++ return this.currentGameType.isCreative() ? 5.0F : 4.5F; ++ } ++ ++ public void updateController() ++ { ++ this.syncCurrentPlayItem(); ++ this.mc.sndManager.playRandomMusicIfReady(); ++ } ++ ++ private boolean sameToolAndBlock(int par1, int par2, int par3) ++ { ++ ItemStack var4 = this.mc.thePlayer.getHeldItem(); ++ boolean var5 = this.field_85183_f == null && var4 == null; ++ ++ if (this.field_85183_f != null && var4 != null) ++ { ++ var5 = var4.itemID == this.field_85183_f.itemID && ItemStack.areItemStackTagsEqual(var4, this.field_85183_f) && (var4.isItemStackDamageable() || var4.getItemDamage() == this.field_85183_f.getItemDamage()); ++ } ++ ++ return par1 == this.currentBlockX && par2 == this.currentBlockY && par3 == this.currentblockZ && var5; ++ } ++ ++ /** ++ * Syncs the current player item with the server ++ */ ++ private void syncCurrentPlayItem() ++ { ++ int var1 = this.mc.thePlayer.inventory.currentItem; ++ ++ if (var1 != this.currentPlayerItem) ++ { ++ this.currentPlayerItem = var1; ++ this.netClientHandler.addToSendQueue(new Packet16BlockItemSwitch(this.currentPlayerItem)); ++ } ++ } ++ ++ /** ++ * Handles a players right click. Args: player, world, x, y, z, side, hitVec ++ */ ++ public boolean onPlayerRightClick(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7, Vec3 par8Vec3) ++ { ++ this.syncCurrentPlayItem(); ++ float var9 = (float)par8Vec3.xCoord - (float)par4; ++ float var10 = (float)par8Vec3.yCoord - (float)par5; ++ float var11 = (float)par8Vec3.zCoord - (float)par6; ++ boolean var12 = false; ++ int var13; ++ ++ if (!par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null) ++ { ++ var13 = par2World.getBlockId(par4, par5, par6); ++ ++ if (var13 > 0 && Block.blocksList[var13].onBlockActivated(par2World, par4, par5, par6, par1EntityPlayer, par7, var9, var10, var11)) ++ { ++ var12 = true; ++ } ++ } ++ ++ if (!var12 && par3ItemStack != null && par3ItemStack.getItem() instanceof ItemBlock) ++ { ++ ItemBlock var16 = (ItemBlock)par3ItemStack.getItem(); ++ ++ if (!var16.canPlaceItemBlockOnSide(par2World, par4, par5, par6, par7, par1EntityPlayer, par3ItemStack)) ++ { ++ return false; ++ } ++ } ++ ++ this.netClientHandler.addToSendQueue(new Packet15Place(par4, par5, par6, par7, par1EntityPlayer.inventory.getCurrentItem(), var9, var10, var11)); ++ ++ if (var12) ++ { ++ return true; ++ } ++ else if (par3ItemStack == null) ++ { ++ return false; ++ } ++ else if (this.currentGameType.isCreative()) ++ { ++ var13 = par3ItemStack.getItemDamage(); ++ int var14 = par3ItemStack.stackSize; ++ boolean var15 = par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, var9, var10, var11); ++ par3ItemStack.setItemDamage(var13); ++ par3ItemStack.stackSize = var14; ++ return var15; ++ } ++ else ++ { ++ return par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, var9, var10, var11); ++ } ++ } ++ ++ /** ++ * Notifies the server of things like consuming food, etc... ++ */ ++ public boolean sendUseItem(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack) ++ { ++ this.syncCurrentPlayItem(); ++ this.netClientHandler.addToSendQueue(new Packet15Place(-1, -1, -1, 255, par1EntityPlayer.inventory.getCurrentItem(), 0.0F, 0.0F, 0.0F)); ++ int var4 = par3ItemStack.stackSize; ++ ItemStack var5 = par3ItemStack.useItemRightClick(par2World, par1EntityPlayer); ++ ++ if (var5 == par3ItemStack && (var5 == null || var5.stackSize == var4)) ++ { ++ return false; ++ } ++ else ++ { ++ par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = var5; ++ ++ if (var5.stackSize == 0) ++ { ++ par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = null; ++ } ++ ++ return true; ++ } ++ } ++ ++ public EntityClientPlayerMP func_78754_a(World par1World) ++ { ++ return new EntityClientPlayerMP(this.mc, par1World, this.mc.getSession(), this.netClientHandler); ++ } ++ ++ /** ++ * Attacks an entity ++ */ ++ public void attackEntity(EntityPlayer par1EntityPlayer, Entity par2Entity) ++ { ++ this.syncCurrentPlayItem(); ++ this.netClientHandler.addToSendQueue(new Packet7UseEntity(par1EntityPlayer.entityId, par2Entity.entityId, 1)); ++ par1EntityPlayer.attackTargetEntityWithCurrentItem(par2Entity); ++ } ++ ++ public boolean func_78768_b(EntityPlayer par1EntityPlayer, Entity par2Entity) ++ { ++ this.syncCurrentPlayItem(); ++ this.netClientHandler.addToSendQueue(new Packet7UseEntity(par1EntityPlayer.entityId, par2Entity.entityId, 0)); ++ return par1EntityPlayer.interactWith(par2Entity); ++ } ++ ++ public ItemStack windowClick(int par1, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) ++ { ++ short var6 = par5EntityPlayer.openContainer.getNextTransactionID(par5EntityPlayer.inventory); ++ ItemStack var7 = par5EntityPlayer.openContainer.slotClick(par2, par3, par4, par5EntityPlayer); ++ this.netClientHandler.addToSendQueue(new Packet102WindowClick(par1, par2, par3, par4, var7, var6)); ++ return var7; ++ } ++ ++ /** ++ * GuiEnchantment uses this during multiplayer to tell PlayerControllerMP to send a packet indicating the ++ * enchantment action the player has taken. ++ */ ++ public void sendEnchantPacket(int par1, int par2) ++ { ++ this.netClientHandler.addToSendQueue(new Packet108EnchantItem(par1, par2)); ++ } ++ ++ /** ++ * Used in PlayerControllerMP to update the server with an ItemStack in a slot. ++ */ ++ public void sendSlotPacket(ItemStack par1ItemStack, int par2) ++ { ++ if (this.currentGameType.isCreative()) ++ { ++ this.netClientHandler.addToSendQueue(new Packet107CreativeSetSlot(par2, par1ItemStack)); ++ } ++ } ++ ++ public void func_78752_a(ItemStack par1ItemStack) ++ { ++ if (this.currentGameType.isCreative() && par1ItemStack != null) ++ { ++ this.netClientHandler.addToSendQueue(new Packet107CreativeSetSlot(-1, par1ItemStack)); ++ } ++ } ++ ++ public void onStoppedUsingItem(EntityPlayer par1EntityPlayer) ++ { ++ this.syncCurrentPlayItem(); ++ this.netClientHandler.addToSendQueue(new Packet14BlockDig(5, 0, 0, 0, 255)); ++ par1EntityPlayer.stopUsingItem(); ++ } ++ ++ public boolean func_78763_f() ++ { ++ return this.currentGameType.isSurvivalOrAdventure(); ++ } ++ ++ /** ++ * Checks if the player is not creative, used for checking if it should break a block instantly ++ */ ++ public boolean isNotCreative() ++ { ++ return !this.currentGameType.isCreative(); ++ } ++ ++ /** ++ * returns true if player is in creative mode ++ */ ++ public boolean isInCreativeMode() ++ { ++ return this.currentGameType.isCreative(); ++ } ++ ++ /** ++ * true for hitting entities far away. ++ */ ++ public boolean extendedReach() ++ { ++ return this.currentGameType.isCreative(); ++ } ++ ++ public boolean func_110738_j() ++ { ++ return this.mc.thePlayer.isRiding() && this.mc.thePlayer.ridingEntity instanceof EntityHorse; ++ } ++ } +*** PlayerInstance.java Sat Feb 5 04:13:14 2022 +--- PlayerInstance.java Sat Feb 5 04:12:36 2022 +*************** +*** 3,23 **** + import java.util.ArrayList; + import java.util.List; + + class PlayerInstance + { +! /** the list of all players in this instance (chunk) */ +! private final List players; + +! /** the chunk the player currently resides in */ +! private final ChunkCoordIntPair currentChunk; +! +! /** array of blocks to update this tick */ +! private short[] blocksToUpdate; +! +! /** the number of blocks that need to be updated next tick */ +! private int numBlocksToUpdate; + + /** + * Integer field where each bit means to make update 16x16x16 division of chunk (from bottom). + */ + private int flagsYAreasToUpdate; +--- 3,18 ---- + import java.util.ArrayList; + import java.util.List; + + class PlayerInstance + { +! private final List playersInChunk; + +! /** note: this is final */ +! private final ChunkCoordIntPair chunkLocation; +! private short[] locationOfBlockChange; +! private int numberOfTilesToUpdate; + + /** + * Integer field where each bit means to make update 16x16x16 division of chunk (from bottom). + */ + private int flagsYAreasToUpdate; +*************** +*** 28,93 **** + final PlayerManager thePlayerManager; + + public PlayerInstance(PlayerManager par1PlayerManager, int par2, int par3) + { + this.thePlayerManager = par1PlayerManager; +! this.players = new ArrayList(); +! this.blocksToUpdate = new short[64]; +! this.currentChunk = new ChunkCoordIntPair(par2, par3); +! par1PlayerManager.getMinecraftServer().theChunkProviderServer.loadChunk(par2, par3); + } + + public void addPlayer(EntityPlayerMP par1EntityPlayerMP) + { +! if (this.players.contains(par1EntityPlayerMP)) + { +! throw new IllegalStateException("Failed to add player. " + par1EntityPlayerMP + " already is in chunk " + this.currentChunk.chunkXPos + ", " + this.currentChunk.chunkZPos); + } + else + { +! if (this.players.isEmpty()) + { + this.previousWorldTime = PlayerManager.getWorldServer(this.thePlayerManager).getTotalWorldTime(); + } + +! this.players.add(par1EntityPlayerMP); +! par1EntityPlayerMP.loadedChunks.add(this.currentChunk); + } + } + + public void removePlayer(EntityPlayerMP par1EntityPlayerMP) + { +! if (this.players.contains(par1EntityPlayerMP)) + { +! Chunk var2 = PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.currentChunk.chunkXPos, this.currentChunk.chunkZPos); +! par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet51MapChunk(var2, true, 0)); +! this.players.remove(par1EntityPlayerMP); +! par1EntityPlayerMP.loadedChunks.remove(this.currentChunk); + +! if (this.players.isEmpty()) + { +! long var3 = (long)this.currentChunk.chunkXPos + 2147483647L | (long)this.currentChunk.chunkZPos + 2147483647L << 32; + this.increaseInhabitedTime(var2); + PlayerManager.getChunkWatchers(this.thePlayerManager).remove(var3); + PlayerManager.getChunkWatcherList(this.thePlayerManager).remove(this); + +! if (this.numBlocksToUpdate > 0) + { + PlayerManager.getChunkWatchersWithPlayers(this.thePlayerManager).remove(this); + } + +! this.thePlayerManager.getMinecraftServer().theChunkProviderServer.dropChunk(this.currentChunk.chunkXPos, this.currentChunk.chunkZPos); + } + } + } + + /** + * This method currently only increases chunk inhabited time. Extension is possible in next versions + */ + public void processChunk() + { +! this.increaseInhabitedTime(PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.currentChunk.chunkXPos, this.currentChunk.chunkZPos)); + } + + /** + * Increases chunk inhabited time every 8000 ticks + */ +--- 23,88 ---- + final PlayerManager thePlayerManager; + + public PlayerInstance(PlayerManager par1PlayerManager, int par2, int par3) + { + this.thePlayerManager = par1PlayerManager; +! this.playersInChunk = new ArrayList(); +! this.locationOfBlockChange = new short[64]; +! this.chunkLocation = new ChunkCoordIntPair(par2, par3); +! par1PlayerManager.getWorldServer().theChunkProviderServer.loadChunk(par2, par3); + } + + public void addPlayer(EntityPlayerMP par1EntityPlayerMP) + { +! if (this.playersInChunk.contains(par1EntityPlayerMP)) + { +! throw new IllegalStateException("Failed to add player. " + par1EntityPlayerMP + " already is in chunk " + this.chunkLocation.chunkXPos + ", " + this.chunkLocation.chunkZPos); + } + else + { +! if (this.playersInChunk.isEmpty()) + { + this.previousWorldTime = PlayerManager.getWorldServer(this.thePlayerManager).getTotalWorldTime(); + } + +! this.playersInChunk.add(par1EntityPlayerMP); +! par1EntityPlayerMP.loadedChunks.add(this.chunkLocation); + } + } + + public void removePlayer(EntityPlayerMP par1EntityPlayerMP) + { +! if (this.playersInChunk.contains(par1EntityPlayerMP)) + { +! Chunk var2 = PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos); +! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet51MapChunk(var2, true, 0)); +! this.playersInChunk.remove(par1EntityPlayerMP); +! par1EntityPlayerMP.loadedChunks.remove(this.chunkLocation); + +! if (this.playersInChunk.isEmpty()) + { +! long var3 = (long)this.chunkLocation.chunkXPos + 2147483647L | (long)this.chunkLocation.chunkZPos + 2147483647L << 32; + this.increaseInhabitedTime(var2); + PlayerManager.getChunkWatchers(this.thePlayerManager).remove(var3); + PlayerManager.getChunkWatcherList(this.thePlayerManager).remove(this); + +! if (this.numberOfTilesToUpdate > 0) + { + PlayerManager.getChunkWatchersWithPlayers(this.thePlayerManager).remove(this); + } + +! this.thePlayerManager.getWorldServer().theChunkProviderServer.unloadChunksIfNotNearSpawn(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos); + } + } + } + + /** + * This method currently only increases chunk inhabited time. Extension is possible in next versions + */ + public void processChunk() + { +! this.increaseInhabitedTime(PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos)); + } + + /** + * Increases chunk inhabited time every 8000 ticks + */ +*************** +*** 95,236 **** + { + par1Chunk.inhabitedTime += PlayerManager.getWorldServer(this.thePlayerManager).getTotalWorldTime() - this.previousWorldTime; + this.previousWorldTime = PlayerManager.getWorldServer(this.thePlayerManager).getTotalWorldTime(); + } + +! /** +! * mark the block as changed so that it will update clients who need to know about it +! */ +! public void markBlockNeedsUpdate(int par1, int par2, int par3) + { +! if (this.numBlocksToUpdate == 0) + { + PlayerManager.getChunkWatchersWithPlayers(this.thePlayerManager).add(this); + } + + this.flagsYAreasToUpdate |= 1 << (par2 >> 4); + +! if (this.numBlocksToUpdate < 64) + { + short var4 = (short)(par1 << 12 | par3 << 8 | par2); + +! for (int var5 = 0; var5 < this.numBlocksToUpdate; ++var5) + { +! if (this.blocksToUpdate[var5] == var4) + { + return; + } + } + +! this.blocksToUpdate[this.numBlocksToUpdate++] = var4; + } + } + +! /** +! * sends the packet to all players in the current instance +! */ +! public void sendPacketToPlayersInInstance(Packet par1Packet) + { +! for (int var2 = 0; var2 < this.players.size(); ++var2) + { +! EntityPlayerMP var3 = (EntityPlayerMP)this.players.get(var2); + +! if (!var3.loadedChunks.contains(this.currentChunk)) + { +! var3.playerNetServerHandler.sendPacket(par1Packet); + } + } + } + +! public void onUpdate() + { +! if (this.numBlocksToUpdate != 0) + { + int var1; + int var2; + int var3; + +! if (this.numBlocksToUpdate == 1) + { +! var1 = this.currentChunk.chunkXPos * 16 + (this.blocksToUpdate[0] >> 12 & 15); +! var2 = this.blocksToUpdate[0] & 255; +! var3 = this.currentChunk.chunkZPos * 16 + (this.blocksToUpdate[0] >> 8 & 15); +! this.sendPacketToPlayersInInstance(new Packet53BlockChange(var1, var2, var3, PlayerManager.getWorldServer(this.thePlayerManager))); + + if (PlayerManager.getWorldServer(this.thePlayerManager).blockHasTileEntity(var1, var2, var3)) + { +! this.updateTileEntity(PlayerManager.getWorldServer(this.thePlayerManager).getBlockTileEntity(var1, var2, var3)); + } + } + else + { + int var4; + +! if (this.numBlocksToUpdate == 64) + { +! var1 = this.currentChunk.chunkXPos * 16; +! var2 = this.currentChunk.chunkZPos * 16; +! this.sendPacketToPlayersInInstance(new Packet51MapChunk(PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.currentChunk.chunkXPos, this.currentChunk.chunkZPos), false, this.flagsYAreasToUpdate)); + + for (var3 = 0; var3 < 16; ++var3) + { + if ((this.flagsYAreasToUpdate & 1 << var3) != 0) + { + var4 = var3 << 4; +! List var5 = PlayerManager.getWorldServer(this.thePlayerManager).getTileEntityList(var1, var4, var2, var1 + 16, var4 + 16, var2 + 16); + + for (int var6 = 0; var6 < var5.size(); ++var6) + { +! this.updateTileEntity((TileEntity)var5.get(var6)); + } + } + } + } + else + { +! this.sendPacketToPlayersInInstance(new Packet52MultiBlockChange(this.currentChunk.chunkXPos, this.currentChunk.chunkZPos, this.blocksToUpdate, this.numBlocksToUpdate, PlayerManager.getWorldServer(this.thePlayerManager))); + +! for (var1 = 0; var1 < this.numBlocksToUpdate; ++var1) + { +! var2 = this.currentChunk.chunkXPos * 16 + (this.blocksToUpdate[var1] >> 12 & 15); +! var3 = this.blocksToUpdate[var1] & 255; +! var4 = this.currentChunk.chunkZPos * 16 + (this.blocksToUpdate[var1] >> 8 & 15); + + if (PlayerManager.getWorldServer(this.thePlayerManager).blockHasTileEntity(var2, var3, var4)) + { +! this.updateTileEntity(PlayerManager.getWorldServer(this.thePlayerManager).getBlockTileEntity(var2, var3, var4)); + } + } + } + } + +! this.numBlocksToUpdate = 0; + this.flagsYAreasToUpdate = 0; + } + } + +! /** +! * sends players update packet about the given entity +! */ +! private void updateTileEntity(TileEntity par1TileEntity) + { + if (par1TileEntity != null) + { + Packet var2 = par1TileEntity.getDescriptionPacket(); + + if (var2 != null) + { +! this.sendPacketToPlayersInInstance(var2); + } + } + } + + static ChunkCoordIntPair getChunkLocation(PlayerInstance par0PlayerInstance) + { +! return par0PlayerInstance.currentChunk; + } + + static List getPlayersInChunk(PlayerInstance par0PlayerInstance) + { +! return par0PlayerInstance.players; + } + } +--- 90,222 ---- + { + par1Chunk.inhabitedTime += PlayerManager.getWorldServer(this.thePlayerManager).getTotalWorldTime() - this.previousWorldTime; + this.previousWorldTime = PlayerManager.getWorldServer(this.thePlayerManager).getTotalWorldTime(); + } + +! public void flagChunkForUpdate(int par1, int par2, int par3) + { +! if (this.numberOfTilesToUpdate == 0) + { + PlayerManager.getChunkWatchersWithPlayers(this.thePlayerManager).add(this); + } + + this.flagsYAreasToUpdate |= 1 << (par2 >> 4); + +! if (this.numberOfTilesToUpdate < 64) + { + short var4 = (short)(par1 << 12 | par3 << 8 | par2); + +! for (int var5 = 0; var5 < this.numberOfTilesToUpdate; ++var5) + { +! if (this.locationOfBlockChange[var5] == var4) + { + return; + } + } + +! this.locationOfBlockChange[this.numberOfTilesToUpdate++] = var4; + } + } + +! public void sendToAllPlayersWatchingChunk(Packet par1Packet) + { +! for (int var2 = 0; var2 < this.playersInChunk.size(); ++var2) + { +! EntityPlayerMP var3 = (EntityPlayerMP)this.playersInChunk.get(var2); + +! if (!var3.loadedChunks.contains(this.chunkLocation)) + { +! var3.playerNetServerHandler.sendPacketToPlayer(par1Packet); + } + } + } + +! public void sendChunkUpdate() + { +! if (this.numberOfTilesToUpdate != 0) + { + int var1; + int var2; + int var3; + +! if (this.numberOfTilesToUpdate == 1) + { +! var1 = this.chunkLocation.chunkXPos * 16 + (this.locationOfBlockChange[0] >> 12 & 15); +! var2 = this.locationOfBlockChange[0] & 255; +! var3 = this.chunkLocation.chunkZPos * 16 + (this.locationOfBlockChange[0] >> 8 & 15); +! this.sendToAllPlayersWatchingChunk(new Packet53BlockChange(var1, var2, var3, PlayerManager.getWorldServer(this.thePlayerManager))); + + if (PlayerManager.getWorldServer(this.thePlayerManager).blockHasTileEntity(var1, var2, var3)) + { +! this.sendTileToAllPlayersWatchingChunk(PlayerManager.getWorldServer(this.thePlayerManager).getBlockTileEntity(var1, var2, var3)); + } + } + else + { + int var4; + +! if (this.numberOfTilesToUpdate == 64) + { +! var1 = this.chunkLocation.chunkXPos * 16; +! var2 = this.chunkLocation.chunkZPos * 16; +! this.sendToAllPlayersWatchingChunk(new Packet51MapChunk(PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos), false, this.flagsYAreasToUpdate)); + + for (var3 = 0; var3 < 16; ++var3) + { + if ((this.flagsYAreasToUpdate & 1 << var3) != 0) + { + var4 = var3 << 4; +! List var5 = PlayerManager.getWorldServer(this.thePlayerManager).getAllTileEntityInBox(var1, var4, var2, var1 + 16, var4 + 16, var2 + 16); + + for (int var6 = 0; var6 < var5.size(); ++var6) + { +! this.sendTileToAllPlayersWatchingChunk((TileEntity)var5.get(var6)); + } + } + } + } + else + { +! this.sendToAllPlayersWatchingChunk(new Packet52MultiBlockChange(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos, this.locationOfBlockChange, this.numberOfTilesToUpdate, PlayerManager.getWorldServer(this.thePlayerManager))); + +! for (var1 = 0; var1 < this.numberOfTilesToUpdate; ++var1) + { +! var2 = this.chunkLocation.chunkXPos * 16 + (this.locationOfBlockChange[var1] >> 12 & 15); +! var3 = this.locationOfBlockChange[var1] & 255; +! var4 = this.chunkLocation.chunkZPos * 16 + (this.locationOfBlockChange[var1] >> 8 & 15); + + if (PlayerManager.getWorldServer(this.thePlayerManager).blockHasTileEntity(var2, var3, var4)) + { +! this.sendTileToAllPlayersWatchingChunk(PlayerManager.getWorldServer(this.thePlayerManager).getBlockTileEntity(var2, var3, var4)); + } + } + } + } + +! this.numberOfTilesToUpdate = 0; + this.flagsYAreasToUpdate = 0; + } + } + +! private void sendTileToAllPlayersWatchingChunk(TileEntity par1TileEntity) + { + if (par1TileEntity != null) + { + Packet var2 = par1TileEntity.getDescriptionPacket(); + + if (var2 != null) + { +! this.sendToAllPlayersWatchingChunk(var2); + } + } + } + + static ChunkCoordIntPair getChunkLocation(PlayerInstance par0PlayerInstance) + { +! return par0PlayerInstance.chunkLocation; + } + + static List getPlayersInChunk(PlayerInstance par0PlayerInstance) + { +! return par0PlayerInstance.playersInChunk; + } + } +*** PlayerListComponent.java Sat Feb 5 04:13:14 2022 +--- /dev/null Thu Jan 1 01:00:00 1970 +*************** +*** 1,35 **** +- package net.minecraft.src; +- +- import java.util.Vector; +- import javax.swing.JList; +- import net.minecraft.server.MinecraftServer; +- +- public class PlayerListComponent extends JList implements IUpdatePlayerListBox +- { +- private MinecraftServer field_120015_a; +- private int field_120014_b; +- +- public PlayerListComponent(MinecraftServer par1MinecraftServer) +- { +- this.field_120015_a = par1MinecraftServer; +- par1MinecraftServer.func_82010_a(this); +- } +- +- /** +- * Updates the JList with a new model. +- */ +- public void update() +- { +- if (this.field_120014_b++ % 20 == 0) +- { +- Vector var1 = new Vector(); +- +- for (int var2 = 0; var2 < this.field_120015_a.getConfigurationManager().playerEntityList.size(); ++var2) +- { +- var1.add(((EntityPlayerMP)this.field_120015_a.getConfigurationManager().playerEntityList.get(var2)).getCommandSenderName()); +- } +- +- this.setListData(var1); +- } +- } +- } +--- 0 ---- +*** PlayerManager.java Sat Feb 5 04:13:14 2022 +--- PlayerManager.java Sat Feb 5 04:12:36 2022 +*************** +*** 8,22 **** + private final WorldServer theWorldServer; + + /** players in the current instance */ + private final List players = new ArrayList(); + +! /** the hash of all playerInstances created */ + private final LongHashMap playerInstances = new LongHashMap(); + +! /** the playerInstances(chunks) that need to be updated */ +! private final List playerInstancesToUpdate = new ArrayList(); + + /** This field is using when chunk should be processed (every 8000 ticks) */ + private final List playerInstanceList = new ArrayList(); + + /** +--- 8,27 ---- + private final WorldServer theWorldServer; + + /** players in the current instance */ + private final List players = new ArrayList(); + +! /** +! * A map of chunk position (two ints concatenated into a long) to PlayerInstance +! */ + private final LongHashMap playerInstances = new LongHashMap(); + +! /** +! * contains a PlayerInstance for every chunk they can see. the "player instance" cotains a list of all players who +! * can also that chunk +! */ +! private final List chunkWatcherWithPlayers = new ArrayList(); + + /** This field is using when chunk should be processed (every 8000 ticks) */ + private final List playerInstanceList = new ArrayList(); + + /** +*************** +*** 45,58 **** + this.playerViewRadius = par2; + this.theWorldServer = par1WorldServer; + } + } + +! /** +! * Returns the MinecraftServer associated with the PlayerManager. +! */ +! public WorldServer getMinecraftServer() + { + return this.theWorldServer; + } + + /** +--- 50,60 ---- + this.playerViewRadius = par2; + this.theWorldServer = par1WorldServer; + } + } + +! public WorldServer getWorldServer() + { + return this.theWorldServer; + } + + /** +*************** +*** 69,92 **** + this.previousTotalWorldTime = var1; + + for (var3 = 0; var3 < this.playerInstanceList.size(); ++var3) + { + var4 = (PlayerInstance)this.playerInstanceList.get(var3); +! var4.onUpdate(); + var4.processChunk(); + } + } + else + { +! for (var3 = 0; var3 < this.playerInstancesToUpdate.size(); ++var3) + { +! var4 = (PlayerInstance)this.playerInstancesToUpdate.get(var3); +! var4.onUpdate(); + } + } + +! this.playerInstancesToUpdate.clear(); + + if (this.players.isEmpty()) + { + WorldProvider var5 = this.theWorldServer.provider; + +--- 71,94 ---- + this.previousTotalWorldTime = var1; + + for (var3 = 0; var3 < this.playerInstanceList.size(); ++var3) + { + var4 = (PlayerInstance)this.playerInstanceList.get(var3); +! var4.sendChunkUpdate(); + var4.processChunk(); + } + } + else + { +! for (var3 = 0; var3 < this.chunkWatcherWithPlayers.size(); ++var3) + { +! var4 = (PlayerInstance)this.chunkWatcherWithPlayers.get(var3); +! var4.sendChunkUpdate(); + } + } + +! this.chunkWatcherWithPlayers.clear(); + + if (this.players.isEmpty()) + { + WorldProvider var5 = this.theWorldServer.provider; + +*************** +*** 95,108 **** + this.theWorldServer.theChunkProviderServer.unloadAllChunks(); + } + } + } + +! /** +! * passi n the chunk x and y and a flag as to whether or not the instance should be made if it doesnt exist +! */ +! private PlayerInstance getPlayerInstance(int par1, int par2, boolean par3) + { + long var4 = (long)par1 + 2147483647L | (long)par2 + 2147483647L << 32; + PlayerInstance var6 = (PlayerInstance)this.playerInstances.getValueByKey(var4); + + if (var6 == null && par3) +--- 97,107 ---- + this.theWorldServer.theChunkProviderServer.unloadAllChunks(); + } + } + } + +! private PlayerInstance getOrCreateChunkWatcher(int par1, int par2, boolean par3) + { + long var4 = (long)par1 + 2147483647L | (long)par2 + 2147483647L << 32; + PlayerInstance var6 = (PlayerInstance)this.playerInstances.getValueByKey(var4); + + if (var6 == null && par3) +*************** +*** 120,139 **** + */ + public void markBlockForUpdate(int par1, int par2, int par3) + { + int var4 = par1 >> 4; + int var5 = par3 >> 4; +! PlayerInstance var6 = this.getPlayerInstance(var4, var5, false); + + if (var6 != null) + { +! var6.markBlockNeedsUpdate(par1 & 15, par2, par3 & 15); + } + } + + /** +! * Adds an EntityPlayerMP to the PlayerManager and to all player instances within player visibility + */ + public void addPlayer(EntityPlayerMP par1EntityPlayerMP) + { + int var2 = (int)par1EntityPlayerMP.posX >> 4; + int var3 = (int)par1EntityPlayerMP.posZ >> 4; +--- 119,138 ---- + */ + public void markBlockForUpdate(int par1, int par2, int par3) + { + int var4 = par1 >> 4; + int var5 = par3 >> 4; +! PlayerInstance var6 = this.getOrCreateChunkWatcher(var4, var5, false); + + if (var6 != null) + { +! var6.flagChunkForUpdate(par1 & 15, par2, par3 & 15); + } + } + + /** +! * Adds an EntityPlayerMP to the PlayerManager. + */ + public void addPlayer(EntityPlayerMP par1EntityPlayerMP) + { + int var2 = (int)par1EntityPlayerMP.posX >> 4; + int var3 = (int)par1EntityPlayerMP.posZ >> 4; +*************** +*** 142,152 **** + + for (int var4 = var2 - this.playerViewRadius; var4 <= var2 + this.playerViewRadius; ++var4) + { + for (int var5 = var3 - this.playerViewRadius; var5 <= var3 + this.playerViewRadius; ++var5) + { +! this.getPlayerInstance(var4, var5, true).addPlayer(par1EntityPlayerMP); + } + } + + this.players.add(par1EntityPlayerMP); + this.filterChunkLoadQueue(par1EntityPlayerMP); +--- 141,151 ---- + + for (int var4 = var2 - this.playerViewRadius; var4 <= var2 + this.playerViewRadius; ++var4) + { + for (int var5 = var3 - this.playerViewRadius; var5 <= var3 + this.playerViewRadius; ++var5) + { +! this.getOrCreateChunkWatcher(var4, var5, true).addPlayer(par1EntityPlayerMP); + } + } + + this.players.add(par1EntityPlayerMP); + this.filterChunkLoadQueue(par1EntityPlayerMP); +*************** +*** 162,172 **** + int var4 = this.playerViewRadius; + int var5 = (int)par1EntityPlayerMP.posX >> 4; + int var6 = (int)par1EntityPlayerMP.posZ >> 4; + int var7 = 0; + int var8 = 0; +! ChunkCoordIntPair var9 = PlayerInstance.getChunkLocation(this.getPlayerInstance(var5, var6, true)); + par1EntityPlayerMP.loadedChunks.clear(); + + if (var2.contains(var9)) + { + par1EntityPlayerMP.loadedChunks.add(var9); +--- 161,171 ---- + int var4 = this.playerViewRadius; + int var5 = (int)par1EntityPlayerMP.posX >> 4; + int var6 = (int)par1EntityPlayerMP.posZ >> 4; + int var7 = 0; + int var8 = 0; +! ChunkCoordIntPair var9 = PlayerInstance.getChunkLocation(this.getOrCreateChunkWatcher(var5, var6, true)); + par1EntityPlayerMP.loadedChunks.clear(); + + if (var2.contains(var9)) + { + par1EntityPlayerMP.loadedChunks.add(var9); +*************** +*** 182,192 **** + + for (int var13 = 0; var13 < var10; ++var13) + { + var7 += var12[0]; + var8 += var12[1]; +! var9 = PlayerInstance.getChunkLocation(this.getPlayerInstance(var5 + var7, var6 + var8, true)); + + if (var2.contains(var9)) + { + par1EntityPlayerMP.loadedChunks.add(var9); + } +--- 181,191 ---- + + for (int var13 = 0; var13 < var10; ++var13) + { + var7 += var12[0]; + var8 += var12[1]; +! var9 = PlayerInstance.getChunkLocation(this.getOrCreateChunkWatcher(var5 + var7, var6 + var8, true)); + + if (var2.contains(var9)) + { + par1EntityPlayerMP.loadedChunks.add(var9); + } +*************** +*** 198,208 **** + + for (var10 = 0; var10 < var4 * 2; ++var10) + { + var7 += this.xzDirectionsConst[var3][0]; + var8 += this.xzDirectionsConst[var3][1]; +! var9 = PlayerInstance.getChunkLocation(this.getPlayerInstance(var5 + var7, var6 + var8, true)); + + if (var2.contains(var9)) + { + par1EntityPlayerMP.loadedChunks.add(var9); + } +--- 197,207 ---- + + for (var10 = 0; var10 < var4 * 2; ++var10) + { + var7 += this.xzDirectionsConst[var3][0]; + var8 += this.xzDirectionsConst[var3][1]; +! var9 = PlayerInstance.getChunkLocation(this.getOrCreateChunkWatcher(var5 + var7, var6 + var8, true)); + + if (var2.contains(var9)) + { + par1EntityPlayerMP.loadedChunks.add(var9); + } +*************** +*** 219,229 **** + + for (int var4 = var2 - this.playerViewRadius; var4 <= var2 + this.playerViewRadius; ++var4) + { + for (int var5 = var3 - this.playerViewRadius; var5 <= var3 + this.playerViewRadius; ++var5) + { +! PlayerInstance var6 = this.getPlayerInstance(var4, var5, false); + + if (var6 != null) + { + var6.removePlayer(par1EntityPlayerMP); + } +--- 218,228 ---- + + for (int var4 = var2 - this.playerViewRadius; var4 <= var2 + this.playerViewRadius; ++var4) + { + for (int var5 = var3 - this.playerViewRadius; var5 <= var3 + this.playerViewRadius; ++var5) + { +! PlayerInstance var6 = this.getOrCreateChunkWatcher(var4, var5, false); + + if (var6 != null) + { + var6.removePlayer(par1EntityPlayerMP); + } +*************** +*** 269,284 **** + { + for (int var16 = var3 - var12; var16 <= var3 + var12; ++var16) + { + if (!this.overlaps(var15, var16, var10, var11, var12)) + { +! this.getPlayerInstance(var15, var16, true).addPlayer(par1EntityPlayerMP); + } + + if (!this.overlaps(var15 - var13, var16 - var14, var2, var3, var12)) + { +! PlayerInstance var17 = this.getPlayerInstance(var15 - var13, var16 - var14, false); + + if (var17 != null) + { + var17.removePlayer(par1EntityPlayerMP); + } +--- 268,283 ---- + { + for (int var16 = var3 - var12; var16 <= var3 + var12; ++var16) + { + if (!this.overlaps(var15, var16, var10, var11, var12)) + { +! this.getOrCreateChunkWatcher(var15, var16, true).addPlayer(par1EntityPlayerMP); + } + + if (!this.overlaps(var15 - var13, var16 - var14, var2, var3, var12)) + { +! PlayerInstance var17 = this.getOrCreateChunkWatcher(var15 - var13, var16 - var14, false); + + if (var17 != null) + { + var17.removePlayer(par1EntityPlayerMP); + } +*************** +*** 293,303 **** + } + } + + public boolean isPlayerWatchingChunk(EntityPlayerMP par1EntityPlayerMP, int par2, int par3) + { +! PlayerInstance var4 = this.getPlayerInstance(par2, par3, false); + return var4 == null ? false : PlayerInstance.getPlayersInChunk(var4).contains(par1EntityPlayerMP) && !par1EntityPlayerMP.loadedChunks.contains(PlayerInstance.getChunkLocation(var4)); + } + + /** + * Get the furthest viewable block given player's view distance +--- 292,302 ---- + } + } + + public boolean isPlayerWatchingChunk(EntityPlayerMP par1EntityPlayerMP, int par2, int par3) + { +! PlayerInstance var4 = this.getOrCreateChunkWatcher(par2, par3, false); + return var4 == null ? false : PlayerInstance.getPlayersInChunk(var4).contains(par1EntityPlayerMP) && !par1EntityPlayerMP.loadedChunks.contains(PlayerInstance.getChunkLocation(var4)); + } + + /** + * Get the furthest viewable block given player's view distance +*************** +*** 325,332 **** + return par0PlayerManager.playerInstanceList; + } + + static List getChunkWatchersWithPlayers(PlayerManager par0PlayerManager) + { +! return par0PlayerManager.playerInstancesToUpdate; + } + } +--- 324,331 ---- + return par0PlayerManager.playerInstanceList; + } + + static List getChunkWatchersWithPlayers(PlayerManager par0PlayerManager) + { +! return par0PlayerManager.chunkWatcherWithPlayers; + } + } +*** PlayerNotFoundException.java Sat Feb 5 04:13:14 2022 +--- PlayerNotFoundException.java Sat Feb 5 04:12:36 2022 +*** PlayerPositionComparator.java Sat Feb 5 04:13:14 2022 +--- PlayerPositionComparator.java Sat Feb 5 04:12:36 2022 +*** PlayerSelector.java Sat Feb 5 04:13:14 2022 +--- PlayerSelector.java Sat Feb 5 04:12:36 2022 +*************** +*** 78,88 **** + int var6 = getDefaultMaximumRange(var4); + int var7 = getDefaultMinimumLevel(var4); + int var8 = getDefaultMaximumLevel(var4); + int var9 = getDefaultCount(var4); + int var10 = EnumGameType.NOT_SET.getID(); +! ChunkCoordinates var11 = par0ICommandSender.getCommandSenderPosition(); + Map var12 = func_96560_a(var3); + String var13 = null; + String var14 = null; + boolean var15 = false; + +--- 78,88 ---- + int var6 = getDefaultMaximumRange(var4); + int var7 = getDefaultMinimumLevel(var4); + int var8 = getDefaultMaximumLevel(var4); + int var9 = getDefaultCount(var4); + int var10 = EnumGameType.NOT_SET.getID(); +! ChunkCoordinates var11 = par0ICommandSender.getPlayerCoordinates(); + Map var12 = func_96560_a(var3); + String var13 = null; + String var14 = null; + boolean var15 = false; + +*** PlayerUsageSnooper.java Sat Feb 5 04:13:14 2022 +--- PlayerUsageSnooper.java Sat Feb 5 04:12:36 2022 +*************** +*** 4,17 **** + import java.lang.management.RuntimeMXBean; + import java.net.MalformedURLException; + import java.net.URL; + import java.util.HashMap; + import java.util.Iterator; + import java.util.List; + import java.util.Map; +- import java.util.Timer; + import java.util.UUID; + + public class PlayerUsageSnooper + { + /** String map for report data */ + private Map dataMap = new HashMap(); +--- 4,18 ---- + import java.lang.management.RuntimeMXBean; + import java.net.MalformedURLException; + import java.net.URL; + import java.util.HashMap; + import java.util.Iterator; ++ import java.util.LinkedHashMap; + import java.util.List; + import java.util.Map; + import java.util.UUID; ++ import java.util.Map.Entry; + + public class PlayerUsageSnooper + { + /** String map for report data */ + private Map dataMap = new HashMap(); +*************** +*** 20,30 **** + /** URL of the server to send the report to */ + private final URL serverUrl; + private final IPlayerUsage playerStatsCollector; + + /** set to fire the snooperThread every 15 mins */ +! private final Timer threadTrigger = new Timer("Snooper Timer", true); + private final Object syncLock = new Object(); + private final long field_98224_g; + private boolean isRunning; + + /** incremented on every getSelfCounterFor */ +--- 21,31 ---- + /** URL of the server to send the report to */ + private final URL serverUrl; + private final IPlayerUsage playerStatsCollector; + + /** set to fire the snooperThread every 15 mins */ +! private final java.util.Timer threadTrigger = new java.util.Timer("Snooper Timer", true); + private final Object syncLock = new Object(); + private final long field_98224_g; + private boolean isRunning; + + /** incremented on every getSelfCounterFor */ +*************** +*** 110,127 **** +--- 111,153 ---- + { + this.dataMap.put(par1Str, par2Obj); + } + } + ++ public Map getCurrentStats() ++ { ++ LinkedHashMap var1 = new LinkedHashMap(); ++ Object var2 = this.syncLock; ++ ++ synchronized (this.syncLock) ++ { ++ this.addMemoryStatsToSnooper(); ++ Iterator var3 = this.dataMap.entrySet().iterator(); ++ ++ while (var3.hasNext()) ++ { ++ Entry var4 = (Entry)var3.next(); ++ var1.put(var4.getKey(), var4.getValue().toString()); ++ } ++ ++ return var1; ++ } ++ } ++ + public boolean isSnooperRunning() + { + return this.isRunning; + } + + public void stopSnooper() + { + this.threadTrigger.cancel(); ++ } ++ ++ public String getUniqueID() ++ { ++ return this.uniqueID; + } + + public long func_130105_g() + { + return this.field_98224_g; +*** PlayerUsageSnooperThread.java Sat Feb 5 04:13:14 2022 +--- PlayerUsageSnooperThread.java Sat Feb 5 04:12:36 2022 +*** PortalPosition.java Sat Feb 5 04:13:14 2022 +--- PortalPosition.java Sat Feb 5 04:12:36 2022 +*** PositionImpl.java Sat Feb 5 04:13:14 2022 +--- PositionImpl.java Sat Feb 5 04:12:36 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- PositionTextureVertex.java Sat Feb 5 04:12:36 2022 +*************** +*** 0 **** +--- 1,32 ---- ++ package net.minecraft.src; ++ ++ public class PositionTextureVertex ++ { ++ public Vec3 vector3D; ++ public float texturePositionX; ++ public float texturePositionY; ++ ++ public PositionTextureVertex(float par1, float par2, float par3, float par4, float par5) ++ { ++ this(Vec3.createVectorHelper((double)par1, (double)par2, (double)par3), par4, par5); ++ } ++ ++ public PositionTextureVertex setTexturePosition(float par1, float par2) ++ { ++ return new PositionTextureVertex(this, par1, par2); ++ } ++ ++ public PositionTextureVertex(PositionTextureVertex par1PositionTextureVertex, float par2, float par3) ++ { ++ this.vector3D = par1PositionTextureVertex.vector3D; ++ this.texturePositionX = par2; ++ this.texturePositionY = par3; ++ } ++ ++ public PositionTextureVertex(Vec3 par1Vec3, float par2, float par3) ++ { ++ this.vector3D = par1Vec3; ++ this.texturePositionX = par2; ++ this.texturePositionY = par3; ++ } ++ } +*** Potion.java Sat Feb 5 04:13:14 2022 +--- Potion.java Sat Feb 5 04:12:36 2022 +*************** +*** 243,252 **** +--- 243,289 ---- + public String getName() + { + return this.name; + } + ++ /** ++ * Returns true if the potion has a associated status icon to display in then inventory when active. ++ */ ++ public boolean hasStatusIcon() ++ { ++ return this.statusIconIndex >= 0; ++ } ++ ++ /** ++ * Returns the index for the icon to display when the potion is active. ++ */ ++ public int getStatusIconIndex() ++ { ++ return this.statusIconIndex; ++ } ++ ++ /** ++ * This method returns true if the potion effect is bad - negative - for the entity. ++ */ ++ public boolean isBadEffect() ++ { ++ return this.isBadEffect; ++ } ++ ++ public static String getDurationString(PotionEffect par0PotionEffect) ++ { ++ if (par0PotionEffect.getIsPotionDurationMax()) ++ { ++ return "**:**"; ++ } ++ else ++ { ++ int var1 = par0PotionEffect.getDuration(); ++ return StringUtils.ticksToElapsedTime(var1); ++ } ++ } ++ + protected Potion setEffectiveness(double par1) + { + this.effectiveness = par1; + return this; + } +*************** +*** 272,281 **** +--- 309,323 ---- + public Potion func_111184_a(Attribute par1Attribute, String par2Str, double par3, int par5) + { + AttributeModifier var6 = new AttributeModifier(UUID.fromString(par2Str), this.getName(), par3, par5); + this.field_111188_I.put(par1Attribute, var6); + return this; ++ } ++ ++ public Map func_111186_k() ++ { ++ return this.field_111188_I; + } + + public void removeAttributesModifiersFromEntity(EntityLivingBase par1EntityLivingBase, BaseAttributeMap par2BaseAttributeMap, int par3) + { + Iterator var4 = this.field_111188_I.entrySet().iterator(); +*** PotionAbsoption.java Sat Feb 5 04:13:14 2022 +--- PotionAbsoption.java Sat Feb 5 04:12:36 2022 +*** PotionAttackDamage.java Sat Feb 5 04:13:14 2022 +--- PotionAttackDamage.java Sat Feb 5 04:12:36 2022 +*** PotionEffect.java Sat Feb 5 04:13:14 2022 +--- PotionEffect.java Sat Feb 5 04:12:36 2022 +*************** +*** 15,24 **** +--- 15,27 ---- + private boolean isSplashPotion; + + /** Whether the potion effect came from a beacon */ + private boolean isAmbient; + ++ /** True if potion effect duration is at maximum, false otherwise. */ ++ private boolean isPotionDurationMax; ++ + public PotionEffect(int par1, int par2) + { + this(par1, par2, 0); + } + +*************** +*** 194,200 **** +--- 197,216 ---- + byte var1 = par0NBTTagCompound.getByte("Id"); + byte var2 = par0NBTTagCompound.getByte("Amplifier"); + int var3 = par0NBTTagCompound.getInteger("Duration"); + boolean var4 = par0NBTTagCompound.getBoolean("Ambient"); + return new PotionEffect(var1, var3, var2, var4); ++ } ++ ++ /** ++ * Toggle the isPotionDurationMax field. ++ */ ++ public void setPotionDurationMax(boolean par1) ++ { ++ this.isPotionDurationMax = par1; ++ } ++ ++ public boolean getIsPotionDurationMax() ++ { ++ return this.isPotionDurationMax; + } + } +*** PotionHealth.java Sat Feb 5 04:13:14 2022 +--- PotionHealth.java Sat Feb 5 04:12:36 2022 +*** PotionHealthBoost.java Sat Feb 5 04:13:14 2022 +--- PotionHealthBoost.java Sat Feb 5 04:12:36 2022 +*** PotionHelper.java Sat Feb 5 04:13:14 2022 +--- PotionHelper.java Sat Feb 5 04:12:36 2022 +*************** +*** 28,38 **** + + /** An array of possible potion prefix names, as translation IDs. */ + private static final String[] potionPrefixes; + + /** +! * Checks if the bit at 1 << j is on in i. + */ + public static boolean checkFlag(int par0, int par1) + { + return (par0 & 1 << par1) != 0; + } +--- 28,38 ---- + + /** An array of possible potion prefix names, as translation IDs. */ + private static final String[] potionPrefixes; + + /** +! * Is the bit given set to 1? + */ + public static boolean checkFlag(int par0, int par1) + { + return (par0 & 1 << par1) != 0; + } +*************** +*** 115,124 **** +--- 115,145 ---- + while (var2.getIsAmbient()); + + return false; + } + ++ public static int func_77915_a(int par0, boolean par1) ++ { ++ if (!par1) ++ { ++ if (field_77925_n.containsKey(Integer.valueOf(par0))) ++ { ++ return ((Integer)field_77925_n.get(Integer.valueOf(par0))).intValue(); ++ } ++ else ++ { ++ int var2 = calcPotionLiquidColor(getPotionEffects(par0, false)); ++ field_77925_n.put(Integer.valueOf(par0), Integer.valueOf(var2)); ++ return var2; ++ } ++ } ++ else ++ { ++ return calcPotionLiquidColor(getPotionEffects(par0, par1)); ++ } ++ } ++ + public static String func_77905_c(int par0) + { + int var1 = func_77909_a(par0); + return potionPrefixes[var1]; + } +*************** +*** 163,173 **** + + return var7; + } + + /** +! * Returns the number of 1 bits in the given integer. + */ + private static int countSetFlags(int par0) + { + int var1; + +--- 184,194 ---- + + return var7; + } + + /** +! * Count the number of bits in an integer set to ON. + */ + private static int countSetFlags(int par0) + { + int var1; + +*************** +*** 419,429 **** + + return var2; + } + + /** +! * Manipulates the specified bit of the potion damage value according to the rules passed from applyIngredient. + */ + private static int brewBitOperations(int par0, int par1, boolean par2, boolean par3, boolean par4) + { + if (par4) + { +--- 440,452 ---- + + return var2; + } + + /** +! * Does bit operations for brewPotionData, given data, the index of the bit being operated upon, whether the bit +! * will be removed, whether the bit will be toggled (NOT), or whether the data field will be set to 0 if the bit is +! * not present. + */ + private static int brewBitOperations(int par0, int par1, boolean par2, boolean par3, boolean par4) + { + if (par4) + { +*************** +*** 454,464 **** + + return par0; + } + + /** +! * Returns the new potion damage value after the specified ingredient info is applied to the specified potion. + */ + public static int applyIngredient(int par0, String par1Str) + { + byte var2 = 0; + int var3 = par1Str.length(); +--- 477,488 ---- + + return par0; + } + + /** +! * Generate a data value for a potion, given its previous data value and the encoded string of new effects it will +! * receive + */ + public static int applyIngredient(int par0, String par1Str) + { + byte var2 = 0; + int var3 = par1Str.length(); +*** Profiler.java Sat Feb 5 04:13:14 2022 +--- Profiler.java Sat Feb 5 04:12:36 2022 +*** ProfilerResult.java Sat Feb 5 04:13:14 2022 +--- ProfilerResult.java Sat Feb 5 04:12:36 2022 +*************** +*** 16,25 **** +--- 16,30 ---- + public int func_76328_a(ProfilerResult par1ProfilerResult) + { + return par1ProfilerResult.field_76332_a < this.field_76332_a ? -1 : (par1ProfilerResult.field_76332_a > this.field_76332_a ? 1 : par1ProfilerResult.field_76331_c.compareTo(this.field_76331_c)); + } + ++ public int func_76329_a() ++ { ++ return (this.field_76331_c.hashCode() & 11184810) + 4473924; ++ } ++ + public int compareTo(Object par1Obj) + { + return this.func_76328_a((ProfilerResult)par1Obj); + } + } +*** PropertyManager.java Sat Feb 5 04:13:14 2022 +--- PropertyManager.java Sat Feb 5 04:12:36 2022 +*************** +*** 6,42 **** + import java.io.IOException; + import java.util.Properties; + + public class PropertyManager + { +! /** The server properties object. */ +! private final Properties serverProperties = new Properties(); + + /** Reference to the logger. */ + private final ILogAgent logger; +! +! /** The server properties file. */ +! private final File serverPropertiesFile; + + public PropertyManager(File par1File, ILogAgent par2ILogAgent) + { +! this.serverPropertiesFile = par1File; + this.logger = par2ILogAgent; + + if (par1File.exists()) + { + FileInputStream var3 = null; + + try + { + var3 = new FileInputStream(par1File); +! this.serverProperties.load(var3); + } + catch (Exception var13) + { + par2ILogAgent.logWarningException("Failed to load " + par1File, var13); +! this.generateNewProperties(); + } + finally + { + if (var3 != null) + { +--- 6,39 ---- + import java.io.IOException; + import java.util.Properties; + + public class PropertyManager + { +! private final Properties properties = new Properties(); + + /** Reference to the logger. */ + private final ILogAgent logger; +! private final File associatedFile; + + public PropertyManager(File par1File, ILogAgent par2ILogAgent) + { +! this.associatedFile = par1File; + this.logger = par2ILogAgent; + + if (par1File.exists()) + { + FileInputStream var3 = null; + + try + { + var3 = new FileInputStream(par1File); +! this.properties.load(var3); + } + catch (Exception var13) + { + par2ILogAgent.logWarningException("Failed to load " + par1File, var13); +! this.logMessageAndSave(); + } + finally + { + if (var3 != null) + { +*************** +*** 52,69 **** + } + } + else + { + par2ILogAgent.logWarning(par1File + " does not exist"); +! this.generateNewProperties(); + } + } + + /** +! * Generates a new properties file. + */ +! public void generateNewProperties() + { + this.logger.logInfo("Generating new properties file"); + this.saveProperties(); + } + +--- 49,67 ---- + } + } + else + { + par2ILogAgent.logWarning(par1File + " does not exist"); +! this.logMessageAndSave(); + } + } + + /** +! * logs an info message then calls saveSettingsToFile Yes this appears to be a potential stack overflow - these 2 +! * functions call each other repeatdly if an exception occurs. + */ +! public void logMessageAndSave() + { + this.logger.logInfo("Generating new properties file"); + this.saveProperties(); + } + +*************** +*** 74,90 **** + { + FileOutputStream var1 = null; + + try + { +! var1 = new FileOutputStream(this.serverPropertiesFile); +! this.serverProperties.store(var1, "Minecraft server properties"); + } + catch (Exception var11) + { +! this.logger.logWarningException("Failed to save " + this.serverPropertiesFile, var11); +! this.generateNewProperties(); + } + finally + { + if (var1 != null) + { +--- 72,88 ---- + { + FileOutputStream var1 = null; + + try + { +! var1 = new FileOutputStream(this.associatedFile); +! this.properties.store(var1, "Minecraft server properties"); + } + catch (Exception var11) + { +! this.logger.logWarningException("Failed to save " + this.associatedFile, var11); +! this.logMessageAndSave(); + } + finally + { + if (var1 != null) + { +*************** +*** 103,141 **** + /** + * Returns this PropertyManager's file object used for property saving. + */ + public File getPropertiesFile() + { +! return this.serverPropertiesFile; + } + + /** +! * Returns a string property. If the property doesn't exist the default is returned. + */ +! public String getStringProperty(String par1Str, String par2Str) + { +! if (!this.serverProperties.containsKey(par1Str)) + { +! this.serverProperties.setProperty(par1Str, par2Str); + this.saveProperties(); + } + +! return this.serverProperties.getProperty(par1Str, par2Str); + } + + /** + * Gets an integer property. If it does not exist, set it to the specified value. + */ + public int getIntProperty(String par1Str, int par2) + { + try + { +! return Integer.parseInt(this.getStringProperty(par1Str, "" + par2)); + } + catch (Exception var4) + { +! this.serverProperties.setProperty(par1Str, "" + par2); + return par2; + } + } + + /** +--- 101,139 ---- + /** + * Returns this PropertyManager's file object used for property saving. + */ + public File getPropertiesFile() + { +! return this.associatedFile; + } + + /** +! * Gets a property. If it does not exist, set it to the specified value. + */ +! public String getProperty(String par1Str, String par2Str) + { +! if (!this.properties.containsKey(par1Str)) + { +! this.properties.setProperty(par1Str, par2Str); + this.saveProperties(); + } + +! return this.properties.getProperty(par1Str, par2Str); + } + + /** + * Gets an integer property. If it does not exist, set it to the specified value. + */ + public int getIntProperty(String par1Str, int par2) + { + try + { +! return Integer.parseInt(this.getProperty(par1Str, "" + par2)); + } + catch (Exception var4) + { +! this.properties.setProperty(par1Str, "" + par2); + return par2; + } + } + + /** +*************** +*** 143,164 **** + */ + public boolean getBooleanProperty(String par1Str, boolean par2) + { + try + { +! return Boolean.parseBoolean(this.getStringProperty(par1Str, "" + par2)); + } + catch (Exception var4) + { +! this.serverProperties.setProperty(par1Str, "" + par2); + return par2; + } + } + + /** + * Saves an Object with the given property name. + */ + public void setProperty(String par1Str, Object par2Obj) + { +! this.serverProperties.setProperty(par1Str, "" + par2Obj); + } + } +--- 141,162 ---- + */ + public boolean getBooleanProperty(String par1Str, boolean par2) + { + try + { +! return Boolean.parseBoolean(this.getProperty(par1Str, "" + par2)); + } + catch (Exception var4) + { +! this.properties.setProperty(par1Str, "" + par2); + return par2; + } + } + + /** + * Saves an Object with the given property name. + */ + public void setProperty(String par1Str, Object par2Obj) + { +! this.properties.setProperty(par1Str, "" + par2Obj); + } + } +*** RandomPositionGenerator.java Sat Feb 5 04:13:14 2022 +--- RandomPositionGenerator.java Sat Feb 5 04:12:36 2022 +*** RangedAttribute.java Sat Feb 5 04:13:14 2022 +--- RangedAttribute.java Sat Feb 5 04:12:36 2022 +*** RConConsoleSource.java Sat Feb 5 04:13:14 2022 +--- RConConsoleSource.java Sat Feb 5 04:12:36 2022 +*************** +*** 2,13 **** + + import net.minecraft.server.MinecraftServer; + + public class RConConsoleSource implements ICommandSender + { +! /** Single instance of RConConsoleSource */ +! public static final RConConsoleSource instance = new RConConsoleSource(); + + /** RCon string buffer for log. */ + private StringBuffer buffer = new StringBuffer(); + + /** +--- 2,13 ---- + + import net.minecraft.server.MinecraftServer; + + public class RConConsoleSource implements ICommandSender + { +! /** only ever used by MinecraftServer.executeCommand */ +! public static final RConConsoleSource consoleBuffer = new RConConsoleSource(); + + /** RCon string buffer for log. */ + private StringBuffer buffer = new StringBuffer(); + + /** +*************** +*** 16,29 **** + public void resetLog() + { + this.buffer.setLength(0); + } + +! /** +! * Gets the contents of the RCon log +! */ +! public String getLogContents() + { + return this.buffer.toString(); + } + + /** +--- 16,26 ---- + public void resetLog() + { + this.buffer.setLength(0); + } + +! public String getChatBuffer() + { + return this.buffer.toString(); + } + + /** +*************** +*** 48,58 **** + } + + /** + * Return the position for this command sender. + */ +! public ChunkCoordinates getCommandSenderPosition() + { + return new ChunkCoordinates(0, 0, 0); + } + + public World getEntityWorld() +--- 45,55 ---- + } + + /** + * Return the position for this command sender. + */ +! public ChunkCoordinates getPlayerCoordinates() + { + return new ChunkCoordinates(0, 0, 0); + } + + public World getEntityWorld() +*** RConOutputStream.java Sat Feb 5 04:13:14 2022 +--- RConOutputStream.java Sat Feb 5 04:12:36 2022 +*** RConThreadBase.java Sat Feb 5 04:13:14 2022 +--- RConThreadBase.java Sat Feb 5 04:12:36 2022 +*** RConThreadClient.java Sat Feb 5 04:13:14 2022 +--- RConThreadClient.java Sat Feb 5 04:12:36 2022 +*************** +*** 78,88 **** + { + String var8 = RConUtils.getBytesAsString(this.buffer, var21, var2); + + try + { +! this.sendMultipacketResponse(var5, this.server.handleRConCommand(var8)); + } + catch (Exception var16) + { + this.sendMultipacketResponse(var5, "Error executing: " + var8 + " (" + var16.getMessage() + ")"); + } +--- 78,88 ---- + { + String var8 = RConUtils.getBytesAsString(this.buffer, var21, var2); + + try + { +! this.sendMultipacketResponse(var5, this.server.executeCommand(var8)); + } + catch (Exception var16) + { + this.sendMultipacketResponse(var5, "Error executing: " + var8 + " (" + var16.getMessage() + ")"); + } +*** RConThreadMain.java Sat Feb 5 04:13:14 2022 +--- RConThreadMain.java Sat Feb 5 04:12:36 2022 +*** RConThreadQuery.java Sat Feb 5 04:13:14 2022 +--- RConThreadQuery.java Sat Feb 5 04:12:36 2022 +*************** +*** 70,80 **** + { + super(par1IServer); + this.queryPort = par1IServer.getIntProperty("query.port", 0); + this.serverHostname = par1IServer.getHostname(); + this.serverPort = par1IServer.getPort(); +! this.serverMotd = par1IServer.getMotd(); + this.maxPlayers = par1IServer.getMaxPlayers(); + this.worldName = par1IServer.getFolderName(); + this.lastQueryResponseTime = 0L; + this.queryHostname = "0.0.0.0"; + +--- 70,80 ---- + { + super(par1IServer); + this.queryPort = par1IServer.getIntProperty("query.port", 0); + this.serverHostname = par1IServer.getHostname(); + this.serverPort = par1IServer.getPort(); +! this.serverMotd = par1IServer.getServerMOTD(); + this.maxPlayers = par1IServer.getMaxPlayers(); + this.worldName = par1IServer.getFolderName(); + this.lastQueryResponseTime = 0L; + this.queryHostname = "0.0.0.0"; + +*************** +*** 182,192 **** + /** + * Creates a query response as a byte array for the specified query DatagramPacket + */ + private byte[] createQueryResponse(DatagramPacket par1DatagramPacket) throws IOException + { +! long var2 = MinecraftServer.getCurrentTimeMillis(); + + if (var2 < this.lastQueryResponseTime + 5000L) + { + byte[] var7 = this.output.toByteArray(); + byte[] var8 = this.getRequestID(par1DatagramPacket.getSocketAddress()); +--- 182,192 ---- + /** + * Creates a query response as a byte array for the specified query DatagramPacket + */ + private byte[] createQueryResponse(DatagramPacket par1DatagramPacket) throws IOException + { +! long var2 = MinecraftServer.getSystemTimeMillis(); + + if (var2 < this.lastQueryResponseTime + 5000L) + { + byte[] var7 = this.output.toByteArray(); + byte[] var8 = this.getRequestID(par1DatagramPacket.getSocketAddress()); +*************** +*** 283,293 **** + */ + private void cleanQueryClientsMap() + { + if (this.running) + { +! long var1 = MinecraftServer.getCurrentTimeMillis(); + + if (var1 >= this.lastAuthCheckTime + 30000L) + { + this.lastAuthCheckTime = var1; + Iterator var3 = this.queryClients.entrySet().iterator(); +--- 283,293 ---- + */ + private void cleanQueryClientsMap() + { + if (this.running) + { +! long var1 = MinecraftServer.getSystemTimeMillis(); + + if (var1 >= this.lastAuthCheckTime + 30000L) + { + this.lastAuthCheckTime = var1; + Iterator var3 = this.queryClients.entrySet().iterator(); +*************** +*** 306,316 **** + } + + public void run() + { + this.logInfo("Query running on " + this.serverHostname + ":" + this.queryPort); +! this.lastAuthCheckTime = MinecraftServer.getCurrentTimeMillis(); + this.incomingPacket = new DatagramPacket(this.buffer, this.buffer.length); + + try + { + while (this.running) +--- 306,316 ---- + } + + public void run() + { + this.logInfo("Query running on " + this.serverHostname + ":" + this.queryPort); +! this.lastAuthCheckTime = MinecraftServer.getSystemTimeMillis(); + this.incomingPacket = new DatagramPacket(this.buffer, this.buffer.length); + + try + { + while (this.running) +*** RConThreadQueryAuth.java Sat Feb 5 04:13:14 2022 +--- RConThreadQueryAuth.java Sat Feb 5 04:12:36 2022 +*************** +*** 7,17 **** + class RConThreadQueryAuth + { + /** The creation timestamp for this auth */ + private long timestamp; + +! /** A random integer value to be used for client response authentication */ + private int randomChallenge; + + /** A client-provided request ID associated with this query. */ + private byte[] requestId; + +--- 7,17 ---- + class RConThreadQueryAuth + { + /** The creation timestamp for this auth */ + private long timestamp; + +! /** A random challenge */ + private int randomChallenge; + + /** A client-provided request ID associated with this query. */ + private byte[] requestId; + +*** RConUtils.java Sat Feb 5 04:13:14 2022 +--- RConUtils.java Sat Feb 5 04:12:36 2022 +*** RecipeFireworks.java Sat Feb 5 04:13:14 2022 +--- RecipeFireworks.java Sat Feb 5 04:12:36 2022 +*** RecipesArmor.java Sat Feb 5 04:13:14 2022 +--- RecipesArmor.java Sat Feb 5 04:12:36 2022 +*** RecipesArmorDyes.java Sat Feb 5 04:13:14 2022 +--- RecipesArmorDyes.java Sat Feb 5 04:12:36 2022 +*** RecipesCrafting.java Sat Feb 5 04:13:14 2022 +--- RecipesCrafting.java Sat Feb 5 04:12:36 2022 +*** RecipesDyes.java Sat Feb 5 04:13:14 2022 +--- RecipesDyes.java Sat Feb 5 04:12:36 2022 +*** RecipesFood.java Sat Feb 5 04:13:14 2022 +--- RecipesFood.java Sat Feb 5 04:12:36 2022 +*** RecipesIngots.java Sat Feb 5 04:13:14 2022 +--- RecipesIngots.java Sat Feb 5 04:12:36 2022 +*** RecipesMapCloning.java Sat Feb 5 04:13:14 2022 +--- RecipesMapCloning.java Sat Feb 5 04:12:36 2022 +*** RecipesMapExtending.java Sat Feb 5 04:13:14 2022 +--- RecipesMapExtending.java Sat Feb 5 04:12:36 2022 +*** RecipeSorter.java Sat Feb 5 04:13:14 2022 +--- RecipeSorter.java Sat Feb 5 04:12:36 2022 +*** RecipesTools.java Sat Feb 5 04:13:14 2022 +--- RecipesTools.java Sat Feb 5 04:12:36 2022 +*** RecipesWeapons.java Sat Feb 5 04:13:14 2022 +--- RecipesWeapons.java Sat Feb 5 04:12:36 2022 +*** RedstoneUpdateInfo.java Sat Feb 5 04:13:14 2022 +--- RedstoneUpdateInfo.java Sat Feb 5 04:12:36 2022 +*** RegionFile.java Sat Feb 5 04:13:14 2022 +--- RegionFile.java Sat Feb 5 04:12:36 2022 +*************** +*** 274,284 **** + this.write(var6, par3ArrayOfByte, par4); + this.setOffset(par1, par2, var6 << 8 | var8); + } + } + +! this.setChunkTimestamp(par1, par2, (int)(MinecraftServer.getCurrentTimeMillis() / 1000L)); + } + catch (IOException var12) + { + var12.printStackTrace(); + } +--- 274,284 ---- + this.write(var6, par3ArrayOfByte, par4); + this.setOffset(par1, par2, var6 << 8 | var8); + } + } + +! this.setChunkTimestamp(par1, par2, (int)(MinecraftServer.getSystemTimeMillis() / 1000L)); + } + catch (IOException var12) + { + var12.printStackTrace(); + } +*** RegionFileCache.java Sat Feb 5 04:13:14 2022 +--- RegionFileCache.java Sat Feb 5 04:12:36 2022 +*************** +*** 40,50 **** + return var6; + } + } + + /** +! * clears region file references + */ + public static synchronized void clearRegionFileReferences() + { + Iterator var0 = regionsByFilename.values().iterator(); + +--- 40,50 ---- + return var6; + } + } + + /** +! * Saves the current Chunk Map Cache + */ + public static synchronized void clearRegionFileReferences() + { + Iterator var0 = regionsByFilename.values().iterator(); + +*** RegionFileChunkBuffer.java Sat Feb 5 04:13:14 2022 +--- RegionFileChunkBuffer.java Sat Feb 5 04:12:36 2022 +*** RegistryDefaulted.java Sat Feb 5 04:13:14 2022 +--- RegistryDefaulted.java Sat Feb 5 04:12:36 2022 +*** RegistrySimple.java Sat Feb 5 04:13:14 2022 +--- RegistrySimple.java Sat Feb 5 04:12:36 2022 +*** /dev/null Thu Jan 1 01:00:00 1970 +--- ReloadableResourceManager.java Sat Feb 5 04:12:36 2022 +*************** +*** 0 **** +--- 1,10 ---- ++ package net.minecraft.src; ++ ++ import java.util.List; ++ ++ public interface ReloadableResourceManager extends ResourceManager ++ { ++ void reloadResources(List var1); ++ ++ void registerReloadListener(ResourceManagerReloadListener var1); ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- Render.java Sat Feb 5 04:12:36 2022 +*************** +*** 0 **** +--- 1,321 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public abstract class Render ++ { ++ private static final ResourceLocation shadowTextures = new ResourceLocation("textures/misc/shadow.png"); ++ protected RenderManager renderManager; ++ protected RenderBlocks renderBlocks = new RenderBlocks(); ++ protected float shadowSize; ++ ++ /** ++ * Determines the darkness of the object's shadow. Higher value makes a darker shadow. ++ */ ++ protected float shadowOpaque = 1.0F; ++ ++ /** ++ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then ++ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic ++ * (Render 0.0F) ++ { ++ Icon var19 = var18 % 2 == 0 ? var9 : var10; ++ this.bindTexture(TextureMap.locationBlocksTexture); ++ float var20 = var19.getMinU(); ++ float var21 = var19.getMinV(); ++ float var22 = var19.getMaxU(); ++ float var23 = var19.getMaxV(); ++ ++ if (var18 / 2 % 2 == 0) ++ { ++ float var24 = var22; ++ var22 = var20; ++ var20 = var24; ++ } ++ ++ var12.addVertexWithUV((double)(var13 - var14), (double)(0.0F - var16), (double)var17, (double)var22, (double)var23); ++ var12.addVertexWithUV((double)(-var13 - var14), (double)(0.0F - var16), (double)var17, (double)var20, (double)var23); ++ var12.addVertexWithUV((double)(-var13 - var14), (double)(1.4F - var16), (double)var17, (double)var20, (double)var21); ++ var12.addVertexWithUV((double)(var13 - var14), (double)(1.4F - var16), (double)var17, (double)var22, (double)var21); ++ var15 -= 0.45F; ++ var16 -= 0.45F; ++ var13 *= 0.9F; ++ var17 += 0.03F; ++ ++var18; ++ } ++ ++ var12.draw(); ++ GL11.glPopMatrix(); ++ GL11.glEnable(GL11.GL_LIGHTING); ++ } ++ ++ /** ++ * Renders the entity shadows at the position, shadow alpha and partialTickTime. Args: entity, x, y, z, shadowAlpha, ++ * partialTickTime ++ */ ++ private void renderShadow(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) ++ { ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ this.renderManager.renderEngine.bindTexture(shadowTextures); ++ World var10 = this.getWorldFromRenderManager(); ++ GL11.glDepthMask(false); ++ float var11 = this.shadowSize; ++ ++ if (par1Entity instanceof EntityLiving) ++ { ++ EntityLiving var12 = (EntityLiving)par1Entity; ++ var11 *= var12.getRenderSizeModifier(); ++ ++ if (var12.isChild()) ++ { ++ var11 *= 0.5F; ++ } ++ } ++ ++ double var35 = par1Entity.lastTickPosX + (par1Entity.posX - par1Entity.lastTickPosX) * (double)par9; ++ double var14 = par1Entity.lastTickPosY + (par1Entity.posY - par1Entity.lastTickPosY) * (double)par9 + (double)par1Entity.getShadowSize(); ++ double var16 = par1Entity.lastTickPosZ + (par1Entity.posZ - par1Entity.lastTickPosZ) * (double)par9; ++ int var18 = MathHelper.floor_double(var35 - (double)var11); ++ int var19 = MathHelper.floor_double(var35 + (double)var11); ++ int var20 = MathHelper.floor_double(var14 - (double)var11); ++ int var21 = MathHelper.floor_double(var14); ++ int var22 = MathHelper.floor_double(var16 - (double)var11); ++ int var23 = MathHelper.floor_double(var16 + (double)var11); ++ double var24 = par2 - var35; ++ double var26 = par4 - var14; ++ double var28 = par6 - var16; ++ Tessellator var30 = Tessellator.instance; ++ var30.startDrawingQuads(); ++ ++ for (int var31 = var18; var31 <= var19; ++var31) ++ { ++ for (int var32 = var20; var32 <= var21; ++var32) ++ { ++ for (int var33 = var22; var33 <= var23; ++var33) ++ { ++ int var34 = var10.getBlockId(var31, var32 - 1, var33); ++ ++ if (var34 > 0 && var10.getBlockLightValue(var31, var32, var33) > 3) ++ { ++ this.renderShadowOnBlock(Block.blocksList[var34], par2, par4 + (double)par1Entity.getShadowSize(), par6, var31, var32, var33, par8, var11, var24, var26 + (double)par1Entity.getShadowSize(), var28); ++ } ++ } ++ } ++ } ++ ++ var30.draw(); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glDisable(GL11.GL_BLEND); ++ GL11.glDepthMask(true); ++ } ++ ++ /** ++ * Returns the render manager's world object ++ */ ++ private World getWorldFromRenderManager() ++ { ++ return this.renderManager.worldObj; ++ } ++ ++ /** ++ * Renders a shadow projected down onto the specified block. Brightness of the block plus how far away on the Y axis ++ * determines the alpha of the shadow. Args: block, centerX, centerY, centerZ, blockX, blockY, blockZ, baseAlpha, ++ * shadowSize, xOffset, yOffset, zOffset ++ */ ++ private void renderShadowOnBlock(Block par1Block, double par2, double par4, double par6, int par8, int par9, int par10, float par11, float par12, double par13, double par15, double par17) ++ { ++ Tessellator var19 = Tessellator.instance; ++ ++ if (par1Block.renderAsNormalBlock()) ++ { ++ double var20 = ((double)par11 - (par4 - ((double)par9 + par15)) / 2.0D) * 0.5D * (double)this.getWorldFromRenderManager().getLightBrightness(par8, par9, par10); ++ ++ if (var20 >= 0.0D) ++ { ++ if (var20 > 1.0D) ++ { ++ var20 = 1.0D; ++ } ++ ++ var19.setColorRGBA_F(1.0F, 1.0F, 1.0F, (float)var20); ++ double var22 = (double)par8 + par1Block.getBlockBoundsMinX() + par13; ++ double var24 = (double)par8 + par1Block.getBlockBoundsMaxX() + par13; ++ double var26 = (double)par9 + par1Block.getBlockBoundsMinY() + par15 + 0.015625D; ++ double var28 = (double)par10 + par1Block.getBlockBoundsMinZ() + par17; ++ double var30 = (double)par10 + par1Block.getBlockBoundsMaxZ() + par17; ++ float var32 = (float)((par2 - var22) / 2.0D / (double)par12 + 0.5D); ++ float var33 = (float)((par2 - var24) / 2.0D / (double)par12 + 0.5D); ++ float var34 = (float)((par6 - var28) / 2.0D / (double)par12 + 0.5D); ++ float var35 = (float)((par6 - var30) / 2.0D / (double)par12 + 0.5D); ++ var19.addVertexWithUV(var22, var26, var28, (double)var32, (double)var34); ++ var19.addVertexWithUV(var22, var26, var30, (double)var32, (double)var35); ++ var19.addVertexWithUV(var24, var26, var30, (double)var33, (double)var35); ++ var19.addVertexWithUV(var24, var26, var28, (double)var33, (double)var34); ++ } ++ } ++ } ++ ++ /** ++ * Renders a white box with the bounds of the AABB translated by the offset. Args: aabb, x, y, z ++ */ ++ public static void renderOffsetAABB(AxisAlignedBB par0AxisAlignedBB, double par1, double par3, double par5) ++ { ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ Tessellator var7 = Tessellator.instance; ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ var7.startDrawingQuads(); ++ var7.setTranslation(par1, par3, par5); ++ var7.setNormal(0.0F, 0.0F, -1.0F); ++ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); ++ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); ++ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); ++ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); ++ var7.setNormal(0.0F, 0.0F, 1.0F); ++ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); ++ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); ++ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); ++ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); ++ var7.setNormal(0.0F, -1.0F, 0.0F); ++ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); ++ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); ++ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); ++ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); ++ var7.setNormal(0.0F, 1.0F, 0.0F); ++ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); ++ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); ++ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); ++ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); ++ var7.setNormal(-1.0F, 0.0F, 0.0F); ++ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); ++ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); ++ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); ++ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); ++ var7.setNormal(1.0F, 0.0F, 0.0F); ++ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); ++ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); ++ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); ++ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); ++ var7.setTranslation(0.0D, 0.0D, 0.0D); ++ var7.draw(); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ } ++ ++ /** ++ * Adds to the tesselator a box using the aabb for the bounds. Args: aabb ++ */ ++ public static void renderAABB(AxisAlignedBB par0AxisAlignedBB) ++ { ++ Tessellator var1 = Tessellator.instance; ++ var1.startDrawingQuads(); ++ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); ++ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); ++ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); ++ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); ++ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); ++ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); ++ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); ++ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); ++ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); ++ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); ++ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); ++ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); ++ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); ++ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); ++ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); ++ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); ++ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); ++ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); ++ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); ++ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); ++ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); ++ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); ++ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); ++ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); ++ var1.draw(); ++ } ++ ++ /** ++ * Sets the RenderManager. ++ */ ++ public void setRenderManager(RenderManager par1RenderManager) ++ { ++ this.renderManager = par1RenderManager; ++ } ++ ++ /** ++ * Renders the entity's shadow and fire (if its on fire). Args: entity, x, y, z, yaw, partialTickTime ++ */ ++ public void doRenderShadowAndFire(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) ++ { ++ if (this.renderManager.options.fancyGraphics && this.shadowSize > 0.0F && !par1Entity.isInvisible()) ++ { ++ double var10 = this.renderManager.getDistanceToCamera(par1Entity.posX, par1Entity.posY, par1Entity.posZ); ++ float var12 = (float)((1.0D - var10 / 256.0D) * (double)this.shadowOpaque); ++ ++ if (var12 > 0.0F) ++ { ++ this.renderShadow(par1Entity, par2, par4, par6, var12, par9); ++ } ++ } ++ ++ if (par1Entity.canRenderOnFire()) ++ { ++ this.renderEntityOnFire(par1Entity, par2, par4, par6, par9); ++ } ++ } ++ ++ /** ++ * Returns the font renderer from the set render manager ++ */ ++ public FontRenderer getFontRendererFromRenderManager() ++ { ++ return this.renderManager.getFontRenderer(); ++ } ++ ++ public void updateIcons(IconRegister par1IconRegister) {} ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- RenderArrow.java Sat Feb 5 04:12:36 2022 +*************** +*** 0 **** +--- 1,94 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ import org.lwjgl.opengl.GL12; ++ ++ public class RenderArrow extends Render ++ { ++ private static final ResourceLocation arrowTextures = new ResourceLocation("textures/entity/arrow.png"); ++ ++ public void renderArrow(EntityArrow par1EntityArrow, double par2, double par4, double par6, float par8, float par9) ++ { ++ this.bindEntityTexture(par1EntityArrow); ++ GL11.glPushMatrix(); ++ GL11.glTranslatef((float)par2, (float)par4, (float)par6); ++ GL11.glRotatef(par1EntityArrow.prevRotationYaw + (par1EntityArrow.rotationYaw - par1EntityArrow.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(par1EntityArrow.prevRotationPitch + (par1EntityArrow.rotationPitch - par1EntityArrow.prevRotationPitch) * par9, 0.0F, 0.0F, 1.0F); ++ Tessellator var10 = Tessellator.instance; ++ byte var11 = 0; ++ float var12 = 0.0F; ++ float var13 = 0.5F; ++ float var14 = (float)(0 + var11 * 10) / 32.0F; ++ float var15 = (float)(5 + var11 * 10) / 32.0F; ++ float var16 = 0.0F; ++ float var17 = 0.15625F; ++ float var18 = (float)(5 + var11 * 10) / 32.0F; ++ float var19 = (float)(10 + var11 * 10) / 32.0F; ++ float var20 = 0.05625F; ++ GL11.glEnable(GL12.GL_RESCALE_NORMAL); ++ float var21 = (float)par1EntityArrow.arrowShake - par9; ++ ++ if (var21 > 0.0F) ++ { ++ float var22 = -MathHelper.sin(var21 * 3.0F) * var21; ++ GL11.glRotatef(var22, 0.0F, 0.0F, 1.0F); ++ } ++ ++ GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F); ++ GL11.glScalef(var20, var20, var20); ++ GL11.glTranslatef(-4.0F, 0.0F, 0.0F); ++ GL11.glNormal3f(var20, 0.0F, 0.0F); ++ var10.startDrawingQuads(); ++ var10.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)var16, (double)var18); ++ var10.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)var17, (double)var18); ++ var10.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)var17, (double)var19); ++ var10.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)var16, (double)var19); ++ var10.draw(); ++ GL11.glNormal3f(-var20, 0.0F, 0.0F); ++ var10.startDrawingQuads(); ++ var10.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)var16, (double)var18); ++ var10.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)var17, (double)var18); ++ var10.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)var17, (double)var19); ++ var10.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)var16, (double)var19); ++ var10.draw(); ++ ++ for (int var23 = 0; var23 < 4; ++var23) ++ { ++ GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); ++ GL11.glNormal3f(0.0F, 0.0F, var20); ++ var10.startDrawingQuads(); ++ var10.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double)var12, (double)var14); ++ var10.addVertexWithUV(8.0D, -2.0D, 0.0D, (double)var13, (double)var14); ++ var10.addVertexWithUV(8.0D, 2.0D, 0.0D, (double)var13, (double)var15); ++ var10.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double)var12, (double)var15); ++ var10.draw(); ++ } ++ ++ GL11.glDisable(GL12.GL_RESCALE_NORMAL); ++ GL11.glPopMatrix(); ++ } ++ ++ protected ResourceLocation getArrowTextures(EntityArrow par1EntityArrow) ++ { ++ return arrowTextures; ++ } ++ ++ /** ++ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. ++ */ ++ protected ResourceLocation getEntityTexture(Entity par1Entity) ++ { ++ return this.getArrowTextures((EntityArrow)par1Entity); ++ } ++ ++ /** ++ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then ++ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic ++ * (Render> 16 & 255) / 255.0F; ++ float var11 = (float)(var9 >> 8 & 255) / 255.0F; ++ float var12 = (float)(var9 & 255) / 255.0F; ++ GL11.glColor3f(var8 * var10, var8 * var11, var8 * var12); ++ ++ if (var4.isItemEnchanted()) ++ { ++ return 31; ++ } ++ ++ return 16; ++ } ++ ++ GL11.glColor3f(var8, var8, var8); ++ ++ if (var4.isItemEnchanted()) ++ { ++ return 15; ++ } ++ ++ return 1; ++ } ++ } ++ ++ return -1; ++ } ++ ++ protected void func_130013_c(EntityLiving par1EntityLiving, int par2, float par3) ++ { ++ ItemStack var4 = par1EntityLiving.func_130225_q(3 - par2); ++ ++ if (var4 != null) ++ { ++ Item var5 = var4.getItem(); ++ ++ if (var5 instanceof ItemArmor) ++ { ++ this.bindTexture(func_110858_a((ItemArmor)var5, par2, "overlay")); ++ float var6 = 1.0F; ++ GL11.glColor3f(var6, var6, var6); ++ } ++ } ++ } ++ ++ public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) ++ { ++ float var10 = 1.0F; ++ GL11.glColor3f(var10, var10, var10); ++ ItemStack var11 = par1EntityLiving.getHeldItem(); ++ this.func_82420_a(par1EntityLiving, var11); ++ double var12 = par4 - (double)par1EntityLiving.yOffset; ++ ++ if (par1EntityLiving.isSneaking()) ++ { ++ var12 -= 0.125D; ++ } ++ ++ super.doRenderLiving(par1EntityLiving, par2, var12, par6, par8, par9); ++ this.field_82423_g.aimedBow = this.field_82425_h.aimedBow = this.modelBipedMain.aimedBow = false; ++ this.field_82423_g.isSneak = this.field_82425_h.isSneak = this.modelBipedMain.isSneak = false; ++ this.field_82423_g.heldItemRight = this.field_82425_h.heldItemRight = this.modelBipedMain.heldItemRight = 0; ++ } ++ ++ protected ResourceLocation func_110856_a(EntityLiving par1EntityLiving) ++ { ++ return null; ++ } ++ ++ protected void func_82420_a(EntityLiving par1EntityLiving, ItemStack par2ItemStack) ++ { ++ this.field_82423_g.heldItemRight = this.field_82425_h.heldItemRight = this.modelBipedMain.heldItemRight = par2ItemStack != null ? 1 : 0; ++ this.field_82423_g.isSneak = this.field_82425_h.isSneak = this.modelBipedMain.isSneak = par1EntityLiving.isSneaking(); ++ } ++ ++ protected void func_130005_c(EntityLiving par1EntityLiving, float par2) ++ { ++ float var3 = 1.0F; ++ GL11.glColor3f(var3, var3, var3); ++ super.renderEquippedItems(par1EntityLiving, par2); ++ ItemStack var4 = par1EntityLiving.getHeldItem(); ++ ItemStack var5 = par1EntityLiving.func_130225_q(3); ++ float var6; ++ ++ if (var5 != null) ++ { ++ GL11.glPushMatrix(); ++ this.modelBipedMain.bipedHead.postRender(0.0625F); ++ ++ if (var5.getItem().itemID < 256) ++ { ++ if (RenderBlocks.renderItemIn3d(Block.blocksList[var5.itemID].getRenderType())) ++ { ++ var6 = 0.625F; ++ GL11.glTranslatef(0.0F, -0.25F, 0.0F); ++ GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glScalef(var6, -var6, -var6); ++ } ++ ++ this.renderManager.itemRenderer.renderItem(par1EntityLiving, var5, 0); ++ } ++ else if (var5.getItem().itemID == Item.skull.itemID) ++ { ++ var6 = 1.0625F; ++ GL11.glScalef(var6, -var6, -var6); ++ String var7 = ""; ++ ++ if (var5.hasTagCompound() && var5.getTagCompound().hasKey("SkullOwner")) ++ { ++ var7 = var5.getTagCompound().getString("SkullOwner"); ++ } ++ ++ TileEntitySkullRenderer.skullRenderer.func_82393_a(-0.5F, 0.0F, -0.5F, 1, 180.0F, var5.getItemDamage(), var7); ++ } ++ ++ GL11.glPopMatrix(); ++ } ++ ++ if (var4 != null) ++ { ++ GL11.glPushMatrix(); ++ ++ if (this.mainModel.isChild) ++ { ++ var6 = 0.5F; ++ GL11.glTranslatef(0.0F, 0.625F, 0.0F); ++ GL11.glRotatef(-20.0F, -1.0F, 0.0F, 0.0F); ++ GL11.glScalef(var6, var6, var6); ++ } ++ ++ this.modelBipedMain.bipedRightArm.postRender(0.0625F); ++ GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F); ++ ++ if (var4.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType())) ++ { ++ var6 = 0.5F; ++ GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); ++ var6 *= 0.75F; ++ GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); ++ GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glScalef(-var6, -var6, var6); ++ } ++ else if (var4.itemID == Item.bow.itemID) ++ { ++ var6 = 0.625F; ++ GL11.glTranslatef(0.0F, 0.125F, 0.3125F); ++ GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glScalef(var6, -var6, var6); ++ GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); ++ GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); ++ } ++ else if (Item.itemsList[var4.itemID].isFull3D()) ++ { ++ var6 = 0.625F; ++ ++ if (Item.itemsList[var4.itemID].shouldRotateAroundWhenRendering()) ++ { ++ GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); ++ GL11.glTranslatef(0.0F, -0.125F, 0.0F); ++ } ++ ++ this.func_82422_c(); ++ GL11.glScalef(var6, -var6, var6); ++ GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); ++ GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); ++ } ++ else ++ { ++ var6 = 0.375F; ++ GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); ++ GL11.glScalef(var6, var6, var6); ++ GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); ++ GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); ++ GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); ++ } ++ ++ this.renderManager.itemRenderer.renderItem(par1EntityLiving, var4, 0); ++ ++ if (var4.getItem().requiresMultipleRenderPasses()) ++ { ++ this.renderManager.itemRenderer.renderItem(par1EntityLiving, var4, 1); ++ } ++ ++ GL11.glPopMatrix(); ++ } ++ } ++ ++ protected void func_82422_c() ++ { ++ GL11.glTranslatef(0.0F, 0.1875F, 0.0F); ++ } ++ ++ protected void func_82439_b(EntityLivingBase par1EntityLivingBase, int par2, float par3) ++ { ++ this.func_130013_c((EntityLiving)par1EntityLivingBase, par2, par3); ++ } ++ ++ /** ++ * Queries whether should render the specified pass or not. ++ */ ++ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) ++ { ++ return this.func_130006_a((EntityLiving)par1EntityLivingBase, par2, par3); ++ } ++ ++ protected void renderEquippedItems(EntityLivingBase par1EntityLivingBase, float par2) ++ { ++ this.func_130005_c((EntityLiving)par1EntityLivingBase, par2); ++ } ++ ++ public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) ++ { ++ this.doRenderLiving((EntityLiving)par1EntityLivingBase, par2, par4, par6, par8, par9); ++ } ++ ++ /** ++ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. ++ */ ++ protected ResourceLocation getEntityTexture(Entity par1Entity) ++ { ++ return this.func_110856_a((EntityLiving)par1Entity); ++ } ++ ++ /** ++ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then ++ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic ++ * (Render=0, all block faces will be rendered using this texture index ++ */ ++ private Icon overrideBlockTexture; ++ ++ /** ++ * Set to true if the texture should be flipped horizontally during render*Face ++ */ ++ private boolean flipTexture; ++ ++ /** ++ * If true, renders all faces on all blocks rather than using the logic in Block.shouldSideBeRendered. Unused. ++ */ ++ private boolean renderAllFaces; ++ ++ /** Fancy grass side matching biome */ ++ public static boolean fancyGrass = true; ++ public boolean useInventoryTint = true; ++ ++ /** The minimum X value for rendering (default 0.0). */ ++ private double renderMinX; ++ ++ /** The maximum X value for rendering (default 1.0). */ ++ private double renderMaxX; ++ ++ /** The minimum Y value for rendering (default 0.0). */ ++ private double renderMinY; ++ ++ /** The maximum Y value for rendering (default 1.0). */ ++ private double renderMaxY; ++ ++ /** The minimum Z value for rendering (default 0.0). */ ++ private double renderMinZ; ++ ++ /** The maximum Z value for rendering (default 1.0). */ ++ private double renderMaxZ; ++ ++ /** ++ * Set by overrideBlockBounds, to keep this class from changing the visual bounding box. ++ */ ++ private boolean lockBlockBounds; ++ private boolean partialRenderBounds; ++ private final Minecraft minecraftRB; ++ private int uvRotateEast; ++ private int uvRotateWest; ++ private int uvRotateSouth; ++ private int uvRotateNorth; ++ private int uvRotateTop; ++ private int uvRotateBottom; ++ ++ /** Whether ambient occlusion is enabled or not */ ++ private boolean enableAO; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion on the north/bottom/east corner. ++ */ ++ private float aoLightValueScratchXYZNNN; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion between the bottom face and the north face. ++ */ ++ private float aoLightValueScratchXYNN; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion on the north/bottom/west corner. ++ */ ++ private float aoLightValueScratchXYZNNP; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion between the bottom face and the east face. ++ */ ++ private float aoLightValueScratchYZNN; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion between the bottom face and the west face. ++ */ ++ private float aoLightValueScratchYZNP; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion on the south/bottom/east corner. ++ */ ++ private float aoLightValueScratchXYZPNN; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion between the bottom face and the south face. ++ */ ++ private float aoLightValueScratchXYPN; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion on the south/bottom/west corner. ++ */ ++ private float aoLightValueScratchXYZPNP; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion on the north/top/east corner. ++ */ ++ private float aoLightValueScratchXYZNPN; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion between the top face and the north face. ++ */ ++ private float aoLightValueScratchXYNP; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion on the north/top/west corner. ++ */ ++ private float aoLightValueScratchXYZNPP; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion between the top face and the east face. ++ */ ++ private float aoLightValueScratchYZPN; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion on the south/top/east corner. ++ */ ++ private float aoLightValueScratchXYZPPN; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion between the top face and the south face. ++ */ ++ private float aoLightValueScratchXYPP; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion between the top face and the west face. ++ */ ++ private float aoLightValueScratchYZPP; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion on the south/top/west corner. ++ */ ++ private float aoLightValueScratchXYZPPP; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion between the north face and the east face. ++ */ ++ private float aoLightValueScratchXZNN; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion between the south face and the east face. ++ */ ++ private float aoLightValueScratchXZPN; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion between the north face and the west face. ++ */ ++ private float aoLightValueScratchXZNP; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion between the south face and the west face. ++ */ ++ private float aoLightValueScratchXZPP; ++ ++ /** Ambient occlusion brightness XYZNNN */ ++ private int aoBrightnessXYZNNN; ++ ++ /** Ambient occlusion brightness XYNN */ ++ private int aoBrightnessXYNN; ++ ++ /** Ambient occlusion brightness XYZNNP */ ++ private int aoBrightnessXYZNNP; ++ ++ /** Ambient occlusion brightness YZNN */ ++ private int aoBrightnessYZNN; ++ ++ /** Ambient occlusion brightness YZNP */ ++ private int aoBrightnessYZNP; ++ ++ /** Ambient occlusion brightness XYZPNN */ ++ private int aoBrightnessXYZPNN; ++ ++ /** Ambient occlusion brightness XYPN */ ++ private int aoBrightnessXYPN; ++ ++ /** Ambient occlusion brightness XYZPNP */ ++ private int aoBrightnessXYZPNP; ++ ++ /** Ambient occlusion brightness XYZNPN */ ++ private int aoBrightnessXYZNPN; ++ ++ /** Ambient occlusion brightness XYNP */ ++ private int aoBrightnessXYNP; ++ ++ /** Ambient occlusion brightness XYZNPP */ ++ private int aoBrightnessXYZNPP; ++ ++ /** Ambient occlusion brightness YZPN */ ++ private int aoBrightnessYZPN; ++ ++ /** Ambient occlusion brightness XYZPPN */ ++ private int aoBrightnessXYZPPN; ++ ++ /** Ambient occlusion brightness XYPP */ ++ private int aoBrightnessXYPP; ++ ++ /** Ambient occlusion brightness YZPP */ ++ private int aoBrightnessYZPP; ++ ++ /** Ambient occlusion brightness XYZPPP */ ++ private int aoBrightnessXYZPPP; ++ ++ /** Ambient occlusion brightness XZNN */ ++ private int aoBrightnessXZNN; ++ ++ /** Ambient occlusion brightness XZPN */ ++ private int aoBrightnessXZPN; ++ ++ /** Ambient occlusion brightness XZNP */ ++ private int aoBrightnessXZNP; ++ ++ /** Ambient occlusion brightness XZPP */ ++ private int aoBrightnessXZPP; ++ ++ /** Brightness top left */ ++ private int brightnessTopLeft; ++ ++ /** Brightness bottom left */ ++ private int brightnessBottomLeft; ++ ++ /** Brightness bottom right */ ++ private int brightnessBottomRight; ++ ++ /** Brightness top right */ ++ private int brightnessTopRight; ++ ++ /** Red color value for the top left corner */ ++ private float colorRedTopLeft; ++ ++ /** Red color value for the bottom left corner */ ++ private float colorRedBottomLeft; ++ ++ /** Red color value for the bottom right corner */ ++ private float colorRedBottomRight; ++ ++ /** Red color value for the top right corner */ ++ private float colorRedTopRight; ++ ++ /** Green color value for the top left corner */ ++ private float colorGreenTopLeft; ++ ++ /** Green color value for the bottom left corner */ ++ private float colorGreenBottomLeft; ++ ++ /** Green color value for the bottom right corner */ ++ private float colorGreenBottomRight; ++ ++ /** Green color value for the top right corner */ ++ private float colorGreenTopRight; ++ ++ /** Blue color value for the top left corner */ ++ private float colorBlueTopLeft; ++ ++ /** Blue color value for the bottom left corner */ ++ private float colorBlueBottomLeft; ++ ++ /** Blue color value for the bottom right corner */ ++ private float colorBlueBottomRight; ++ ++ /** Blue color value for the top right corner */ ++ private float colorBlueTopRight; ++ ++ public RenderBlocks(IBlockAccess par1IBlockAccess) ++ { ++ this.blockAccess = par1IBlockAccess; ++ this.minecraftRB = Minecraft.getMinecraft(); ++ } ++ ++ public RenderBlocks() ++ { ++ this.minecraftRB = Minecraft.getMinecraft(); ++ } ++ ++ /** ++ * Sets overrideBlockTexture ++ */ ++ public void setOverrideBlockTexture(Icon par1Icon) ++ { ++ this.overrideBlockTexture = par1Icon; ++ } ++ ++ /** ++ * Clear override block texture ++ */ ++ public void clearOverrideBlockTexture() ++ { ++ this.overrideBlockTexture = null; ++ } ++ ++ public boolean hasOverrideBlockTexture() ++ { ++ return this.overrideBlockTexture != null; ++ } ++ ++ /** ++ * Sets the bounding box for the block to draw in, e.g. 0.25-0.75 on all axes for a half-size, centered block. ++ */ ++ public void setRenderBounds(double par1, double par3, double par5, double par7, double par9, double par11) ++ { ++ if (!this.lockBlockBounds) ++ { ++ this.renderMinX = par1; ++ this.renderMaxX = par7; ++ this.renderMinY = par3; ++ this.renderMaxY = par9; ++ this.renderMinZ = par5; ++ this.renderMaxZ = par11; ++ this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2 && (this.renderMinX > 0.0D || this.renderMaxX < 1.0D || this.renderMinY > 0.0D || this.renderMaxY < 1.0D || this.renderMinZ > 0.0D || this.renderMaxZ < 1.0D); ++ } ++ } ++ ++ /** ++ * Like setRenderBounds, but automatically pulling the bounds from the given Block. ++ */ ++ public void setRenderBoundsFromBlock(Block par1Block) ++ { ++ if (!this.lockBlockBounds) ++ { ++ this.renderMinX = par1Block.getBlockBoundsMinX(); ++ this.renderMaxX = par1Block.getBlockBoundsMaxX(); ++ this.renderMinY = par1Block.getBlockBoundsMinY(); ++ this.renderMaxY = par1Block.getBlockBoundsMaxY(); ++ this.renderMinZ = par1Block.getBlockBoundsMinZ(); ++ this.renderMaxZ = par1Block.getBlockBoundsMaxZ(); ++ this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2 && (this.renderMinX > 0.0D || this.renderMaxX < 1.0D || this.renderMinY > 0.0D || this.renderMaxY < 1.0D || this.renderMinZ > 0.0D || this.renderMaxZ < 1.0D); ++ } ++ } ++ ++ /** ++ * Like setRenderBounds, but locks the values so that RenderBlocks won't change them. If you use this, you must ++ * call unlockBlockBounds after you finish rendering! ++ */ ++ public void overrideBlockBounds(double par1, double par3, double par5, double par7, double par9, double par11) ++ { ++ this.renderMinX = par1; ++ this.renderMaxX = par7; ++ this.renderMinY = par3; ++ this.renderMaxY = par9; ++ this.renderMinZ = par5; ++ this.renderMaxZ = par11; ++ this.lockBlockBounds = true; ++ this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2 && (this.renderMinX > 0.0D || this.renderMaxX < 1.0D || this.renderMinY > 0.0D || this.renderMaxY < 1.0D || this.renderMinZ > 0.0D || this.renderMaxZ < 1.0D); ++ } ++ ++ /** ++ * Unlocks the visual bounding box so that RenderBlocks can change it again. ++ */ ++ public void unlockBlockBounds() ++ { ++ this.lockBlockBounds = false; ++ } ++ ++ /** ++ * Renders a block using the given texture instead of the block's own default texture ++ */ ++ public void renderBlockUsingTexture(Block par1Block, int par2, int par3, int par4, Icon par5Icon) ++ { ++ this.setOverrideBlockTexture(par5Icon); ++ this.renderBlockByRenderType(par1Block, par2, par3, par4); ++ this.clearOverrideBlockTexture(); ++ } ++ ++ /** ++ * Render all faces of a block ++ */ ++ public void renderBlockAllFaces(Block par1Block, int par2, int par3, int par4) ++ { ++ this.renderAllFaces = true; ++ this.renderBlockByRenderType(par1Block, par2, par3, par4); ++ this.renderAllFaces = false; ++ } ++ ++ /** ++ * Renders the block at the given coordinates using the block's rendering type ++ */ ++ public boolean renderBlockByRenderType(Block par1Block, int par2, int par3, int par4) ++ { ++ int var5 = par1Block.getRenderType(); ++ ++ if (var5 == -1) ++ { ++ return false; ++ } ++ else ++ { ++ par1Block.setBlockBoundsBasedOnState(this.blockAccess, par2, par3, par4); ++ this.setRenderBoundsFromBlock(par1Block); ++ return var5 == 0 ? this.renderStandardBlock(par1Block, par2, par3, par4) : (var5 == 4 ? this.renderBlockFluids(par1Block, par2, par3, par4) : (var5 == 31 ? this.renderBlockLog(par1Block, par2, par3, par4) : (var5 == 1 ? this.renderCrossedSquares(par1Block, par2, par3, par4) : (var5 == 2 ? this.renderBlockTorch(par1Block, par2, par3, par4) : (var5 == 20 ? this.renderBlockVine(par1Block, par2, par3, par4) : (var5 == 11 ? this.renderBlockFence((BlockFence)par1Block, par2, par3, par4) : (var5 == 39 ? this.renderBlockQuartz(par1Block, par2, par3, par4) : (var5 == 5 ? this.renderBlockRedstoneWire(par1Block, par2, par3, par4) : (var5 == 13 ? this.renderBlockCactus(par1Block, par2, par3, par4) : (var5 == 9 ? this.renderBlockMinecartTrack((BlockRailBase)par1Block, par2, par3, par4) : (var5 == 19 ? this.renderBlockStem(par1Block, par2, par3, par4) : (var5 == 23 ? this.renderBlockLilyPad(par1Block, par2, par3, par4) : (var5 == 6 ? this.renderBlockCrops(par1Block, par2, par3, par4) : (var5 == 3 ? this.renderBlockFire((BlockFire)par1Block, par2, par3, par4) : (var5 == 8 ? this.renderBlockLadder(par1Block, par2, par3, par4) : (var5 == 7 ? this.renderBlockDoor(par1Block, par2, par3, par4) : (var5 == 10 ? this.renderBlockStairs((BlockStairs)par1Block, par2, par3, par4) : (var5 == 27 ? this.renderBlockDragonEgg((BlockDragonEgg)par1Block, par2, par3, par4) : (var5 == 32 ? this.renderBlockWall((BlockWall)par1Block, par2, par3, par4) : (var5 == 12 ? this.renderBlockLever(par1Block, par2, par3, par4) : (var5 == 29 ? this.renderBlockTripWireSource(par1Block, par2, par3, par4) : (var5 == 30 ? this.renderBlockTripWire(par1Block, par2, par3, par4) : (var5 == 14 ? this.renderBlockBed(par1Block, par2, par3, par4) : (var5 == 15 ? this.renderBlockRepeater((BlockRedstoneRepeater)par1Block, par2, par3, par4) : (var5 == 36 ? this.renderBlockRedstoneLogic((BlockRedstoneLogic)par1Block, par2, par3, par4) : (var5 == 37 ? this.renderBlockComparator((BlockComparator)par1Block, par2, par3, par4) : (var5 == 16 ? this.renderPistonBase(par1Block, par2, par3, par4, false) : (var5 == 17 ? this.renderPistonExtension(par1Block, par2, par3, par4, true) : (var5 == 18 ? this.renderBlockPane((BlockPane)par1Block, par2, par3, par4) : (var5 == 21 ? this.renderBlockFenceGate((BlockFenceGate)par1Block, par2, par3, par4) : (var5 == 24 ? this.renderBlockCauldron((BlockCauldron)par1Block, par2, par3, par4) : (var5 == 33 ? this.renderBlockFlowerpot((BlockFlowerPot)par1Block, par2, par3, par4) : (var5 == 35 ? this.renderBlockAnvil((BlockAnvil)par1Block, par2, par3, par4) : (var5 == 25 ? this.renderBlockBrewingStand((BlockBrewingStand)par1Block, par2, par3, par4) : (var5 == 26 ? this.renderBlockEndPortalFrame((BlockEndPortalFrame)par1Block, par2, par3, par4) : (var5 == 28 ? this.renderBlockCocoa((BlockCocoa)par1Block, par2, par3, par4) : (var5 == 34 ? this.renderBlockBeacon((BlockBeacon)par1Block, par2, par3, par4) : (var5 == 38 ? this.renderBlockHopper((BlockHopper)par1Block, par2, par3, par4) : false)))))))))))))))))))))))))))))))))))))); ++ } ++ } ++ ++ /** ++ * Render BlockEndPortalFrame ++ */ ++ private boolean renderBlockEndPortalFrame(BlockEndPortalFrame par1BlockEndPortalFrame, int par2, int par3, int par4) ++ { ++ int var5 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ int var6 = var5 & 3; ++ ++ if (var6 == 0) ++ { ++ this.uvRotateTop = 3; ++ } ++ else if (var6 == 3) ++ { ++ this.uvRotateTop = 1; ++ } ++ else if (var6 == 1) ++ { ++ this.uvRotateTop = 2; ++ } ++ ++ if (!BlockEndPortalFrame.isEnderEyeInserted(var5)) ++ { ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.8125D, 1.0D); ++ this.renderStandardBlock(par1BlockEndPortalFrame, par2, par3, par4); ++ this.uvRotateTop = 0; ++ return true; ++ } ++ else ++ { ++ this.renderAllFaces = true; ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.8125D, 1.0D); ++ this.renderStandardBlock(par1BlockEndPortalFrame, par2, par3, par4); ++ this.setOverrideBlockTexture(par1BlockEndPortalFrame.func_94398_p()); ++ this.setRenderBounds(0.25D, 0.8125D, 0.25D, 0.75D, 1.0D, 0.75D); ++ this.renderStandardBlock(par1BlockEndPortalFrame, par2, par3, par4); ++ this.renderAllFaces = false; ++ this.clearOverrideBlockTexture(); ++ this.uvRotateTop = 0; ++ return true; ++ } ++ } ++ ++ /** ++ * render a bed at the given coordinates ++ */ ++ private boolean renderBlockBed(Block par1Block, int par2, int par3, int par4) ++ { ++ Tessellator var5 = Tessellator.instance; ++ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ int var7 = BlockBed.getDirection(var6); ++ boolean var8 = BlockBed.isBlockHeadOfBed(var6); ++ float var9 = 0.5F; ++ float var10 = 1.0F; ++ float var11 = 0.8F; ++ float var12 = 0.6F; ++ int var25 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4); ++ var5.setBrightness(var25); ++ var5.setColorOpaque_F(var9, var9, var9); ++ Icon var27 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 0); ++ double var28 = (double)var27.getMinU(); ++ double var30 = (double)var27.getMaxU(); ++ double var32 = (double)var27.getMinV(); ++ double var34 = (double)var27.getMaxV(); ++ double var36 = (double)par2 + this.renderMinX; ++ double var38 = (double)par2 + this.renderMaxX; ++ double var40 = (double)par3 + this.renderMinY + 0.1875D; ++ double var42 = (double)par4 + this.renderMinZ; ++ double var44 = (double)par4 + this.renderMaxZ; ++ var5.addVertexWithUV(var36, var40, var44, var28, var34); ++ var5.addVertexWithUV(var36, var40, var42, var28, var32); ++ var5.addVertexWithUV(var38, var40, var42, var30, var32); ++ var5.addVertexWithUV(var38, var40, var44, var30, var34); ++ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4)); ++ var5.setColorOpaque_F(var10, var10, var10); ++ var27 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 1); ++ var28 = (double)var27.getMinU(); ++ var30 = (double)var27.getMaxU(); ++ var32 = (double)var27.getMinV(); ++ var34 = (double)var27.getMaxV(); ++ var36 = var28; ++ var38 = var30; ++ var40 = var32; ++ var42 = var32; ++ var44 = var28; ++ double var46 = var30; ++ double var48 = var34; ++ double var50 = var34; ++ ++ if (var7 == 0) ++ { ++ var38 = var28; ++ var40 = var34; ++ var44 = var30; ++ var50 = var32; ++ } ++ else if (var7 == 2) ++ { ++ var36 = var30; ++ var42 = var34; ++ var46 = var28; ++ var48 = var32; ++ } ++ else if (var7 == 3) ++ { ++ var36 = var30; ++ var42 = var34; ++ var46 = var28; ++ var48 = var32; ++ var38 = var28; ++ var40 = var34; ++ var44 = var30; ++ var50 = var32; ++ } ++ ++ double var52 = (double)par2 + this.renderMinX; ++ double var54 = (double)par2 + this.renderMaxX; ++ double var56 = (double)par3 + this.renderMaxY; ++ double var58 = (double)par4 + this.renderMinZ; ++ double var60 = (double)par4 + this.renderMaxZ; ++ var5.addVertexWithUV(var54, var56, var60, var44, var48); ++ var5.addVertexWithUV(var54, var56, var58, var36, var40); ++ var5.addVertexWithUV(var52, var56, var58, var38, var42); ++ var5.addVertexWithUV(var52, var56, var60, var46, var50); ++ int var62 = Direction.directionToFacing[var7]; ++ ++ if (var8) ++ { ++ var62 = Direction.directionToFacing[Direction.rotateOpposite[var7]]; ++ } ++ ++ byte var63 = 4; ++ ++ switch (var7) ++ { ++ case 0: ++ var63 = 5; ++ break; ++ ++ case 1: ++ var63 = 3; ++ ++ case 2: ++ default: ++ break; ++ ++ case 3: ++ var63 = 2; ++ } ++ ++ if (var62 != 2 && (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3, par4 - 1, 2))) ++ { ++ var5.setBrightness(this.renderMinZ > 0.0D ? var25 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1)); ++ var5.setColorOpaque_F(var11, var11, var11); ++ this.flipTexture = var63 == 2; ++ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 2)); ++ } ++ ++ if (var62 != 3 && (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3, par4 + 1, 3))) ++ { ++ var5.setBrightness(this.renderMaxZ < 1.0D ? var25 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1)); ++ var5.setColorOpaque_F(var11, var11, var11); ++ this.flipTexture = var63 == 3; ++ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 3)); ++ } ++ ++ if (var62 != 4 && (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2 - 1, par3, par4, 4))) ++ { ++ var5.setBrightness(this.renderMinZ > 0.0D ? var25 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4)); ++ var5.setColorOpaque_F(var12, var12, var12); ++ this.flipTexture = var63 == 4; ++ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 4)); ++ } ++ ++ if (var62 != 5 && (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2 + 1, par3, par4, 5))) ++ { ++ var5.setBrightness(this.renderMaxZ < 1.0D ? var25 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4)); ++ var5.setColorOpaque_F(var12, var12, var12); ++ this.flipTexture = var63 == 5; ++ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 5)); ++ } ++ ++ this.flipTexture = false; ++ return true; ++ } ++ ++ /** ++ * Render BlockBrewingStand ++ */ ++ private boolean renderBlockBrewingStand(BlockBrewingStand par1BlockBrewingStand, int par2, int par3, int par4) ++ { ++ this.setRenderBounds(0.4375D, 0.0D, 0.4375D, 0.5625D, 0.875D, 0.5625D); ++ this.renderStandardBlock(par1BlockBrewingStand, par2, par3, par4); ++ this.setOverrideBlockTexture(par1BlockBrewingStand.getBrewingStandIcon()); ++ this.renderAllFaces = true; ++ this.setRenderBounds(0.5625D, 0.0D, 0.3125D, 0.9375D, 0.125D, 0.6875D); ++ this.renderStandardBlock(par1BlockBrewingStand, par2, par3, par4); ++ this.setRenderBounds(0.125D, 0.0D, 0.0625D, 0.5D, 0.125D, 0.4375D); ++ this.renderStandardBlock(par1BlockBrewingStand, par2, par3, par4); ++ this.setRenderBounds(0.125D, 0.0D, 0.5625D, 0.5D, 0.125D, 0.9375D); ++ this.renderStandardBlock(par1BlockBrewingStand, par2, par3, par4); ++ this.renderAllFaces = false; ++ this.clearOverrideBlockTexture(); ++ Tessellator var5 = Tessellator.instance; ++ var5.setBrightness(par1BlockBrewingStand.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ float var6 = 1.0F; ++ int var7 = par1BlockBrewingStand.colorMultiplier(this.blockAccess, par2, par3, par4); ++ float var8 = (float)(var7 >> 16 & 255) / 255.0F; ++ float var9 = (float)(var7 >> 8 & 255) / 255.0F; ++ float var10 = (float)(var7 & 255) / 255.0F; ++ ++ if (EntityRenderer.anaglyphEnable) ++ { ++ float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; ++ float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; ++ float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; ++ var8 = var11; ++ var9 = var12; ++ var10 = var13; ++ } ++ ++ var5.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); ++ Icon var32 = this.getBlockIconFromSideAndMetadata(par1BlockBrewingStand, 0, 0); ++ ++ if (this.hasOverrideBlockTexture()) ++ { ++ var32 = this.overrideBlockTexture; ++ } ++ ++ double var33 = (double)var32.getMinV(); ++ double var14 = (double)var32.getMaxV(); ++ int var16 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ ++ for (int var17 = 0; var17 < 3; ++var17) ++ { ++ double var18 = (double)var17 * Math.PI * 2.0D / 3.0D + (Math.PI / 2D); ++ double var20 = (double)var32.getInterpolatedU(8.0D); ++ double var22 = (double)var32.getMaxU(); ++ ++ if ((var16 & 1 << var17) != 0) ++ { ++ var22 = (double)var32.getMinU(); ++ } ++ ++ double var24 = (double)par2 + 0.5D; ++ double var26 = (double)par2 + 0.5D + Math.sin(var18) * 8.0D / 16.0D; ++ double var28 = (double)par4 + 0.5D; ++ double var30 = (double)par4 + 0.5D + Math.cos(var18) * 8.0D / 16.0D; ++ var5.addVertexWithUV(var24, (double)(par3 + 1), var28, var20, var33); ++ var5.addVertexWithUV(var24, (double)(par3 + 0), var28, var20, var14); ++ var5.addVertexWithUV(var26, (double)(par3 + 0), var30, var22, var14); ++ var5.addVertexWithUV(var26, (double)(par3 + 1), var30, var22, var33); ++ var5.addVertexWithUV(var26, (double)(par3 + 1), var30, var22, var33); ++ var5.addVertexWithUV(var26, (double)(par3 + 0), var30, var22, var14); ++ var5.addVertexWithUV(var24, (double)(par3 + 0), var28, var20, var14); ++ var5.addVertexWithUV(var24, (double)(par3 + 1), var28, var20, var33); ++ } ++ ++ par1BlockBrewingStand.setBlockBoundsForItemRender(); ++ return true; ++ } ++ ++ /** ++ * Render block cauldron ++ */ ++ private boolean renderBlockCauldron(BlockCauldron par1BlockCauldron, int par2, int par3, int par4) ++ { ++ this.renderStandardBlock(par1BlockCauldron, par2, par3, par4); ++ Tessellator var5 = Tessellator.instance; ++ var5.setBrightness(par1BlockCauldron.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ float var6 = 1.0F; ++ int var7 = par1BlockCauldron.colorMultiplier(this.blockAccess, par2, par3, par4); ++ float var8 = (float)(var7 >> 16 & 255) / 255.0F; ++ float var9 = (float)(var7 >> 8 & 255) / 255.0F; ++ float var10 = (float)(var7 & 255) / 255.0F; ++ float var12; ++ ++ if (EntityRenderer.anaglyphEnable) ++ { ++ float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; ++ var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; ++ float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; ++ var8 = var11; ++ var9 = var12; ++ var10 = var13; ++ } ++ ++ var5.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); ++ Icon var16 = par1BlockCauldron.getBlockTextureFromSide(2); ++ var12 = 0.125F; ++ this.renderFaceXPos(par1BlockCauldron, (double)((float)par2 - 1.0F + var12), (double)par3, (double)par4, var16); ++ this.renderFaceXNeg(par1BlockCauldron, (double)((float)par2 + 1.0F - var12), (double)par3, (double)par4, var16); ++ this.renderFaceZPos(par1BlockCauldron, (double)par2, (double)par3, (double)((float)par4 - 1.0F + var12), var16); ++ this.renderFaceZNeg(par1BlockCauldron, (double)par2, (double)par3, (double)((float)par4 + 1.0F - var12), var16); ++ Icon var17 = BlockCauldron.getCauldronIcon("inner"); ++ this.renderFaceYPos(par1BlockCauldron, (double)par2, (double)((float)par3 - 1.0F + 0.25F), (double)par4, var17); ++ this.renderFaceYNeg(par1BlockCauldron, (double)par2, (double)((float)par3 + 1.0F - 0.75F), (double)par4, var17); ++ int var14 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ ++ if (var14 > 0) ++ { ++ Icon var15 = BlockFluid.getFluidIcon("water_still"); ++ ++ if (var14 > 3) ++ { ++ var14 = 3; ++ } ++ ++ this.renderFaceYPos(par1BlockCauldron, (double)par2, (double)((float)par3 - 1.0F + (6.0F + (float)var14 * 3.0F) / 16.0F), (double)par4, var15); ++ } ++ ++ return true; ++ } ++ ++ /** ++ * Renders flower pot ++ */ ++ private boolean renderBlockFlowerpot(BlockFlowerPot par1BlockFlowerPot, int par2, int par3, int par4) ++ { ++ this.renderStandardBlock(par1BlockFlowerPot, par2, par3, par4); ++ Tessellator var5 = Tessellator.instance; ++ var5.setBrightness(par1BlockFlowerPot.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ float var6 = 1.0F; ++ int var7 = par1BlockFlowerPot.colorMultiplier(this.blockAccess, par2, par3, par4); ++ Icon var8 = this.getBlockIconFromSide(par1BlockFlowerPot, 0); ++ float var9 = (float)(var7 >> 16 & 255) / 255.0F; ++ float var10 = (float)(var7 >> 8 & 255) / 255.0F; ++ float var11 = (float)(var7 & 255) / 255.0F; ++ float var12; ++ float var14; ++ ++ if (EntityRenderer.anaglyphEnable) ++ { ++ var12 = (var9 * 30.0F + var10 * 59.0F + var11 * 11.0F) / 100.0F; ++ float var13 = (var9 * 30.0F + var10 * 70.0F) / 100.0F; ++ var14 = (var9 * 30.0F + var11 * 70.0F) / 100.0F; ++ var9 = var12; ++ var10 = var13; ++ var11 = var14; ++ } ++ ++ var5.setColorOpaque_F(var6 * var9, var6 * var10, var6 * var11); ++ var12 = 0.1865F; ++ this.renderFaceXPos(par1BlockFlowerPot, (double)((float)par2 - 0.5F + var12), (double)par3, (double)par4, var8); ++ this.renderFaceXNeg(par1BlockFlowerPot, (double)((float)par2 + 0.5F - var12), (double)par3, (double)par4, var8); ++ this.renderFaceZPos(par1BlockFlowerPot, (double)par2, (double)par3, (double)((float)par4 - 0.5F + var12), var8); ++ this.renderFaceZNeg(par1BlockFlowerPot, (double)par2, (double)par3, (double)((float)par4 + 0.5F - var12), var8); ++ this.renderFaceYPos(par1BlockFlowerPot, (double)par2, (double)((float)par3 - 0.5F + var12 + 0.1875F), (double)par4, this.getBlockIcon(Block.dirt)); ++ int var19 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ ++ if (var19 != 0) ++ { ++ var14 = 0.0F; ++ float var15 = 4.0F; ++ float var16 = 0.0F; ++ BlockFlower var17 = null; ++ ++ switch (var19) ++ { ++ case 1: ++ var17 = Block.plantRed; ++ break; ++ ++ case 2: ++ var17 = Block.plantYellow; ++ ++ case 3: ++ case 4: ++ case 5: ++ case 6: ++ default: ++ break; ++ ++ case 7: ++ var17 = Block.mushroomRed; ++ break; ++ ++ case 8: ++ var17 = Block.mushroomBrown; ++ } ++ ++ var5.addTranslation(var14 / 16.0F, var15 / 16.0F, var16 / 16.0F); ++ ++ if (var17 != null) ++ { ++ this.renderBlockByRenderType(var17, par2, par3, par4); ++ } ++ else if (var19 == 9) ++ { ++ this.renderAllFaces = true; ++ float var18 = 0.125F; ++ this.setRenderBounds((double)(0.5F - var18), 0.0D, (double)(0.5F - var18), (double)(0.5F + var18), 0.25D, (double)(0.5F + var18)); ++ this.renderStandardBlock(Block.cactus, par2, par3, par4); ++ this.setRenderBounds((double)(0.5F - var18), 0.25D, (double)(0.5F - var18), (double)(0.5F + var18), 0.5D, (double)(0.5F + var18)); ++ this.renderStandardBlock(Block.cactus, par2, par3, par4); ++ this.setRenderBounds((double)(0.5F - var18), 0.5D, (double)(0.5F - var18), (double)(0.5F + var18), 0.75D, (double)(0.5F + var18)); ++ this.renderStandardBlock(Block.cactus, par2, par3, par4); ++ this.renderAllFaces = false; ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); ++ } ++ else if (var19 == 3) ++ { ++ this.drawCrossedSquares(Block.sapling, 0, (double)par2, (double)par3, (double)par4, 0.75F); ++ } ++ else if (var19 == 5) ++ { ++ this.drawCrossedSquares(Block.sapling, 2, (double)par2, (double)par3, (double)par4, 0.75F); ++ } ++ else if (var19 == 4) ++ { ++ this.drawCrossedSquares(Block.sapling, 1, (double)par2, (double)par3, (double)par4, 0.75F); ++ } ++ else if (var19 == 6) ++ { ++ this.drawCrossedSquares(Block.sapling, 3, (double)par2, (double)par3, (double)par4, 0.75F); ++ } ++ else if (var19 == 11) ++ { ++ var7 = Block.tallGrass.colorMultiplier(this.blockAccess, par2, par3, par4); ++ var9 = (float)(var7 >> 16 & 255) / 255.0F; ++ var10 = (float)(var7 >> 8 & 255) / 255.0F; ++ var11 = (float)(var7 & 255) / 255.0F; ++ var5.setColorOpaque_F(var6 * var9, var6 * var10, var6 * var11); ++ this.drawCrossedSquares(Block.tallGrass, 2, (double)par2, (double)par3, (double)par4, 0.75F); ++ } ++ else if (var19 == 10) ++ { ++ this.drawCrossedSquares(Block.deadBush, 2, (double)par2, (double)par3, (double)par4, 0.75F); ++ } ++ ++ var5.addTranslation(-var14 / 16.0F, -var15 / 16.0F, -var16 / 16.0F); ++ } ++ ++ return true; ++ } ++ ++ /** ++ * Renders anvil ++ */ ++ private boolean renderBlockAnvil(BlockAnvil par1BlockAnvil, int par2, int par3, int par4) ++ { ++ return this.renderBlockAnvilMetadata(par1BlockAnvil, par2, par3, par4, this.blockAccess.getBlockMetadata(par2, par3, par4)); ++ } ++ ++ /** ++ * Renders anvil block with metadata ++ */ ++ public boolean renderBlockAnvilMetadata(BlockAnvil par1BlockAnvil, int par2, int par3, int par4, int par5) ++ { ++ Tessellator var6 = Tessellator.instance; ++ var6.setBrightness(par1BlockAnvil.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ float var7 = 1.0F; ++ int var8 = par1BlockAnvil.colorMultiplier(this.blockAccess, par2, par3, par4); ++ float var9 = (float)(var8 >> 16 & 255) / 255.0F; ++ float var10 = (float)(var8 >> 8 & 255) / 255.0F; ++ float var11 = (float)(var8 & 255) / 255.0F; ++ ++ if (EntityRenderer.anaglyphEnable) ++ { ++ float var12 = (var9 * 30.0F + var10 * 59.0F + var11 * 11.0F) / 100.0F; ++ float var13 = (var9 * 30.0F + var10 * 70.0F) / 100.0F; ++ float var14 = (var9 * 30.0F + var11 * 70.0F) / 100.0F; ++ var9 = var12; ++ var10 = var13; ++ var11 = var14; ++ } ++ ++ var6.setColorOpaque_F(var7 * var9, var7 * var10, var7 * var11); ++ return this.renderBlockAnvilOrient(par1BlockAnvil, par2, par3, par4, par5, false); ++ } ++ ++ /** ++ * Renders anvil block with orientation ++ */ ++ private boolean renderBlockAnvilOrient(BlockAnvil par1BlockAnvil, int par2, int par3, int par4, int par5, boolean par6) ++ { ++ int var7 = par6 ? 0 : par5 & 3; ++ boolean var8 = false; ++ float var9 = 0.0F; ++ ++ switch (var7) ++ { ++ case 0: ++ this.uvRotateSouth = 2; ++ this.uvRotateNorth = 1; ++ this.uvRotateTop = 3; ++ this.uvRotateBottom = 3; ++ break; ++ ++ case 1: ++ this.uvRotateEast = 1; ++ this.uvRotateWest = 2; ++ this.uvRotateTop = 2; ++ this.uvRotateBottom = 1; ++ var8 = true; ++ break; ++ ++ case 2: ++ this.uvRotateSouth = 1; ++ this.uvRotateNorth = 2; ++ break; ++ ++ case 3: ++ this.uvRotateEast = 2; ++ this.uvRotateWest = 1; ++ this.uvRotateTop = 1; ++ this.uvRotateBottom = 2; ++ var8 = true; ++ } ++ ++ var9 = this.renderBlockAnvilRotate(par1BlockAnvil, par2, par3, par4, 0, var9, 0.75F, 0.25F, 0.75F, var8, par6, par5); ++ var9 = this.renderBlockAnvilRotate(par1BlockAnvil, par2, par3, par4, 1, var9, 0.5F, 0.0625F, 0.625F, var8, par6, par5); ++ var9 = this.renderBlockAnvilRotate(par1BlockAnvil, par2, par3, par4, 2, var9, 0.25F, 0.3125F, 0.5F, var8, par6, par5); ++ this.renderBlockAnvilRotate(par1BlockAnvil, par2, par3, par4, 3, var9, 0.625F, 0.375F, 1.0F, var8, par6, par5); ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); ++ this.uvRotateEast = 0; ++ this.uvRotateWest = 0; ++ this.uvRotateSouth = 0; ++ this.uvRotateNorth = 0; ++ this.uvRotateTop = 0; ++ this.uvRotateBottom = 0; ++ return true; ++ } ++ ++ /** ++ * Renders anvil block with rotation ++ */ ++ private float renderBlockAnvilRotate(BlockAnvil par1BlockAnvil, int par2, int par3, int par4, int par5, float par6, float par7, float par8, float par9, boolean par10, boolean par11, int par12) ++ { ++ if (par10) ++ { ++ float var13 = par7; ++ par7 = par9; ++ par9 = var13; ++ } ++ ++ par7 /= 2.0F; ++ par9 /= 2.0F; ++ par1BlockAnvil.field_82521_b = par5; ++ this.setRenderBounds((double)(0.5F - par7), (double)par6, (double)(0.5F - par9), (double)(0.5F + par7), (double)(par6 + par8), (double)(0.5F + par9)); ++ ++ if (par11) ++ { ++ Tessellator var14 = Tessellator.instance; ++ var14.startDrawingQuads(); ++ var14.setNormal(0.0F, -1.0F, 0.0F); ++ this.renderFaceYNeg(par1BlockAnvil, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockAnvil, 0, par12)); ++ var14.draw(); ++ var14.startDrawingQuads(); ++ var14.setNormal(0.0F, 1.0F, 0.0F); ++ this.renderFaceYPos(par1BlockAnvil, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockAnvil, 1, par12)); ++ var14.draw(); ++ var14.startDrawingQuads(); ++ var14.setNormal(0.0F, 0.0F, -1.0F); ++ this.renderFaceZNeg(par1BlockAnvil, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockAnvil, 2, par12)); ++ var14.draw(); ++ var14.startDrawingQuads(); ++ var14.setNormal(0.0F, 0.0F, 1.0F); ++ this.renderFaceZPos(par1BlockAnvil, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockAnvil, 3, par12)); ++ var14.draw(); ++ var14.startDrawingQuads(); ++ var14.setNormal(-1.0F, 0.0F, 0.0F); ++ this.renderFaceXNeg(par1BlockAnvil, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockAnvil, 4, par12)); ++ var14.draw(); ++ var14.startDrawingQuads(); ++ var14.setNormal(1.0F, 0.0F, 0.0F); ++ this.renderFaceXPos(par1BlockAnvil, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockAnvil, 5, par12)); ++ var14.draw(); ++ } ++ else ++ { ++ this.renderStandardBlock(par1BlockAnvil, par2, par3, par4); ++ } ++ ++ return par6 + par8; ++ } ++ ++ /** ++ * Renders a torch block at the given coordinates ++ */ ++ public boolean renderBlockTorch(Block par1Block, int par2, int par3, int par4) ++ { ++ int var5 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ Tessellator var6 = Tessellator.instance; ++ var6.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ var6.setColorOpaque_F(1.0F, 1.0F, 1.0F); ++ double var7 = 0.4000000059604645D; ++ double var9 = 0.5D - var7; ++ double var11 = 0.20000000298023224D; ++ ++ if (var5 == 1) ++ { ++ this.renderTorchAtAngle(par1Block, (double)par2 - var9, (double)par3 + var11, (double)par4, -var7, 0.0D, 0); ++ } ++ else if (var5 == 2) ++ { ++ this.renderTorchAtAngle(par1Block, (double)par2 + var9, (double)par3 + var11, (double)par4, var7, 0.0D, 0); ++ } ++ else if (var5 == 3) ++ { ++ this.renderTorchAtAngle(par1Block, (double)par2, (double)par3 + var11, (double)par4 - var9, 0.0D, -var7, 0); ++ } ++ else if (var5 == 4) ++ { ++ this.renderTorchAtAngle(par1Block, (double)par2, (double)par3 + var11, (double)par4 + var9, 0.0D, var7, 0); ++ } ++ else ++ { ++ this.renderTorchAtAngle(par1Block, (double)par2, (double)par3, (double)par4, 0.0D, 0.0D, 0); ++ } ++ ++ return true; ++ } ++ ++ /** ++ * render a redstone repeater at the given coordinates ++ */ ++ private boolean renderBlockRepeater(BlockRedstoneRepeater par1BlockRedstoneRepeater, int par2, int par3, int par4) ++ { ++ int var5 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ int var6 = var5 & 3; ++ int var7 = (var5 & 12) >> 2; ++ Tessellator var8 = Tessellator.instance; ++ var8.setBrightness(par1BlockRedstoneRepeater.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ var8.setColorOpaque_F(1.0F, 1.0F, 1.0F); ++ double var9 = -0.1875D; ++ boolean var11 = par1BlockRedstoneRepeater.func_94476_e(this.blockAccess, par2, par3, par4, var5); ++ double var12 = 0.0D; ++ double var14 = 0.0D; ++ double var16 = 0.0D; ++ double var18 = 0.0D; ++ ++ switch (var6) ++ { ++ case 0: ++ var18 = -0.3125D; ++ var14 = BlockRedstoneRepeater.repeaterTorchOffset[var7]; ++ break; ++ ++ case 1: ++ var16 = 0.3125D; ++ var12 = -BlockRedstoneRepeater.repeaterTorchOffset[var7]; ++ break; ++ ++ case 2: ++ var18 = 0.3125D; ++ var14 = -BlockRedstoneRepeater.repeaterTorchOffset[var7]; ++ break; ++ ++ case 3: ++ var16 = -0.3125D; ++ var12 = BlockRedstoneRepeater.repeaterTorchOffset[var7]; ++ } ++ ++ if (!var11) ++ { ++ this.renderTorchAtAngle(par1BlockRedstoneRepeater, (double)par2 + var12, (double)par3 + var9, (double)par4 + var14, 0.0D, 0.0D, 0); ++ } ++ else ++ { ++ Icon var20 = this.getBlockIcon(Block.bedrock); ++ this.setOverrideBlockTexture(var20); ++ float var21 = 2.0F; ++ float var22 = 14.0F; ++ float var23 = 7.0F; ++ float var24 = 9.0F; ++ ++ switch (var6) ++ { ++ case 1: ++ case 3: ++ var21 = 7.0F; ++ var22 = 9.0F; ++ var23 = 2.0F; ++ var24 = 14.0F; ++ ++ case 0: ++ case 2: ++ default: ++ this.setRenderBounds((double)(var21 / 16.0F + (float)var12), 0.125D, (double)(var23 / 16.0F + (float)var14), (double)(var22 / 16.0F + (float)var12), 0.25D, (double)(var24 / 16.0F + (float)var14)); ++ double var25 = (double)var20.getInterpolatedU((double)var21); ++ double var27 = (double)var20.getInterpolatedV((double)var23); ++ double var29 = (double)var20.getInterpolatedU((double)var22); ++ double var31 = (double)var20.getInterpolatedV((double)var24); ++ var8.addVertexWithUV((double)((float)par2 + var21 / 16.0F) + var12, (double)((float)par3 + 0.25F), (double)((float)par4 + var23 / 16.0F) + var14, var25, var27); ++ var8.addVertexWithUV((double)((float)par2 + var21 / 16.0F) + var12, (double)((float)par3 + 0.25F), (double)((float)par4 + var24 / 16.0F) + var14, var25, var31); ++ var8.addVertexWithUV((double)((float)par2 + var22 / 16.0F) + var12, (double)((float)par3 + 0.25F), (double)((float)par4 + var24 / 16.0F) + var14, var29, var31); ++ var8.addVertexWithUV((double)((float)par2 + var22 / 16.0F) + var12, (double)((float)par3 + 0.25F), (double)((float)par4 + var23 / 16.0F) + var14, var29, var27); ++ this.renderStandardBlock(par1BlockRedstoneRepeater, par2, par3, par4); ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.125D, 1.0D); ++ this.clearOverrideBlockTexture(); ++ } ++ } ++ ++ var8.setBrightness(par1BlockRedstoneRepeater.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ var8.setColorOpaque_F(1.0F, 1.0F, 1.0F); ++ this.renderTorchAtAngle(par1BlockRedstoneRepeater, (double)par2 + var16, (double)par3 + var9, (double)par4 + var18, 0.0D, 0.0D, 0); ++ this.renderBlockRedstoneLogic(par1BlockRedstoneRepeater, par2, par3, par4); ++ return true; ++ } ++ ++ private boolean renderBlockComparator(BlockComparator par1BlockComparator, int par2, int par3, int par4) ++ { ++ Tessellator var5 = Tessellator.instance; ++ var5.setBrightness(par1BlockComparator.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); ++ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ int var7 = var6 & 3; ++ double var8 = 0.0D; ++ double var10 = -0.1875D; ++ double var12 = 0.0D; ++ double var14 = 0.0D; ++ double var16 = 0.0D; ++ Icon var18; ++ ++ if (par1BlockComparator.func_94490_c(var6)) ++ { ++ var18 = Block.torchRedstoneActive.getBlockTextureFromSide(0); ++ } ++ else ++ { ++ var10 -= 0.1875D; ++ var18 = Block.torchRedstoneIdle.getBlockTextureFromSide(0); ++ } ++ ++ switch (var7) ++ { ++ case 0: ++ var12 = -0.3125D; ++ var16 = 1.0D; ++ break; ++ ++ case 1: ++ var8 = 0.3125D; ++ var14 = -1.0D; ++ break; ++ ++ case 2: ++ var12 = 0.3125D; ++ var16 = -1.0D; ++ break; ++ ++ case 3: ++ var8 = -0.3125D; ++ var14 = 1.0D; ++ } ++ ++ this.renderTorchAtAngle(par1BlockComparator, (double)par2 + 0.25D * var14 + 0.1875D * var16, (double)((float)par3 - 0.1875F), (double)par4 + 0.25D * var16 + 0.1875D * var14, 0.0D, 0.0D, var6); ++ this.renderTorchAtAngle(par1BlockComparator, (double)par2 + 0.25D * var14 + -0.1875D * var16, (double)((float)par3 - 0.1875F), (double)par4 + 0.25D * var16 + -0.1875D * var14, 0.0D, 0.0D, var6); ++ this.setOverrideBlockTexture(var18); ++ this.renderTorchAtAngle(par1BlockComparator, (double)par2 + var8, (double)par3 + var10, (double)par4 + var12, 0.0D, 0.0D, var6); ++ this.clearOverrideBlockTexture(); ++ this.renderBlockRedstoneLogicMetadata(par1BlockComparator, par2, par3, par4, var7); ++ return true; ++ } ++ ++ private boolean renderBlockRedstoneLogic(BlockRedstoneLogic par1BlockRedstoneLogic, int par2, int par3, int par4) ++ { ++ Tessellator var5 = Tessellator.instance; ++ this.renderBlockRedstoneLogicMetadata(par1BlockRedstoneLogic, par2, par3, par4, this.blockAccess.getBlockMetadata(par2, par3, par4) & 3); ++ return true; ++ } ++ ++ private void renderBlockRedstoneLogicMetadata(BlockRedstoneLogic par1BlockRedstoneLogic, int par2, int par3, int par4, int par5) ++ { ++ this.renderStandardBlock(par1BlockRedstoneLogic, par2, par3, par4); ++ Tessellator var6 = Tessellator.instance; ++ var6.setBrightness(par1BlockRedstoneLogic.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ var6.setColorOpaque_F(1.0F, 1.0F, 1.0F); ++ int var7 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ Icon var8 = this.getBlockIconFromSideAndMetadata(par1BlockRedstoneLogic, 1, var7); ++ double var9 = (double)var8.getMinU(); ++ double var11 = (double)var8.getMaxU(); ++ double var13 = (double)var8.getMinV(); ++ double var15 = (double)var8.getMaxV(); ++ double var17 = 0.125D; ++ double var19 = (double)(par2 + 1); ++ double var21 = (double)(par2 + 1); ++ double var23 = (double)(par2 + 0); ++ double var25 = (double)(par2 + 0); ++ double var27 = (double)(par4 + 0); ++ double var29 = (double)(par4 + 1); ++ double var31 = (double)(par4 + 1); ++ double var33 = (double)(par4 + 0); ++ double var35 = (double)par3 + var17; ++ ++ if (par5 == 2) ++ { ++ var19 = var21 = (double)(par2 + 0); ++ var23 = var25 = (double)(par2 + 1); ++ var27 = var33 = (double)(par4 + 1); ++ var29 = var31 = (double)(par4 + 0); ++ } ++ else if (par5 == 3) ++ { ++ var19 = var25 = (double)(par2 + 0); ++ var21 = var23 = (double)(par2 + 1); ++ var27 = var29 = (double)(par4 + 0); ++ var31 = var33 = (double)(par4 + 1); ++ } ++ else if (par5 == 1) ++ { ++ var19 = var25 = (double)(par2 + 1); ++ var21 = var23 = (double)(par2 + 0); ++ var27 = var29 = (double)(par4 + 1); ++ var31 = var33 = (double)(par4 + 0); ++ } ++ ++ var6.addVertexWithUV(var25, var35, var33, var9, var13); ++ var6.addVertexWithUV(var23, var35, var31, var9, var15); ++ var6.addVertexWithUV(var21, var35, var29, var11, var15); ++ var6.addVertexWithUV(var19, var35, var27, var11, var13); ++ } ++ ++ /** ++ * Render all faces of the piston base ++ */ ++ public void renderPistonBaseAllFaces(Block par1Block, int par2, int par3, int par4) ++ { ++ this.renderAllFaces = true; ++ this.renderPistonBase(par1Block, par2, par3, par4, true); ++ this.renderAllFaces = false; ++ } ++ ++ /** ++ * renders a block as a piston base ++ */ ++ private boolean renderPistonBase(Block par1Block, int par2, int par3, int par4, boolean par5) ++ { ++ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ boolean var7 = par5 || (var6 & 8) != 0; ++ int var8 = BlockPistonBase.getOrientation(var6); ++ float var9 = 0.25F; ++ ++ if (var7) ++ { ++ switch (var8) ++ { ++ case 0: ++ this.uvRotateEast = 3; ++ this.uvRotateWest = 3; ++ this.uvRotateSouth = 3; ++ this.uvRotateNorth = 3; ++ this.setRenderBounds(0.0D, 0.25D, 0.0D, 1.0D, 1.0D, 1.0D); ++ break; ++ ++ case 1: ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.75D, 1.0D); ++ break; ++ ++ case 2: ++ this.uvRotateSouth = 1; ++ this.uvRotateNorth = 2; ++ this.setRenderBounds(0.0D, 0.0D, 0.25D, 1.0D, 1.0D, 1.0D); ++ break; ++ ++ case 3: ++ this.uvRotateSouth = 2; ++ this.uvRotateNorth = 1; ++ this.uvRotateTop = 3; ++ this.uvRotateBottom = 3; ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.75D); ++ break; ++ ++ case 4: ++ this.uvRotateEast = 1; ++ this.uvRotateWest = 2; ++ this.uvRotateTop = 2; ++ this.uvRotateBottom = 1; ++ this.setRenderBounds(0.25D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); ++ break; ++ ++ case 5: ++ this.uvRotateEast = 2; ++ this.uvRotateWest = 1; ++ this.uvRotateTop = 1; ++ this.uvRotateBottom = 2; ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 0.75D, 1.0D, 1.0D); ++ } ++ ++ ((BlockPistonBase)par1Block).func_96479_b((float)this.renderMinX, (float)this.renderMinY, (float)this.renderMinZ, (float)this.renderMaxX, (float)this.renderMaxY, (float)this.renderMaxZ); ++ this.renderStandardBlock(par1Block, par2, par3, par4); ++ this.uvRotateEast = 0; ++ this.uvRotateWest = 0; ++ this.uvRotateSouth = 0; ++ this.uvRotateNorth = 0; ++ this.uvRotateTop = 0; ++ this.uvRotateBottom = 0; ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); ++ ((BlockPistonBase)par1Block).func_96479_b((float)this.renderMinX, (float)this.renderMinY, (float)this.renderMinZ, (float)this.renderMaxX, (float)this.renderMaxY, (float)this.renderMaxZ); ++ } ++ else ++ { ++ switch (var8) ++ { ++ case 0: ++ this.uvRotateEast = 3; ++ this.uvRotateWest = 3; ++ this.uvRotateSouth = 3; ++ this.uvRotateNorth = 3; ++ ++ case 1: ++ default: ++ break; ++ ++ case 2: ++ this.uvRotateSouth = 1; ++ this.uvRotateNorth = 2; ++ break; ++ ++ case 3: ++ this.uvRotateSouth = 2; ++ this.uvRotateNorth = 1; ++ this.uvRotateTop = 3; ++ this.uvRotateBottom = 3; ++ break; ++ ++ case 4: ++ this.uvRotateEast = 1; ++ this.uvRotateWest = 2; ++ this.uvRotateTop = 2; ++ this.uvRotateBottom = 1; ++ break; ++ ++ case 5: ++ this.uvRotateEast = 2; ++ this.uvRotateWest = 1; ++ this.uvRotateTop = 1; ++ this.uvRotateBottom = 2; ++ } ++ ++ this.renderStandardBlock(par1Block, par2, par3, par4); ++ this.uvRotateEast = 0; ++ this.uvRotateWest = 0; ++ this.uvRotateSouth = 0; ++ this.uvRotateNorth = 0; ++ this.uvRotateTop = 0; ++ this.uvRotateBottom = 0; ++ } ++ ++ return true; ++ } ++ ++ /** ++ * Render piston rod up/down ++ */ ++ private void renderPistonRodUD(double par1, double par3, double par5, double par7, double par9, double par11, float par13, double par14) ++ { ++ Icon var16 = BlockPistonBase.getPistonBaseIcon("piston_side"); ++ ++ if (this.hasOverrideBlockTexture()) ++ { ++ var16 = this.overrideBlockTexture; ++ } ++ ++ Tessellator var17 = Tessellator.instance; ++ double var18 = (double)var16.getMinU(); ++ double var20 = (double)var16.getMinV(); ++ double var22 = (double)var16.getInterpolatedU(par14); ++ double var24 = (double)var16.getInterpolatedV(4.0D); ++ var17.setColorOpaque_F(par13, par13, par13); ++ var17.addVertexWithUV(par1, par7, par9, var22, var20); ++ var17.addVertexWithUV(par1, par5, par9, var18, var20); ++ var17.addVertexWithUV(par3, par5, par11, var18, var24); ++ var17.addVertexWithUV(par3, par7, par11, var22, var24); ++ } ++ ++ /** ++ * Render piston rod south/north ++ */ ++ private void renderPistonRodSN(double par1, double par3, double par5, double par7, double par9, double par11, float par13, double par14) ++ { ++ Icon var16 = BlockPistonBase.getPistonBaseIcon("piston_side"); ++ ++ if (this.hasOverrideBlockTexture()) ++ { ++ var16 = this.overrideBlockTexture; ++ } ++ ++ Tessellator var17 = Tessellator.instance; ++ double var18 = (double)var16.getMinU(); ++ double var20 = (double)var16.getMinV(); ++ double var22 = (double)var16.getInterpolatedU(par14); ++ double var24 = (double)var16.getInterpolatedV(4.0D); ++ var17.setColorOpaque_F(par13, par13, par13); ++ var17.addVertexWithUV(par1, par5, par11, var22, var20); ++ var17.addVertexWithUV(par1, par5, par9, var18, var20); ++ var17.addVertexWithUV(par3, par7, par9, var18, var24); ++ var17.addVertexWithUV(par3, par7, par11, var22, var24); ++ } ++ ++ /** ++ * Render piston rod east/west ++ */ ++ private void renderPistonRodEW(double par1, double par3, double par5, double par7, double par9, double par11, float par13, double par14) ++ { ++ Icon var16 = BlockPistonBase.getPistonBaseIcon("piston_side"); ++ ++ if (this.hasOverrideBlockTexture()) ++ { ++ var16 = this.overrideBlockTexture; ++ } ++ ++ Tessellator var17 = Tessellator.instance; ++ double var18 = (double)var16.getMinU(); ++ double var20 = (double)var16.getMinV(); ++ double var22 = (double)var16.getInterpolatedU(par14); ++ double var24 = (double)var16.getInterpolatedV(4.0D); ++ var17.setColorOpaque_F(par13, par13, par13); ++ var17.addVertexWithUV(par3, par5, par9, var22, var20); ++ var17.addVertexWithUV(par1, par5, par9, var18, var20); ++ var17.addVertexWithUV(par1, par7, par11, var18, var24); ++ var17.addVertexWithUV(par3, par7, par11, var22, var24); ++ } ++ ++ /** ++ * Render all faces of the piston extension ++ */ ++ public void renderPistonExtensionAllFaces(Block par1Block, int par2, int par3, int par4, boolean par5) ++ { ++ this.renderAllFaces = true; ++ this.renderPistonExtension(par1Block, par2, par3, par4, par5); ++ this.renderAllFaces = false; ++ } ++ ++ /** ++ * renders the pushing part of a piston ++ */ ++ private boolean renderPistonExtension(Block par1Block, int par2, int par3, int par4, boolean par5) ++ { ++ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ int var7 = BlockPistonExtension.getDirectionMeta(var6); ++ float var8 = 0.25F; ++ float var9 = 0.375F; ++ float var10 = 0.625F; ++ float var11 = par1Block.getBlockBrightness(this.blockAccess, par2, par3, par4); ++ float var12 = par5 ? 1.0F : 0.5F; ++ double var13 = par5 ? 16.0D : 8.0D; ++ ++ switch (var7) ++ { ++ case 0: ++ this.uvRotateEast = 3; ++ this.uvRotateWest = 3; ++ this.uvRotateSouth = 3; ++ this.uvRotateNorth = 3; ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.25D, 1.0D); ++ this.renderStandardBlock(par1Block, par2, par3, par4); ++ this.renderPistonRodUD((double)((float)par2 + 0.375F), (double)((float)par2 + 0.625F), (double)((float)par3 + 0.25F), (double)((float)par3 + 0.25F + var12), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.625F), var11 * 0.8F, var13); ++ this.renderPistonRodUD((double)((float)par2 + 0.625F), (double)((float)par2 + 0.375F), (double)((float)par3 + 0.25F), (double)((float)par3 + 0.25F + var12), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.375F), var11 * 0.8F, var13); ++ this.renderPistonRodUD((double)((float)par2 + 0.375F), (double)((float)par2 + 0.375F), (double)((float)par3 + 0.25F), (double)((float)par3 + 0.25F + var12), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.625F), var11 * 0.6F, var13); ++ this.renderPistonRodUD((double)((float)par2 + 0.625F), (double)((float)par2 + 0.625F), (double)((float)par3 + 0.25F), (double)((float)par3 + 0.25F + var12), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.375F), var11 * 0.6F, var13); ++ break; ++ ++ case 1: ++ this.setRenderBounds(0.0D, 0.75D, 0.0D, 1.0D, 1.0D, 1.0D); ++ this.renderStandardBlock(par1Block, par2, par3, par4); ++ this.renderPistonRodUD((double)((float)par2 + 0.375F), (double)((float)par2 + 0.625F), (double)((float)par3 - 0.25F + 1.0F - var12), (double)((float)par3 - 0.25F + 1.0F), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.625F), var11 * 0.8F, var13); ++ this.renderPistonRodUD((double)((float)par2 + 0.625F), (double)((float)par2 + 0.375F), (double)((float)par3 - 0.25F + 1.0F - var12), (double)((float)par3 - 0.25F + 1.0F), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.375F), var11 * 0.8F, var13); ++ this.renderPistonRodUD((double)((float)par2 + 0.375F), (double)((float)par2 + 0.375F), (double)((float)par3 - 0.25F + 1.0F - var12), (double)((float)par3 - 0.25F + 1.0F), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.625F), var11 * 0.6F, var13); ++ this.renderPistonRodUD((double)((float)par2 + 0.625F), (double)((float)par2 + 0.625F), (double)((float)par3 - 0.25F + 1.0F - var12), (double)((float)par3 - 0.25F + 1.0F), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.375F), var11 * 0.6F, var13); ++ break; ++ ++ case 2: ++ this.uvRotateSouth = 1; ++ this.uvRotateNorth = 2; ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.25D); ++ this.renderStandardBlock(par1Block, par2, par3, par4); ++ this.renderPistonRodSN((double)((float)par2 + 0.375F), (double)((float)par2 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par4 + 0.25F), (double)((float)par4 + 0.25F + var12), var11 * 0.6F, var13); ++ this.renderPistonRodSN((double)((float)par2 + 0.625F), (double)((float)par2 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par4 + 0.25F), (double)((float)par4 + 0.25F + var12), var11 * 0.6F, var13); ++ this.renderPistonRodSN((double)((float)par2 + 0.375F), (double)((float)par2 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.375F), (double)((float)par4 + 0.25F), (double)((float)par4 + 0.25F + var12), var11 * 0.5F, var13); ++ this.renderPistonRodSN((double)((float)par2 + 0.625F), (double)((float)par2 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.625F), (double)((float)par4 + 0.25F), (double)((float)par4 + 0.25F + var12), var11, var13); ++ break; ++ ++ case 3: ++ this.uvRotateSouth = 2; ++ this.uvRotateNorth = 1; ++ this.uvRotateTop = 3; ++ this.uvRotateBottom = 3; ++ this.setRenderBounds(0.0D, 0.0D, 0.75D, 1.0D, 1.0D, 1.0D); ++ this.renderStandardBlock(par1Block, par2, par3, par4); ++ this.renderPistonRodSN((double)((float)par2 + 0.375F), (double)((float)par2 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par4 - 0.25F + 1.0F - var12), (double)((float)par4 - 0.25F + 1.0F), var11 * 0.6F, var13); ++ this.renderPistonRodSN((double)((float)par2 + 0.625F), (double)((float)par2 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par4 - 0.25F + 1.0F - var12), (double)((float)par4 - 0.25F + 1.0F), var11 * 0.6F, var13); ++ this.renderPistonRodSN((double)((float)par2 + 0.375F), (double)((float)par2 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.375F), (double)((float)par4 - 0.25F + 1.0F - var12), (double)((float)par4 - 0.25F + 1.0F), var11 * 0.5F, var13); ++ this.renderPistonRodSN((double)((float)par2 + 0.625F), (double)((float)par2 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.625F), (double)((float)par4 - 0.25F + 1.0F - var12), (double)((float)par4 - 0.25F + 1.0F), var11, var13); ++ break; ++ ++ case 4: ++ this.uvRotateEast = 1; ++ this.uvRotateWest = 2; ++ this.uvRotateTop = 2; ++ this.uvRotateBottom = 1; ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 0.25D, 1.0D, 1.0D); ++ this.renderStandardBlock(par1Block, par2, par3, par4); ++ this.renderPistonRodEW((double)((float)par2 + 0.25F), (double)((float)par2 + 0.25F + var12), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.375F), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.375F), var11 * 0.5F, var13); ++ this.renderPistonRodEW((double)((float)par2 + 0.25F), (double)((float)par2 + 0.25F + var12), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.625F), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.625F), var11, var13); ++ this.renderPistonRodEW((double)((float)par2 + 0.25F), (double)((float)par2 + 0.25F + var12), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.375F), var11 * 0.6F, var13); ++ this.renderPistonRodEW((double)((float)par2 + 0.25F), (double)((float)par2 + 0.25F + var12), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.625F), var11 * 0.6F, var13); ++ break; ++ ++ case 5: ++ this.uvRotateEast = 2; ++ this.uvRotateWest = 1; ++ this.uvRotateTop = 1; ++ this.uvRotateBottom = 2; ++ this.setRenderBounds(0.75D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); ++ this.renderStandardBlock(par1Block, par2, par3, par4); ++ this.renderPistonRodEW((double)((float)par2 - 0.25F + 1.0F - var12), (double)((float)par2 - 0.25F + 1.0F), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.375F), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.375F), var11 * 0.5F, var13); ++ this.renderPistonRodEW((double)((float)par2 - 0.25F + 1.0F - var12), (double)((float)par2 - 0.25F + 1.0F), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.625F), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.625F), var11, var13); ++ this.renderPistonRodEW((double)((float)par2 - 0.25F + 1.0F - var12), (double)((float)par2 - 0.25F + 1.0F), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.375F), var11 * 0.6F, var13); ++ this.renderPistonRodEW((double)((float)par2 - 0.25F + 1.0F - var12), (double)((float)par2 - 0.25F + 1.0F), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.625F), var11 * 0.6F, var13); ++ } ++ ++ this.uvRotateEast = 0; ++ this.uvRotateWest = 0; ++ this.uvRotateSouth = 0; ++ this.uvRotateNorth = 0; ++ this.uvRotateTop = 0; ++ this.uvRotateBottom = 0; ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); ++ return true; ++ } ++ ++ /** ++ * Renders a lever block at the given coordinates ++ */ ++ public boolean renderBlockLever(Block par1Block, int par2, int par3, int par4) ++ { ++ int var5 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ int var6 = var5 & 7; ++ boolean var7 = (var5 & 8) > 0; ++ Tessellator var8 = Tessellator.instance; ++ boolean var9 = this.hasOverrideBlockTexture(); ++ ++ if (!var9) ++ { ++ this.setOverrideBlockTexture(this.getBlockIcon(Block.cobblestone)); ++ } ++ ++ float var10 = 0.25F; ++ float var11 = 0.1875F; ++ float var12 = 0.1875F; ++ ++ if (var6 == 5) ++ { ++ this.setRenderBounds((double)(0.5F - var11), 0.0D, (double)(0.5F - var10), (double)(0.5F + var11), (double)var12, (double)(0.5F + var10)); ++ } ++ else if (var6 == 6) ++ { ++ this.setRenderBounds((double)(0.5F - var10), 0.0D, (double)(0.5F - var11), (double)(0.5F + var10), (double)var12, (double)(0.5F + var11)); ++ } ++ else if (var6 == 4) ++ { ++ this.setRenderBounds((double)(0.5F - var11), (double)(0.5F - var10), (double)(1.0F - var12), (double)(0.5F + var11), (double)(0.5F + var10), 1.0D); ++ } ++ else if (var6 == 3) ++ { ++ this.setRenderBounds((double)(0.5F - var11), (double)(0.5F - var10), 0.0D, (double)(0.5F + var11), (double)(0.5F + var10), (double)var12); ++ } ++ else if (var6 == 2) ++ { ++ this.setRenderBounds((double)(1.0F - var12), (double)(0.5F - var10), (double)(0.5F - var11), 1.0D, (double)(0.5F + var10), (double)(0.5F + var11)); ++ } ++ else if (var6 == 1) ++ { ++ this.setRenderBounds(0.0D, (double)(0.5F - var10), (double)(0.5F - var11), (double)var12, (double)(0.5F + var10), (double)(0.5F + var11)); ++ } ++ else if (var6 == 0) ++ { ++ this.setRenderBounds((double)(0.5F - var10), (double)(1.0F - var12), (double)(0.5F - var11), (double)(0.5F + var10), 1.0D, (double)(0.5F + var11)); ++ } ++ else if (var6 == 7) ++ { ++ this.setRenderBounds((double)(0.5F - var11), (double)(1.0F - var12), (double)(0.5F - var10), (double)(0.5F + var11), 1.0D, (double)(0.5F + var10)); ++ } ++ ++ this.renderStandardBlock(par1Block, par2, par3, par4); ++ ++ if (!var9) ++ { ++ this.clearOverrideBlockTexture(); ++ } ++ ++ var8.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ float var13 = 1.0F; ++ ++ if (Block.lightValue[par1Block.blockID] > 0) ++ { ++ var13 = 1.0F; ++ } ++ ++ var8.setColorOpaque_F(var13, var13, var13); ++ Icon var14 = this.getBlockIconFromSide(par1Block, 0); ++ ++ if (this.hasOverrideBlockTexture()) ++ { ++ var14 = this.overrideBlockTexture; ++ } ++ ++ double var15 = (double)var14.getMinU(); ++ double var17 = (double)var14.getMinV(); ++ double var19 = (double)var14.getMaxU(); ++ double var21 = (double)var14.getMaxV(); ++ Vec3[] var23 = new Vec3[8]; ++ float var24 = 0.0625F; ++ float var25 = 0.0625F; ++ float var26 = 0.625F; ++ var23[0] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var24), 0.0D, (double)(-var25)); ++ var23[1] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var24, 0.0D, (double)(-var25)); ++ var23[2] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var24, 0.0D, (double)var25); ++ var23[3] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var24), 0.0D, (double)var25); ++ var23[4] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var24), (double)var26, (double)(-var25)); ++ var23[5] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var24, (double)var26, (double)(-var25)); ++ var23[6] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var24, (double)var26, (double)var25); ++ var23[7] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var24), (double)var26, (double)var25); ++ ++ for (int var27 = 0; var27 < 8; ++var27) ++ { ++ if (var7) ++ { ++ var23[var27].zCoord -= 0.0625D; ++ var23[var27].rotateAroundX(((float)Math.PI * 2F / 9F)); ++ } ++ else ++ { ++ var23[var27].zCoord += 0.0625D; ++ var23[var27].rotateAroundX(-((float)Math.PI * 2F / 9F)); ++ } ++ ++ if (var6 == 0 || var6 == 7) ++ { ++ var23[var27].rotateAroundZ((float)Math.PI); ++ } ++ ++ if (var6 == 6 || var6 == 0) ++ { ++ var23[var27].rotateAroundY(((float)Math.PI / 2F)); ++ } ++ ++ if (var6 > 0 && var6 < 5) ++ { ++ var23[var27].yCoord -= 0.375D; ++ var23[var27].rotateAroundX(((float)Math.PI / 2F)); ++ ++ if (var6 == 4) ++ { ++ var23[var27].rotateAroundY(0.0F); ++ } ++ ++ if (var6 == 3) ++ { ++ var23[var27].rotateAroundY((float)Math.PI); ++ } ++ ++ if (var6 == 2) ++ { ++ var23[var27].rotateAroundY(((float)Math.PI / 2F)); ++ } ++ ++ if (var6 == 1) ++ { ++ var23[var27].rotateAroundY(-((float)Math.PI / 2F)); ++ } ++ ++ var23[var27].xCoord += (double)par2 + 0.5D; ++ var23[var27].yCoord += (double)((float)par3 + 0.5F); ++ var23[var27].zCoord += (double)par4 + 0.5D; ++ } ++ else if (var6 != 0 && var6 != 7) ++ { ++ var23[var27].xCoord += (double)par2 + 0.5D; ++ var23[var27].yCoord += (double)((float)par3 + 0.125F); ++ var23[var27].zCoord += (double)par4 + 0.5D; ++ } ++ else ++ { ++ var23[var27].xCoord += (double)par2 + 0.5D; ++ var23[var27].yCoord += (double)((float)par3 + 0.875F); ++ var23[var27].zCoord += (double)par4 + 0.5D; ++ } ++ } ++ ++ Vec3 var32 = null; ++ Vec3 var28 = null; ++ Vec3 var29 = null; ++ Vec3 var30 = null; ++ ++ for (int var31 = 0; var31 < 6; ++var31) ++ { ++ if (var31 == 0) ++ { ++ var15 = (double)var14.getInterpolatedU(7.0D); ++ var17 = (double)var14.getInterpolatedV(6.0D); ++ var19 = (double)var14.getInterpolatedU(9.0D); ++ var21 = (double)var14.getInterpolatedV(8.0D); ++ } ++ else if (var31 == 2) ++ { ++ var15 = (double)var14.getInterpolatedU(7.0D); ++ var17 = (double)var14.getInterpolatedV(6.0D); ++ var19 = (double)var14.getInterpolatedU(9.0D); ++ var21 = (double)var14.getMaxV(); ++ } ++ ++ if (var31 == 0) ++ { ++ var32 = var23[0]; ++ var28 = var23[1]; ++ var29 = var23[2]; ++ var30 = var23[3]; ++ } ++ else if (var31 == 1) ++ { ++ var32 = var23[7]; ++ var28 = var23[6]; ++ var29 = var23[5]; ++ var30 = var23[4]; ++ } ++ else if (var31 == 2) ++ { ++ var32 = var23[1]; ++ var28 = var23[0]; ++ var29 = var23[4]; ++ var30 = var23[5]; ++ } ++ else if (var31 == 3) ++ { ++ var32 = var23[2]; ++ var28 = var23[1]; ++ var29 = var23[5]; ++ var30 = var23[6]; ++ } ++ else if (var31 == 4) ++ { ++ var32 = var23[3]; ++ var28 = var23[2]; ++ var29 = var23[6]; ++ var30 = var23[7]; ++ } ++ else if (var31 == 5) ++ { ++ var32 = var23[0]; ++ var28 = var23[3]; ++ var29 = var23[7]; ++ var30 = var23[4]; ++ } ++ ++ var8.addVertexWithUV(var32.xCoord, var32.yCoord, var32.zCoord, var15, var21); ++ var8.addVertexWithUV(var28.xCoord, var28.yCoord, var28.zCoord, var19, var21); ++ var8.addVertexWithUV(var29.xCoord, var29.yCoord, var29.zCoord, var19, var17); ++ var8.addVertexWithUV(var30.xCoord, var30.yCoord, var30.zCoord, var15, var17); ++ } ++ ++ return true; ++ } ++ ++ /** ++ * Renders a trip wire source block at the given coordinates ++ */ ++ public boolean renderBlockTripWireSource(Block par1Block, int par2, int par3, int par4) ++ { ++ Tessellator var5 = Tessellator.instance; ++ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ int var7 = var6 & 3; ++ boolean var8 = (var6 & 4) == 4; ++ boolean var9 = (var6 & 8) == 8; ++ boolean var10 = !this.blockAccess.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4); ++ boolean var11 = this.hasOverrideBlockTexture(); ++ ++ if (!var11) ++ { ++ this.setOverrideBlockTexture(this.getBlockIcon(Block.planks)); ++ } ++ ++ float var12 = 0.25F; ++ float var13 = 0.125F; ++ float var14 = 0.125F; ++ float var15 = 0.3F - var12; ++ float var16 = 0.3F + var12; ++ ++ if (var7 == 2) ++ { ++ this.setRenderBounds((double)(0.5F - var13), (double)var15, (double)(1.0F - var14), (double)(0.5F + var13), (double)var16, 1.0D); ++ } ++ else if (var7 == 0) ++ { ++ this.setRenderBounds((double)(0.5F - var13), (double)var15, 0.0D, (double)(0.5F + var13), (double)var16, (double)var14); ++ } ++ else if (var7 == 1) ++ { ++ this.setRenderBounds((double)(1.0F - var14), (double)var15, (double)(0.5F - var13), 1.0D, (double)var16, (double)(0.5F + var13)); ++ } ++ else if (var7 == 3) ++ { ++ this.setRenderBounds(0.0D, (double)var15, (double)(0.5F - var13), (double)var14, (double)var16, (double)(0.5F + var13)); ++ } ++ ++ this.renderStandardBlock(par1Block, par2, par3, par4); ++ ++ if (!var11) ++ { ++ this.clearOverrideBlockTexture(); ++ } ++ ++ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ float var17 = 1.0F; ++ ++ if (Block.lightValue[par1Block.blockID] > 0) ++ { ++ var17 = 1.0F; ++ } ++ ++ var5.setColorOpaque_F(var17, var17, var17); ++ Icon var18 = this.getBlockIconFromSide(par1Block, 0); ++ ++ if (this.hasOverrideBlockTexture()) ++ { ++ var18 = this.overrideBlockTexture; ++ } ++ ++ double var19 = (double)var18.getMinU(); ++ double var21 = (double)var18.getMinV(); ++ double var23 = (double)var18.getMaxU(); ++ double var25 = (double)var18.getMaxV(); ++ Vec3[] var27 = new Vec3[8]; ++ float var28 = 0.046875F; ++ float var29 = 0.046875F; ++ float var30 = 0.3125F; ++ var27[0] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var28), 0.0D, (double)(-var29)); ++ var27[1] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var28, 0.0D, (double)(-var29)); ++ var27[2] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var28, 0.0D, (double)var29); ++ var27[3] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var28), 0.0D, (double)var29); ++ var27[4] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var28), (double)var30, (double)(-var29)); ++ var27[5] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var28, (double)var30, (double)(-var29)); ++ var27[6] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var28, (double)var30, (double)var29); ++ var27[7] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var28), (double)var30, (double)var29); ++ ++ for (int var31 = 0; var31 < 8; ++var31) ++ { ++ var27[var31].zCoord += 0.0625D; ++ ++ if (var9) ++ { ++ var27[var31].rotateAroundX(0.5235988F); ++ var27[var31].yCoord -= 0.4375D; ++ } ++ else if (var8) ++ { ++ var27[var31].rotateAroundX(0.08726647F); ++ var27[var31].yCoord -= 0.4375D; ++ } ++ else ++ { ++ var27[var31].rotateAroundX(-((float)Math.PI * 2F / 9F)); ++ var27[var31].yCoord -= 0.375D; ++ } ++ ++ var27[var31].rotateAroundX(((float)Math.PI / 2F)); ++ ++ if (var7 == 2) ++ { ++ var27[var31].rotateAroundY(0.0F); ++ } ++ ++ if (var7 == 0) ++ { ++ var27[var31].rotateAroundY((float)Math.PI); ++ } ++ ++ if (var7 == 1) ++ { ++ var27[var31].rotateAroundY(((float)Math.PI / 2F)); ++ } ++ ++ if (var7 == 3) ++ { ++ var27[var31].rotateAroundY(-((float)Math.PI / 2F)); ++ } ++ ++ var27[var31].xCoord += (double)par2 + 0.5D; ++ var27[var31].yCoord += (double)((float)par3 + 0.3125F); ++ var27[var31].zCoord += (double)par4 + 0.5D; ++ } ++ ++ Vec3 var62 = null; ++ Vec3 var32 = null; ++ Vec3 var33 = null; ++ Vec3 var34 = null; ++ byte var35 = 7; ++ byte var36 = 9; ++ byte var37 = 9; ++ byte var38 = 16; ++ ++ for (int var39 = 0; var39 < 6; ++var39) ++ { ++ if (var39 == 0) ++ { ++ var62 = var27[0]; ++ var32 = var27[1]; ++ var33 = var27[2]; ++ var34 = var27[3]; ++ var19 = (double)var18.getInterpolatedU((double)var35); ++ var21 = (double)var18.getInterpolatedV((double)var37); ++ var23 = (double)var18.getInterpolatedU((double)var36); ++ var25 = (double)var18.getInterpolatedV((double)(var37 + 2)); ++ } ++ else if (var39 == 1) ++ { ++ var62 = var27[7]; ++ var32 = var27[6]; ++ var33 = var27[5]; ++ var34 = var27[4]; ++ } ++ else if (var39 == 2) ++ { ++ var62 = var27[1]; ++ var32 = var27[0]; ++ var33 = var27[4]; ++ var34 = var27[5]; ++ var19 = (double)var18.getInterpolatedU((double)var35); ++ var21 = (double)var18.getInterpolatedV((double)var37); ++ var23 = (double)var18.getInterpolatedU((double)var36); ++ var25 = (double)var18.getInterpolatedV((double)var38); ++ } ++ else if (var39 == 3) ++ { ++ var62 = var27[2]; ++ var32 = var27[1]; ++ var33 = var27[5]; ++ var34 = var27[6]; ++ } ++ else if (var39 == 4) ++ { ++ var62 = var27[3]; ++ var32 = var27[2]; ++ var33 = var27[6]; ++ var34 = var27[7]; ++ } ++ else if (var39 == 5) ++ { ++ var62 = var27[0]; ++ var32 = var27[3]; ++ var33 = var27[7]; ++ var34 = var27[4]; ++ } ++ ++ var5.addVertexWithUV(var62.xCoord, var62.yCoord, var62.zCoord, var19, var25); ++ var5.addVertexWithUV(var32.xCoord, var32.yCoord, var32.zCoord, var23, var25); ++ var5.addVertexWithUV(var33.xCoord, var33.yCoord, var33.zCoord, var23, var21); ++ var5.addVertexWithUV(var34.xCoord, var34.yCoord, var34.zCoord, var19, var21); ++ } ++ ++ float var63 = 0.09375F; ++ float var40 = 0.09375F; ++ float var41 = 0.03125F; ++ var27[0] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var63), 0.0D, (double)(-var40)); ++ var27[1] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var63, 0.0D, (double)(-var40)); ++ var27[2] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var63, 0.0D, (double)var40); ++ var27[3] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var63), 0.0D, (double)var40); ++ var27[4] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var63), (double)var41, (double)(-var40)); ++ var27[5] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var63, (double)var41, (double)(-var40)); ++ var27[6] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var63, (double)var41, (double)var40); ++ var27[7] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var63), (double)var41, (double)var40); ++ ++ for (int var42 = 0; var42 < 8; ++var42) ++ { ++ var27[var42].zCoord += 0.21875D; ++ ++ if (var9) ++ { ++ var27[var42].yCoord -= 0.09375D; ++ var27[var42].zCoord -= 0.1625D; ++ var27[var42].rotateAroundX(0.0F); ++ } ++ else if (var8) ++ { ++ var27[var42].yCoord += 0.015625D; ++ var27[var42].zCoord -= 0.171875D; ++ var27[var42].rotateAroundX(0.17453294F); ++ } ++ else ++ { ++ var27[var42].rotateAroundX(0.87266463F); ++ } ++ ++ if (var7 == 2) ++ { ++ var27[var42].rotateAroundY(0.0F); ++ } ++ ++ if (var7 == 0) ++ { ++ var27[var42].rotateAroundY((float)Math.PI); ++ } ++ ++ if (var7 == 1) ++ { ++ var27[var42].rotateAroundY(((float)Math.PI / 2F)); ++ } ++ ++ if (var7 == 3) ++ { ++ var27[var42].rotateAroundY(-((float)Math.PI / 2F)); ++ } ++ ++ var27[var42].xCoord += (double)par2 + 0.5D; ++ var27[var42].yCoord += (double)((float)par3 + 0.3125F); ++ var27[var42].zCoord += (double)par4 + 0.5D; ++ } ++ ++ byte var64 = 5; ++ byte var43 = 11; ++ byte var44 = 3; ++ byte var45 = 9; ++ ++ for (int var46 = 0; var46 < 6; ++var46) ++ { ++ if (var46 == 0) ++ { ++ var62 = var27[0]; ++ var32 = var27[1]; ++ var33 = var27[2]; ++ var34 = var27[3]; ++ var19 = (double)var18.getInterpolatedU((double)var64); ++ var21 = (double)var18.getInterpolatedV((double)var44); ++ var23 = (double)var18.getInterpolatedU((double)var43); ++ var25 = (double)var18.getInterpolatedV((double)var45); ++ } ++ else if (var46 == 1) ++ { ++ var62 = var27[7]; ++ var32 = var27[6]; ++ var33 = var27[5]; ++ var34 = var27[4]; ++ } ++ else if (var46 == 2) ++ { ++ var62 = var27[1]; ++ var32 = var27[0]; ++ var33 = var27[4]; ++ var34 = var27[5]; ++ var19 = (double)var18.getInterpolatedU((double)var64); ++ var21 = (double)var18.getInterpolatedV((double)var44); ++ var23 = (double)var18.getInterpolatedU((double)var43); ++ var25 = (double)var18.getInterpolatedV((double)(var44 + 2)); ++ } ++ else if (var46 == 3) ++ { ++ var62 = var27[2]; ++ var32 = var27[1]; ++ var33 = var27[5]; ++ var34 = var27[6]; ++ } ++ else if (var46 == 4) ++ { ++ var62 = var27[3]; ++ var32 = var27[2]; ++ var33 = var27[6]; ++ var34 = var27[7]; ++ } ++ else if (var46 == 5) ++ { ++ var62 = var27[0]; ++ var32 = var27[3]; ++ var33 = var27[7]; ++ var34 = var27[4]; ++ } ++ ++ var5.addVertexWithUV(var62.xCoord, var62.yCoord, var62.zCoord, var19, var25); ++ var5.addVertexWithUV(var32.xCoord, var32.yCoord, var32.zCoord, var23, var25); ++ var5.addVertexWithUV(var33.xCoord, var33.yCoord, var33.zCoord, var23, var21); ++ var5.addVertexWithUV(var34.xCoord, var34.yCoord, var34.zCoord, var19, var21); ++ } ++ ++ if (var8) ++ { ++ double var65 = var27[0].yCoord; ++ float var48 = 0.03125F; ++ float var49 = 0.5F - var48 / 2.0F; ++ float var50 = var49 + var48; ++ Icon var51 = this.getBlockIcon(Block.tripWire); ++ double var52 = (double)var18.getMinU(); ++ double var54 = (double)var18.getInterpolatedV(var8 ? 2.0D : 0.0D); ++ double var56 = (double)var18.getMaxU(); ++ double var58 = (double)var18.getInterpolatedV(var8 ? 4.0D : 2.0D); ++ double var60 = (double)(var10 ? 3.5F : 1.5F) / 16.0D; ++ var17 = par1Block.getBlockBrightness(this.blockAccess, par2, par3, par4) * 0.75F; ++ var5.setColorOpaque_F(var17, var17, var17); ++ ++ if (var7 == 2) ++ { ++ var5.addVertexWithUV((double)((float)par2 + var49), (double)par3 + var60, (double)par4 + 0.25D, var52, var54); ++ var5.addVertexWithUV((double)((float)par2 + var50), (double)par3 + var60, (double)par4 + 0.25D, var52, var58); ++ var5.addVertexWithUV((double)((float)par2 + var50), (double)par3 + var60, (double)par4, var56, var58); ++ var5.addVertexWithUV((double)((float)par2 + var49), (double)par3 + var60, (double)par4, var56, var54); ++ var5.addVertexWithUV((double)((float)par2 + var49), var65, (double)par4 + 0.5D, var52, var54); ++ var5.addVertexWithUV((double)((float)par2 + var50), var65, (double)par4 + 0.5D, var52, var58); ++ var5.addVertexWithUV((double)((float)par2 + var50), (double)par3 + var60, (double)par4 + 0.25D, var56, var58); ++ var5.addVertexWithUV((double)((float)par2 + var49), (double)par3 + var60, (double)par4 + 0.25D, var56, var54); ++ } ++ else if (var7 == 0) ++ { ++ var5.addVertexWithUV((double)((float)par2 + var49), (double)par3 + var60, (double)par4 + 0.75D, var52, var54); ++ var5.addVertexWithUV((double)((float)par2 + var50), (double)par3 + var60, (double)par4 + 0.75D, var52, var58); ++ var5.addVertexWithUV((double)((float)par2 + var50), var65, (double)par4 + 0.5D, var56, var58); ++ var5.addVertexWithUV((double)((float)par2 + var49), var65, (double)par4 + 0.5D, var56, var54); ++ var5.addVertexWithUV((double)((float)par2 + var49), (double)par3 + var60, (double)(par4 + 1), var52, var54); ++ var5.addVertexWithUV((double)((float)par2 + var50), (double)par3 + var60, (double)(par4 + 1), var52, var58); ++ var5.addVertexWithUV((double)((float)par2 + var50), (double)par3 + var60, (double)par4 + 0.75D, var56, var58); ++ var5.addVertexWithUV((double)((float)par2 + var49), (double)par3 + var60, (double)par4 + 0.75D, var56, var54); ++ } ++ else if (var7 == 1) ++ { ++ var5.addVertexWithUV((double)par2, (double)par3 + var60, (double)((float)par4 + var50), var52, var58); ++ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var60, (double)((float)par4 + var50), var56, var58); ++ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var60, (double)((float)par4 + var49), var56, var54); ++ var5.addVertexWithUV((double)par2, (double)par3 + var60, (double)((float)par4 + var49), var52, var54); ++ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var60, (double)((float)par4 + var50), var52, var58); ++ var5.addVertexWithUV((double)par2 + 0.5D, var65, (double)((float)par4 + var50), var56, var58); ++ var5.addVertexWithUV((double)par2 + 0.5D, var65, (double)((float)par4 + var49), var56, var54); ++ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var60, (double)((float)par4 + var49), var52, var54); ++ } ++ else ++ { ++ var5.addVertexWithUV((double)par2 + 0.5D, var65, (double)((float)par4 + var50), var52, var58); ++ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var60, (double)((float)par4 + var50), var56, var58); ++ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var60, (double)((float)par4 + var49), var56, var54); ++ var5.addVertexWithUV((double)par2 + 0.5D, var65, (double)((float)par4 + var49), var52, var54); ++ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var60, (double)((float)par4 + var50), var52, var58); ++ var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var60, (double)((float)par4 + var50), var56, var58); ++ var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var60, (double)((float)par4 + var49), var56, var54); ++ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var60, (double)((float)par4 + var49), var52, var54); ++ } ++ } ++ ++ return true; ++ } ++ ++ /** ++ * Renders a trip wire block at the given coordinates ++ */ ++ public boolean renderBlockTripWire(Block par1Block, int par2, int par3, int par4) ++ { ++ Tessellator var5 = Tessellator.instance; ++ Icon var6 = this.getBlockIconFromSide(par1Block, 0); ++ int var7 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ boolean var8 = (var7 & 4) == 4; ++ boolean var9 = (var7 & 2) == 2; ++ ++ if (this.hasOverrideBlockTexture()) ++ { ++ var6 = this.overrideBlockTexture; ++ } ++ ++ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ float var10 = par1Block.getBlockBrightness(this.blockAccess, par2, par3, par4) * 0.75F; ++ var5.setColorOpaque_F(var10, var10, var10); ++ double var11 = (double)var6.getMinU(); ++ double var13 = (double)var6.getInterpolatedV(var8 ? 2.0D : 0.0D); ++ double var15 = (double)var6.getMaxU(); ++ double var17 = (double)var6.getInterpolatedV(var8 ? 4.0D : 2.0D); ++ double var19 = (double)(var9 ? 3.5F : 1.5F) / 16.0D; ++ boolean var21 = BlockTripWire.func_72148_a(this.blockAccess, par2, par3, par4, var7, 1); ++ boolean var22 = BlockTripWire.func_72148_a(this.blockAccess, par2, par3, par4, var7, 3); ++ boolean var23 = BlockTripWire.func_72148_a(this.blockAccess, par2, par3, par4, var7, 2); ++ boolean var24 = BlockTripWire.func_72148_a(this.blockAccess, par2, par3, par4, var7, 0); ++ float var25 = 0.03125F; ++ float var26 = 0.5F - var25 / 2.0F; ++ float var27 = var26 + var25; ++ ++ if (!var23 && !var22 && !var24 && !var21) ++ { ++ var23 = true; ++ var24 = true; ++ } ++ ++ if (var23) ++ { ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.25D, var11, var13); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.25D, var11, var17); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4, var15, var17); ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4, var15, var13); ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4, var15, var13); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4, var15, var17); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.25D, var11, var17); ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.25D, var11, var13); ++ } ++ ++ if (var23 || var24 && !var22 && !var21) ++ { ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.5D, var11, var13); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.5D, var11, var17); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.25D, var15, var17); ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.25D, var15, var13); ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.25D, var15, var13); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.25D, var15, var17); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.5D, var11, var17); ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.5D, var11, var13); ++ } ++ ++ if (var24 || var23 && !var22 && !var21) ++ { ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.75D, var11, var13); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.75D, var11, var17); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.5D, var15, var17); ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.5D, var15, var13); ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.5D, var15, var13); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.5D, var15, var17); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.75D, var11, var17); ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.75D, var11, var13); ++ } ++ ++ if (var24) ++ { ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)(par4 + 1), var11, var13); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)(par4 + 1), var11, var17); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.75D, var15, var17); ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.75D, var15, var13); ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.75D, var15, var13); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.75D, var15, var17); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)(par4 + 1), var11, var17); ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)(par4 + 1), var11, var13); ++ } ++ ++ if (var21) ++ { ++ var5.addVertexWithUV((double)par2, (double)par3 + var19, (double)((float)par4 + var27), var11, var17); ++ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var19, (double)((float)par4 + var27), var15, var17); ++ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var19, (double)((float)par4 + var26), var15, var13); ++ var5.addVertexWithUV((double)par2, (double)par3 + var19, (double)((float)par4 + var26), var11, var13); ++ var5.addVertexWithUV((double)par2, (double)par3 + var19, (double)((float)par4 + var26), var11, var13); ++ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var19, (double)((float)par4 + var26), var15, var13); ++ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var19, (double)((float)par4 + var27), var15, var17); ++ var5.addVertexWithUV((double)par2, (double)par3 + var19, (double)((float)par4 + var27), var11, var17); ++ } ++ ++ if (var21 || var22 && !var23 && !var24) ++ { ++ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var19, (double)((float)par4 + var27), var11, var17); ++ var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var19, (double)((float)par4 + var27), var15, var17); ++ var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var19, (double)((float)par4 + var26), var15, var13); ++ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var19, (double)((float)par4 + var26), var11, var13); ++ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var19, (double)((float)par4 + var26), var11, var13); ++ var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var19, (double)((float)par4 + var26), var15, var13); ++ var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var19, (double)((float)par4 + var27), var15, var17); ++ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var19, (double)((float)par4 + var27), var11, var17); ++ } ++ ++ if (var22 || var21 && !var23 && !var24) ++ { ++ var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var19, (double)((float)par4 + var27), var11, var17); ++ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var19, (double)((float)par4 + var27), var15, var17); ++ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var19, (double)((float)par4 + var26), var15, var13); ++ var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var19, (double)((float)par4 + var26), var11, var13); ++ var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var19, (double)((float)par4 + var26), var11, var13); ++ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var19, (double)((float)par4 + var26), var15, var13); ++ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var19, (double)((float)par4 + var27), var15, var17); ++ var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var19, (double)((float)par4 + var27), var11, var17); ++ } ++ ++ if (var22) ++ { ++ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var19, (double)((float)par4 + var27), var11, var17); ++ var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var19, (double)((float)par4 + var27), var15, var17); ++ var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var19, (double)((float)par4 + var26), var15, var13); ++ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var19, (double)((float)par4 + var26), var11, var13); ++ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var19, (double)((float)par4 + var26), var11, var13); ++ var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var19, (double)((float)par4 + var26), var15, var13); ++ var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var19, (double)((float)par4 + var27), var15, var17); ++ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var19, (double)((float)par4 + var27), var11, var17); ++ } ++ ++ return true; ++ } ++ ++ /** ++ * Renders a fire block at the given coordinates ++ */ ++ public boolean renderBlockFire(BlockFire par1BlockFire, int par2, int par3, int par4) ++ { ++ Tessellator var5 = Tessellator.instance; ++ Icon var6 = par1BlockFire.getFireIcon(0); ++ Icon var7 = par1BlockFire.getFireIcon(1); ++ Icon var8 = var6; ++ ++ if (this.hasOverrideBlockTexture()) ++ { ++ var8 = this.overrideBlockTexture; ++ } ++ ++ var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); ++ var5.setBrightness(par1BlockFire.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ double var9 = (double)var8.getMinU(); ++ double var11 = (double)var8.getMinV(); ++ double var13 = (double)var8.getMaxU(); ++ double var15 = (double)var8.getMaxV(); ++ float var17 = 1.4F; ++ double var20; ++ double var22; ++ double var24; ++ double var26; ++ double var28; ++ double var30; ++ double var32; ++ ++ if (!this.blockAccess.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 - 1, par4)) ++ { ++ float var36 = 0.2F; ++ float var19 = 0.0625F; ++ ++ if ((par2 + par3 + par4 & 1) == 1) ++ { ++ var9 = (double)var7.getMinU(); ++ var11 = (double)var7.getMinV(); ++ var13 = (double)var7.getMaxU(); ++ var15 = (double)var7.getMaxV(); ++ } ++ ++ if ((par2 / 2 + par3 / 2 + par4 / 2 & 1) == 1) ++ { ++ var20 = var13; ++ var13 = var9; ++ var9 = var20; ++ } ++ ++ if (Block.fire.canBlockCatchFire(this.blockAccess, par2 - 1, par3, par4)) ++ { ++ var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var13, var11); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1), var13, var15); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15); ++ var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var11); ++ var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var11); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1), var13, var15); ++ var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var13, var11); ++ } ++ ++ if (Block.fire.canBlockCatchFire(this.blockAccess, par2 + 1, par3, par4)) ++ { ++ var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var11); ++ var5.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15); ++ var5.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1), var13, var15); ++ var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var13, var11); ++ var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var13, var11); ++ var5.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1), var13, var15); ++ var5.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15); ++ var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var11); ++ } ++ ++ if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3, par4 - 1)) ++ { ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var13, var11); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var13, var15); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var9, var11); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var9, var11); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var13, var15); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var13, var11); ++ } ++ ++ if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3, par4 + 1)) ++ { ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var9, var11); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + var19), (double)(par4 + 1 - 0), var9, var15); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1 - 0), var13, var15); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var13, var11); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var13, var11); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1 - 0), var13, var15); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + var19), (double)(par4 + 1 - 0), var9, var15); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var9, var11); ++ } ++ ++ if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 + 1, par4)) ++ { ++ var20 = (double)par2 + 0.5D + 0.5D; ++ var22 = (double)par2 + 0.5D - 0.5D; ++ var24 = (double)par4 + 0.5D + 0.5D; ++ var26 = (double)par4 + 0.5D - 0.5D; ++ var28 = (double)par2 + 0.5D - 0.5D; ++ var30 = (double)par2 + 0.5D + 0.5D; ++ var32 = (double)par4 + 0.5D - 0.5D; ++ double var34 = (double)par4 + 0.5D + 0.5D; ++ var9 = (double)var6.getMinU(); ++ var11 = (double)var6.getMinV(); ++ var13 = (double)var6.getMaxU(); ++ var15 = (double)var6.getMaxV(); ++ ++par3; ++ var17 = -0.2F; ++ ++ if ((par2 + par3 + par4 & 1) == 0) ++ { ++ var5.addVertexWithUV(var28, (double)((float)par3 + var17), (double)(par4 + 0), var13, var11); ++ var5.addVertexWithUV(var20, (double)(par3 + 0), (double)(par4 + 0), var13, var15); ++ var5.addVertexWithUV(var20, (double)(par3 + 0), (double)(par4 + 1), var9, var15); ++ var5.addVertexWithUV(var28, (double)((float)par3 + var17), (double)(par4 + 1), var9, var11); ++ var9 = (double)var7.getMinU(); ++ var11 = (double)var7.getMinV(); ++ var13 = (double)var7.getMaxU(); ++ var15 = (double)var7.getMaxV(); ++ var5.addVertexWithUV(var30, (double)((float)par3 + var17), (double)(par4 + 1), var13, var11); ++ var5.addVertexWithUV(var22, (double)(par3 + 0), (double)(par4 + 1), var13, var15); ++ var5.addVertexWithUV(var22, (double)(par3 + 0), (double)(par4 + 0), var9, var15); ++ var5.addVertexWithUV(var30, (double)((float)par3 + var17), (double)(par4 + 0), var9, var11); ++ } ++ else ++ { ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17), var34, var13, var11); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), var26, var13, var15); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), var26, var9, var15); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17), var34, var9, var11); ++ var9 = (double)var7.getMinU(); ++ var11 = (double)var7.getMinV(); ++ var13 = (double)var7.getMaxU(); ++ var15 = (double)var7.getMaxV(); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17), var32, var13, var11); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), var24, var13, var15); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), var24, var9, var15); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17), var32, var9, var11); ++ } ++ } ++ } ++ else ++ { ++ double var18 = (double)par2 + 0.5D + 0.2D; ++ var20 = (double)par2 + 0.5D - 0.2D; ++ var22 = (double)par4 + 0.5D + 0.2D; ++ var24 = (double)par4 + 0.5D - 0.2D; ++ var26 = (double)par2 + 0.5D - 0.3D; ++ var28 = (double)par2 + 0.5D + 0.3D; ++ var30 = (double)par4 + 0.5D - 0.3D; ++ var32 = (double)par4 + 0.5D + 0.3D; ++ var5.addVertexWithUV(var26, (double)((float)par3 + var17), (double)(par4 + 1), var13, var11); ++ var5.addVertexWithUV(var18, (double)(par3 + 0), (double)(par4 + 1), var13, var15); ++ var5.addVertexWithUV(var18, (double)(par3 + 0), (double)(par4 + 0), var9, var15); ++ var5.addVertexWithUV(var26, (double)((float)par3 + var17), (double)(par4 + 0), var9, var11); ++ var5.addVertexWithUV(var28, (double)((float)par3 + var17), (double)(par4 + 0), var13, var11); ++ var5.addVertexWithUV(var20, (double)(par3 + 0), (double)(par4 + 0), var13, var15); ++ var5.addVertexWithUV(var20, (double)(par3 + 0), (double)(par4 + 1), var9, var15); ++ var5.addVertexWithUV(var28, (double)((float)par3 + var17), (double)(par4 + 1), var9, var11); ++ var9 = (double)var7.getMinU(); ++ var11 = (double)var7.getMinV(); ++ var13 = (double)var7.getMaxU(); ++ var15 = (double)var7.getMaxV(); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17), var32, var13, var11); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), var24, var13, var15); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), var24, var9, var15); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17), var32, var9, var11); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17), var30, var13, var11); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), var22, var13, var15); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), var22, var9, var15); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17), var30, var9, var11); ++ var18 = (double)par2 + 0.5D - 0.5D; ++ var20 = (double)par2 + 0.5D + 0.5D; ++ var22 = (double)par4 + 0.5D - 0.5D; ++ var24 = (double)par4 + 0.5D + 0.5D; ++ var26 = (double)par2 + 0.5D - 0.4D; ++ var28 = (double)par2 + 0.5D + 0.4D; ++ var30 = (double)par4 + 0.5D - 0.4D; ++ var32 = (double)par4 + 0.5D + 0.4D; ++ var5.addVertexWithUV(var26, (double)((float)par3 + var17), (double)(par4 + 0), var9, var11); ++ var5.addVertexWithUV(var18, (double)(par3 + 0), (double)(par4 + 0), var9, var15); ++ var5.addVertexWithUV(var18, (double)(par3 + 0), (double)(par4 + 1), var13, var15); ++ var5.addVertexWithUV(var26, (double)((float)par3 + var17), (double)(par4 + 1), var13, var11); ++ var5.addVertexWithUV(var28, (double)((float)par3 + var17), (double)(par4 + 1), var9, var11); ++ var5.addVertexWithUV(var20, (double)(par3 + 0), (double)(par4 + 1), var9, var15); ++ var5.addVertexWithUV(var20, (double)(par3 + 0), (double)(par4 + 0), var13, var15); ++ var5.addVertexWithUV(var28, (double)((float)par3 + var17), (double)(par4 + 0), var13, var11); ++ var9 = (double)var6.getMinU(); ++ var11 = (double)var6.getMinV(); ++ var13 = (double)var6.getMaxU(); ++ var15 = (double)var6.getMaxV(); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17), var32, var9, var11); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), var24, var9, var15); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), var24, var13, var15); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17), var32, var13, var11); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17), var30, var9, var11); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), var22, var9, var15); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), var22, var13, var15); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17), var30, var13, var11); ++ } ++ ++ return true; ++ } ++ ++ /** ++ * Renders a redstone wire block at the given coordinates ++ */ ++ public boolean renderBlockRedstoneWire(Block par1Block, int par2, int par3, int par4) ++ { ++ Tessellator var5 = Tessellator.instance; ++ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ Icon var7 = BlockRedstoneWire.getRedstoneWireIcon("cross"); ++ Icon var8 = BlockRedstoneWire.getRedstoneWireIcon("line"); ++ Icon var9 = BlockRedstoneWire.getRedstoneWireIcon("cross_overlay"); ++ Icon var10 = BlockRedstoneWire.getRedstoneWireIcon("line_overlay"); ++ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ float var11 = 1.0F; ++ float var12 = (float)var6 / 15.0F; ++ float var13 = var12 * 0.6F + 0.4F; ++ ++ if (var6 == 0) ++ { ++ var13 = 0.3F; ++ } ++ ++ float var14 = var12 * var12 * 0.7F - 0.5F; ++ float var15 = var12 * var12 * 0.6F - 0.7F; ++ ++ if (var14 < 0.0F) ++ { ++ var14 = 0.0F; ++ } ++ ++ if (var15 < 0.0F) ++ { ++ var15 = 0.0F; ++ } ++ ++ var5.setColorOpaque_F(var13, var14, var15); ++ double var16 = 0.015625D; ++ double var18 = 0.015625D; ++ boolean var20 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 - 1, par3, par4, 1) || !this.blockAccess.isBlockNormalCube(par2 - 1, par3, par4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 - 1, par3 - 1, par4, -1); ++ boolean var21 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 + 1, par3, par4, 3) || !this.blockAccess.isBlockNormalCube(par2 + 1, par3, par4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 + 1, par3 - 1, par4, -1); ++ boolean var22 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3, par4 - 1, 2) || !this.blockAccess.isBlockNormalCube(par2, par3, par4 - 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3 - 1, par4 - 1, -1); ++ boolean var23 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3, par4 + 1, 0) || !this.blockAccess.isBlockNormalCube(par2, par3, par4 + 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3 - 1, par4 + 1, -1); ++ ++ if (!this.blockAccess.isBlockNormalCube(par2, par3 + 1, par4)) ++ { ++ if (this.blockAccess.isBlockNormalCube(par2 - 1, par3, par4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 - 1, par3 + 1, par4, -1)) ++ { ++ var20 = true; ++ } ++ ++ if (this.blockAccess.isBlockNormalCube(par2 + 1, par3, par4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 + 1, par3 + 1, par4, -1)) ++ { ++ var21 = true; ++ } ++ ++ if (this.blockAccess.isBlockNormalCube(par2, par3, par4 - 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3 + 1, par4 - 1, -1)) ++ { ++ var22 = true; ++ } ++ ++ if (this.blockAccess.isBlockNormalCube(par2, par3, par4 + 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3 + 1, par4 + 1, -1)) ++ { ++ var23 = true; ++ } ++ } ++ ++ float var24 = (float)(par2 + 0); ++ float var25 = (float)(par2 + 1); ++ float var26 = (float)(par4 + 0); ++ float var27 = (float)(par4 + 1); ++ int var28 = 0; ++ ++ if ((var20 || var21) && !var22 && !var23) ++ { ++ var28 = 1; ++ } ++ ++ if ((var22 || var23) && !var21 && !var20) ++ { ++ var28 = 2; ++ } ++ ++ if (var28 == 0) ++ { ++ int var29 = 0; ++ int var30 = 0; ++ int var31 = 16; ++ int var32 = 16; ++ boolean var33 = true; ++ ++ if (!var20) ++ { ++ var24 += 0.3125F; ++ } ++ ++ if (!var20) ++ { ++ var29 += 5; ++ } ++ ++ if (!var21) ++ { ++ var25 -= 0.3125F; ++ } ++ ++ if (!var21) ++ { ++ var31 -= 5; ++ } ++ ++ if (!var22) ++ { ++ var26 += 0.3125F; ++ } ++ ++ if (!var22) ++ { ++ var30 += 5; ++ } ++ ++ if (!var23) ++ { ++ var27 -= 0.3125F; ++ } ++ ++ if (!var23) ++ { ++ var32 -= 5; ++ } ++ ++ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var27, (double)var7.getInterpolatedU((double)var31), (double)var7.getInterpolatedV((double)var32)); ++ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var26, (double)var7.getInterpolatedU((double)var31), (double)var7.getInterpolatedV((double)var30)); ++ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var26, (double)var7.getInterpolatedU((double)var29), (double)var7.getInterpolatedV((double)var30)); ++ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var27, (double)var7.getInterpolatedU((double)var29), (double)var7.getInterpolatedV((double)var32)); ++ var5.setColorOpaque_F(var11, var11, var11); ++ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var27, (double)var9.getInterpolatedU((double)var31), (double)var9.getInterpolatedV((double)var32)); ++ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var26, (double)var9.getInterpolatedU((double)var31), (double)var9.getInterpolatedV((double)var30)); ++ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var26, (double)var9.getInterpolatedU((double)var29), (double)var9.getInterpolatedV((double)var30)); ++ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var27, (double)var9.getInterpolatedU((double)var29), (double)var9.getInterpolatedV((double)var32)); ++ } ++ else if (var28 == 1) ++ { ++ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var27, (double)var8.getMaxU(), (double)var8.getMaxV()); ++ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var26, (double)var8.getMaxU(), (double)var8.getMinV()); ++ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var26, (double)var8.getMinU(), (double)var8.getMinV()); ++ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var27, (double)var8.getMinU(), (double)var8.getMaxV()); ++ var5.setColorOpaque_F(var11, var11, var11); ++ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var27, (double)var10.getMaxU(), (double)var10.getMaxV()); ++ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var26, (double)var10.getMaxU(), (double)var10.getMinV()); ++ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var26, (double)var10.getMinU(), (double)var10.getMinV()); ++ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var27, (double)var10.getMinU(), (double)var10.getMaxV()); ++ } ++ else ++ { ++ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var27, (double)var8.getMaxU(), (double)var8.getMaxV()); ++ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var26, (double)var8.getMinU(), (double)var8.getMaxV()); ++ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var26, (double)var8.getMinU(), (double)var8.getMinV()); ++ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var27, (double)var8.getMaxU(), (double)var8.getMinV()); ++ var5.setColorOpaque_F(var11, var11, var11); ++ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var27, (double)var10.getMaxU(), (double)var10.getMaxV()); ++ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var26, (double)var10.getMinU(), (double)var10.getMaxV()); ++ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var26, (double)var10.getMinU(), (double)var10.getMinV()); ++ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var27, (double)var10.getMaxU(), (double)var10.getMinV()); ++ } ++ ++ if (!this.blockAccess.isBlockNormalCube(par2, par3 + 1, par4)) ++ { ++ float var34 = 0.021875F; ++ ++ if (this.blockAccess.isBlockNormalCube(par2 - 1, par3, par4) && this.blockAccess.getBlockId(par2 - 1, par3 + 1, par4) == Block.redstoneWire.blockID) ++ { ++ var5.setColorOpaque_F(var11 * var13, var11 * var14, var11 * var15); ++ var5.addVertexWithUV((double)par2 + 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1), (double)var8.getMaxU(), (double)var8.getMinV()); ++ var5.addVertexWithUV((double)par2 + 0.015625D, (double)(par3 + 0), (double)(par4 + 1), (double)var8.getMinU(), (double)var8.getMinV()); ++ var5.addVertexWithUV((double)par2 + 0.015625D, (double)(par3 + 0), (double)(par4 + 0), (double)var8.getMinU(), (double)var8.getMaxV()); ++ var5.addVertexWithUV((double)par2 + 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 0), (double)var8.getMaxU(), (double)var8.getMaxV()); ++ var5.setColorOpaque_F(var11, var11, var11); ++ var5.addVertexWithUV((double)par2 + 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1), (double)var10.getMaxU(), (double)var10.getMinV()); ++ var5.addVertexWithUV((double)par2 + 0.015625D, (double)(par3 + 0), (double)(par4 + 1), (double)var10.getMinU(), (double)var10.getMinV()); ++ var5.addVertexWithUV((double)par2 + 0.015625D, (double)(par3 + 0), (double)(par4 + 0), (double)var10.getMinU(), (double)var10.getMaxV()); ++ var5.addVertexWithUV((double)par2 + 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 0), (double)var10.getMaxU(), (double)var10.getMaxV()); ++ } ++ ++ if (this.blockAccess.isBlockNormalCube(par2 + 1, par3, par4) && this.blockAccess.getBlockId(par2 + 1, par3 + 1, par4) == Block.redstoneWire.blockID) ++ { ++ var5.setColorOpaque_F(var11 * var13, var11 * var14, var11 * var15); ++ var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)(par3 + 0), (double)(par4 + 1), (double)var8.getMinU(), (double)var8.getMaxV()); ++ var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1), (double)var8.getMaxU(), (double)var8.getMaxV()); ++ var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 0), (double)var8.getMaxU(), (double)var8.getMinV()); ++ var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)(par3 + 0), (double)(par4 + 0), (double)var8.getMinU(), (double)var8.getMinV()); ++ var5.setColorOpaque_F(var11, var11, var11); ++ var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)(par3 + 0), (double)(par4 + 1), (double)var10.getMinU(), (double)var10.getMaxV()); ++ var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1), (double)var10.getMaxU(), (double)var10.getMaxV()); ++ var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 0), (double)var10.getMaxU(), (double)var10.getMinV()); ++ var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)(par3 + 0), (double)(par4 + 0), (double)var10.getMinU(), (double)var10.getMinV()); ++ } ++ ++ if (this.blockAccess.isBlockNormalCube(par2, par3, par4 - 1) && this.blockAccess.getBlockId(par2, par3 + 1, par4 - 1) == Block.redstoneWire.blockID) ++ { ++ var5.setColorOpaque_F(var11 * var13, var11 * var14, var11 * var15); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)par4 + 0.015625D, (double)var8.getMinU(), (double)var8.getMaxV()); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 1) + 0.021875F), (double)par4 + 0.015625D, (double)var8.getMaxU(), (double)var8.getMaxV()); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 1) + 0.021875F), (double)par4 + 0.015625D, (double)var8.getMaxU(), (double)var8.getMinV()); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)par4 + 0.015625D, (double)var8.getMinU(), (double)var8.getMinV()); ++ var5.setColorOpaque_F(var11, var11, var11); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)par4 + 0.015625D, (double)var10.getMinU(), (double)var10.getMaxV()); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 1) + 0.021875F), (double)par4 + 0.015625D, (double)var10.getMaxU(), (double)var10.getMaxV()); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 1) + 0.021875F), (double)par4 + 0.015625D, (double)var10.getMaxU(), (double)var10.getMinV()); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)par4 + 0.015625D, (double)var10.getMinU(), (double)var10.getMinV()); ++ } ++ ++ if (this.blockAccess.isBlockNormalCube(par2, par3, par4 + 1) && this.blockAccess.getBlockId(par2, par3 + 1, par4 + 1) == Block.redstoneWire.blockID) ++ { ++ var5.setColorOpaque_F(var11 * var13, var11 * var14, var11 * var15); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1) - 0.015625D, (double)var8.getMaxU(), (double)var8.getMinV()); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)(par4 + 1) - 0.015625D, (double)var8.getMinU(), (double)var8.getMinV()); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)(par4 + 1) - 0.015625D, (double)var8.getMinU(), (double)var8.getMaxV()); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1) - 0.015625D, (double)var8.getMaxU(), (double)var8.getMaxV()); ++ var5.setColorOpaque_F(var11, var11, var11); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1) - 0.015625D, (double)var10.getMaxU(), (double)var10.getMinV()); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)(par4 + 1) - 0.015625D, (double)var10.getMinU(), (double)var10.getMinV()); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)(par4 + 1) - 0.015625D, (double)var10.getMinU(), (double)var10.getMaxV()); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1) - 0.015625D, (double)var10.getMaxU(), (double)var10.getMaxV()); ++ } ++ } ++ ++ return true; ++ } ++ ++ /** ++ * Renders a minecart track block at the given coordinates ++ */ ++ public boolean renderBlockMinecartTrack(BlockRailBase par1BlockRailBase, int par2, int par3, int par4) ++ { ++ Tessellator var5 = Tessellator.instance; ++ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ Icon var7 = this.getBlockIconFromSideAndMetadata(par1BlockRailBase, 0, var6); ++ ++ if (this.hasOverrideBlockTexture()) ++ { ++ var7 = this.overrideBlockTexture; ++ } ++ ++ if (par1BlockRailBase.isPowered()) ++ { ++ var6 &= 7; ++ } ++ ++ var5.setBrightness(par1BlockRailBase.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); ++ double var8 = (double)var7.getMinU(); ++ double var10 = (double)var7.getMinV(); ++ double var12 = (double)var7.getMaxU(); ++ double var14 = (double)var7.getMaxV(); ++ double var16 = 0.0625D; ++ double var18 = (double)(par2 + 1); ++ double var20 = (double)(par2 + 1); ++ double var22 = (double)(par2 + 0); ++ double var24 = (double)(par2 + 0); ++ double var26 = (double)(par4 + 0); ++ double var28 = (double)(par4 + 1); ++ double var30 = (double)(par4 + 1); ++ double var32 = (double)(par4 + 0); ++ double var34 = (double)par3 + var16; ++ double var36 = (double)par3 + var16; ++ double var38 = (double)par3 + var16; ++ double var40 = (double)par3 + var16; ++ ++ if (var6 != 1 && var6 != 2 && var6 != 3 && var6 != 7) ++ { ++ if (var6 == 8) ++ { ++ var18 = var20 = (double)(par2 + 0); ++ var22 = var24 = (double)(par2 + 1); ++ var26 = var32 = (double)(par4 + 1); ++ var28 = var30 = (double)(par4 + 0); ++ } ++ else if (var6 == 9) ++ { ++ var18 = var24 = (double)(par2 + 0); ++ var20 = var22 = (double)(par2 + 1); ++ var26 = var28 = (double)(par4 + 0); ++ var30 = var32 = (double)(par4 + 1); ++ } ++ } ++ else ++ { ++ var18 = var24 = (double)(par2 + 1); ++ var20 = var22 = (double)(par2 + 0); ++ var26 = var28 = (double)(par4 + 1); ++ var30 = var32 = (double)(par4 + 0); ++ } ++ ++ if (var6 != 2 && var6 != 4) ++ { ++ if (var6 == 3 || var6 == 5) ++ { ++ ++var36; ++ ++var38; ++ } ++ } ++ else ++ { ++ ++var34; ++ ++var40; ++ } ++ ++ var5.addVertexWithUV(var18, var34, var26, var12, var10); ++ var5.addVertexWithUV(var20, var36, var28, var12, var14); ++ var5.addVertexWithUV(var22, var38, var30, var8, var14); ++ var5.addVertexWithUV(var24, var40, var32, var8, var10); ++ var5.addVertexWithUV(var24, var40, var32, var8, var10); ++ var5.addVertexWithUV(var22, var38, var30, var8, var14); ++ var5.addVertexWithUV(var20, var36, var28, var12, var14); ++ var5.addVertexWithUV(var18, var34, var26, var12, var10); ++ return true; ++ } ++ ++ /** ++ * Renders a ladder block at the given coordinates ++ */ ++ public boolean renderBlockLadder(Block par1Block, int par2, int par3, int par4) ++ { ++ Tessellator var5 = Tessellator.instance; ++ Icon var6 = this.getBlockIconFromSide(par1Block, 0); ++ ++ if (this.hasOverrideBlockTexture()) ++ { ++ var6 = this.overrideBlockTexture; ++ } ++ ++ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ float var7 = 1.0F; ++ var5.setColorOpaque_F(var7, var7, var7); ++ double var20 = (double)var6.getMinU(); ++ double var9 = (double)var6.getMinV(); ++ double var11 = (double)var6.getMaxU(); ++ double var13 = (double)var6.getMaxV(); ++ int var15 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ double var16 = 0.0D; ++ double var18 = 0.05000000074505806D; ++ ++ if (var15 == 5) ++ { ++ var5.addVertexWithUV((double)par2 + var18, (double)(par3 + 1) + var16, (double)(par4 + 1) + var16, var20, var9); ++ var5.addVertexWithUV((double)par2 + var18, (double)(par3 + 0) - var16, (double)(par4 + 1) + var16, var20, var13); ++ var5.addVertexWithUV((double)par2 + var18, (double)(par3 + 0) - var16, (double)(par4 + 0) - var16, var11, var13); ++ var5.addVertexWithUV((double)par2 + var18, (double)(par3 + 1) + var16, (double)(par4 + 0) - var16, var11, var9); ++ } ++ ++ if (var15 == 4) ++ { ++ var5.addVertexWithUV((double)(par2 + 1) - var18, (double)(par3 + 0) - var16, (double)(par4 + 1) + var16, var11, var13); ++ var5.addVertexWithUV((double)(par2 + 1) - var18, (double)(par3 + 1) + var16, (double)(par4 + 1) + var16, var11, var9); ++ var5.addVertexWithUV((double)(par2 + 1) - var18, (double)(par3 + 1) + var16, (double)(par4 + 0) - var16, var20, var9); ++ var5.addVertexWithUV((double)(par2 + 1) - var18, (double)(par3 + 0) - var16, (double)(par4 + 0) - var16, var20, var13); ++ } ++ ++ if (var15 == 3) ++ { ++ var5.addVertexWithUV((double)(par2 + 1) + var16, (double)(par3 + 0) - var16, (double)par4 + var18, var11, var13); ++ var5.addVertexWithUV((double)(par2 + 1) + var16, (double)(par3 + 1) + var16, (double)par4 + var18, var11, var9); ++ var5.addVertexWithUV((double)(par2 + 0) - var16, (double)(par3 + 1) + var16, (double)par4 + var18, var20, var9); ++ var5.addVertexWithUV((double)(par2 + 0) - var16, (double)(par3 + 0) - var16, (double)par4 + var18, var20, var13); ++ } ++ ++ if (var15 == 2) ++ { ++ var5.addVertexWithUV((double)(par2 + 1) + var16, (double)(par3 + 1) + var16, (double)(par4 + 1) - var18, var20, var9); ++ var5.addVertexWithUV((double)(par2 + 1) + var16, (double)(par3 + 0) - var16, (double)(par4 + 1) - var18, var20, var13); ++ var5.addVertexWithUV((double)(par2 + 0) - var16, (double)(par3 + 0) - var16, (double)(par4 + 1) - var18, var11, var13); ++ var5.addVertexWithUV((double)(par2 + 0) - var16, (double)(par3 + 1) + var16, (double)(par4 + 1) - var18, var11, var9); ++ } ++ ++ return true; ++ } ++ ++ /** ++ * Render block vine ++ */ ++ public boolean renderBlockVine(Block par1Block, int par2, int par3, int par4) ++ { ++ Tessellator var5 = Tessellator.instance; ++ Icon var6 = this.getBlockIconFromSide(par1Block, 0); ++ ++ if (this.hasOverrideBlockTexture()) ++ { ++ var6 = this.overrideBlockTexture; ++ } ++ ++ float var7 = 1.0F; ++ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ int var8 = par1Block.colorMultiplier(this.blockAccess, par2, par3, par4); ++ float var9 = (float)(var8 >> 16 & 255) / 255.0F; ++ float var10 = (float)(var8 >> 8 & 255) / 255.0F; ++ float var11 = (float)(var8 & 255) / 255.0F; ++ var5.setColorOpaque_F(var7 * var9, var7 * var10, var7 * var11); ++ double var19 = (double)var6.getMinU(); ++ double var20 = (double)var6.getMinV(); ++ double var12 = (double)var6.getMaxU(); ++ double var14 = (double)var6.getMaxV(); ++ double var16 = 0.05000000074505806D; ++ int var18 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ ++ if ((var18 & 2) != 0) ++ { ++ var5.addVertexWithUV((double)par2 + var16, (double)(par3 + 1), (double)(par4 + 1), var19, var20); ++ var5.addVertexWithUV((double)par2 + var16, (double)(par3 + 0), (double)(par4 + 1), var19, var14); ++ var5.addVertexWithUV((double)par2 + var16, (double)(par3 + 0), (double)(par4 + 0), var12, var14); ++ var5.addVertexWithUV((double)par2 + var16, (double)(par3 + 1), (double)(par4 + 0), var12, var20); ++ var5.addVertexWithUV((double)par2 + var16, (double)(par3 + 1), (double)(par4 + 0), var12, var20); ++ var5.addVertexWithUV((double)par2 + var16, (double)(par3 + 0), (double)(par4 + 0), var12, var14); ++ var5.addVertexWithUV((double)par2 + var16, (double)(par3 + 0), (double)(par4 + 1), var19, var14); ++ var5.addVertexWithUV((double)par2 + var16, (double)(par3 + 1), (double)(par4 + 1), var19, var20); ++ } ++ ++ if ((var18 & 8) != 0) ++ { ++ var5.addVertexWithUV((double)(par2 + 1) - var16, (double)(par3 + 0), (double)(par4 + 1), var12, var14); ++ var5.addVertexWithUV((double)(par2 + 1) - var16, (double)(par3 + 1), (double)(par4 + 1), var12, var20); ++ var5.addVertexWithUV((double)(par2 + 1) - var16, (double)(par3 + 1), (double)(par4 + 0), var19, var20); ++ var5.addVertexWithUV((double)(par2 + 1) - var16, (double)(par3 + 0), (double)(par4 + 0), var19, var14); ++ var5.addVertexWithUV((double)(par2 + 1) - var16, (double)(par3 + 0), (double)(par4 + 0), var19, var14); ++ var5.addVertexWithUV((double)(par2 + 1) - var16, (double)(par3 + 1), (double)(par4 + 0), var19, var20); ++ var5.addVertexWithUV((double)(par2 + 1) - var16, (double)(par3 + 1), (double)(par4 + 1), var12, var20); ++ var5.addVertexWithUV((double)(par2 + 1) - var16, (double)(par3 + 0), (double)(par4 + 1), var12, var14); ++ } ++ ++ if ((var18 & 4) != 0) ++ { ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)par4 + var16, var12, var14); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 1), (double)par4 + var16, var12, var20); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 1), (double)par4 + var16, var19, var20); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)par4 + var16, var19, var14); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)par4 + var16, var19, var14); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 1), (double)par4 + var16, var19, var20); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 1), (double)par4 + var16, var12, var20); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)par4 + var16, var12, var14); ++ } ++ ++ if ((var18 & 1) != 0) ++ { ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 1), (double)(par4 + 1) - var16, var19, var20); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)(par4 + 1) - var16, var19, var14); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)(par4 + 1) - var16, var12, var14); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 1), (double)(par4 + 1) - var16, var12, var20); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 1), (double)(par4 + 1) - var16, var12, var20); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)(par4 + 1) - var16, var12, var14); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)(par4 + 1) - var16, var19, var14); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 1), (double)(par4 + 1) - var16, var19, var20); ++ } ++ ++ if (this.blockAccess.isBlockNormalCube(par2, par3 + 1, par4)) ++ { ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 1) - var16, (double)(par4 + 0), var19, var20); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 1) - var16, (double)(par4 + 1), var19, var14); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 1) - var16, (double)(par4 + 1), var12, var14); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 1) - var16, (double)(par4 + 0), var12, var20); ++ } ++ ++ return true; ++ } ++ ++ public boolean renderBlockPane(BlockPane par1BlockPane, int par2, int par3, int par4) ++ { ++ int var5 = this.blockAccess.getHeight(); ++ Tessellator var6 = Tessellator.instance; ++ var6.setBrightness(par1BlockPane.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ float var7 = 1.0F; ++ int var8 = par1BlockPane.colorMultiplier(this.blockAccess, par2, par3, par4); ++ float var9 = (float)(var8 >> 16 & 255) / 255.0F; ++ float var10 = (float)(var8 >> 8 & 255) / 255.0F; ++ float var11 = (float)(var8 & 255) / 255.0F; ++ ++ if (EntityRenderer.anaglyphEnable) ++ { ++ float var12 = (var9 * 30.0F + var10 * 59.0F + var11 * 11.0F) / 100.0F; ++ float var13 = (var9 * 30.0F + var10 * 70.0F) / 100.0F; ++ float var14 = (var9 * 30.0F + var11 * 70.0F) / 100.0F; ++ var9 = var12; ++ var10 = var13; ++ var11 = var14; ++ } ++ ++ var6.setColorOpaque_F(var7 * var9, var7 * var10, var7 * var11); ++ Icon var64; ++ Icon var65; ++ ++ if (this.hasOverrideBlockTexture()) ++ { ++ var64 = this.overrideBlockTexture; ++ var65 = this.overrideBlockTexture; ++ } ++ else ++ { ++ int var66 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ var64 = this.getBlockIconFromSideAndMetadata(par1BlockPane, 0, var66); ++ var65 = par1BlockPane.getSideTextureIndex(); ++ } ++ ++ double var67 = (double)var64.getMinU(); ++ double var16 = (double)var64.getInterpolatedU(8.0D); ++ double var18 = (double)var64.getMaxU(); ++ double var20 = (double)var64.getMinV(); ++ double var22 = (double)var64.getMaxV(); ++ double var24 = (double)var65.getInterpolatedU(7.0D); ++ double var26 = (double)var65.getInterpolatedU(9.0D); ++ double var28 = (double)var65.getMinV(); ++ double var30 = (double)var65.getInterpolatedV(8.0D); ++ double var32 = (double)var65.getMaxV(); ++ double var34 = (double)par2; ++ double var36 = (double)par2 + 0.5D; ++ double var38 = (double)(par2 + 1); ++ double var40 = (double)par4; ++ double var42 = (double)par4 + 0.5D; ++ double var44 = (double)(par4 + 1); ++ double var46 = (double)par2 + 0.5D - 0.0625D; ++ double var48 = (double)par2 + 0.5D + 0.0625D; ++ double var50 = (double)par4 + 0.5D - 0.0625D; ++ double var52 = (double)par4 + 0.5D + 0.0625D; ++ boolean var54 = par1BlockPane.canThisPaneConnectToThisBlockID(this.blockAccess.getBlockId(par2, par3, par4 - 1)); ++ boolean var55 = par1BlockPane.canThisPaneConnectToThisBlockID(this.blockAccess.getBlockId(par2, par3, par4 + 1)); ++ boolean var56 = par1BlockPane.canThisPaneConnectToThisBlockID(this.blockAccess.getBlockId(par2 - 1, par3, par4)); ++ boolean var57 = par1BlockPane.canThisPaneConnectToThisBlockID(this.blockAccess.getBlockId(par2 + 1, par3, par4)); ++ boolean var58 = par1BlockPane.shouldSideBeRendered(this.blockAccess, par2, par3 + 1, par4, 1); ++ boolean var59 = par1BlockPane.shouldSideBeRendered(this.blockAccess, par2, par3 - 1, par4, 0); ++ double var60 = 0.01D; ++ double var62 = 0.005D; ++ ++ if ((!var56 || !var57) && (var56 || var57 || var54 || var55)) ++ { ++ if (var56 && !var57) ++ { ++ var6.addVertexWithUV(var34, (double)(par3 + 1), var42, var67, var20); ++ var6.addVertexWithUV(var34, (double)(par3 + 0), var42, var67, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var42, var16, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var42, var16, var20); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var42, var67, var20); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var42, var67, var22); ++ var6.addVertexWithUV(var34, (double)(par3 + 0), var42, var16, var22); ++ var6.addVertexWithUV(var34, (double)(par3 + 1), var42, var16, var20); ++ ++ if (!var55 && !var54) ++ { ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var52, var24, var28); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var52, var24, var32); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var50, var26, var32); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var50, var26, var28); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var50, var24, var28); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var50, var24, var32); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var52, var26, var32); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var52, var26, var28); ++ } ++ ++ if (var58 || par3 < var5 - 1 && this.blockAccess.isAirBlock(par2 - 1, par3 + 1, par4)) ++ { ++ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var52, var26, var32); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var50, var24, var32); ++ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var50, var24, var30); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var52, var26, var32); ++ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var50, var24, var32); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var50, var24, var30); ++ } ++ ++ if (var59 || par3 > 1 && this.blockAccess.isAirBlock(par2 - 1, par3 - 1, par4)) ++ { ++ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var52, var26, var32); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var50, var24, var32); ++ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var50, var24, var30); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var52, var26, var32); ++ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var50, var24, var32); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var50, var24, var30); ++ } ++ } ++ else if (!var56 && var57) ++ { ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var42, var16, var20); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var42, var16, var22); ++ var6.addVertexWithUV(var38, (double)(par3 + 0), var42, var18, var22); ++ var6.addVertexWithUV(var38, (double)(par3 + 1), var42, var18, var20); ++ var6.addVertexWithUV(var38, (double)(par3 + 1), var42, var16, var20); ++ var6.addVertexWithUV(var38, (double)(par3 + 0), var42, var16, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var42, var18, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var42, var18, var20); ++ ++ if (!var55 && !var54) ++ { ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var50, var24, var28); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var50, var24, var32); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var52, var26, var32); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var52, var26, var28); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var52, var24, var28); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var52, var24, var32); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var50, var26, var32); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var50, var26, var28); ++ } ++ ++ if (var58 || par3 < var5 - 1 && this.blockAccess.isAirBlock(par2 + 1, par3 + 1, par4)) ++ { ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var52, var26, var28); ++ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var50, var24, var30); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var50, var24, var28); ++ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var52, var26, var28); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var50, var24, var30); ++ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var50, var24, var28); ++ } ++ ++ if (var59 || par3 > 1 && this.blockAccess.isAirBlock(par2 + 1, par3 - 1, par4)) ++ { ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var52, var26, var28); ++ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var50, var24, var30); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var50, var24, var28); ++ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var52, var26, var28); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var50, var24, var30); ++ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var50, var24, var28); ++ } ++ } ++ } ++ else ++ { ++ var6.addVertexWithUV(var34, (double)(par3 + 1), var42, var67, var20); ++ var6.addVertexWithUV(var34, (double)(par3 + 0), var42, var67, var22); ++ var6.addVertexWithUV(var38, (double)(par3 + 0), var42, var18, var22); ++ var6.addVertexWithUV(var38, (double)(par3 + 1), var42, var18, var20); ++ var6.addVertexWithUV(var38, (double)(par3 + 1), var42, var67, var20); ++ var6.addVertexWithUV(var38, (double)(par3 + 0), var42, var67, var22); ++ var6.addVertexWithUV(var34, (double)(par3 + 0), var42, var18, var22); ++ var6.addVertexWithUV(var34, (double)(par3 + 1), var42, var18, var20); ++ ++ if (var58) ++ { ++ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var52, var26, var32); ++ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var52, var26, var28); ++ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var50, var24, var28); ++ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var50, var24, var32); ++ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var52, var26, var32); ++ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var52, var26, var28); ++ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var50, var24, var28); ++ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var50, var24, var32); ++ } ++ else ++ { ++ if (par3 < var5 - 1 && this.blockAccess.isAirBlock(par2 - 1, par3 + 1, par4)) ++ { ++ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var52, var26, var32); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var50, var24, var32); ++ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var50, var24, var30); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var52, var26, var32); ++ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var50, var24, var32); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var50, var24, var30); ++ } ++ ++ if (par3 < var5 - 1 && this.blockAccess.isAirBlock(par2 + 1, par3 + 1, par4)) ++ { ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var52, var26, var28); ++ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var50, var24, var30); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var50, var24, var28); ++ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var52, var26, var28); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var50, var24, var30); ++ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var50, var24, var28); ++ } ++ } ++ ++ if (var59) ++ { ++ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var52, var26, var32); ++ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var52, var26, var28); ++ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var50, var24, var28); ++ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var50, var24, var32); ++ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var52, var26, var32); ++ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var52, var26, var28); ++ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var50, var24, var28); ++ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var50, var24, var32); ++ } ++ else ++ { ++ if (par3 > 1 && this.blockAccess.isAirBlock(par2 - 1, par3 - 1, par4)) ++ { ++ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var52, var26, var32); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var50, var24, var32); ++ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var50, var24, var30); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var52, var26, var32); ++ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var50, var24, var32); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var50, var24, var30); ++ } ++ ++ if (par3 > 1 && this.blockAccess.isAirBlock(par2 + 1, par3 - 1, par4)) ++ { ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var52, var26, var28); ++ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var50, var24, var30); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var50, var24, var28); ++ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var52, var26, var28); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var50, var24, var30); ++ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var50, var24, var28); ++ } ++ } ++ } ++ ++ if ((!var54 || !var55) && (var56 || var57 || var54 || var55)) ++ { ++ if (var54 && !var55) ++ { ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var40, var67, var20); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var40, var67, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var42, var16, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var42, var16, var20); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var42, var67, var20); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var42, var67, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var40, var16, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var40, var16, var20); ++ ++ if (!var57 && !var56) ++ { ++ var6.addVertexWithUV(var46, (double)(par3 + 1), var42, var24, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 0), var42, var24, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 0), var42, var26, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1), var42, var26, var28); ++ var6.addVertexWithUV(var48, (double)(par3 + 1), var42, var24, var28); ++ var6.addVertexWithUV(var48, (double)(par3 + 0), var42, var24, var32); ++ var6.addVertexWithUV(var46, (double)(par3 + 0), var42, var26, var32); ++ var6.addVertexWithUV(var46, (double)(par3 + 1), var42, var26, var28); ++ } ++ ++ if (var58 || par3 < var5 - 1 && this.blockAccess.isAirBlock(par2, par3 + 1, par4 - 1)) ++ { ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var40, var26, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var42, var26, var30); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var42, var24, var30); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var40, var24, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var42, var26, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var40, var26, var30); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var40, var24, var30); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var42, var24, var28); ++ } ++ ++ if (var59 || par3 > 1 && this.blockAccess.isAirBlock(par2, par3 - 1, par4 - 1)) ++ { ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var40, var26, var28); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var42, var26, var30); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var42, var24, var30); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var40, var24, var28); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var42, var26, var28); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var40, var26, var30); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var40, var24, var30); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var42, var24, var28); ++ } ++ } ++ else if (!var54 && var55) ++ { ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var42, var16, var20); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var42, var16, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var44, var18, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var44, var18, var20); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var44, var16, var20); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var44, var16, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var42, var18, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var42, var18, var20); ++ ++ if (!var57 && !var56) ++ { ++ var6.addVertexWithUV(var48, (double)(par3 + 1), var42, var24, var28); ++ var6.addVertexWithUV(var48, (double)(par3 + 0), var42, var24, var32); ++ var6.addVertexWithUV(var46, (double)(par3 + 0), var42, var26, var32); ++ var6.addVertexWithUV(var46, (double)(par3 + 1), var42, var26, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 1), var42, var24, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 0), var42, var24, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 0), var42, var26, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1), var42, var26, var28); ++ } ++ ++ if (var58 || par3 < var5 - 1 && this.blockAccess.isAirBlock(par2, par3 + 1, par4 + 1)) ++ { ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var42, var24, var30); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var44, var24, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var44, var26, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var42, var26, var30); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var44, var24, var30); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var42, var24, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var42, var26, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var44, var26, var30); ++ } ++ ++ if (var59 || par3 > 1 && this.blockAccess.isAirBlock(par2, par3 - 1, par4 + 1)) ++ { ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var42, var24, var30); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var44, var24, var32); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var44, var26, var32); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var42, var26, var30); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var44, var24, var30); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var42, var24, var32); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var42, var26, var32); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var44, var26, var30); ++ } ++ } ++ } ++ else ++ { ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var44, var67, var20); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var44, var67, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var40, var18, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var40, var18, var20); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var40, var67, var20); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var40, var67, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var44, var18, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var44, var18, var20); ++ ++ if (var58) ++ { ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var44, var26, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var40, var26, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var40, var24, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var44, var24, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var40, var26, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var44, var26, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var44, var24, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var40, var24, var32); ++ } ++ else ++ { ++ if (par3 < var5 - 1 && this.blockAccess.isAirBlock(par2, par3 + 1, par4 - 1)) ++ { ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var40, var26, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var42, var26, var30); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var42, var24, var30); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var40, var24, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var42, var26, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var40, var26, var30); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var40, var24, var30); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var42, var24, var28); ++ } ++ ++ if (par3 < var5 - 1 && this.blockAccess.isAirBlock(par2, par3 + 1, par4 + 1)) ++ { ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var42, var24, var30); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var44, var24, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var44, var26, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var42, var26, var30); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var44, var24, var30); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var42, var24, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var42, var26, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var44, var26, var30); ++ } ++ } ++ ++ if (var59) ++ { ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var44, var26, var32); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var40, var26, var28); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var40, var24, var28); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var44, var24, var32); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var40, var26, var32); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var44, var26, var28); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var44, var24, var28); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var40, var24, var32); ++ } ++ else ++ { ++ if (par3 > 1 && this.blockAccess.isAirBlock(par2, par3 - 1, par4 - 1)) ++ { ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var40, var26, var28); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var42, var26, var30); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var42, var24, var30); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var40, var24, var28); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var42, var26, var28); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var40, var26, var30); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var40, var24, var30); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var42, var24, var28); ++ } ++ ++ if (par3 > 1 && this.blockAccess.isAirBlock(par2, par3 - 1, par4 + 1)) ++ { ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var42, var24, var30); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var44, var24, var32); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var44, var26, var32); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var42, var26, var30); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var44, var24, var30); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var42, var24, var32); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var42, var26, var32); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var44, var26, var30); ++ } ++ } ++ } ++ ++ return true; ++ } ++ ++ /** ++ * Renders any block requiring croseed squares such as reeds, flowers, and mushrooms ++ */ ++ public boolean renderCrossedSquares(Block par1Block, int par2, int par3, int par4) ++ { ++ Tessellator var5 = Tessellator.instance; ++ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ float var6 = 1.0F; ++ int var7 = par1Block.colorMultiplier(this.blockAccess, par2, par3, par4); ++ float var8 = (float)(var7 >> 16 & 255) / 255.0F; ++ float var9 = (float)(var7 >> 8 & 255) / 255.0F; ++ float var10 = (float)(var7 & 255) / 255.0F; ++ ++ if (EntityRenderer.anaglyphEnable) ++ { ++ float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; ++ float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; ++ float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; ++ var8 = var11; ++ var9 = var12; ++ var10 = var13; ++ } ++ ++ var5.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); ++ double var19 = (double)par2; ++ double var20 = (double)par3; ++ double var15 = (double)par4; ++ ++ if (par1Block == Block.tallGrass) ++ { ++ long var17 = (long)(par2 * 3129871) ^ (long)par4 * 116129781L ^ (long)par3; ++ var17 = var17 * var17 * 42317861L + var17 * 11L; ++ var19 += ((double)((float)(var17 >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D; ++ var20 += ((double)((float)(var17 >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D; ++ var15 += ((double)((float)(var17 >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D; ++ } ++ ++ this.drawCrossedSquares(par1Block, this.blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, 1.0F); ++ return true; ++ } ++ ++ /** ++ * Render block stem ++ */ ++ public boolean renderBlockStem(Block par1Block, int par2, int par3, int par4) ++ { ++ BlockStem var5 = (BlockStem)par1Block; ++ Tessellator var6 = Tessellator.instance; ++ var6.setBrightness(var5.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ float var7 = 1.0F; ++ int var8 = var5.colorMultiplier(this.blockAccess, par2, par3, par4); ++ float var9 = (float)(var8 >> 16 & 255) / 255.0F; ++ float var10 = (float)(var8 >> 8 & 255) / 255.0F; ++ float var11 = (float)(var8 & 255) / 255.0F; ++ ++ if (EntityRenderer.anaglyphEnable) ++ { ++ float var12 = (var9 * 30.0F + var10 * 59.0F + var11 * 11.0F) / 100.0F; ++ float var13 = (var9 * 30.0F + var10 * 70.0F) / 100.0F; ++ float var14 = (var9 * 30.0F + var11 * 70.0F) / 100.0F; ++ var9 = var12; ++ var10 = var13; ++ var11 = var14; ++ } ++ ++ var6.setColorOpaque_F(var7 * var9, var7 * var10, var7 * var11); ++ var5.setBlockBoundsBasedOnState(this.blockAccess, par2, par3, par4); ++ int var15 = var5.getState(this.blockAccess, par2, par3, par4); ++ ++ if (var15 < 0) ++ { ++ this.renderBlockStemSmall(var5, this.blockAccess.getBlockMetadata(par2, par3, par4), this.renderMaxY, (double)par2, (double)((float)par3 - 0.0625F), (double)par4); ++ } ++ else ++ { ++ this.renderBlockStemSmall(var5, this.blockAccess.getBlockMetadata(par2, par3, par4), 0.5D, (double)par2, (double)((float)par3 - 0.0625F), (double)par4); ++ this.renderBlockStemBig(var5, this.blockAccess.getBlockMetadata(par2, par3, par4), var15, this.renderMaxY, (double)par2, (double)((float)par3 - 0.0625F), (double)par4); ++ } ++ ++ return true; ++ } ++ ++ /** ++ * Render block crops ++ */ ++ public boolean renderBlockCrops(Block par1Block, int par2, int par3, int par4) ++ { ++ Tessellator var5 = Tessellator.instance; ++ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); ++ this.renderBlockCropsImpl(par1Block, this.blockAccess.getBlockMetadata(par2, par3, par4), (double)par2, (double)((float)par3 - 0.0625F), (double)par4); ++ return true; ++ } ++ ++ /** ++ * Renders a torch at the given coordinates, with the base slanting at the given delta ++ */ ++ public void renderTorchAtAngle(Block par1Block, double par2, double par4, double par6, double par8, double par10, int par12) ++ { ++ Tessellator var13 = Tessellator.instance; ++ Icon var14 = this.getBlockIconFromSideAndMetadata(par1Block, 0, par12); ++ ++ if (this.hasOverrideBlockTexture()) ++ { ++ var14 = this.overrideBlockTexture; ++ } ++ ++ double var15 = (double)var14.getMinU(); ++ double var17 = (double)var14.getMinV(); ++ double var19 = (double)var14.getMaxU(); ++ double var21 = (double)var14.getMaxV(); ++ double var23 = (double)var14.getInterpolatedU(7.0D); ++ double var25 = (double)var14.getInterpolatedV(6.0D); ++ double var27 = (double)var14.getInterpolatedU(9.0D); ++ double var29 = (double)var14.getInterpolatedV(8.0D); ++ double var31 = (double)var14.getInterpolatedU(7.0D); ++ double var33 = (double)var14.getInterpolatedV(13.0D); ++ double var35 = (double)var14.getInterpolatedU(9.0D); ++ double var37 = (double)var14.getInterpolatedV(15.0D); ++ par2 += 0.5D; ++ par6 += 0.5D; ++ double var39 = par2 - 0.5D; ++ double var41 = par2 + 0.5D; ++ double var43 = par6 - 0.5D; ++ double var45 = par6 + 0.5D; ++ double var47 = 0.0625D; ++ double var49 = 0.625D; ++ var13.addVertexWithUV(par2 + par8 * (1.0D - var49) - var47, par4 + var49, par6 + par10 * (1.0D - var49) - var47, var23, var25); ++ var13.addVertexWithUV(par2 + par8 * (1.0D - var49) - var47, par4 + var49, par6 + par10 * (1.0D - var49) + var47, var23, var29); ++ var13.addVertexWithUV(par2 + par8 * (1.0D - var49) + var47, par4 + var49, par6 + par10 * (1.0D - var49) + var47, var27, var29); ++ var13.addVertexWithUV(par2 + par8 * (1.0D - var49) + var47, par4 + var49, par6 + par10 * (1.0D - var49) - var47, var27, var25); ++ var13.addVertexWithUV(par2 + var47 + par8, par4, par6 - var47 + par10, var35, var33); ++ var13.addVertexWithUV(par2 + var47 + par8, par4, par6 + var47 + par10, var35, var37); ++ var13.addVertexWithUV(par2 - var47 + par8, par4, par6 + var47 + par10, var31, var37); ++ var13.addVertexWithUV(par2 - var47 + par8, par4, par6 - var47 + par10, var31, var33); ++ var13.addVertexWithUV(par2 - var47, par4 + 1.0D, var43, var15, var17); ++ var13.addVertexWithUV(par2 - var47 + par8, par4 + 0.0D, var43 + par10, var15, var21); ++ var13.addVertexWithUV(par2 - var47 + par8, par4 + 0.0D, var45 + par10, var19, var21); ++ var13.addVertexWithUV(par2 - var47, par4 + 1.0D, var45, var19, var17); ++ var13.addVertexWithUV(par2 + var47, par4 + 1.0D, var45, var15, var17); ++ var13.addVertexWithUV(par2 + par8 + var47, par4 + 0.0D, var45 + par10, var15, var21); ++ var13.addVertexWithUV(par2 + par8 + var47, par4 + 0.0D, var43 + par10, var19, var21); ++ var13.addVertexWithUV(par2 + var47, par4 + 1.0D, var43, var19, var17); ++ var13.addVertexWithUV(var39, par4 + 1.0D, par6 + var47, var15, var17); ++ var13.addVertexWithUV(var39 + par8, par4 + 0.0D, par6 + var47 + par10, var15, var21); ++ var13.addVertexWithUV(var41 + par8, par4 + 0.0D, par6 + var47 + par10, var19, var21); ++ var13.addVertexWithUV(var41, par4 + 1.0D, par6 + var47, var19, var17); ++ var13.addVertexWithUV(var41, par4 + 1.0D, par6 - var47, var15, var17); ++ var13.addVertexWithUV(var41 + par8, par4 + 0.0D, par6 - var47 + par10, var15, var21); ++ var13.addVertexWithUV(var39 + par8, par4 + 0.0D, par6 - var47 + par10, var19, var21); ++ var13.addVertexWithUV(var39, par4 + 1.0D, par6 - var47, var19, var17); ++ } ++ ++ /** ++ * Utility function to draw crossed swuares ++ */ ++ public void drawCrossedSquares(Block par1Block, int par2, double par3, double par5, double par7, float par9) ++ { ++ Tessellator var10 = Tessellator.instance; ++ Icon var11 = this.getBlockIconFromSideAndMetadata(par1Block, 0, par2); ++ ++ if (this.hasOverrideBlockTexture()) ++ { ++ var11 = this.overrideBlockTexture; ++ } ++ ++ double var12 = (double)var11.getMinU(); ++ double var14 = (double)var11.getMinV(); ++ double var16 = (double)var11.getMaxU(); ++ double var18 = (double)var11.getMaxV(); ++ double var20 = 0.45D * (double)par9; ++ double var22 = par3 + 0.5D - var20; ++ double var24 = par3 + 0.5D + var20; ++ double var26 = par7 + 0.5D - var20; ++ double var28 = par7 + 0.5D + var20; ++ var10.addVertexWithUV(var22, par5 + (double)par9, var26, var12, var14); ++ var10.addVertexWithUV(var22, par5 + 0.0D, var26, var12, var18); ++ var10.addVertexWithUV(var24, par5 + 0.0D, var28, var16, var18); ++ var10.addVertexWithUV(var24, par5 + (double)par9, var28, var16, var14); ++ var10.addVertexWithUV(var24, par5 + (double)par9, var28, var12, var14); ++ var10.addVertexWithUV(var24, par5 + 0.0D, var28, var12, var18); ++ var10.addVertexWithUV(var22, par5 + 0.0D, var26, var16, var18); ++ var10.addVertexWithUV(var22, par5 + (double)par9, var26, var16, var14); ++ var10.addVertexWithUV(var22, par5 + (double)par9, var28, var12, var14); ++ var10.addVertexWithUV(var22, par5 + 0.0D, var28, var12, var18); ++ var10.addVertexWithUV(var24, par5 + 0.0D, var26, var16, var18); ++ var10.addVertexWithUV(var24, par5 + (double)par9, var26, var16, var14); ++ var10.addVertexWithUV(var24, par5 + (double)par9, var26, var12, var14); ++ var10.addVertexWithUV(var24, par5 + 0.0D, var26, var12, var18); ++ var10.addVertexWithUV(var22, par5 + 0.0D, var28, var16, var18); ++ var10.addVertexWithUV(var22, par5 + (double)par9, var28, var16, var14); ++ } ++ ++ /** ++ * Render block stem small ++ */ ++ public void renderBlockStemSmall(Block par1Block, int par2, double par3, double par5, double par7, double par9) ++ { ++ Tessellator var11 = Tessellator.instance; ++ Icon var12 = this.getBlockIconFromSideAndMetadata(par1Block, 0, par2); ++ ++ if (this.hasOverrideBlockTexture()) ++ { ++ var12 = this.overrideBlockTexture; ++ } ++ ++ double var13 = (double)var12.getMinU(); ++ double var15 = (double)var12.getMinV(); ++ double var17 = (double)var12.getMaxU(); ++ double var19 = (double)var12.getInterpolatedV(par3 * 16.0D); ++ double var21 = par5 + 0.5D - 0.44999998807907104D; ++ double var23 = par5 + 0.5D + 0.44999998807907104D; ++ double var25 = par9 + 0.5D - 0.44999998807907104D; ++ double var27 = par9 + 0.5D + 0.44999998807907104D; ++ var11.addVertexWithUV(var21, par7 + par3, var25, var13, var15); ++ var11.addVertexWithUV(var21, par7 + 0.0D, var25, var13, var19); ++ var11.addVertexWithUV(var23, par7 + 0.0D, var27, var17, var19); ++ var11.addVertexWithUV(var23, par7 + par3, var27, var17, var15); ++ var11.addVertexWithUV(var23, par7 + par3, var27, var13, var15); ++ var11.addVertexWithUV(var23, par7 + 0.0D, var27, var13, var19); ++ var11.addVertexWithUV(var21, par7 + 0.0D, var25, var17, var19); ++ var11.addVertexWithUV(var21, par7 + par3, var25, var17, var15); ++ var11.addVertexWithUV(var21, par7 + par3, var27, var13, var15); ++ var11.addVertexWithUV(var21, par7 + 0.0D, var27, var13, var19); ++ var11.addVertexWithUV(var23, par7 + 0.0D, var25, var17, var19); ++ var11.addVertexWithUV(var23, par7 + par3, var25, var17, var15); ++ var11.addVertexWithUV(var23, par7 + par3, var25, var13, var15); ++ var11.addVertexWithUV(var23, par7 + 0.0D, var25, var13, var19); ++ var11.addVertexWithUV(var21, par7 + 0.0D, var27, var17, var19); ++ var11.addVertexWithUV(var21, par7 + par3, var27, var17, var15); ++ } ++ ++ /** ++ * Render BlockLilyPad ++ */ ++ public boolean renderBlockLilyPad(Block par1Block, int par2, int par3, int par4) ++ { ++ Tessellator var5 = Tessellator.instance; ++ Icon var6 = this.getBlockIconFromSide(par1Block, 1); ++ ++ if (this.hasOverrideBlockTexture()) ++ { ++ var6 = this.overrideBlockTexture; ++ } ++ ++ float var7 = 0.015625F; ++ double var8 = (double)var6.getMinU(); ++ double var10 = (double)var6.getMinV(); ++ double var12 = (double)var6.getMaxU(); ++ double var14 = (double)var6.getMaxV(); ++ long var16 = (long)(par2 * 3129871) ^ (long)par4 * 116129781L ^ (long)par3; ++ var16 = var16 * var16 * 42317861L + var16 * 11L; ++ int var18 = (int)(var16 >> 16 & 3L); ++ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ float var19 = (float)par2 + 0.5F; ++ float var20 = (float)par4 + 0.5F; ++ float var21 = (float)(var18 & 1) * 0.5F * (float)(1 - var18 / 2 % 2 * 2); ++ float var22 = (float)(var18 + 1 & 1) * 0.5F * (float)(1 - (var18 + 1) / 2 % 2 * 2); ++ var5.setColorOpaque_I(par1Block.getBlockColor()); ++ var5.addVertexWithUV((double)(var19 + var21 - var22), (double)((float)par3 + var7), (double)(var20 + var21 + var22), var8, var10); ++ var5.addVertexWithUV((double)(var19 + var21 + var22), (double)((float)par3 + var7), (double)(var20 - var21 + var22), var12, var10); ++ var5.addVertexWithUV((double)(var19 - var21 + var22), (double)((float)par3 + var7), (double)(var20 - var21 - var22), var12, var14); ++ var5.addVertexWithUV((double)(var19 - var21 - var22), (double)((float)par3 + var7), (double)(var20 + var21 - var22), var8, var14); ++ var5.setColorOpaque_I((par1Block.getBlockColor() & 16711422) >> 1); ++ var5.addVertexWithUV((double)(var19 - var21 - var22), (double)((float)par3 + var7), (double)(var20 + var21 - var22), var8, var14); ++ var5.addVertexWithUV((double)(var19 - var21 + var22), (double)((float)par3 + var7), (double)(var20 - var21 - var22), var12, var14); ++ var5.addVertexWithUV((double)(var19 + var21 + var22), (double)((float)par3 + var7), (double)(var20 - var21 + var22), var12, var10); ++ var5.addVertexWithUV((double)(var19 + var21 - var22), (double)((float)par3 + var7), (double)(var20 + var21 + var22), var8, var10); ++ return true; ++ } ++ ++ /** ++ * Render block stem big ++ */ ++ public void renderBlockStemBig(BlockStem par1BlockStem, int par2, int par3, double par4, double par6, double par8, double par10) ++ { ++ Tessellator var12 = Tessellator.instance; ++ Icon var13 = par1BlockStem.getStemIcon(); ++ ++ if (this.hasOverrideBlockTexture()) ++ { ++ var13 = this.overrideBlockTexture; ++ } ++ ++ double var14 = (double)var13.getMinU(); ++ double var16 = (double)var13.getMinV(); ++ double var18 = (double)var13.getMaxU(); ++ double var20 = (double)var13.getMaxV(); ++ double var22 = par6 + 0.5D - 0.5D; ++ double var24 = par6 + 0.5D + 0.5D; ++ double var26 = par10 + 0.5D - 0.5D; ++ double var28 = par10 + 0.5D + 0.5D; ++ double var30 = par6 + 0.5D; ++ double var32 = par10 + 0.5D; ++ ++ if ((par3 + 1) / 2 % 2 == 1) ++ { ++ double var34 = var18; ++ var18 = var14; ++ var14 = var34; ++ } ++ ++ if (par3 < 2) ++ { ++ var12.addVertexWithUV(var22, par8 + par4, var32, var14, var16); ++ var12.addVertexWithUV(var22, par8 + 0.0D, var32, var14, var20); ++ var12.addVertexWithUV(var24, par8 + 0.0D, var32, var18, var20); ++ var12.addVertexWithUV(var24, par8 + par4, var32, var18, var16); ++ var12.addVertexWithUV(var24, par8 + par4, var32, var18, var16); ++ var12.addVertexWithUV(var24, par8 + 0.0D, var32, var18, var20); ++ var12.addVertexWithUV(var22, par8 + 0.0D, var32, var14, var20); ++ var12.addVertexWithUV(var22, par8 + par4, var32, var14, var16); ++ } ++ else ++ { ++ var12.addVertexWithUV(var30, par8 + par4, var28, var14, var16); ++ var12.addVertexWithUV(var30, par8 + 0.0D, var28, var14, var20); ++ var12.addVertexWithUV(var30, par8 + 0.0D, var26, var18, var20); ++ var12.addVertexWithUV(var30, par8 + par4, var26, var18, var16); ++ var12.addVertexWithUV(var30, par8 + par4, var26, var18, var16); ++ var12.addVertexWithUV(var30, par8 + 0.0D, var26, var18, var20); ++ var12.addVertexWithUV(var30, par8 + 0.0D, var28, var14, var20); ++ var12.addVertexWithUV(var30, par8 + par4, var28, var14, var16); ++ } ++ } ++ ++ /** ++ * Render block crops implementation ++ */ ++ public void renderBlockCropsImpl(Block par1Block, int par2, double par3, double par5, double par7) ++ { ++ Tessellator var9 = Tessellator.instance; ++ Icon var10 = this.getBlockIconFromSideAndMetadata(par1Block, 0, par2); ++ ++ if (this.hasOverrideBlockTexture()) ++ { ++ var10 = this.overrideBlockTexture; ++ } ++ ++ double var11 = (double)var10.getMinU(); ++ double var13 = (double)var10.getMinV(); ++ double var15 = (double)var10.getMaxU(); ++ double var17 = (double)var10.getMaxV(); ++ double var19 = par3 + 0.5D - 0.25D; ++ double var21 = par3 + 0.5D + 0.25D; ++ double var23 = par7 + 0.5D - 0.5D; ++ double var25 = par7 + 0.5D + 0.5D; ++ var9.addVertexWithUV(var19, par5 + 1.0D, var23, var11, var13); ++ var9.addVertexWithUV(var19, par5 + 0.0D, var23, var11, var17); ++ var9.addVertexWithUV(var19, par5 + 0.0D, var25, var15, var17); ++ var9.addVertexWithUV(var19, par5 + 1.0D, var25, var15, var13); ++ var9.addVertexWithUV(var19, par5 + 1.0D, var25, var11, var13); ++ var9.addVertexWithUV(var19, par5 + 0.0D, var25, var11, var17); ++ var9.addVertexWithUV(var19, par5 + 0.0D, var23, var15, var17); ++ var9.addVertexWithUV(var19, par5 + 1.0D, var23, var15, var13); ++ var9.addVertexWithUV(var21, par5 + 1.0D, var25, var11, var13); ++ var9.addVertexWithUV(var21, par5 + 0.0D, var25, var11, var17); ++ var9.addVertexWithUV(var21, par5 + 0.0D, var23, var15, var17); ++ var9.addVertexWithUV(var21, par5 + 1.0D, var23, var15, var13); ++ var9.addVertexWithUV(var21, par5 + 1.0D, var23, var11, var13); ++ var9.addVertexWithUV(var21, par5 + 0.0D, var23, var11, var17); ++ var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); ++ var9.addVertexWithUV(var21, par5 + 1.0D, var25, var15, var13); ++ var19 = par3 + 0.5D - 0.5D; ++ var21 = par3 + 0.5D + 0.5D; ++ var23 = par7 + 0.5D - 0.25D; ++ var25 = par7 + 0.5D + 0.25D; ++ var9.addVertexWithUV(var19, par5 + 1.0D, var23, var11, var13); ++ var9.addVertexWithUV(var19, par5 + 0.0D, var23, var11, var17); ++ var9.addVertexWithUV(var21, par5 + 0.0D, var23, var15, var17); ++ var9.addVertexWithUV(var21, par5 + 1.0D, var23, var15, var13); ++ var9.addVertexWithUV(var21, par5 + 1.0D, var23, var11, var13); ++ var9.addVertexWithUV(var21, par5 + 0.0D, var23, var11, var17); ++ var9.addVertexWithUV(var19, par5 + 0.0D, var23, var15, var17); ++ var9.addVertexWithUV(var19, par5 + 1.0D, var23, var15, var13); ++ var9.addVertexWithUV(var21, par5 + 1.0D, var25, var11, var13); ++ var9.addVertexWithUV(var21, par5 + 0.0D, var25, var11, var17); ++ var9.addVertexWithUV(var19, par5 + 0.0D, var25, var15, var17); ++ var9.addVertexWithUV(var19, par5 + 1.0D, var25, var15, var13); ++ var9.addVertexWithUV(var19, par5 + 1.0D, var25, var11, var13); ++ var9.addVertexWithUV(var19, par5 + 0.0D, var25, var11, var17); ++ var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); ++ var9.addVertexWithUV(var21, par5 + 1.0D, var25, var15, var13); ++ } ++ ++ /** ++ * Renders a block based on the BlockFluids class at the given coordinates ++ */ ++ public boolean renderBlockFluids(Block par1Block, int par2, int par3, int par4) ++ { ++ Tessellator var5 = Tessellator.instance; ++ int var6 = par1Block.colorMultiplier(this.blockAccess, par2, par3, par4); ++ float var7 = (float)(var6 >> 16 & 255) / 255.0F; ++ float var8 = (float)(var6 >> 8 & 255) / 255.0F; ++ float var9 = (float)(var6 & 255) / 255.0F; ++ boolean var10 = par1Block.shouldSideBeRendered(this.blockAccess, par2, par3 + 1, par4, 1); ++ boolean var11 = par1Block.shouldSideBeRendered(this.blockAccess, par2, par3 - 1, par4, 0); ++ boolean[] var12 = new boolean[] {par1Block.shouldSideBeRendered(this.blockAccess, par2, par3, par4 - 1, 2), par1Block.shouldSideBeRendered(this.blockAccess, par2, par3, par4 + 1, 3), par1Block.shouldSideBeRendered(this.blockAccess, par2 - 1, par3, par4, 4), par1Block.shouldSideBeRendered(this.blockAccess, par2 + 1, par3, par4, 5)}; ++ ++ if (!var10 && !var11 && !var12[0] && !var12[1] && !var12[2] && !var12[3]) ++ { ++ return false; ++ } ++ else ++ { ++ boolean var13 = false; ++ float var14 = 0.5F; ++ float var15 = 1.0F; ++ float var16 = 0.8F; ++ float var17 = 0.6F; ++ double var18 = 0.0D; ++ double var20 = 1.0D; ++ Material var22 = par1Block.blockMaterial; ++ int var23 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ double var24 = (double)this.getFluidHeight(par2, par3, par4, var22); ++ double var26 = (double)this.getFluidHeight(par2, par3, par4 + 1, var22); ++ double var28 = (double)this.getFluidHeight(par2 + 1, par3, par4 + 1, var22); ++ double var30 = (double)this.getFluidHeight(par2 + 1, par3, par4, var22); ++ double var32 = 0.0010000000474974513D; ++ float var52; ++ float var53; ++ float var54; ++ ++ if (this.renderAllFaces || var10) ++ { ++ var13 = true; ++ Icon var34 = this.getBlockIconFromSideAndMetadata(par1Block, 1, var23); ++ float var35 = (float)BlockFluid.getFlowDirection(this.blockAccess, par2, par3, par4, var22); ++ ++ if (var35 > -999.0F) ++ { ++ var34 = this.getBlockIconFromSideAndMetadata(par1Block, 2, var23); ++ } ++ ++ var24 -= var32; ++ var26 -= var32; ++ var28 -= var32; ++ var30 -= var32; ++ double var36; ++ double var38; ++ double var40; ++ double var42; ++ double var44; ++ double var46; ++ double var48; ++ double var50; ++ ++ if (var35 < -999.0F) ++ { ++ var36 = (double)var34.getInterpolatedU(0.0D); ++ var44 = (double)var34.getInterpolatedV(0.0D); ++ var38 = var36; ++ var46 = (double)var34.getInterpolatedV(16.0D); ++ var40 = (double)var34.getInterpolatedU(16.0D); ++ var48 = var46; ++ var42 = var40; ++ var50 = var44; ++ } ++ else ++ { ++ var52 = MathHelper.sin(var35) * 0.25F; ++ var53 = MathHelper.cos(var35) * 0.25F; ++ var54 = 8.0F; ++ var36 = (double)var34.getInterpolatedU((double)(8.0F + (-var53 - var52) * 16.0F)); ++ var44 = (double)var34.getInterpolatedV((double)(8.0F + (-var53 + var52) * 16.0F)); ++ var38 = (double)var34.getInterpolatedU((double)(8.0F + (-var53 + var52) * 16.0F)); ++ var46 = (double)var34.getInterpolatedV((double)(8.0F + (var53 + var52) * 16.0F)); ++ var40 = (double)var34.getInterpolatedU((double)(8.0F + (var53 + var52) * 16.0F)); ++ var48 = (double)var34.getInterpolatedV((double)(8.0F + (var53 - var52) * 16.0F)); ++ var42 = (double)var34.getInterpolatedU((double)(8.0F + (var53 - var52) * 16.0F)); ++ var50 = (double)var34.getInterpolatedV((double)(8.0F + (-var53 - var52) * 16.0F)); ++ } ++ ++ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ var52 = 1.0F; ++ var5.setColorOpaque_F(var15 * var52 * var7, var15 * var52 * var8, var15 * var52 * var9); ++ var5.addVertexWithUV((double)(par2 + 0), (double)par3 + var24, (double)(par4 + 0), var36, var44); ++ var5.addVertexWithUV((double)(par2 + 0), (double)par3 + var26, (double)(par4 + 1), var38, var46); ++ var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var28, (double)(par4 + 1), var40, var48); ++ var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var30, (double)(par4 + 0), var42, var50); ++ } ++ ++ if (this.renderAllFaces || var11) ++ { ++ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4)); ++ float var57 = 1.0F; ++ var5.setColorOpaque_F(var14 * var57, var14 * var57, var14 * var57); ++ this.renderFaceYNeg(par1Block, (double)par2, (double)par3 + var32, (double)par4, this.getBlockIconFromSide(par1Block, 0)); ++ var13 = true; ++ } ++ ++ for (int var59 = 0; var59 < 4; ++var59) ++ { ++ int var58 = par2; ++ int var37 = par4; ++ ++ if (var59 == 0) ++ { ++ var37 = par4 - 1; ++ } ++ ++ if (var59 == 1) ++ { ++ ++var37; ++ } ++ ++ if (var59 == 2) ++ { ++ var58 = par2 - 1; ++ } ++ ++ if (var59 == 3) ++ { ++ ++var58; ++ } ++ ++ Icon var60 = this.getBlockIconFromSideAndMetadata(par1Block, var59 + 2, var23); ++ ++ if (this.renderAllFaces || var12[var59]) ++ { ++ double var39; ++ double var41; ++ double var43; ++ double var45; ++ double var47; ++ double var49; ++ ++ if (var59 == 0) ++ { ++ var39 = var24; ++ var41 = var30; ++ var43 = (double)par2; ++ var47 = (double)(par2 + 1); ++ var45 = (double)par4 + var32; ++ var49 = (double)par4 + var32; ++ } ++ else if (var59 == 1) ++ { ++ var39 = var28; ++ var41 = var26; ++ var43 = (double)(par2 + 1); ++ var47 = (double)par2; ++ var45 = (double)(par4 + 1) - var32; ++ var49 = (double)(par4 + 1) - var32; ++ } ++ else if (var59 == 2) ++ { ++ var39 = var26; ++ var41 = var24; ++ var43 = (double)par2 + var32; ++ var47 = (double)par2 + var32; ++ var45 = (double)(par4 + 1); ++ var49 = (double)par4; ++ } ++ else ++ { ++ var39 = var30; ++ var41 = var28; ++ var43 = (double)(par2 + 1) - var32; ++ var47 = (double)(par2 + 1) - var32; ++ var45 = (double)par4; ++ var49 = (double)(par4 + 1); ++ } ++ ++ var13 = true; ++ float var51 = var60.getInterpolatedU(0.0D); ++ var52 = var60.getInterpolatedU(8.0D); ++ var53 = var60.getInterpolatedV((1.0D - var39) * 16.0D * 0.5D); ++ var54 = var60.getInterpolatedV((1.0D - var41) * 16.0D * 0.5D); ++ float var55 = var60.getInterpolatedV(8.0D); ++ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, var58, par3, var37)); ++ float var56 = 1.0F; ++ ++ if (var59 < 2) ++ { ++ var56 *= var16; ++ } ++ else ++ { ++ var56 *= var17; ++ } ++ ++ var5.setColorOpaque_F(var15 * var56 * var7, var15 * var56 * var8, var15 * var56 * var9); ++ var5.addVertexWithUV(var43, (double)par3 + var39, var45, (double)var51, (double)var53); ++ var5.addVertexWithUV(var47, (double)par3 + var41, var49, (double)var52, (double)var54); ++ var5.addVertexWithUV(var47, (double)(par3 + 0), var49, (double)var52, (double)var55); ++ var5.addVertexWithUV(var43, (double)(par3 + 0), var45, (double)var51, (double)var55); ++ } ++ } ++ ++ this.renderMinY = var18; ++ this.renderMaxY = var20; ++ return var13; ++ } ++ } ++ ++ /** ++ * Get fluid height ++ */ ++ private float getFluidHeight(int par1, int par2, int par3, Material par4Material) ++ { ++ int var5 = 0; ++ float var6 = 0.0F; ++ ++ for (int var7 = 0; var7 < 4; ++var7) ++ { ++ int var8 = par1 - (var7 & 1); ++ int var10 = par3 - (var7 >> 1 & 1); ++ ++ if (this.blockAccess.getBlockMaterial(var8, par2 + 1, var10) == par4Material) ++ { ++ return 1.0F; ++ } ++ ++ Material var11 = this.blockAccess.getBlockMaterial(var8, par2, var10); ++ ++ if (var11 == par4Material) ++ { ++ int var12 = this.blockAccess.getBlockMetadata(var8, par2, var10); ++ ++ if (var12 >= 8 || var12 == 0) ++ { ++ var6 += BlockFluid.getFluidHeightPercent(var12) * 10.0F; ++ var5 += 10; ++ } ++ ++ var6 += BlockFluid.getFluidHeightPercent(var12); ++ ++var5; ++ } ++ else if (!var11.isSolid()) ++ { ++ ++var6; ++ ++var5; ++ } ++ } ++ ++ return 1.0F - var6 / (float)var5; ++ } ++ ++ /** ++ * Renders a falling sand block ++ */ ++ public void renderBlockSandFalling(Block par1Block, World par2World, int par3, int par4, int par5, int par6) ++ { ++ float var7 = 0.5F; ++ float var8 = 1.0F; ++ float var9 = 0.8F; ++ float var10 = 0.6F; ++ Tessellator var11 = Tessellator.instance; ++ var11.startDrawingQuads(); ++ var11.setBrightness(par1Block.getMixedBrightnessForBlock(par2World, par3, par4, par5)); ++ float var12 = 1.0F; ++ float var13 = 1.0F; ++ ++ if (var13 < var12) ++ { ++ var13 = var12; ++ } ++ ++ var11.setColorOpaque_F(var7 * var13, var7 * var13, var7 * var13); ++ this.renderFaceYNeg(par1Block, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(par1Block, 0, par6)); ++ var13 = 1.0F; ++ ++ if (var13 < var12) ++ { ++ var13 = var12; ++ } ++ ++ var11.setColorOpaque_F(var8 * var13, var8 * var13, var8 * var13); ++ this.renderFaceYPos(par1Block, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(par1Block, 1, par6)); ++ var13 = 1.0F; ++ ++ if (var13 < var12) ++ { ++ var13 = var12; ++ } ++ ++ var11.setColorOpaque_F(var9 * var13, var9 * var13, var9 * var13); ++ this.renderFaceZNeg(par1Block, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(par1Block, 2, par6)); ++ var13 = 1.0F; ++ ++ if (var13 < var12) ++ { ++ var13 = var12; ++ } ++ ++ var11.setColorOpaque_F(var9 * var13, var9 * var13, var9 * var13); ++ this.renderFaceZPos(par1Block, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(par1Block, 3, par6)); ++ var13 = 1.0F; ++ ++ if (var13 < var12) ++ { ++ var13 = var12; ++ } ++ ++ var11.setColorOpaque_F(var10 * var13, var10 * var13, var10 * var13); ++ this.renderFaceXNeg(par1Block, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(par1Block, 4, par6)); ++ var13 = 1.0F; ++ ++ if (var13 < var12) ++ { ++ var13 = var12; ++ } ++ ++ var11.setColorOpaque_F(var10 * var13, var10 * var13, var10 * var13); ++ this.renderFaceXPos(par1Block, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(par1Block, 5, par6)); ++ var11.draw(); ++ } ++ ++ /** ++ * Renders a standard cube block at the given coordinates ++ */ ++ public boolean renderStandardBlock(Block par1Block, int par2, int par3, int par4) ++ { ++ int var5 = par1Block.colorMultiplier(this.blockAccess, par2, par3, par4); ++ float var6 = (float)(var5 >> 16 & 255) / 255.0F; ++ float var7 = (float)(var5 >> 8 & 255) / 255.0F; ++ float var8 = (float)(var5 & 255) / 255.0F; ++ ++ if (EntityRenderer.anaglyphEnable) ++ { ++ float var9 = (var6 * 30.0F + var7 * 59.0F + var8 * 11.0F) / 100.0F; ++ float var10 = (var6 * 30.0F + var7 * 70.0F) / 100.0F; ++ float var11 = (var6 * 30.0F + var8 * 70.0F) / 100.0F; ++ var6 = var9; ++ var7 = var10; ++ var8 = var11; ++ } ++ ++ return Minecraft.isAmbientOcclusionEnabled() && Block.lightValue[par1Block.blockID] == 0 ? (this.partialRenderBounds ? this.renderStandardBlockWithAmbientOcclusionPartial(par1Block, par2, par3, par4, var6, var7, var8) : this.renderStandardBlockWithAmbientOcclusion(par1Block, par2, par3, par4, var6, var7, var8)) : this.renderStandardBlockWithColorMultiplier(par1Block, par2, par3, par4, var6, var7, var8); ++ } ++ ++ /** ++ * Renders a log block at the given coordinates ++ */ ++ public boolean renderBlockLog(Block par1Block, int par2, int par3, int par4) ++ { ++ int var5 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ int var6 = var5 & 12; ++ ++ if (var6 == 4) ++ { ++ this.uvRotateEast = 1; ++ this.uvRotateWest = 1; ++ this.uvRotateTop = 1; ++ this.uvRotateBottom = 1; ++ } ++ else if (var6 == 8) ++ { ++ this.uvRotateSouth = 1; ++ this.uvRotateNorth = 1; ++ } ++ ++ boolean var7 = this.renderStandardBlock(par1Block, par2, par3, par4); ++ this.uvRotateSouth = 0; ++ this.uvRotateEast = 0; ++ this.uvRotateWest = 0; ++ this.uvRotateNorth = 0; ++ this.uvRotateTop = 0; ++ this.uvRotateBottom = 0; ++ return var7; ++ } ++ ++ public boolean renderBlockQuartz(Block par1Block, int par2, int par3, int par4) ++ { ++ int var5 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ ++ if (var5 == 3) ++ { ++ this.uvRotateEast = 1; ++ this.uvRotateWest = 1; ++ this.uvRotateTop = 1; ++ this.uvRotateBottom = 1; ++ } ++ else if (var5 == 4) ++ { ++ this.uvRotateSouth = 1; ++ this.uvRotateNorth = 1; ++ } ++ ++ boolean var6 = this.renderStandardBlock(par1Block, par2, par3, par4); ++ this.uvRotateSouth = 0; ++ this.uvRotateEast = 0; ++ this.uvRotateWest = 0; ++ this.uvRotateNorth = 0; ++ this.uvRotateTop = 0; ++ this.uvRotateBottom = 0; ++ return var6; ++ } ++ ++ public boolean renderStandardBlockWithAmbientOcclusion(Block par1Block, int par2, int par3, int par4, float par5, float par6, float par7) ++ { ++ this.enableAO = true; ++ boolean var8 = false; ++ float var9 = 0.0F; ++ float var10 = 0.0F; ++ float var11 = 0.0F; ++ float var12 = 0.0F; ++ boolean var13 = true; ++ int var14 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4); ++ Tessellator var15 = Tessellator.instance; ++ var15.setBrightness(983055); ++ ++ if (this.getBlockIcon(par1Block).getIconName().equals("grass_top")) ++ { ++ var13 = false; ++ } ++ else if (this.hasOverrideBlockTexture()) ++ { ++ var13 = false; ++ } ++ ++ boolean var16; ++ boolean var17; ++ boolean var18; ++ boolean var19; ++ int var20; ++ float var21; ++ ++ if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3 - 1, par4, 0)) ++ { ++ if (this.renderMinY <= 0.0D) ++ { ++ --par3; ++ } ++ ++ this.aoBrightnessXYNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); ++ this.aoBrightnessYZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); ++ this.aoBrightnessYZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); ++ this.aoBrightnessXYPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); ++ this.aoLightValueScratchXYNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); ++ this.aoLightValueScratchYZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); ++ this.aoLightValueScratchYZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); ++ this.aoLightValueScratchXYPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); ++ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 - 1, par4)]; ++ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 - 1, par4)]; ++ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 + 1)]; ++ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 - 1)]; ++ ++ if (!var19 && !var17) ++ { ++ this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXYNN; ++ this.aoBrightnessXYZNNN = this.aoBrightnessXYNN; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZNNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 - 1); ++ this.aoBrightnessXYZNNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 - 1); ++ } ++ ++ if (!var18 && !var17) ++ { ++ this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXYNN; ++ this.aoBrightnessXYZNNP = this.aoBrightnessXYNN; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZNNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 + 1); ++ this.aoBrightnessXYZNNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 + 1); ++ } ++ ++ if (!var19 && !var16) ++ { ++ this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXYPN; ++ this.aoBrightnessXYZPNN = this.aoBrightnessXYPN; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZPNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 - 1); ++ this.aoBrightnessXYZPNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 - 1); ++ } ++ ++ if (!var18 && !var16) ++ { ++ this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXYPN; ++ this.aoBrightnessXYZPNP = this.aoBrightnessXYPN; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZPNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 + 1); ++ this.aoBrightnessXYZPNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 + 1); ++ } ++ ++ if (this.renderMinY <= 0.0D) ++ { ++ ++par3; ++ } ++ ++ var20 = var14; ++ ++ if (this.renderMinY <= 0.0D || !this.blockAccess.isBlockOpaqueCube(par2, par3 - 1, par4)) ++ { ++ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); ++ } ++ ++ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); ++ var9 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXYNN + this.aoLightValueScratchYZNP + var21) / 4.0F; ++ var12 = (this.aoLightValueScratchYZNP + var21 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXYPN) / 4.0F; ++ var11 = (var21 + this.aoLightValueScratchYZNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNN) / 4.0F; ++ var10 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNN + var21 + this.aoLightValueScratchYZNN) / 4.0F; ++ this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXYNN, this.aoBrightnessYZNP, var20); ++ this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXYPN, var20); ++ this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYPN, this.aoBrightnessXYZPNN, var20); ++ this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNN, this.aoBrightnessYZNN, var20); ++ ++ if (var13) ++ { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * 0.5F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * 0.5F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * 0.5F; ++ } ++ else ++ { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.5F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.5F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.5F; ++ } ++ ++ this.colorRedTopLeft *= var9; ++ this.colorGreenTopLeft *= var9; ++ this.colorBlueTopLeft *= var9; ++ this.colorRedBottomLeft *= var10; ++ this.colorGreenBottomLeft *= var10; ++ this.colorBlueBottomLeft *= var10; ++ this.colorRedBottomRight *= var11; ++ this.colorGreenBottomRight *= var11; ++ this.colorBlueBottomRight *= var11; ++ this.colorRedTopRight *= var12; ++ this.colorGreenTopRight *= var12; ++ this.colorBlueTopRight *= var12; ++ this.renderFaceYNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 0)); ++ var8 = true; ++ } ++ ++ if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3 + 1, par4, 1)) ++ { ++ if (this.renderMaxY >= 1.0D) ++ { ++ ++par3; ++ } ++ ++ this.aoBrightnessXYNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); ++ this.aoBrightnessXYPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); ++ this.aoBrightnessYZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); ++ this.aoBrightnessYZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); ++ this.aoLightValueScratchXYNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); ++ this.aoLightValueScratchXYPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); ++ this.aoLightValueScratchYZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); ++ this.aoLightValueScratchYZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); ++ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 + 1, par4)]; ++ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 + 1, par4)]; ++ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 + 1)]; ++ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 - 1)]; ++ ++ if (!var19 && !var17) ++ { ++ this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXYNP; ++ this.aoBrightnessXYZNPN = this.aoBrightnessXYNP; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZNPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 - 1); ++ this.aoBrightnessXYZNPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 - 1); ++ } ++ ++ if (!var19 && !var16) ++ { ++ this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXYPP; ++ this.aoBrightnessXYZPPN = this.aoBrightnessXYPP; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZPPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 - 1); ++ this.aoBrightnessXYZPPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 - 1); ++ } ++ ++ if (!var18 && !var17) ++ { ++ this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXYNP; ++ this.aoBrightnessXYZNPP = this.aoBrightnessXYNP; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZNPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 + 1); ++ this.aoBrightnessXYZNPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 + 1); ++ } ++ ++ if (!var18 && !var16) ++ { ++ this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXYPP; ++ this.aoBrightnessXYZPPP = this.aoBrightnessXYPP; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZPPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 + 1); ++ this.aoBrightnessXYZPPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 + 1); ++ } ++ ++ if (this.renderMaxY >= 1.0D) ++ { ++ --par3; ++ } ++ ++ var20 = var14; ++ ++ if (this.renderMaxY >= 1.0D || !this.blockAccess.isBlockOpaqueCube(par2, par3 + 1, par4)) ++ { ++ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); ++ } ++ ++ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); ++ var12 = (this.aoLightValueScratchXYZNPP + this.aoLightValueScratchXYNP + this.aoLightValueScratchYZPP + var21) / 4.0F; ++ var9 = (this.aoLightValueScratchYZPP + var21 + this.aoLightValueScratchXYZPPP + this.aoLightValueScratchXYPP) / 4.0F; ++ var10 = (var21 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPN) / 4.0F; ++ var11 = (this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPN + var21 + this.aoLightValueScratchYZPN) / 4.0F; ++ this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessXYZNPP, this.aoBrightnessXYNP, this.aoBrightnessYZPP, var20); ++ this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXYZPPP, this.aoBrightnessXYPP, var20); ++ this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXYPP, this.aoBrightnessXYZPPN, var20); ++ this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessXYNP, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, var20); ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7; ++ this.colorRedTopLeft *= var9; ++ this.colorGreenTopLeft *= var9; ++ this.colorBlueTopLeft *= var9; ++ this.colorRedBottomLeft *= var10; ++ this.colorGreenBottomLeft *= var10; ++ this.colorBlueBottomLeft *= var10; ++ this.colorRedBottomRight *= var11; ++ this.colorGreenBottomRight *= var11; ++ this.colorBlueBottomRight *= var11; ++ this.colorRedTopRight *= var12; ++ this.colorGreenTopRight *= var12; ++ this.colorBlueTopRight *= var12; ++ this.renderFaceYPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 1)); ++ var8 = true; ++ } ++ ++ Icon var22; ++ ++ if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3, par4 - 1, 2)) ++ { ++ if (this.renderMinZ <= 0.0D) ++ { ++ --par4; ++ } ++ ++ this.aoLightValueScratchXZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); ++ this.aoLightValueScratchYZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); ++ this.aoLightValueScratchYZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); ++ this.aoLightValueScratchXZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); ++ this.aoBrightnessXZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); ++ this.aoBrightnessYZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); ++ this.aoBrightnessYZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); ++ this.aoBrightnessXZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); ++ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 - 1)]; ++ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 - 1)]; ++ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 - 1)]; ++ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 - 1)]; ++ ++ if (!var17 && !var19) ++ { ++ this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN; ++ this.aoBrightnessXYZNNN = this.aoBrightnessXZNN; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZNNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 - 1, par4); ++ this.aoBrightnessXYZNNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 - 1, par4); ++ } ++ ++ if (!var17 && !var18) ++ { ++ this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN; ++ this.aoBrightnessXYZNPN = this.aoBrightnessXZNN; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZNPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 + 1, par4); ++ this.aoBrightnessXYZNPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 + 1, par4); ++ } ++ ++ if (!var16 && !var19) ++ { ++ this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN; ++ this.aoBrightnessXYZPNN = this.aoBrightnessXZPN; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZPNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 - 1, par4); ++ this.aoBrightnessXYZPNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 - 1, par4); ++ } ++ ++ if (!var16 && !var18) ++ { ++ this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN; ++ this.aoBrightnessXYZPPN = this.aoBrightnessXZPN; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZPPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 + 1, par4); ++ this.aoBrightnessXYZPPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 + 1, par4); ++ } ++ ++ if (this.renderMinZ <= 0.0D) ++ { ++ ++par4; ++ } ++ ++ var20 = var14; ++ ++ if (this.renderMinZ <= 0.0D || !this.blockAccess.isBlockOpaqueCube(par2, par3, par4 - 1)) ++ { ++ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); ++ } ++ ++ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); ++ var9 = (this.aoLightValueScratchXZNN + this.aoLightValueScratchXYZNPN + var21 + this.aoLightValueScratchYZPN) / 4.0F; ++ var10 = (var21 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXZPN + this.aoLightValueScratchXYZPPN) / 4.0F; ++ var11 = (this.aoLightValueScratchYZNN + var21 + this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXZPN) / 4.0F; ++ var12 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXZNN + this.aoLightValueScratchYZNN + var21) / 4.0F; ++ this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, var20); ++ this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, var20); ++ this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYZPNN, this.aoBrightnessXZPN, var20); ++ this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXZNN, this.aoBrightnessYZNN, var20); ++ ++ if (var13) ++ { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * 0.8F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * 0.8F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * 0.8F; ++ } ++ else ++ { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.8F; ++ } ++ ++ this.colorRedTopLeft *= var9; ++ this.colorGreenTopLeft *= var9; ++ this.colorBlueTopLeft *= var9; ++ this.colorRedBottomLeft *= var10; ++ this.colorGreenBottomLeft *= var10; ++ this.colorBlueBottomLeft *= var10; ++ this.colorRedBottomRight *= var11; ++ this.colorGreenBottomRight *= var11; ++ this.colorBlueBottomRight *= var11; ++ this.colorRedTopRight *= var12; ++ this.colorGreenTopRight *= var12; ++ this.colorBlueTopRight *= var12; ++ var22 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 2); ++ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, var22); ++ ++ if (fancyGrass && var22.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) ++ { ++ this.colorRedTopLeft *= par5; ++ this.colorRedBottomLeft *= par5; ++ this.colorRedBottomRight *= par5; ++ this.colorRedTopRight *= par5; ++ this.colorGreenTopLeft *= par6; ++ this.colorGreenBottomLeft *= par6; ++ this.colorGreenBottomRight *= par6; ++ this.colorGreenTopRight *= par6; ++ this.colorBlueTopLeft *= par7; ++ this.colorBlueBottomLeft *= par7; ++ this.colorBlueBottomRight *= par7; ++ this.colorBlueTopRight *= par7; ++ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); ++ } ++ ++ var8 = true; ++ } ++ ++ if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3, par4 + 1, 3)) ++ { ++ if (this.renderMaxZ >= 1.0D) ++ { ++ ++par4; ++ } ++ ++ this.aoLightValueScratchXZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); ++ this.aoLightValueScratchXZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); ++ this.aoLightValueScratchYZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); ++ this.aoLightValueScratchYZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); ++ this.aoBrightnessXZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); ++ this.aoBrightnessXZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); ++ this.aoBrightnessYZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); ++ this.aoBrightnessYZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); ++ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 + 1)]; ++ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 + 1)]; ++ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 + 1)]; ++ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 + 1)]; ++ ++ if (!var17 && !var19) ++ { ++ this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP; ++ this.aoBrightnessXYZNNP = this.aoBrightnessXZNP; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZNNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 - 1, par4); ++ this.aoBrightnessXYZNNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 - 1, par4); ++ } ++ ++ if (!var17 && !var18) ++ { ++ this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP; ++ this.aoBrightnessXYZNPP = this.aoBrightnessXZNP; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZNPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 + 1, par4); ++ this.aoBrightnessXYZNPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 + 1, par4); ++ } ++ ++ if (!var16 && !var19) ++ { ++ this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP; ++ this.aoBrightnessXYZPNP = this.aoBrightnessXZPP; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZPNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 - 1, par4); ++ this.aoBrightnessXYZPNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 - 1, par4); ++ } ++ ++ if (!var16 && !var18) ++ { ++ this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP; ++ this.aoBrightnessXYZPPP = this.aoBrightnessXZPP; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZPPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 + 1, par4); ++ this.aoBrightnessXYZPPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 + 1, par4); ++ } ++ ++ if (this.renderMaxZ >= 1.0D) ++ { ++ --par4; ++ } ++ ++ var20 = var14; ++ ++ if (this.renderMaxZ >= 1.0D || !this.blockAccess.isBlockOpaqueCube(par2, par3, par4 + 1)) ++ { ++ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); ++ } ++ ++ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); ++ var9 = (this.aoLightValueScratchXZNP + this.aoLightValueScratchXYZNPP + var21 + this.aoLightValueScratchYZPP) / 4.0F; ++ var12 = (var21 + this.aoLightValueScratchYZPP + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYZPPP) / 4.0F; ++ var11 = (this.aoLightValueScratchYZNP + var21 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXZPP) / 4.0F; ++ var10 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXZNP + this.aoLightValueScratchYZNP + var21) / 4.0F; ++ this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYZNPP, this.aoBrightnessYZPP, var20); ++ this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXZPP, this.aoBrightnessXYZPPP, var20); ++ this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, var20); ++ this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, this.aoBrightnessYZNP, var20); ++ ++ if (var13) ++ { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * 0.8F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * 0.8F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * 0.8F; ++ } ++ else ++ { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.8F; ++ } ++ ++ this.colorRedTopLeft *= var9; ++ this.colorGreenTopLeft *= var9; ++ this.colorBlueTopLeft *= var9; ++ this.colorRedBottomLeft *= var10; ++ this.colorGreenBottomLeft *= var10; ++ this.colorBlueBottomLeft *= var10; ++ this.colorRedBottomRight *= var11; ++ this.colorGreenBottomRight *= var11; ++ this.colorBlueBottomRight *= var11; ++ this.colorRedTopRight *= var12; ++ this.colorGreenTopRight *= var12; ++ this.colorBlueTopRight *= var12; ++ var22 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 3); ++ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 3)); ++ ++ if (fancyGrass && var22.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) ++ { ++ this.colorRedTopLeft *= par5; ++ this.colorRedBottomLeft *= par5; ++ this.colorRedBottomRight *= par5; ++ this.colorRedTopRight *= par5; ++ this.colorGreenTopLeft *= par6; ++ this.colorGreenBottomLeft *= par6; ++ this.colorGreenBottomRight *= par6; ++ this.colorGreenTopRight *= par6; ++ this.colorBlueTopLeft *= par7; ++ this.colorBlueBottomLeft *= par7; ++ this.colorBlueBottomRight *= par7; ++ this.colorBlueTopRight *= par7; ++ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); ++ } ++ ++ var8 = true; ++ } ++ ++ if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2 - 1, par3, par4, 4)) ++ { ++ if (this.renderMinX <= 0.0D) ++ { ++ --par2; ++ } ++ ++ this.aoLightValueScratchXYNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); ++ this.aoLightValueScratchXZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); ++ this.aoLightValueScratchXZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); ++ this.aoLightValueScratchXYNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); ++ this.aoBrightnessXYNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); ++ this.aoBrightnessXZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); ++ this.aoBrightnessXZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); ++ this.aoBrightnessXYNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); ++ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 + 1, par4)]; ++ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 - 1, par4)]; ++ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 - 1)]; ++ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 + 1)]; ++ ++ if (!var18 && !var17) ++ { ++ this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN; ++ this.aoBrightnessXYZNNN = this.aoBrightnessXZNN; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZNNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 - 1); ++ this.aoBrightnessXYZNNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 - 1); ++ } ++ ++ if (!var19 && !var17) ++ { ++ this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP; ++ this.aoBrightnessXYZNNP = this.aoBrightnessXZNP; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZNNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 + 1); ++ this.aoBrightnessXYZNNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 + 1); ++ } ++ ++ if (!var18 && !var16) ++ { ++ this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN; ++ this.aoBrightnessXYZNPN = this.aoBrightnessXZNN; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZNPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 - 1); ++ this.aoBrightnessXYZNPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 - 1); ++ } ++ ++ if (!var19 && !var16) ++ { ++ this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP; ++ this.aoBrightnessXYZNPP = this.aoBrightnessXZNP; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZNPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 + 1); ++ this.aoBrightnessXYZNPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 + 1); ++ } ++ ++ if (this.renderMinX <= 0.0D) ++ { ++ ++par2; ++ } ++ ++ var20 = var14; ++ ++ if (this.renderMinX <= 0.0D || !this.blockAccess.isBlockOpaqueCube(par2 - 1, par3, par4)) ++ { ++ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); ++ } ++ ++ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); ++ var12 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNP + var21 + this.aoLightValueScratchXZNP) / 4.0F; ++ var9 = (var21 + this.aoLightValueScratchXZNP + this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPP) / 4.0F; ++ var10 = (this.aoLightValueScratchXZNN + var21 + this.aoLightValueScratchXYZNPN + this.aoLightValueScratchXYNP) / 4.0F; ++ var11 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXYNN + this.aoLightValueScratchXZNN + var21) / 4.0F; ++ this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, var20); ++ this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYNP, this.aoBrightnessXYZNPP, var20); ++ this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessXYNP, var20); ++ this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXYNN, this.aoBrightnessXZNN, var20); ++ ++ if (var13) ++ { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * 0.6F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * 0.6F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * 0.6F; ++ } ++ else ++ { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.6F; ++ } ++ ++ this.colorRedTopLeft *= var9; ++ this.colorGreenTopLeft *= var9; ++ this.colorBlueTopLeft *= var9; ++ this.colorRedBottomLeft *= var10; ++ this.colorGreenBottomLeft *= var10; ++ this.colorBlueBottomLeft *= var10; ++ this.colorRedBottomRight *= var11; ++ this.colorGreenBottomRight *= var11; ++ this.colorBlueBottomRight *= var11; ++ this.colorRedTopRight *= var12; ++ this.colorGreenTopRight *= var12; ++ this.colorBlueTopRight *= var12; ++ var22 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 4); ++ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, var22); ++ ++ if (fancyGrass && var22.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) ++ { ++ this.colorRedTopLeft *= par5; ++ this.colorRedBottomLeft *= par5; ++ this.colorRedBottomRight *= par5; ++ this.colorRedTopRight *= par5; ++ this.colorGreenTopLeft *= par6; ++ this.colorGreenBottomLeft *= par6; ++ this.colorGreenBottomRight *= par6; ++ this.colorGreenTopRight *= par6; ++ this.colorBlueTopLeft *= par7; ++ this.colorBlueBottomLeft *= par7; ++ this.colorBlueBottomRight *= par7; ++ this.colorBlueTopRight *= par7; ++ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); ++ } ++ ++ var8 = true; ++ } ++ ++ if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2 + 1, par3, par4, 5)) ++ { ++ if (this.renderMaxX >= 1.0D) ++ { ++ ++par2; ++ } ++ ++ this.aoLightValueScratchXYPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); ++ this.aoLightValueScratchXZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); ++ this.aoLightValueScratchXZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); ++ this.aoLightValueScratchXYPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); ++ this.aoBrightnessXYPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); ++ this.aoBrightnessXZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); ++ this.aoBrightnessXZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); ++ this.aoBrightnessXYPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); ++ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 + 1, par4)]; ++ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 - 1, par4)]; ++ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 + 1)]; ++ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 - 1)]; ++ ++ if (!var17 && !var19) ++ { ++ this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN; ++ this.aoBrightnessXYZPNN = this.aoBrightnessXZPN; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZPNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 - 1); ++ this.aoBrightnessXYZPNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 - 1); ++ } ++ ++ if (!var17 && !var18) ++ { ++ this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP; ++ this.aoBrightnessXYZPNP = this.aoBrightnessXZPP; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZPNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 + 1); ++ this.aoBrightnessXYZPNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 + 1); ++ } ++ ++ if (!var16 && !var19) ++ { ++ this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN; ++ this.aoBrightnessXYZPPN = this.aoBrightnessXZPN; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZPPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 - 1); ++ this.aoBrightnessXYZPPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 - 1); ++ } ++ ++ if (!var16 && !var18) ++ { ++ this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP; ++ this.aoBrightnessXYZPPP = this.aoBrightnessXZPP; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZPPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 + 1); ++ this.aoBrightnessXYZPPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 + 1); ++ } ++ ++ if (this.renderMaxX >= 1.0D) ++ { ++ --par2; ++ } ++ ++ var20 = var14; ++ ++ if (this.renderMaxX >= 1.0D || !this.blockAccess.isBlockOpaqueCube(par2 + 1, par3, par4)) ++ { ++ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); ++ } ++ ++ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); ++ var9 = (this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNP + var21 + this.aoLightValueScratchXZPP) / 4.0F; ++ var10 = (this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXZPN + var21) / 4.0F; ++ var11 = (this.aoLightValueScratchXZPN + var21 + this.aoLightValueScratchXYZPPN + this.aoLightValueScratchXYPP) / 4.0F; ++ var12 = (var21 + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPP) / 4.0F; ++ this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXYPN, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, var20); ++ this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessXZPP, this.aoBrightnessXYPP, this.aoBrightnessXYZPPP, var20); ++ this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, this.aoBrightnessXYPP, var20); ++ this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXYZPNN, this.aoBrightnessXYPN, this.aoBrightnessXZPN, var20); ++ ++ if (var13) ++ { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * 0.6F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * 0.6F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * 0.6F; ++ } ++ else ++ { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.6F; ++ } ++ ++ this.colorRedTopLeft *= var9; ++ this.colorGreenTopLeft *= var9; ++ this.colorBlueTopLeft *= var9; ++ this.colorRedBottomLeft *= var10; ++ this.colorGreenBottomLeft *= var10; ++ this.colorBlueBottomLeft *= var10; ++ this.colorRedBottomRight *= var11; ++ this.colorGreenBottomRight *= var11; ++ this.colorBlueBottomRight *= var11; ++ this.colorRedTopRight *= var12; ++ this.colorGreenTopRight *= var12; ++ this.colorBlueTopRight *= var12; ++ var22 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 5); ++ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, var22); ++ ++ if (fancyGrass && var22.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) ++ { ++ this.colorRedTopLeft *= par5; ++ this.colorRedBottomLeft *= par5; ++ this.colorRedBottomRight *= par5; ++ this.colorRedTopRight *= par5; ++ this.colorGreenTopLeft *= par6; ++ this.colorGreenBottomLeft *= par6; ++ this.colorGreenBottomRight *= par6; ++ this.colorGreenTopRight *= par6; ++ this.colorBlueTopLeft *= par7; ++ this.colorBlueBottomLeft *= par7; ++ this.colorBlueBottomRight *= par7; ++ this.colorBlueTopRight *= par7; ++ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); ++ } ++ ++ var8 = true; ++ } ++ ++ this.enableAO = false; ++ return var8; ++ } ++ ++ /** ++ * Renders non-full-cube block with ambient occusion. Args: block, x, y, z, red, green, blue (lighting) ++ */ ++ public boolean renderStandardBlockWithAmbientOcclusionPartial(Block par1Block, int par2, int par3, int par4, float par5, float par6, float par7) ++ { ++ this.enableAO = true; ++ boolean var8 = false; ++ float var9 = 0.0F; ++ float var10 = 0.0F; ++ float var11 = 0.0F; ++ float var12 = 0.0F; ++ boolean var13 = true; ++ int var14 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4); ++ Tessellator var15 = Tessellator.instance; ++ var15.setBrightness(983055); ++ ++ if (this.getBlockIcon(par1Block).getIconName().equals("grass_top")) ++ { ++ var13 = false; ++ } ++ else if (this.hasOverrideBlockTexture()) ++ { ++ var13 = false; ++ } ++ ++ boolean var16; ++ boolean var17; ++ boolean var18; ++ boolean var19; ++ int var20; ++ float var21; ++ ++ if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3 - 1, par4, 0)) ++ { ++ if (this.renderMinY <= 0.0D) ++ { ++ --par3; ++ } ++ ++ this.aoBrightnessXYNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); ++ this.aoBrightnessYZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); ++ this.aoBrightnessYZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); ++ this.aoBrightnessXYPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); ++ this.aoLightValueScratchXYNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); ++ this.aoLightValueScratchYZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); ++ this.aoLightValueScratchYZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); ++ this.aoLightValueScratchXYPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); ++ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 - 1, par4)]; ++ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 - 1, par4)]; ++ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 + 1)]; ++ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 - 1)]; ++ ++ if (!var19 && !var17) ++ { ++ this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXYNN; ++ this.aoBrightnessXYZNNN = this.aoBrightnessXYNN; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZNNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 - 1); ++ this.aoBrightnessXYZNNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 - 1); ++ } ++ ++ if (!var18 && !var17) ++ { ++ this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXYNN; ++ this.aoBrightnessXYZNNP = this.aoBrightnessXYNN; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZNNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 + 1); ++ this.aoBrightnessXYZNNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 + 1); ++ } ++ ++ if (!var19 && !var16) ++ { ++ this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXYPN; ++ this.aoBrightnessXYZPNN = this.aoBrightnessXYPN; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZPNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 - 1); ++ this.aoBrightnessXYZPNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 - 1); ++ } ++ ++ if (!var18 && !var16) ++ { ++ this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXYPN; ++ this.aoBrightnessXYZPNP = this.aoBrightnessXYPN; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZPNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 + 1); ++ this.aoBrightnessXYZPNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 + 1); ++ } ++ ++ if (this.renderMinY <= 0.0D) ++ { ++ ++par3; ++ } ++ ++ var20 = var14; ++ ++ if (this.renderMinY <= 0.0D || !this.blockAccess.isBlockOpaqueCube(par2, par3 - 1, par4)) ++ { ++ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); ++ } ++ ++ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); ++ var9 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXYNN + this.aoLightValueScratchYZNP + var21) / 4.0F; ++ var12 = (this.aoLightValueScratchYZNP + var21 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXYPN) / 4.0F; ++ var11 = (var21 + this.aoLightValueScratchYZNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNN) / 4.0F; ++ var10 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNN + var21 + this.aoLightValueScratchYZNN) / 4.0F; ++ this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXYNN, this.aoBrightnessYZNP, var20); ++ this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXYPN, var20); ++ this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYPN, this.aoBrightnessXYZPNN, var20); ++ this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNN, this.aoBrightnessYZNN, var20); ++ ++ if (var13) ++ { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * 0.5F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * 0.5F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * 0.5F; ++ } ++ else ++ { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.5F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.5F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.5F; ++ } ++ ++ this.colorRedTopLeft *= var9; ++ this.colorGreenTopLeft *= var9; ++ this.colorBlueTopLeft *= var9; ++ this.colorRedBottomLeft *= var10; ++ this.colorGreenBottomLeft *= var10; ++ this.colorBlueBottomLeft *= var10; ++ this.colorRedBottomRight *= var11; ++ this.colorGreenBottomRight *= var11; ++ this.colorBlueBottomRight *= var11; ++ this.colorRedTopRight *= var12; ++ this.colorGreenTopRight *= var12; ++ this.colorBlueTopRight *= var12; ++ this.renderFaceYNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 0)); ++ var8 = true; ++ } ++ ++ if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3 + 1, par4, 1)) ++ { ++ if (this.renderMaxY >= 1.0D) ++ { ++ ++par3; ++ } ++ ++ this.aoBrightnessXYNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); ++ this.aoBrightnessXYPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); ++ this.aoBrightnessYZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); ++ this.aoBrightnessYZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); ++ this.aoLightValueScratchXYNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); ++ this.aoLightValueScratchXYPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); ++ this.aoLightValueScratchYZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); ++ this.aoLightValueScratchYZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); ++ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 + 1, par4)]; ++ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 + 1, par4)]; ++ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 + 1)]; ++ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 - 1)]; ++ ++ if (!var19 && !var17) ++ { ++ this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXYNP; ++ this.aoBrightnessXYZNPN = this.aoBrightnessXYNP; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZNPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 - 1); ++ this.aoBrightnessXYZNPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 - 1); ++ } ++ ++ if (!var19 && !var16) ++ { ++ this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXYPP; ++ this.aoBrightnessXYZPPN = this.aoBrightnessXYPP; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZPPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 - 1); ++ this.aoBrightnessXYZPPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 - 1); ++ } ++ ++ if (!var18 && !var17) ++ { ++ this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXYNP; ++ this.aoBrightnessXYZNPP = this.aoBrightnessXYNP; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZNPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 + 1); ++ this.aoBrightnessXYZNPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 + 1); ++ } ++ ++ if (!var18 && !var16) ++ { ++ this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXYPP; ++ this.aoBrightnessXYZPPP = this.aoBrightnessXYPP; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZPPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 + 1); ++ this.aoBrightnessXYZPPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 + 1); ++ } ++ ++ if (this.renderMaxY >= 1.0D) ++ { ++ --par3; ++ } ++ ++ var20 = var14; ++ ++ if (this.renderMaxY >= 1.0D || !this.blockAccess.isBlockOpaqueCube(par2, par3 + 1, par4)) ++ { ++ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); ++ } ++ ++ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); ++ var12 = (this.aoLightValueScratchXYZNPP + this.aoLightValueScratchXYNP + this.aoLightValueScratchYZPP + var21) / 4.0F; ++ var9 = (this.aoLightValueScratchYZPP + var21 + this.aoLightValueScratchXYZPPP + this.aoLightValueScratchXYPP) / 4.0F; ++ var10 = (var21 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPN) / 4.0F; ++ var11 = (this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPN + var21 + this.aoLightValueScratchYZPN) / 4.0F; ++ this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessXYZNPP, this.aoBrightnessXYNP, this.aoBrightnessYZPP, var20); ++ this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXYZPPP, this.aoBrightnessXYPP, var20); ++ this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXYPP, this.aoBrightnessXYZPPN, var20); ++ this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessXYNP, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, var20); ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7; ++ this.colorRedTopLeft *= var9; ++ this.colorGreenTopLeft *= var9; ++ this.colorBlueTopLeft *= var9; ++ this.colorRedBottomLeft *= var10; ++ this.colorGreenBottomLeft *= var10; ++ this.colorBlueBottomLeft *= var10; ++ this.colorRedBottomRight *= var11; ++ this.colorGreenBottomRight *= var11; ++ this.colorBlueBottomRight *= var11; ++ this.colorRedTopRight *= var12; ++ this.colorGreenTopRight *= var12; ++ this.colorBlueTopRight *= var12; ++ this.renderFaceYPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 1)); ++ var8 = true; ++ } ++ ++ float var22; ++ float var23; ++ float var24; ++ float var25; ++ int var26; ++ int var27; ++ int var28; ++ int var29; ++ Icon var30; ++ ++ if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3, par4 - 1, 2)) ++ { ++ if (this.renderMinZ <= 0.0D) ++ { ++ --par4; ++ } ++ ++ this.aoLightValueScratchXZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); ++ this.aoLightValueScratchYZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); ++ this.aoLightValueScratchYZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); ++ this.aoLightValueScratchXZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); ++ this.aoBrightnessXZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); ++ this.aoBrightnessYZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); ++ this.aoBrightnessYZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); ++ this.aoBrightnessXZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); ++ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 - 1)]; ++ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 - 1)]; ++ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 - 1)]; ++ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 - 1)]; ++ ++ if (!var17 && !var19) ++ { ++ this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN; ++ this.aoBrightnessXYZNNN = this.aoBrightnessXZNN; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZNNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 - 1, par4); ++ this.aoBrightnessXYZNNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 - 1, par4); ++ } ++ ++ if (!var17 && !var18) ++ { ++ this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN; ++ this.aoBrightnessXYZNPN = this.aoBrightnessXZNN; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZNPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 + 1, par4); ++ this.aoBrightnessXYZNPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 + 1, par4); ++ } ++ ++ if (!var16 && !var19) ++ { ++ this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN; ++ this.aoBrightnessXYZPNN = this.aoBrightnessXZPN; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZPNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 - 1, par4); ++ this.aoBrightnessXYZPNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 - 1, par4); ++ } ++ ++ if (!var16 && !var18) ++ { ++ this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN; ++ this.aoBrightnessXYZPPN = this.aoBrightnessXZPN; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZPPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 + 1, par4); ++ this.aoBrightnessXYZPPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 + 1, par4); ++ } ++ ++ if (this.renderMinZ <= 0.0D) ++ { ++ ++par4; ++ } ++ ++ var20 = var14; ++ ++ if (this.renderMinZ <= 0.0D || !this.blockAccess.isBlockOpaqueCube(par2, par3, par4 - 1)) ++ { ++ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); ++ } ++ ++ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); ++ var22 = (this.aoLightValueScratchXZNN + this.aoLightValueScratchXYZNPN + var21 + this.aoLightValueScratchYZPN) / 4.0F; ++ var23 = (var21 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXZPN + this.aoLightValueScratchXYZPPN) / 4.0F; ++ var24 = (this.aoLightValueScratchYZNN + var21 + this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXZPN) / 4.0F; ++ var25 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXZNN + this.aoLightValueScratchYZNN + var21) / 4.0F; ++ var9 = (float)((double)var22 * this.renderMaxY * (1.0D - this.renderMinX) + (double)var23 * this.renderMinY * this.renderMinX + (double)var24 * (1.0D - this.renderMaxY) * this.renderMinX + (double)var25 * (1.0D - this.renderMaxY) * (1.0D - this.renderMinX)); ++ var10 = (float)((double)var22 * this.renderMaxY * (1.0D - this.renderMaxX) + (double)var23 * this.renderMaxY * this.renderMaxX + (double)var24 * (1.0D - this.renderMaxY) * this.renderMaxX + (double)var25 * (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX)); ++ var11 = (float)((double)var22 * this.renderMinY * (1.0D - this.renderMaxX) + (double)var23 * this.renderMinY * this.renderMaxX + (double)var24 * (1.0D - this.renderMinY) * this.renderMaxX + (double)var25 * (1.0D - this.renderMinY) * (1.0D - this.renderMaxX)); ++ var12 = (float)((double)var22 * this.renderMinY * (1.0D - this.renderMinX) + (double)var23 * this.renderMinY * this.renderMinX + (double)var24 * (1.0D - this.renderMinY) * this.renderMinX + (double)var25 * (1.0D - this.renderMinY) * (1.0D - this.renderMinX)); ++ var26 = this.getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, var20); ++ var27 = this.getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, var20); ++ var28 = this.getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYZPNN, this.aoBrightnessXZPN, var20); ++ var29 = this.getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXZNN, this.aoBrightnessYZNN, var20); ++ this.brightnessTopLeft = this.mixAoBrightness(var26, var27, var28, var29, this.renderMaxY * (1.0D - this.renderMinX), this.renderMaxY * this.renderMinX, (1.0D - this.renderMaxY) * this.renderMinX, (1.0D - this.renderMaxY) * (1.0D - this.renderMinX)); ++ this.brightnessBottomLeft = this.mixAoBrightness(var26, var27, var28, var29, this.renderMaxY * (1.0D - this.renderMaxX), this.renderMaxY * this.renderMaxX, (1.0D - this.renderMaxY) * this.renderMaxX, (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX)); ++ this.brightnessBottomRight = this.mixAoBrightness(var26, var27, var28, var29, this.renderMinY * (1.0D - this.renderMaxX), this.renderMinY * this.renderMaxX, (1.0D - this.renderMinY) * this.renderMaxX, (1.0D - this.renderMinY) * (1.0D - this.renderMaxX)); ++ this.brightnessTopRight = this.mixAoBrightness(var26, var27, var28, var29, this.renderMinY * (1.0D - this.renderMinX), this.renderMinY * this.renderMinX, (1.0D - this.renderMinY) * this.renderMinX, (1.0D - this.renderMinY) * (1.0D - this.renderMinX)); ++ ++ if (var13) ++ { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * 0.8F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * 0.8F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * 0.8F; ++ } ++ else ++ { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.8F; ++ } ++ ++ this.colorRedTopLeft *= var9; ++ this.colorGreenTopLeft *= var9; ++ this.colorBlueTopLeft *= var9; ++ this.colorRedBottomLeft *= var10; ++ this.colorGreenBottomLeft *= var10; ++ this.colorBlueBottomLeft *= var10; ++ this.colorRedBottomRight *= var11; ++ this.colorGreenBottomRight *= var11; ++ this.colorBlueBottomRight *= var11; ++ this.colorRedTopRight *= var12; ++ this.colorGreenTopRight *= var12; ++ this.colorBlueTopRight *= var12; ++ var30 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 2); ++ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, var30); ++ ++ if (fancyGrass && var30.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) ++ { ++ this.colorRedTopLeft *= par5; ++ this.colorRedBottomLeft *= par5; ++ this.colorRedBottomRight *= par5; ++ this.colorRedTopRight *= par5; ++ this.colorGreenTopLeft *= par6; ++ this.colorGreenBottomLeft *= par6; ++ this.colorGreenBottomRight *= par6; ++ this.colorGreenTopRight *= par6; ++ this.colorBlueTopLeft *= par7; ++ this.colorBlueBottomLeft *= par7; ++ this.colorBlueBottomRight *= par7; ++ this.colorBlueTopRight *= par7; ++ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); ++ } ++ ++ var8 = true; ++ } ++ ++ if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3, par4 + 1, 3)) ++ { ++ if (this.renderMaxZ >= 1.0D) ++ { ++ ++par4; ++ } ++ ++ this.aoLightValueScratchXZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); ++ this.aoLightValueScratchXZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); ++ this.aoLightValueScratchYZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); ++ this.aoLightValueScratchYZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); ++ this.aoBrightnessXZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); ++ this.aoBrightnessXZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); ++ this.aoBrightnessYZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); ++ this.aoBrightnessYZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); ++ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 + 1)]; ++ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 + 1)]; ++ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 + 1)]; ++ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 + 1)]; ++ ++ if (!var17 && !var19) ++ { ++ this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP; ++ this.aoBrightnessXYZNNP = this.aoBrightnessXZNP; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZNNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 - 1, par4); ++ this.aoBrightnessXYZNNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 - 1, par4); ++ } ++ ++ if (!var17 && !var18) ++ { ++ this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP; ++ this.aoBrightnessXYZNPP = this.aoBrightnessXZNP; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZNPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 + 1, par4); ++ this.aoBrightnessXYZNPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 + 1, par4); ++ } ++ ++ if (!var16 && !var19) ++ { ++ this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP; ++ this.aoBrightnessXYZPNP = this.aoBrightnessXZPP; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZPNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 - 1, par4); ++ this.aoBrightnessXYZPNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 - 1, par4); ++ } ++ ++ if (!var16 && !var18) ++ { ++ this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP; ++ this.aoBrightnessXYZPPP = this.aoBrightnessXZPP; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZPPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 + 1, par4); ++ this.aoBrightnessXYZPPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 + 1, par4); ++ } ++ ++ if (this.renderMaxZ >= 1.0D) ++ { ++ --par4; ++ } ++ ++ var20 = var14; ++ ++ if (this.renderMaxZ >= 1.0D || !this.blockAccess.isBlockOpaqueCube(par2, par3, par4 + 1)) ++ { ++ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); ++ } ++ ++ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); ++ var22 = (this.aoLightValueScratchXZNP + this.aoLightValueScratchXYZNPP + var21 + this.aoLightValueScratchYZPP) / 4.0F; ++ var23 = (var21 + this.aoLightValueScratchYZPP + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYZPPP) / 4.0F; ++ var24 = (this.aoLightValueScratchYZNP + var21 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXZPP) / 4.0F; ++ var25 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXZNP + this.aoLightValueScratchYZNP + var21) / 4.0F; ++ var9 = (float)((double)var22 * this.renderMaxY * (1.0D - this.renderMinX) + (double)var23 * this.renderMaxY * this.renderMinX + (double)var24 * (1.0D - this.renderMaxY) * this.renderMinX + (double)var25 * (1.0D - this.renderMaxY) * (1.0D - this.renderMinX)); ++ var10 = (float)((double)var22 * this.renderMinY * (1.0D - this.renderMinX) + (double)var23 * this.renderMinY * this.renderMinX + (double)var24 * (1.0D - this.renderMinY) * this.renderMinX + (double)var25 * (1.0D - this.renderMinY) * (1.0D - this.renderMinX)); ++ var11 = (float)((double)var22 * this.renderMinY * (1.0D - this.renderMaxX) + (double)var23 * this.renderMinY * this.renderMaxX + (double)var24 * (1.0D - this.renderMinY) * this.renderMaxX + (double)var25 * (1.0D - this.renderMinY) * (1.0D - this.renderMaxX)); ++ var12 = (float)((double)var22 * this.renderMaxY * (1.0D - this.renderMaxX) + (double)var23 * this.renderMaxY * this.renderMaxX + (double)var24 * (1.0D - this.renderMaxY) * this.renderMaxX + (double)var25 * (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX)); ++ var26 = this.getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYZNPP, this.aoBrightnessYZPP, var20); ++ var27 = this.getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXZPP, this.aoBrightnessXYZPPP, var20); ++ var28 = this.getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, var20); ++ var29 = this.getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, this.aoBrightnessYZNP, var20); ++ this.brightnessTopLeft = this.mixAoBrightness(var26, var29, var28, var27, this.renderMaxY * (1.0D - this.renderMinX), (1.0D - this.renderMaxY) * (1.0D - this.renderMinX), (1.0D - this.renderMaxY) * this.renderMinX, this.renderMaxY * this.renderMinX); ++ this.brightnessBottomLeft = this.mixAoBrightness(var26, var29, var28, var27, this.renderMinY * (1.0D - this.renderMinX), (1.0D - this.renderMinY) * (1.0D - this.renderMinX), (1.0D - this.renderMinY) * this.renderMinX, this.renderMinY * this.renderMinX); ++ this.brightnessBottomRight = this.mixAoBrightness(var26, var29, var28, var27, this.renderMinY * (1.0D - this.renderMaxX), (1.0D - this.renderMinY) * (1.0D - this.renderMaxX), (1.0D - this.renderMinY) * this.renderMaxX, this.renderMinY * this.renderMaxX); ++ this.brightnessTopRight = this.mixAoBrightness(var26, var29, var28, var27, this.renderMaxY * (1.0D - this.renderMaxX), (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX), (1.0D - this.renderMaxY) * this.renderMaxX, this.renderMaxY * this.renderMaxX); ++ ++ if (var13) ++ { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * 0.8F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * 0.8F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * 0.8F; ++ } ++ else ++ { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.8F; ++ } ++ ++ this.colorRedTopLeft *= var9; ++ this.colorGreenTopLeft *= var9; ++ this.colorBlueTopLeft *= var9; ++ this.colorRedBottomLeft *= var10; ++ this.colorGreenBottomLeft *= var10; ++ this.colorBlueBottomLeft *= var10; ++ this.colorRedBottomRight *= var11; ++ this.colorGreenBottomRight *= var11; ++ this.colorBlueBottomRight *= var11; ++ this.colorRedTopRight *= var12; ++ this.colorGreenTopRight *= var12; ++ this.colorBlueTopRight *= var12; ++ var30 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 3); ++ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 3)); ++ ++ if (fancyGrass && var30.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) ++ { ++ this.colorRedTopLeft *= par5; ++ this.colorRedBottomLeft *= par5; ++ this.colorRedBottomRight *= par5; ++ this.colorRedTopRight *= par5; ++ this.colorGreenTopLeft *= par6; ++ this.colorGreenBottomLeft *= par6; ++ this.colorGreenBottomRight *= par6; ++ this.colorGreenTopRight *= par6; ++ this.colorBlueTopLeft *= par7; ++ this.colorBlueBottomLeft *= par7; ++ this.colorBlueBottomRight *= par7; ++ this.colorBlueTopRight *= par7; ++ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); ++ } ++ ++ var8 = true; ++ } ++ ++ if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2 - 1, par3, par4, 4)) ++ { ++ if (this.renderMinX <= 0.0D) ++ { ++ --par2; ++ } ++ ++ this.aoLightValueScratchXYNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); ++ this.aoLightValueScratchXZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); ++ this.aoLightValueScratchXZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); ++ this.aoLightValueScratchXYNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); ++ this.aoBrightnessXYNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); ++ this.aoBrightnessXZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); ++ this.aoBrightnessXZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); ++ this.aoBrightnessXYNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); ++ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 + 1, par4)]; ++ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 - 1, par4)]; ++ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 - 1)]; ++ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 + 1)]; ++ ++ if (!var18 && !var17) ++ { ++ this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN; ++ this.aoBrightnessXYZNNN = this.aoBrightnessXZNN; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZNNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 - 1); ++ this.aoBrightnessXYZNNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 - 1); ++ } ++ ++ if (!var19 && !var17) ++ { ++ this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP; ++ this.aoBrightnessXYZNNP = this.aoBrightnessXZNP; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZNNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 + 1); ++ this.aoBrightnessXYZNNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 + 1); ++ } ++ ++ if (!var18 && !var16) ++ { ++ this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN; ++ this.aoBrightnessXYZNPN = this.aoBrightnessXZNN; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZNPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 - 1); ++ this.aoBrightnessXYZNPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 - 1); ++ } ++ ++ if (!var19 && !var16) ++ { ++ this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP; ++ this.aoBrightnessXYZNPP = this.aoBrightnessXZNP; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZNPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 + 1); ++ this.aoBrightnessXYZNPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 + 1); ++ } ++ ++ if (this.renderMinX <= 0.0D) ++ { ++ ++par2; ++ } ++ ++ var20 = var14; ++ ++ if (this.renderMinX <= 0.0D || !this.blockAccess.isBlockOpaqueCube(par2 - 1, par3, par4)) ++ { ++ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); ++ } ++ ++ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); ++ var22 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNP + var21 + this.aoLightValueScratchXZNP) / 4.0F; ++ var23 = (var21 + this.aoLightValueScratchXZNP + this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPP) / 4.0F; ++ var24 = (this.aoLightValueScratchXZNN + var21 + this.aoLightValueScratchXYZNPN + this.aoLightValueScratchXYNP) / 4.0F; ++ var25 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXYNN + this.aoLightValueScratchXZNN + var21) / 4.0F; ++ var9 = (float)((double)var23 * this.renderMaxY * this.renderMaxZ + (double)var24 * this.renderMaxY * (1.0D - this.renderMaxZ) + (double)var25 * (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ) + (double)var22 * (1.0D - this.renderMaxY) * this.renderMaxZ); ++ var10 = (float)((double)var23 * this.renderMaxY * this.renderMinZ + (double)var24 * this.renderMaxY * (1.0D - this.renderMinZ) + (double)var25 * (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ) + (double)var22 * (1.0D - this.renderMaxY) * this.renderMinZ); ++ var11 = (float)((double)var23 * this.renderMinY * this.renderMinZ + (double)var24 * this.renderMinY * (1.0D - this.renderMinZ) + (double)var25 * (1.0D - this.renderMinY) * (1.0D - this.renderMinZ) + (double)var22 * (1.0D - this.renderMinY) * this.renderMinZ); ++ var12 = (float)((double)var23 * this.renderMinY * this.renderMaxZ + (double)var24 * this.renderMinY * (1.0D - this.renderMaxZ) + (double)var25 * (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ) + (double)var22 * (1.0D - this.renderMinY) * this.renderMaxZ); ++ var26 = this.getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, var20); ++ var27 = this.getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYNP, this.aoBrightnessXYZNPP, var20); ++ var28 = this.getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessXYNP, var20); ++ var29 = this.getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXYNN, this.aoBrightnessXZNN, var20); ++ this.brightnessTopLeft = this.mixAoBrightness(var27, var28, var29, var26, this.renderMaxY * this.renderMaxZ, this.renderMaxY * (1.0D - this.renderMaxZ), (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ), (1.0D - this.renderMaxY) * this.renderMaxZ); ++ this.brightnessBottomLeft = this.mixAoBrightness(var27, var28, var29, var26, this.renderMaxY * this.renderMinZ, this.renderMaxY * (1.0D - this.renderMinZ), (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ), (1.0D - this.renderMaxY) * this.renderMinZ); ++ this.brightnessBottomRight = this.mixAoBrightness(var27, var28, var29, var26, this.renderMinY * this.renderMinZ, this.renderMinY * (1.0D - this.renderMinZ), (1.0D - this.renderMinY) * (1.0D - this.renderMinZ), (1.0D - this.renderMinY) * this.renderMinZ); ++ this.brightnessTopRight = this.mixAoBrightness(var27, var28, var29, var26, this.renderMinY * this.renderMaxZ, this.renderMinY * (1.0D - this.renderMaxZ), (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ), (1.0D - this.renderMinY) * this.renderMaxZ); ++ ++ if (var13) ++ { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * 0.6F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * 0.6F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * 0.6F; ++ } ++ else ++ { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.6F; ++ } ++ ++ this.colorRedTopLeft *= var9; ++ this.colorGreenTopLeft *= var9; ++ this.colorBlueTopLeft *= var9; ++ this.colorRedBottomLeft *= var10; ++ this.colorGreenBottomLeft *= var10; ++ this.colorBlueBottomLeft *= var10; ++ this.colorRedBottomRight *= var11; ++ this.colorGreenBottomRight *= var11; ++ this.colorBlueBottomRight *= var11; ++ this.colorRedTopRight *= var12; ++ this.colorGreenTopRight *= var12; ++ this.colorBlueTopRight *= var12; ++ var30 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 4); ++ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, var30); ++ ++ if (fancyGrass && var30.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) ++ { ++ this.colorRedTopLeft *= par5; ++ this.colorRedBottomLeft *= par5; ++ this.colorRedBottomRight *= par5; ++ this.colorRedTopRight *= par5; ++ this.colorGreenTopLeft *= par6; ++ this.colorGreenBottomLeft *= par6; ++ this.colorGreenBottomRight *= par6; ++ this.colorGreenTopRight *= par6; ++ this.colorBlueTopLeft *= par7; ++ this.colorBlueBottomLeft *= par7; ++ this.colorBlueBottomRight *= par7; ++ this.colorBlueTopRight *= par7; ++ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); ++ } ++ ++ var8 = true; ++ } ++ ++ if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2 + 1, par3, par4, 5)) ++ { ++ if (this.renderMaxX >= 1.0D) ++ { ++ ++par2; ++ } ++ ++ this.aoLightValueScratchXYPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); ++ this.aoLightValueScratchXZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); ++ this.aoLightValueScratchXZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); ++ this.aoLightValueScratchXYPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); ++ this.aoBrightnessXYPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); ++ this.aoBrightnessXZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); ++ this.aoBrightnessXZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); ++ this.aoBrightnessXYPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); ++ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 + 1, par4)]; ++ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 - 1, par4)]; ++ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 + 1)]; ++ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 - 1)]; ++ ++ if (!var17 && !var19) ++ { ++ this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN; ++ this.aoBrightnessXYZPNN = this.aoBrightnessXZPN; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZPNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 - 1); ++ this.aoBrightnessXYZPNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 - 1); ++ } ++ ++ if (!var17 && !var18) ++ { ++ this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP; ++ this.aoBrightnessXYZPNP = this.aoBrightnessXZPP; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZPNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 + 1); ++ this.aoBrightnessXYZPNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 + 1); ++ } ++ ++ if (!var16 && !var19) ++ { ++ this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN; ++ this.aoBrightnessXYZPPN = this.aoBrightnessXZPN; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZPPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 - 1); ++ this.aoBrightnessXYZPPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 - 1); ++ } ++ ++ if (!var16 && !var18) ++ { ++ this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP; ++ this.aoBrightnessXYZPPP = this.aoBrightnessXZPP; ++ } ++ else ++ { ++ this.aoLightValueScratchXYZPPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 + 1); ++ this.aoBrightnessXYZPPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 + 1); ++ } ++ ++ if (this.renderMaxX >= 1.0D) ++ { ++ --par2; ++ } ++ ++ var20 = var14; ++ ++ if (this.renderMaxX >= 1.0D || !this.blockAccess.isBlockOpaqueCube(par2 + 1, par3, par4)) ++ { ++ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); ++ } ++ ++ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); ++ var22 = (this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNP + var21 + this.aoLightValueScratchXZPP) / 4.0F; ++ var23 = (this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXZPN + var21) / 4.0F; ++ var24 = (this.aoLightValueScratchXZPN + var21 + this.aoLightValueScratchXYZPPN + this.aoLightValueScratchXYPP) / 4.0F; ++ var25 = (var21 + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPP) / 4.0F; ++ var9 = (float)((double)var22 * (1.0D - this.renderMinY) * this.renderMaxZ + (double)var23 * (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ) + (double)var24 * this.renderMinY * (1.0D - this.renderMaxZ) + (double)var25 * this.renderMinY * this.renderMaxZ); ++ var10 = (float)((double)var22 * (1.0D - this.renderMinY) * this.renderMinZ + (double)var23 * (1.0D - this.renderMinY) * (1.0D - this.renderMinZ) + (double)var24 * this.renderMinY * (1.0D - this.renderMinZ) + (double)var25 * this.renderMinY * this.renderMinZ); ++ var11 = (float)((double)var22 * (1.0D - this.renderMaxY) * this.renderMinZ + (double)var23 * (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ) + (double)var24 * this.renderMaxY * (1.0D - this.renderMinZ) + (double)var25 * this.renderMaxY * this.renderMinZ); ++ var12 = (float)((double)var22 * (1.0D - this.renderMaxY) * this.renderMaxZ + (double)var23 * (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ) + (double)var24 * this.renderMaxY * (1.0D - this.renderMaxZ) + (double)var25 * this.renderMaxY * this.renderMaxZ); ++ var26 = this.getAoBrightness(this.aoBrightnessXYPN, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, var20); ++ var27 = this.getAoBrightness(this.aoBrightnessXZPP, this.aoBrightnessXYPP, this.aoBrightnessXYZPPP, var20); ++ var28 = this.getAoBrightness(this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, this.aoBrightnessXYPP, var20); ++ var29 = this.getAoBrightness(this.aoBrightnessXYZPNN, this.aoBrightnessXYPN, this.aoBrightnessXZPN, var20); ++ this.brightnessTopLeft = this.mixAoBrightness(var26, var29, var28, var27, (1.0D - this.renderMinY) * this.renderMaxZ, (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ), this.renderMinY * (1.0D - this.renderMaxZ), this.renderMinY * this.renderMaxZ); ++ this.brightnessBottomLeft = this.mixAoBrightness(var26, var29, var28, var27, (1.0D - this.renderMinY) * this.renderMinZ, (1.0D - this.renderMinY) * (1.0D - this.renderMinZ), this.renderMinY * (1.0D - this.renderMinZ), this.renderMinY * this.renderMinZ); ++ this.brightnessBottomRight = this.mixAoBrightness(var26, var29, var28, var27, (1.0D - this.renderMaxY) * this.renderMinZ, (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ), this.renderMaxY * (1.0D - this.renderMinZ), this.renderMaxY * this.renderMinZ); ++ this.brightnessTopRight = this.mixAoBrightness(var26, var29, var28, var27, (1.0D - this.renderMaxY) * this.renderMaxZ, (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ), this.renderMaxY * (1.0D - this.renderMaxZ), this.renderMaxY * this.renderMaxZ); ++ ++ if (var13) ++ { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * 0.6F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * 0.6F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * 0.6F; ++ } ++ else ++ { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.6F; ++ } ++ ++ this.colorRedTopLeft *= var9; ++ this.colorGreenTopLeft *= var9; ++ this.colorBlueTopLeft *= var9; ++ this.colorRedBottomLeft *= var10; ++ this.colorGreenBottomLeft *= var10; ++ this.colorBlueBottomLeft *= var10; ++ this.colorRedBottomRight *= var11; ++ this.colorGreenBottomRight *= var11; ++ this.colorBlueBottomRight *= var11; ++ this.colorRedTopRight *= var12; ++ this.colorGreenTopRight *= var12; ++ this.colorBlueTopRight *= var12; ++ var30 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 5); ++ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, var30); ++ ++ if (fancyGrass && var30.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) ++ { ++ this.colorRedTopLeft *= par5; ++ this.colorRedBottomLeft *= par5; ++ this.colorRedBottomRight *= par5; ++ this.colorRedTopRight *= par5; ++ this.colorGreenTopLeft *= par6; ++ this.colorGreenBottomLeft *= par6; ++ this.colorGreenBottomRight *= par6; ++ this.colorGreenTopRight *= par6; ++ this.colorBlueTopLeft *= par7; ++ this.colorBlueBottomLeft *= par7; ++ this.colorBlueBottomRight *= par7; ++ this.colorBlueTopRight *= par7; ++ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); ++ } ++ ++ var8 = true; ++ } ++ ++ this.enableAO = false; ++ return var8; ++ } ++ ++ /** ++ * Get ambient occlusion brightness ++ */ ++ private int getAoBrightness(int par1, int par2, int par3, int par4) ++ { ++ if (par1 == 0) ++ { ++ par1 = par4; ++ } ++ ++ if (par2 == 0) ++ { ++ par2 = par4; ++ } ++ ++ if (par3 == 0) ++ { ++ par3 = par4; ++ } ++ ++ return par1 + par2 + par3 + par4 >> 2 & 16711935; ++ } ++ ++ private int mixAoBrightness(int par1, int par2, int par3, int par4, double par5, double par7, double par9, double par11) ++ { ++ int var13 = (int)((double)(par1 >> 16 & 255) * par5 + (double)(par2 >> 16 & 255) * par7 + (double)(par3 >> 16 & 255) * par9 + (double)(par4 >> 16 & 255) * par11) & 255; ++ int var14 = (int)((double)(par1 & 255) * par5 + (double)(par2 & 255) * par7 + (double)(par3 & 255) * par9 + (double)(par4 & 255) * par11) & 255; ++ return var13 << 16 | var14; ++ } ++ ++ /** ++ * Renders a standard cube block at the given coordinates, with a given color ratio. Args: block, x, y, z, r, g, b ++ */ ++ public boolean renderStandardBlockWithColorMultiplier(Block par1Block, int par2, int par3, int par4, float par5, float par6, float par7) ++ { ++ this.enableAO = false; ++ Tessellator var8 = Tessellator.instance; ++ boolean var9 = false; ++ float var10 = 0.5F; ++ float var11 = 1.0F; ++ float var12 = 0.8F; ++ float var13 = 0.6F; ++ float var14 = var11 * par5; ++ float var15 = var11 * par6; ++ float var16 = var11 * par7; ++ float var17 = var10; ++ float var18 = var12; ++ float var19 = var13; ++ float var20 = var10; ++ float var21 = var12; ++ float var22 = var13; ++ float var23 = var10; ++ float var24 = var12; ++ float var25 = var13; ++ ++ if (par1Block != Block.grass) ++ { ++ var17 = var10 * par5; ++ var18 = var12 * par5; ++ var19 = var13 * par5; ++ var20 = var10 * par6; ++ var21 = var12 * par6; ++ var22 = var13 * par6; ++ var23 = var10 * par7; ++ var24 = var12 * par7; ++ var25 = var13 * par7; ++ } ++ ++ int var26 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4); ++ ++ if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3 - 1, par4, 0)) ++ { ++ var8.setBrightness(this.renderMinY > 0.0D ? var26 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4)); ++ var8.setColorOpaque_F(var17, var20, var23); ++ this.renderFaceYNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 0)); ++ var9 = true; ++ } ++ ++ if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3 + 1, par4, 1)) ++ { ++ var8.setBrightness(this.renderMaxY < 1.0D ? var26 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4)); ++ var8.setColorOpaque_F(var14, var15, var16); ++ this.renderFaceYPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 1)); ++ var9 = true; ++ } ++ ++ Icon var28; ++ ++ if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3, par4 - 1, 2)) ++ { ++ var8.setBrightness(this.renderMinZ > 0.0D ? var26 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1)); ++ var8.setColorOpaque_F(var18, var21, var24); ++ var28 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 2); ++ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, var28); ++ ++ if (fancyGrass && var28.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) ++ { ++ var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7); ++ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); ++ } ++ ++ var9 = true; ++ } ++ ++ if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3, par4 + 1, 3)) ++ { ++ var8.setBrightness(this.renderMaxZ < 1.0D ? var26 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1)); ++ var8.setColorOpaque_F(var18, var21, var24); ++ var28 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 3); ++ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, var28); ++ ++ if (fancyGrass && var28.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) ++ { ++ var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7); ++ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); ++ } ++ ++ var9 = true; ++ } ++ ++ if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2 - 1, par3, par4, 4)) ++ { ++ var8.setBrightness(this.renderMinX > 0.0D ? var26 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4)); ++ var8.setColorOpaque_F(var19, var22, var25); ++ var28 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 4); ++ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, var28); ++ ++ if (fancyGrass && var28.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) ++ { ++ var8.setColorOpaque_F(var19 * par5, var22 * par6, var25 * par7); ++ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); ++ } ++ ++ var9 = true; ++ } ++ ++ if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2 + 1, par3, par4, 5)) ++ { ++ var8.setBrightness(this.renderMaxX < 1.0D ? var26 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4)); ++ var8.setColorOpaque_F(var19, var22, var25); ++ var28 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 5); ++ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, var28); ++ ++ if (fancyGrass && var28.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) ++ { ++ var8.setColorOpaque_F(var19 * par5, var22 * par6, var25 * par7); ++ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); ++ } ++ ++ var9 = true; ++ } ++ ++ return var9; ++ } ++ ++ /** ++ * Renders a Cocoa block at the given coordinates ++ */ ++ private boolean renderBlockCocoa(BlockCocoa par1BlockCocoa, int par2, int par3, int par4) ++ { ++ Tessellator var5 = Tessellator.instance; ++ var5.setBrightness(par1BlockCocoa.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); ++ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ int var7 = BlockDirectional.getDirection(var6); ++ int var8 = BlockCocoa.func_72219_c(var6); ++ Icon var9 = par1BlockCocoa.getCocoaIcon(var8); ++ int var10 = 4 + var8 * 2; ++ int var11 = 5 + var8 * 2; ++ double var12 = 15.0D - (double)var10; ++ double var14 = 15.0D; ++ double var16 = 4.0D; ++ double var18 = 4.0D + (double)var11; ++ double var20 = (double)var9.getInterpolatedU(var12); ++ double var22 = (double)var9.getInterpolatedU(var14); ++ double var24 = (double)var9.getInterpolatedV(var16); ++ double var26 = (double)var9.getInterpolatedV(var18); ++ double var28 = 0.0D; ++ double var30 = 0.0D; ++ ++ switch (var7) ++ { ++ case 0: ++ var28 = 8.0D - (double)(var10 / 2); ++ var30 = 15.0D - (double)var10; ++ break; ++ ++ case 1: ++ var28 = 1.0D; ++ var30 = 8.0D - (double)(var10 / 2); ++ break; ++ ++ case 2: ++ var28 = 8.0D - (double)(var10 / 2); ++ var30 = 1.0D; ++ break; ++ ++ case 3: ++ var28 = 15.0D - (double)var10; ++ var30 = 8.0D - (double)(var10 / 2); ++ } ++ ++ double var32 = (double)par2 + var28 / 16.0D; ++ double var34 = (double)par2 + (var28 + (double)var10) / 16.0D; ++ double var36 = (double)par3 + (12.0D - (double)var11) / 16.0D; ++ double var38 = (double)par3 + 0.75D; ++ double var40 = (double)par4 + var30 / 16.0D; ++ double var42 = (double)par4 + (var30 + (double)var10) / 16.0D; ++ var5.addVertexWithUV(var32, var36, var40, var20, var26); ++ var5.addVertexWithUV(var32, var36, var42, var22, var26); ++ var5.addVertexWithUV(var32, var38, var42, var22, var24); ++ var5.addVertexWithUV(var32, var38, var40, var20, var24); ++ var5.addVertexWithUV(var34, var36, var42, var20, var26); ++ var5.addVertexWithUV(var34, var36, var40, var22, var26); ++ var5.addVertexWithUV(var34, var38, var40, var22, var24); ++ var5.addVertexWithUV(var34, var38, var42, var20, var24); ++ var5.addVertexWithUV(var34, var36, var40, var20, var26); ++ var5.addVertexWithUV(var32, var36, var40, var22, var26); ++ var5.addVertexWithUV(var32, var38, var40, var22, var24); ++ var5.addVertexWithUV(var34, var38, var40, var20, var24); ++ var5.addVertexWithUV(var32, var36, var42, var20, var26); ++ var5.addVertexWithUV(var34, var36, var42, var22, var26); ++ var5.addVertexWithUV(var34, var38, var42, var22, var24); ++ var5.addVertexWithUV(var32, var38, var42, var20, var24); ++ int var44 = var10; ++ ++ if (var8 >= 2) ++ { ++ var44 = var10 - 1; ++ } ++ ++ var20 = (double)var9.getMinU(); ++ var22 = (double)var9.getInterpolatedU((double)var44); ++ var24 = (double)var9.getMinV(); ++ var26 = (double)var9.getInterpolatedV((double)var44); ++ var5.addVertexWithUV(var32, var38, var42, var20, var26); ++ var5.addVertexWithUV(var34, var38, var42, var22, var26); ++ var5.addVertexWithUV(var34, var38, var40, var22, var24); ++ var5.addVertexWithUV(var32, var38, var40, var20, var24); ++ var5.addVertexWithUV(var32, var36, var40, var20, var24); ++ var5.addVertexWithUV(var34, var36, var40, var22, var24); ++ var5.addVertexWithUV(var34, var36, var42, var22, var26); ++ var5.addVertexWithUV(var32, var36, var42, var20, var26); ++ var20 = (double)var9.getInterpolatedU(12.0D); ++ var22 = (double)var9.getMaxU(); ++ var24 = (double)var9.getMinV(); ++ var26 = (double)var9.getInterpolatedV(4.0D); ++ var28 = 8.0D; ++ var30 = 0.0D; ++ double var45; ++ ++ switch (var7) ++ { ++ case 0: ++ var28 = 8.0D; ++ var30 = 12.0D; ++ var45 = var20; ++ var20 = var22; ++ var22 = var45; ++ break; ++ ++ case 1: ++ var28 = 0.0D; ++ var30 = 8.0D; ++ break; ++ ++ case 2: ++ var28 = 8.0D; ++ var30 = 0.0D; ++ break; ++ ++ case 3: ++ var28 = 12.0D; ++ var30 = 8.0D; ++ var45 = var20; ++ var20 = var22; ++ var22 = var45; ++ } ++ ++ var32 = (double)par2 + var28 / 16.0D; ++ var34 = (double)par2 + (var28 + 4.0D) / 16.0D; ++ var36 = (double)par3 + 0.75D; ++ var38 = (double)par3 + 1.0D; ++ var40 = (double)par4 + var30 / 16.0D; ++ var42 = (double)par4 + (var30 + 4.0D) / 16.0D; ++ ++ if (var7 != 2 && var7 != 0) ++ { ++ if (var7 == 1 || var7 == 3) ++ { ++ var5.addVertexWithUV(var34, var36, var40, var20, var26); ++ var5.addVertexWithUV(var32, var36, var40, var22, var26); ++ var5.addVertexWithUV(var32, var38, var40, var22, var24); ++ var5.addVertexWithUV(var34, var38, var40, var20, var24); ++ var5.addVertexWithUV(var32, var36, var40, var22, var26); ++ var5.addVertexWithUV(var34, var36, var40, var20, var26); ++ var5.addVertexWithUV(var34, var38, var40, var20, var24); ++ var5.addVertexWithUV(var32, var38, var40, var22, var24); ++ } ++ } ++ else ++ { ++ var5.addVertexWithUV(var32, var36, var40, var22, var26); ++ var5.addVertexWithUV(var32, var36, var42, var20, var26); ++ var5.addVertexWithUV(var32, var38, var42, var20, var24); ++ var5.addVertexWithUV(var32, var38, var40, var22, var24); ++ var5.addVertexWithUV(var32, var36, var42, var20, var26); ++ var5.addVertexWithUV(var32, var36, var40, var22, var26); ++ var5.addVertexWithUV(var32, var38, var40, var22, var24); ++ var5.addVertexWithUV(var32, var38, var42, var20, var24); ++ } ++ ++ return true; ++ } ++ ++ /** ++ * Renders beacon block ++ */ ++ private boolean renderBlockBeacon(BlockBeacon par1BlockBeacon, int par2, int par3, int par4) ++ { ++ float var5 = 0.1875F; ++ this.setOverrideBlockTexture(this.getBlockIcon(Block.glass)); ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); ++ this.renderStandardBlock(par1BlockBeacon, par2, par3, par4); ++ this.renderAllFaces = true; ++ this.setOverrideBlockTexture(this.getBlockIcon(Block.obsidian)); ++ this.setRenderBounds(0.125D, 0.0062500000931322575D, 0.125D, 0.875D, (double)var5, 0.875D); ++ this.renderStandardBlock(par1BlockBeacon, par2, par3, par4); ++ this.setOverrideBlockTexture(this.getBlockIcon(Block.beacon)); ++ this.setRenderBounds(0.1875D, (double)var5, 0.1875D, 0.8125D, 0.875D, 0.8125D); ++ this.renderStandardBlock(par1BlockBeacon, par2, par3, par4); ++ this.renderAllFaces = false; ++ this.clearOverrideBlockTexture(); ++ return true; ++ } ++ ++ /** ++ * Renders a cactus block at the given coordinates ++ */ ++ public boolean renderBlockCactus(Block par1Block, int par2, int par3, int par4) ++ { ++ int var5 = par1Block.colorMultiplier(this.blockAccess, par2, par3, par4); ++ float var6 = (float)(var5 >> 16 & 255) / 255.0F; ++ float var7 = (float)(var5 >> 8 & 255) / 255.0F; ++ float var8 = (float)(var5 & 255) / 255.0F; ++ ++ if (EntityRenderer.anaglyphEnable) ++ { ++ float var9 = (var6 * 30.0F + var7 * 59.0F + var8 * 11.0F) / 100.0F; ++ float var10 = (var6 * 30.0F + var7 * 70.0F) / 100.0F; ++ float var11 = (var6 * 30.0F + var8 * 70.0F) / 100.0F; ++ var6 = var9; ++ var7 = var10; ++ var8 = var11; ++ } ++ ++ return this.renderBlockCactusImpl(par1Block, par2, par3, par4, var6, var7, var8); ++ } ++ ++ /** ++ * Render block cactus implementation ++ */ ++ public boolean renderBlockCactusImpl(Block par1Block, int par2, int par3, int par4, float par5, float par6, float par7) ++ { ++ Tessellator var8 = Tessellator.instance; ++ boolean var9 = false; ++ float var10 = 0.5F; ++ float var11 = 1.0F; ++ float var12 = 0.8F; ++ float var13 = 0.6F; ++ float var14 = var10 * par5; ++ float var15 = var11 * par5; ++ float var16 = var12 * par5; ++ float var17 = var13 * par5; ++ float var18 = var10 * par6; ++ float var19 = var11 * par6; ++ float var20 = var12 * par6; ++ float var21 = var13 * par6; ++ float var22 = var10 * par7; ++ float var23 = var11 * par7; ++ float var24 = var12 * par7; ++ float var25 = var13 * par7; ++ float var26 = 0.0625F; ++ int var27 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4); ++ ++ if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3 - 1, par4, 0)) ++ { ++ var8.setBrightness(this.renderMinY > 0.0D ? var27 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4)); ++ var8.setColorOpaque_F(var14, var18, var22); ++ this.renderFaceYNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 0)); ++ } ++ ++ if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3 + 1, par4, 1)) ++ { ++ var8.setBrightness(this.renderMaxY < 1.0D ? var27 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4)); ++ var8.setColorOpaque_F(var15, var19, var23); ++ this.renderFaceYPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 1)); ++ } ++ ++ var8.setBrightness(var27); ++ var8.setColorOpaque_F(var16, var20, var24); ++ var8.addTranslation(0.0F, 0.0F, var26); ++ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 2)); ++ var8.addTranslation(0.0F, 0.0F, -var26); ++ var8.addTranslation(0.0F, 0.0F, -var26); ++ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 3)); ++ var8.addTranslation(0.0F, 0.0F, var26); ++ var8.setColorOpaque_F(var17, var21, var25); ++ var8.addTranslation(var26, 0.0F, 0.0F); ++ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 4)); ++ var8.addTranslation(-var26, 0.0F, 0.0F); ++ var8.addTranslation(-var26, 0.0F, 0.0F); ++ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 5)); ++ var8.addTranslation(var26, 0.0F, 0.0F); ++ return true; ++ } ++ ++ public boolean renderBlockFence(BlockFence par1BlockFence, int par2, int par3, int par4) ++ { ++ boolean var5 = false; ++ float var6 = 0.375F; ++ float var7 = 0.625F; ++ this.setRenderBounds((double)var6, 0.0D, (double)var6, (double)var7, 1.0D, (double)var7); ++ this.renderStandardBlock(par1BlockFence, par2, par3, par4); ++ var5 = true; ++ boolean var8 = false; ++ boolean var9 = false; ++ ++ if (par1BlockFence.canConnectFenceTo(this.blockAccess, par2 - 1, par3, par4) || par1BlockFence.canConnectFenceTo(this.blockAccess, par2 + 1, par3, par4)) ++ { ++ var8 = true; ++ } ++ ++ if (par1BlockFence.canConnectFenceTo(this.blockAccess, par2, par3, par4 - 1) || par1BlockFence.canConnectFenceTo(this.blockAccess, par2, par3, par4 + 1)) ++ { ++ var9 = true; ++ } ++ ++ boolean var10 = par1BlockFence.canConnectFenceTo(this.blockAccess, par2 - 1, par3, par4); ++ boolean var11 = par1BlockFence.canConnectFenceTo(this.blockAccess, par2 + 1, par3, par4); ++ boolean var12 = par1BlockFence.canConnectFenceTo(this.blockAccess, par2, par3, par4 - 1); ++ boolean var13 = par1BlockFence.canConnectFenceTo(this.blockAccess, par2, par3, par4 + 1); ++ ++ if (!var8 && !var9) ++ { ++ var8 = true; ++ } ++ ++ var6 = 0.4375F; ++ var7 = 0.5625F; ++ float var14 = 0.75F; ++ float var15 = 0.9375F; ++ float var16 = var10 ? 0.0F : var6; ++ float var17 = var11 ? 1.0F : var7; ++ float var18 = var12 ? 0.0F : var6; ++ float var19 = var13 ? 1.0F : var7; ++ ++ if (var8) ++ { ++ this.setRenderBounds((double)var16, (double)var14, (double)var6, (double)var17, (double)var15, (double)var7); ++ this.renderStandardBlock(par1BlockFence, par2, par3, par4); ++ var5 = true; ++ } ++ ++ if (var9) ++ { ++ this.setRenderBounds((double)var6, (double)var14, (double)var18, (double)var7, (double)var15, (double)var19); ++ this.renderStandardBlock(par1BlockFence, par2, par3, par4); ++ var5 = true; ++ } ++ ++ var14 = 0.375F; ++ var15 = 0.5625F; ++ ++ if (var8) ++ { ++ this.setRenderBounds((double)var16, (double)var14, (double)var6, (double)var17, (double)var15, (double)var7); ++ this.renderStandardBlock(par1BlockFence, par2, par3, par4); ++ var5 = true; ++ } ++ ++ if (var9) ++ { ++ this.setRenderBounds((double)var6, (double)var14, (double)var18, (double)var7, (double)var15, (double)var19); ++ this.renderStandardBlock(par1BlockFence, par2, par3, par4); ++ var5 = true; ++ } ++ ++ par1BlockFence.setBlockBoundsBasedOnState(this.blockAccess, par2, par3, par4); ++ return var5; ++ } ++ ++ /** ++ * Renders wall block ++ */ ++ public boolean renderBlockWall(BlockWall par1BlockWall, int par2, int par3, int par4) ++ { ++ boolean var5 = par1BlockWall.canConnectWallTo(this.blockAccess, par2 - 1, par3, par4); ++ boolean var6 = par1BlockWall.canConnectWallTo(this.blockAccess, par2 + 1, par3, par4); ++ boolean var7 = par1BlockWall.canConnectWallTo(this.blockAccess, par2, par3, par4 - 1); ++ boolean var8 = par1BlockWall.canConnectWallTo(this.blockAccess, par2, par3, par4 + 1); ++ boolean var9 = var7 && var8 && !var5 && !var6; ++ boolean var10 = !var7 && !var8 && var5 && var6; ++ boolean var11 = this.blockAccess.isAirBlock(par2, par3 + 1, par4); ++ ++ if ((var9 || var10) && var11) ++ { ++ if (var9) ++ { ++ this.setRenderBounds(0.3125D, 0.0D, 0.0D, 0.6875D, 0.8125D, 1.0D); ++ this.renderStandardBlock(par1BlockWall, par2, par3, par4); ++ } ++ else ++ { ++ this.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); ++ this.renderStandardBlock(par1BlockWall, par2, par3, par4); ++ } ++ } ++ else ++ { ++ this.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); ++ this.renderStandardBlock(par1BlockWall, par2, par3, par4); ++ ++ if (var5) ++ { ++ this.setRenderBounds(0.0D, 0.0D, 0.3125D, 0.25D, 0.8125D, 0.6875D); ++ this.renderStandardBlock(par1BlockWall, par2, par3, par4); ++ } ++ ++ if (var6) ++ { ++ this.setRenderBounds(0.75D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); ++ this.renderStandardBlock(par1BlockWall, par2, par3, par4); ++ } ++ ++ if (var7) ++ { ++ this.setRenderBounds(0.3125D, 0.0D, 0.0D, 0.6875D, 0.8125D, 0.25D); ++ this.renderStandardBlock(par1BlockWall, par2, par3, par4); ++ } ++ ++ if (var8) ++ { ++ this.setRenderBounds(0.3125D, 0.0D, 0.75D, 0.6875D, 0.8125D, 1.0D); ++ this.renderStandardBlock(par1BlockWall, par2, par3, par4); ++ } ++ } ++ ++ par1BlockWall.setBlockBoundsBasedOnState(this.blockAccess, par2, par3, par4); ++ return true; ++ } ++ ++ public boolean renderBlockDragonEgg(BlockDragonEgg par1BlockDragonEgg, int par2, int par3, int par4) ++ { ++ boolean var5 = false; ++ int var6 = 0; ++ ++ for (int var7 = 0; var7 < 8; ++var7) ++ { ++ byte var8 = 0; ++ byte var9 = 1; ++ ++ if (var7 == 0) ++ { ++ var8 = 2; ++ } ++ ++ if (var7 == 1) ++ { ++ var8 = 3; ++ } ++ ++ if (var7 == 2) ++ { ++ var8 = 4; ++ } ++ ++ if (var7 == 3) ++ { ++ var8 = 5; ++ var9 = 2; ++ } ++ ++ if (var7 == 4) ++ { ++ var8 = 6; ++ var9 = 3; ++ } ++ ++ if (var7 == 5) ++ { ++ var8 = 7; ++ var9 = 5; ++ } ++ ++ if (var7 == 6) ++ { ++ var8 = 6; ++ var9 = 2; ++ } ++ ++ if (var7 == 7) ++ { ++ var8 = 3; ++ } ++ ++ float var10 = (float)var8 / 16.0F; ++ float var11 = 1.0F - (float)var6 / 16.0F; ++ float var12 = 1.0F - (float)(var6 + var9) / 16.0F; ++ var6 += var9; ++ this.setRenderBounds((double)(0.5F - var10), (double)var12, (double)(0.5F - var10), (double)(0.5F + var10), (double)var11, (double)(0.5F + var10)); ++ this.renderStandardBlock(par1BlockDragonEgg, par2, par3, par4); ++ } ++ ++ var5 = true; ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); ++ return var5; ++ } ++ ++ /** ++ * Render block fence gate ++ */ ++ public boolean renderBlockFenceGate(BlockFenceGate par1BlockFenceGate, int par2, int par3, int par4) ++ { ++ boolean var5 = true; ++ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ boolean var7 = BlockFenceGate.isFenceGateOpen(var6); ++ int var8 = BlockDirectional.getDirection(var6); ++ float var9 = 0.375F; ++ float var10 = 0.5625F; ++ float var11 = 0.75F; ++ float var12 = 0.9375F; ++ float var13 = 0.3125F; ++ float var14 = 1.0F; ++ ++ if ((var8 == 2 || var8 == 0) && this.blockAccess.getBlockId(par2 - 1, par3, par4) == Block.cobblestoneWall.blockID && this.blockAccess.getBlockId(par2 + 1, par3, par4) == Block.cobblestoneWall.blockID || (var8 == 3 || var8 == 1) && this.blockAccess.getBlockId(par2, par3, par4 - 1) == Block.cobblestoneWall.blockID && this.blockAccess.getBlockId(par2, par3, par4 + 1) == Block.cobblestoneWall.blockID) ++ { ++ var9 -= 0.1875F; ++ var10 -= 0.1875F; ++ var11 -= 0.1875F; ++ var12 -= 0.1875F; ++ var13 -= 0.1875F; ++ var14 -= 0.1875F; ++ } ++ ++ this.renderAllFaces = true; ++ float var15; ++ float var16; ++ float var17; ++ float var18; ++ ++ if (var8 != 3 && var8 != 1) ++ { ++ var15 = 0.0F; ++ var16 = 0.125F; ++ var17 = 0.4375F; ++ var18 = 0.5625F; ++ this.setRenderBounds((double)var15, (double)var13, (double)var17, (double)var16, (double)var14, (double)var18); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ var15 = 0.875F; ++ var16 = 1.0F; ++ this.setRenderBounds((double)var15, (double)var13, (double)var17, (double)var16, (double)var14, (double)var18); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ } ++ else ++ { ++ this.uvRotateTop = 1; ++ var15 = 0.4375F; ++ var16 = 0.5625F; ++ var17 = 0.0F; ++ var18 = 0.125F; ++ this.setRenderBounds((double)var15, (double)var13, (double)var17, (double)var16, (double)var14, (double)var18); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ var17 = 0.875F; ++ var18 = 1.0F; ++ this.setRenderBounds((double)var15, (double)var13, (double)var17, (double)var16, (double)var14, (double)var18); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.uvRotateTop = 0; ++ } ++ ++ if (var7) ++ { ++ if (var8 == 2 || var8 == 0) ++ { ++ this.uvRotateTop = 1; ++ } ++ ++ float var19; ++ float var20; ++ float var21; ++ ++ if (var8 == 3) ++ { ++ var15 = 0.0F; ++ var16 = 0.125F; ++ var17 = 0.875F; ++ var18 = 1.0F; ++ var19 = 0.5625F; ++ var20 = 0.8125F; ++ var21 = 0.9375F; ++ this.setRenderBounds(0.8125D, (double)var9, 0.0D, 0.9375D, (double)var12, 0.125D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds(0.8125D, (double)var9, 0.875D, 0.9375D, (double)var12, 1.0D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds(0.5625D, (double)var9, 0.0D, 0.8125D, (double)var10, 0.125D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds(0.5625D, (double)var9, 0.875D, 0.8125D, (double)var10, 1.0D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds(0.5625D, (double)var11, 0.0D, 0.8125D, (double)var12, 0.125D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds(0.5625D, (double)var11, 0.875D, 0.8125D, (double)var12, 1.0D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ } ++ else if (var8 == 1) ++ { ++ var15 = 0.0F; ++ var16 = 0.125F; ++ var17 = 0.875F; ++ var18 = 1.0F; ++ var19 = 0.0625F; ++ var20 = 0.1875F; ++ var21 = 0.4375F; ++ this.setRenderBounds(0.0625D, (double)var9, 0.0D, 0.1875D, (double)var12, 0.125D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds(0.0625D, (double)var9, 0.875D, 0.1875D, (double)var12, 1.0D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds(0.1875D, (double)var9, 0.0D, 0.4375D, (double)var10, 0.125D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds(0.1875D, (double)var9, 0.875D, 0.4375D, (double)var10, 1.0D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds(0.1875D, (double)var11, 0.0D, 0.4375D, (double)var12, 0.125D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds(0.1875D, (double)var11, 0.875D, 0.4375D, (double)var12, 1.0D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ } ++ else if (var8 == 0) ++ { ++ var15 = 0.0F; ++ var16 = 0.125F; ++ var17 = 0.875F; ++ var18 = 1.0F; ++ var19 = 0.5625F; ++ var20 = 0.8125F; ++ var21 = 0.9375F; ++ this.setRenderBounds(0.0D, (double)var9, 0.8125D, 0.125D, (double)var12, 0.9375D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds(0.875D, (double)var9, 0.8125D, 1.0D, (double)var12, 0.9375D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds(0.0D, (double)var9, 0.5625D, 0.125D, (double)var10, 0.8125D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds(0.875D, (double)var9, 0.5625D, 1.0D, (double)var10, 0.8125D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds(0.0D, (double)var11, 0.5625D, 0.125D, (double)var12, 0.8125D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds(0.875D, (double)var11, 0.5625D, 1.0D, (double)var12, 0.8125D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ } ++ else if (var8 == 2) ++ { ++ var15 = 0.0F; ++ var16 = 0.125F; ++ var17 = 0.875F; ++ var18 = 1.0F; ++ var19 = 0.0625F; ++ var20 = 0.1875F; ++ var21 = 0.4375F; ++ this.setRenderBounds(0.0D, (double)var9, 0.0625D, 0.125D, (double)var12, 0.1875D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds(0.875D, (double)var9, 0.0625D, 1.0D, (double)var12, 0.1875D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds(0.0D, (double)var9, 0.1875D, 0.125D, (double)var10, 0.4375D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds(0.875D, (double)var9, 0.1875D, 1.0D, (double)var10, 0.4375D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds(0.0D, (double)var11, 0.1875D, 0.125D, (double)var12, 0.4375D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds(0.875D, (double)var11, 0.1875D, 1.0D, (double)var12, 0.4375D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ } ++ } ++ else if (var8 != 3 && var8 != 1) ++ { ++ var15 = 0.375F; ++ var16 = 0.5F; ++ var17 = 0.4375F; ++ var18 = 0.5625F; ++ this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var12, (double)var18); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ var15 = 0.5F; ++ var16 = 0.625F; ++ this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var12, (double)var18); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ var15 = 0.625F; ++ var16 = 0.875F; ++ this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ var15 = 0.125F; ++ var16 = 0.375F; ++ this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ } ++ else ++ { ++ this.uvRotateTop = 1; ++ var15 = 0.4375F; ++ var16 = 0.5625F; ++ var17 = 0.375F; ++ var18 = 0.5F; ++ this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var12, (double)var18); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ var17 = 0.5F; ++ var18 = 0.625F; ++ this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var12, (double)var18); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ var17 = 0.625F; ++ var18 = 0.875F; ++ this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ var17 = 0.125F; ++ var18 = 0.375F; ++ this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ } ++ ++ this.renderAllFaces = false; ++ this.uvRotateTop = 0; ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); ++ return var5; ++ } ++ ++ private boolean renderBlockHopper(BlockHopper par1BlockHopper, int par2, int par3, int par4) ++ { ++ Tessellator var5 = Tessellator.instance; ++ var5.setBrightness(par1BlockHopper.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ float var6 = 1.0F; ++ int var7 = par1BlockHopper.colorMultiplier(this.blockAccess, par2, par3, par4); ++ float var8 = (float)(var7 >> 16 & 255) / 255.0F; ++ float var9 = (float)(var7 >> 8 & 255) / 255.0F; ++ float var10 = (float)(var7 & 255) / 255.0F; ++ ++ if (EntityRenderer.anaglyphEnable) ++ { ++ float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; ++ float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; ++ float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; ++ var8 = var11; ++ var9 = var12; ++ var10 = var13; ++ } ++ ++ var5.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); ++ return this.renderBlockHopperMetadata(par1BlockHopper, par2, par3, par4, this.blockAccess.getBlockMetadata(par2, par3, par4), false); ++ } ++ ++ private boolean renderBlockHopperMetadata(BlockHopper par1BlockHopper, int par2, int par3, int par4, int par5, boolean par6) ++ { ++ Tessellator var7 = Tessellator.instance; ++ int var8 = BlockHopper.getDirectionFromMetadata(par5); ++ double var9 = 0.625D; ++ this.setRenderBounds(0.0D, var9, 0.0D, 1.0D, 1.0D, 1.0D); ++ ++ if (par6) ++ { ++ var7.startDrawingQuads(); ++ var7.setNormal(0.0F, -1.0F, 0.0F); ++ this.renderFaceYNeg(par1BlockHopper, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockHopper, 0, par5)); ++ var7.draw(); ++ var7.startDrawingQuads(); ++ var7.setNormal(0.0F, 1.0F, 0.0F); ++ this.renderFaceYPos(par1BlockHopper, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockHopper, 1, par5)); ++ var7.draw(); ++ var7.startDrawingQuads(); ++ var7.setNormal(0.0F, 0.0F, -1.0F); ++ this.renderFaceZNeg(par1BlockHopper, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockHopper, 2, par5)); ++ var7.draw(); ++ var7.startDrawingQuads(); ++ var7.setNormal(0.0F, 0.0F, 1.0F); ++ this.renderFaceZPos(par1BlockHopper, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockHopper, 3, par5)); ++ var7.draw(); ++ var7.startDrawingQuads(); ++ var7.setNormal(-1.0F, 0.0F, 0.0F); ++ this.renderFaceXNeg(par1BlockHopper, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockHopper, 4, par5)); ++ var7.draw(); ++ var7.startDrawingQuads(); ++ var7.setNormal(1.0F, 0.0F, 0.0F); ++ this.renderFaceXPos(par1BlockHopper, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockHopper, 5, par5)); ++ var7.draw(); ++ } ++ else ++ { ++ this.renderStandardBlock(par1BlockHopper, par2, par3, par4); ++ } ++ ++ float var13; ++ ++ if (!par6) ++ { ++ var7.setBrightness(par1BlockHopper.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ float var11 = 1.0F; ++ int var12 = par1BlockHopper.colorMultiplier(this.blockAccess, par2, par3, par4); ++ var13 = (float)(var12 >> 16 & 255) / 255.0F; ++ float var14 = (float)(var12 >> 8 & 255) / 255.0F; ++ float var15 = (float)(var12 & 255) / 255.0F; ++ ++ if (EntityRenderer.anaglyphEnable) ++ { ++ float var16 = (var13 * 30.0F + var14 * 59.0F + var15 * 11.0F) / 100.0F; ++ float var17 = (var13 * 30.0F + var14 * 70.0F) / 100.0F; ++ float var18 = (var13 * 30.0F + var15 * 70.0F) / 100.0F; ++ var13 = var16; ++ var14 = var17; ++ var15 = var18; ++ } ++ ++ var7.setColorOpaque_F(var11 * var13, var11 * var14, var11 * var15); ++ } ++ ++ Icon var24 = BlockHopper.getHopperIcon("hopper_outside"); ++ Icon var25 = BlockHopper.getHopperIcon("hopper_inside"); ++ var13 = 0.125F; ++ ++ if (par6) ++ { ++ var7.startDrawingQuads(); ++ var7.setNormal(1.0F, 0.0F, 0.0F); ++ this.renderFaceXPos(par1BlockHopper, (double)(-1.0F + var13), 0.0D, 0.0D, var24); ++ var7.draw(); ++ var7.startDrawingQuads(); ++ var7.setNormal(-1.0F, 0.0F, 0.0F); ++ this.renderFaceXNeg(par1BlockHopper, (double)(1.0F - var13), 0.0D, 0.0D, var24); ++ var7.draw(); ++ var7.startDrawingQuads(); ++ var7.setNormal(0.0F, 0.0F, 1.0F); ++ this.renderFaceZPos(par1BlockHopper, 0.0D, 0.0D, (double)(-1.0F + var13), var24); ++ var7.draw(); ++ var7.startDrawingQuads(); ++ var7.setNormal(0.0F, 0.0F, -1.0F); ++ this.renderFaceZNeg(par1BlockHopper, 0.0D, 0.0D, (double)(1.0F - var13), var24); ++ var7.draw(); ++ var7.startDrawingQuads(); ++ var7.setNormal(0.0F, 1.0F, 0.0F); ++ this.renderFaceYPos(par1BlockHopper, 0.0D, -1.0D + var9, 0.0D, var25); ++ var7.draw(); ++ } ++ else ++ { ++ this.renderFaceXPos(par1BlockHopper, (double)((float)par2 - 1.0F + var13), (double)par3, (double)par4, var24); ++ this.renderFaceXNeg(par1BlockHopper, (double)((float)par2 + 1.0F - var13), (double)par3, (double)par4, var24); ++ this.renderFaceZPos(par1BlockHopper, (double)par2, (double)par3, (double)((float)par4 - 1.0F + var13), var24); ++ this.renderFaceZNeg(par1BlockHopper, (double)par2, (double)par3, (double)((float)par4 + 1.0F - var13), var24); ++ this.renderFaceYPos(par1BlockHopper, (double)par2, (double)((float)par3 - 1.0F) + var9, (double)par4, var25); ++ } ++ ++ this.setOverrideBlockTexture(var24); ++ double var26 = 0.25D; ++ double var27 = 0.25D; ++ this.setRenderBounds(var26, var27, var26, 1.0D - var26, var9 - 0.002D, 1.0D - var26); ++ ++ if (par6) ++ { ++ var7.startDrawingQuads(); ++ var7.setNormal(1.0F, 0.0F, 0.0F); ++ this.renderFaceXPos(par1BlockHopper, 0.0D, 0.0D, 0.0D, var24); ++ var7.draw(); ++ var7.startDrawingQuads(); ++ var7.setNormal(-1.0F, 0.0F, 0.0F); ++ this.renderFaceXNeg(par1BlockHopper, 0.0D, 0.0D, 0.0D, var24); ++ var7.draw(); ++ var7.startDrawingQuads(); ++ var7.setNormal(0.0F, 0.0F, 1.0F); ++ this.renderFaceZPos(par1BlockHopper, 0.0D, 0.0D, 0.0D, var24); ++ var7.draw(); ++ var7.startDrawingQuads(); ++ var7.setNormal(0.0F, 0.0F, -1.0F); ++ this.renderFaceZNeg(par1BlockHopper, 0.0D, 0.0D, 0.0D, var24); ++ var7.draw(); ++ var7.startDrawingQuads(); ++ var7.setNormal(0.0F, 1.0F, 0.0F); ++ this.renderFaceYPos(par1BlockHopper, 0.0D, 0.0D, 0.0D, var24); ++ var7.draw(); ++ var7.startDrawingQuads(); ++ var7.setNormal(0.0F, -1.0F, 0.0F); ++ this.renderFaceYNeg(par1BlockHopper, 0.0D, 0.0D, 0.0D, var24); ++ var7.draw(); ++ } ++ else ++ { ++ this.renderStandardBlock(par1BlockHopper, par2, par3, par4); ++ } ++ ++ if (!par6) ++ { ++ double var20 = 0.375D; ++ double var22 = 0.25D; ++ this.setOverrideBlockTexture(var24); ++ ++ if (var8 == 0) ++ { ++ this.setRenderBounds(var20, 0.0D, var20, 1.0D - var20, 0.25D, 1.0D - var20); ++ this.renderStandardBlock(par1BlockHopper, par2, par3, par4); ++ } ++ ++ if (var8 == 2) ++ { ++ this.setRenderBounds(var20, var27, 0.0D, 1.0D - var20, var27 + var22, var26); ++ this.renderStandardBlock(par1BlockHopper, par2, par3, par4); ++ } ++ ++ if (var8 == 3) ++ { ++ this.setRenderBounds(var20, var27, 1.0D - var26, 1.0D - var20, var27 + var22, 1.0D); ++ this.renderStandardBlock(par1BlockHopper, par2, par3, par4); ++ } ++ ++ if (var8 == 4) ++ { ++ this.setRenderBounds(0.0D, var27, var20, var26, var27 + var22, 1.0D - var20); ++ this.renderStandardBlock(par1BlockHopper, par2, par3, par4); ++ } ++ ++ if (var8 == 5) ++ { ++ this.setRenderBounds(1.0D - var26, var27, var20, 1.0D, var27 + var22, 1.0D - var20); ++ this.renderStandardBlock(par1BlockHopper, par2, par3, par4); ++ } ++ } ++ ++ this.clearOverrideBlockTexture(); ++ return true; ++ } ++ ++ /** ++ * Renders a stair block at the given coordinates ++ */ ++ public boolean renderBlockStairs(BlockStairs par1BlockStairs, int par2, int par3, int par4) ++ { ++ par1BlockStairs.func_82541_d(this.blockAccess, par2, par3, par4); ++ this.setRenderBoundsFromBlock(par1BlockStairs); ++ this.renderStandardBlock(par1BlockStairs, par2, par3, par4); ++ boolean var5 = par1BlockStairs.func_82542_g(this.blockAccess, par2, par3, par4); ++ this.setRenderBoundsFromBlock(par1BlockStairs); ++ this.renderStandardBlock(par1BlockStairs, par2, par3, par4); ++ ++ if (var5 && par1BlockStairs.func_82544_h(this.blockAccess, par2, par3, par4)) ++ { ++ this.setRenderBoundsFromBlock(par1BlockStairs); ++ this.renderStandardBlock(par1BlockStairs, par2, par3, par4); ++ } ++ ++ return true; ++ } ++ ++ /** ++ * Renders a door block at the given coordinates ++ */ ++ public boolean renderBlockDoor(Block par1Block, int par2, int par3, int par4) ++ { ++ Tessellator var5 = Tessellator.instance; ++ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ ++ if ((var6 & 8) != 0) ++ { ++ if (this.blockAccess.getBlockId(par2, par3 - 1, par4) != par1Block.blockID) ++ { ++ return false; ++ } ++ } ++ else if (this.blockAccess.getBlockId(par2, par3 + 1, par4) != par1Block.blockID) ++ { ++ return false; ++ } ++ ++ boolean var7 = false; ++ float var8 = 0.5F; ++ float var9 = 1.0F; ++ float var10 = 0.8F; ++ float var11 = 0.6F; ++ int var12 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4); ++ var5.setBrightness(this.renderMinY > 0.0D ? var12 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4)); ++ var5.setColorOpaque_F(var8, var8, var8); ++ this.renderFaceYNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 0)); ++ var7 = true; ++ var5.setBrightness(this.renderMaxY < 1.0D ? var12 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4)); ++ var5.setColorOpaque_F(var9, var9, var9); ++ this.renderFaceYPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 1)); ++ var7 = true; ++ var5.setBrightness(this.renderMinZ > 0.0D ? var12 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1)); ++ var5.setColorOpaque_F(var10, var10, var10); ++ Icon var14 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 2); ++ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, var14); ++ var7 = true; ++ this.flipTexture = false; ++ var5.setBrightness(this.renderMaxZ < 1.0D ? var12 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1)); ++ var5.setColorOpaque_F(var10, var10, var10); ++ var14 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 3); ++ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, var14); ++ var7 = true; ++ this.flipTexture = false; ++ var5.setBrightness(this.renderMinX > 0.0D ? var12 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4)); ++ var5.setColorOpaque_F(var11, var11, var11); ++ var14 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 4); ++ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, var14); ++ var7 = true; ++ this.flipTexture = false; ++ var5.setBrightness(this.renderMaxX < 1.0D ? var12 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4)); ++ var5.setColorOpaque_F(var11, var11, var11); ++ var14 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 5); ++ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, var14); ++ var7 = true; ++ this.flipTexture = false; ++ return var7; ++ } ++ ++ /** ++ * Renders the given texture to the bottom face of the block. Args: block, x, y, z, texture ++ */ ++ public void renderFaceYNeg(Block par1Block, double par2, double par4, double par6, Icon par8Icon) ++ { ++ Tessellator var9 = Tessellator.instance; ++ ++ if (this.hasOverrideBlockTexture()) ++ { ++ par8Icon = this.overrideBlockTexture; ++ } ++ ++ double var10 = (double)par8Icon.getInterpolatedU(this.renderMinX * 16.0D); ++ double var12 = (double)par8Icon.getInterpolatedU(this.renderMaxX * 16.0D); ++ double var14 = (double)par8Icon.getInterpolatedV(this.renderMinZ * 16.0D); ++ double var16 = (double)par8Icon.getInterpolatedV(this.renderMaxZ * 16.0D); ++ ++ if (this.renderMinX < 0.0D || this.renderMaxX > 1.0D) ++ { ++ var10 = (double)par8Icon.getMinU(); ++ var12 = (double)par8Icon.getMaxU(); ++ } ++ ++ if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) ++ { ++ var14 = (double)par8Icon.getMinV(); ++ var16 = (double)par8Icon.getMaxV(); ++ } ++ ++ double var18 = var12; ++ double var20 = var10; ++ double var22 = var14; ++ double var24 = var16; ++ ++ if (this.uvRotateBottom == 2) ++ { ++ var10 = (double)par8Icon.getInterpolatedU(this.renderMinZ * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(this.renderMaxZ * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinX * 16.0D); ++ var22 = var14; ++ var24 = var16; ++ var18 = var10; ++ var20 = var12; ++ var14 = var16; ++ var16 = var22; ++ } ++ else if (this.uvRotateBottom == 1) ++ { ++ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(this.renderMinX * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(this.renderMaxX * 16.0D); ++ var18 = var12; ++ var20 = var10; ++ var10 = var12; ++ var12 = var20; ++ var22 = var16; ++ var24 = var14; ++ } ++ else if (this.uvRotateBottom == 3) ++ { ++ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinX * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); ++ var18 = var12; ++ var20 = var10; ++ var22 = var14; ++ var24 = var16; ++ } ++ ++ double var26 = par2 + this.renderMinX; ++ double var28 = par2 + this.renderMaxX; ++ double var30 = par4 + this.renderMinY; ++ double var32 = par6 + this.renderMinZ; ++ double var34 = par6 + this.renderMaxZ; ++ ++ if (this.enableAO) ++ { ++ var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); ++ var9.setBrightness(this.brightnessTopLeft); ++ var9.addVertexWithUV(var26, var30, var34, var20, var24); ++ var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); ++ var9.setBrightness(this.brightnessBottomLeft); ++ var9.addVertexWithUV(var26, var30, var32, var10, var14); ++ var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); ++ var9.setBrightness(this.brightnessBottomRight); ++ var9.addVertexWithUV(var28, var30, var32, var18, var22); ++ var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); ++ var9.setBrightness(this.brightnessTopRight); ++ var9.addVertexWithUV(var28, var30, var34, var12, var16); ++ } ++ else ++ { ++ var9.addVertexWithUV(var26, var30, var34, var20, var24); ++ var9.addVertexWithUV(var26, var30, var32, var10, var14); ++ var9.addVertexWithUV(var28, var30, var32, var18, var22); ++ var9.addVertexWithUV(var28, var30, var34, var12, var16); ++ } ++ } ++ ++ /** ++ * Renders the given texture to the top face of the block. Args: block, x, y, z, texture ++ */ ++ public void renderFaceYPos(Block par1Block, double par2, double par4, double par6, Icon par8Icon) ++ { ++ Tessellator var9 = Tessellator.instance; ++ ++ if (this.hasOverrideBlockTexture()) ++ { ++ par8Icon = this.overrideBlockTexture; ++ } ++ ++ double var10 = (double)par8Icon.getInterpolatedU(this.renderMinX * 16.0D); ++ double var12 = (double)par8Icon.getInterpolatedU(this.renderMaxX * 16.0D); ++ double var14 = (double)par8Icon.getInterpolatedV(this.renderMinZ * 16.0D); ++ double var16 = (double)par8Icon.getInterpolatedV(this.renderMaxZ * 16.0D); ++ ++ if (this.renderMinX < 0.0D || this.renderMaxX > 1.0D) ++ { ++ var10 = (double)par8Icon.getMinU(); ++ var12 = (double)par8Icon.getMaxU(); ++ } ++ ++ if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) ++ { ++ var14 = (double)par8Icon.getMinV(); ++ var16 = (double)par8Icon.getMaxV(); ++ } ++ ++ double var18 = var12; ++ double var20 = var10; ++ double var22 = var14; ++ double var24 = var16; ++ ++ if (this.uvRotateTop == 1) ++ { ++ var10 = (double)par8Icon.getInterpolatedU(this.renderMinZ * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(this.renderMaxZ * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinX * 16.0D); ++ var22 = var14; ++ var24 = var16; ++ var18 = var10; ++ var20 = var12; ++ var14 = var16; ++ var16 = var22; ++ } ++ else if (this.uvRotateTop == 2) ++ { ++ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(this.renderMinX * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(this.renderMaxX * 16.0D); ++ var18 = var12; ++ var20 = var10; ++ var10 = var12; ++ var12 = var20; ++ var22 = var16; ++ var24 = var14; ++ } ++ else if (this.uvRotateTop == 3) ++ { ++ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinX * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); ++ var18 = var12; ++ var20 = var10; ++ var22 = var14; ++ var24 = var16; ++ } ++ ++ double var26 = par2 + this.renderMinX; ++ double var28 = par2 + this.renderMaxX; ++ double var30 = par4 + this.renderMaxY; ++ double var32 = par6 + this.renderMinZ; ++ double var34 = par6 + this.renderMaxZ; ++ ++ if (this.enableAO) ++ { ++ var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); ++ var9.setBrightness(this.brightnessTopLeft); ++ var9.addVertexWithUV(var28, var30, var34, var12, var16); ++ var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); ++ var9.setBrightness(this.brightnessBottomLeft); ++ var9.addVertexWithUV(var28, var30, var32, var18, var22); ++ var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); ++ var9.setBrightness(this.brightnessBottomRight); ++ var9.addVertexWithUV(var26, var30, var32, var10, var14); ++ var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); ++ var9.setBrightness(this.brightnessTopRight); ++ var9.addVertexWithUV(var26, var30, var34, var20, var24); ++ } ++ else ++ { ++ var9.addVertexWithUV(var28, var30, var34, var12, var16); ++ var9.addVertexWithUV(var28, var30, var32, var18, var22); ++ var9.addVertexWithUV(var26, var30, var32, var10, var14); ++ var9.addVertexWithUV(var26, var30, var34, var20, var24); ++ } ++ } ++ ++ /** ++ * Renders the given texture to the north (z-negative) face of the block. Args: block, x, y, z, texture ++ */ ++ public void renderFaceZNeg(Block par1Block, double par2, double par4, double par6, Icon par8Icon) ++ { ++ Tessellator var9 = Tessellator.instance; ++ ++ if (this.hasOverrideBlockTexture()) ++ { ++ par8Icon = this.overrideBlockTexture; ++ } ++ ++ double var10 = (double)par8Icon.getInterpolatedU(this.renderMinX * 16.0D); ++ double var12 = (double)par8Icon.getInterpolatedU(this.renderMaxX * 16.0D); ++ double var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); ++ double var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinY * 16.0D); ++ double var18; ++ ++ if (this.flipTexture) ++ { ++ var18 = var10; ++ var10 = var12; ++ var12 = var18; ++ } ++ ++ if (this.renderMinX < 0.0D || this.renderMaxX > 1.0D) ++ { ++ var10 = (double)par8Icon.getMinU(); ++ var12 = (double)par8Icon.getMaxU(); ++ } ++ ++ if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) ++ { ++ var14 = (double)par8Icon.getMinV(); ++ var16 = (double)par8Icon.getMaxV(); ++ } ++ ++ var18 = var12; ++ double var20 = var10; ++ double var22 = var14; ++ double var24 = var16; ++ ++ if (this.uvRotateEast == 2) ++ { ++ var10 = (double)par8Icon.getInterpolatedU(this.renderMinY * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinX * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(this.renderMaxY * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); ++ var22 = var14; ++ var24 = var16; ++ var18 = var10; ++ var20 = var12; ++ var14 = var16; ++ var16 = var22; ++ } ++ else if (this.uvRotateEast == 1) ++ { ++ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(this.renderMaxX * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinY * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(this.renderMinX * 16.0D); ++ var18 = var12; ++ var20 = var10; ++ var10 = var12; ++ var12 = var20; ++ var22 = var16; ++ var24 = var14; ++ } ++ else if (this.uvRotateEast == 3) ++ { ++ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinX * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(this.renderMaxY * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(this.renderMinY * 16.0D); ++ var18 = var12; ++ var20 = var10; ++ var22 = var14; ++ var24 = var16; ++ } ++ ++ double var26 = par2 + this.renderMinX; ++ double var28 = par2 + this.renderMaxX; ++ double var30 = par4 + this.renderMinY; ++ double var32 = par4 + this.renderMaxY; ++ double var34 = par6 + this.renderMinZ; ++ ++ if (this.enableAO) ++ { ++ var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); ++ var9.setBrightness(this.brightnessTopLeft); ++ var9.addVertexWithUV(var26, var32, var34, var18, var22); ++ var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); ++ var9.setBrightness(this.brightnessBottomLeft); ++ var9.addVertexWithUV(var28, var32, var34, var10, var14); ++ var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); ++ var9.setBrightness(this.brightnessBottomRight); ++ var9.addVertexWithUV(var28, var30, var34, var20, var24); ++ var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); ++ var9.setBrightness(this.brightnessTopRight); ++ var9.addVertexWithUV(var26, var30, var34, var12, var16); ++ } ++ else ++ { ++ var9.addVertexWithUV(var26, var32, var34, var18, var22); ++ var9.addVertexWithUV(var28, var32, var34, var10, var14); ++ var9.addVertexWithUV(var28, var30, var34, var20, var24); ++ var9.addVertexWithUV(var26, var30, var34, var12, var16); ++ } ++ } ++ ++ /** ++ * Renders the given texture to the south (z-positive) face of the block. Args: block, x, y, z, texture ++ */ ++ public void renderFaceZPos(Block par1Block, double par2, double par4, double par6, Icon par8Icon) ++ { ++ Tessellator var9 = Tessellator.instance; ++ ++ if (this.hasOverrideBlockTexture()) ++ { ++ par8Icon = this.overrideBlockTexture; ++ } ++ ++ double var10 = (double)par8Icon.getInterpolatedU(this.renderMinX * 16.0D); ++ double var12 = (double)par8Icon.getInterpolatedU(this.renderMaxX * 16.0D); ++ double var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); ++ double var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinY * 16.0D); ++ double var18; ++ ++ if (this.flipTexture) ++ { ++ var18 = var10; ++ var10 = var12; ++ var12 = var18; ++ } ++ ++ if (this.renderMinX < 0.0D || this.renderMaxX > 1.0D) ++ { ++ var10 = (double)par8Icon.getMinU(); ++ var12 = (double)par8Icon.getMaxU(); ++ } ++ ++ if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) ++ { ++ var14 = (double)par8Icon.getMinV(); ++ var16 = (double)par8Icon.getMaxV(); ++ } ++ ++ var18 = var12; ++ double var20 = var10; ++ double var22 = var14; ++ double var24 = var16; ++ ++ if (this.uvRotateWest == 1) ++ { ++ var10 = (double)par8Icon.getInterpolatedU(this.renderMinY * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinX * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(this.renderMaxY * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); ++ var22 = var14; ++ var24 = var16; ++ var18 = var10; ++ var20 = var12; ++ var14 = var16; ++ var16 = var22; ++ } ++ else if (this.uvRotateWest == 2) ++ { ++ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(this.renderMinX * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinY * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(this.renderMaxX * 16.0D); ++ var18 = var12; ++ var20 = var10; ++ var10 = var12; ++ var12 = var20; ++ var22 = var16; ++ var24 = var14; ++ } ++ else if (this.uvRotateWest == 3) ++ { ++ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinX * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(this.renderMaxY * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(this.renderMinY * 16.0D); ++ var18 = var12; ++ var20 = var10; ++ var22 = var14; ++ var24 = var16; ++ } ++ ++ double var26 = par2 + this.renderMinX; ++ double var28 = par2 + this.renderMaxX; ++ double var30 = par4 + this.renderMinY; ++ double var32 = par4 + this.renderMaxY; ++ double var34 = par6 + this.renderMaxZ; ++ ++ if (this.enableAO) ++ { ++ var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); ++ var9.setBrightness(this.brightnessTopLeft); ++ var9.addVertexWithUV(var26, var32, var34, var10, var14); ++ var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); ++ var9.setBrightness(this.brightnessBottomLeft); ++ var9.addVertexWithUV(var26, var30, var34, var20, var24); ++ var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); ++ var9.setBrightness(this.brightnessBottomRight); ++ var9.addVertexWithUV(var28, var30, var34, var12, var16); ++ var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); ++ var9.setBrightness(this.brightnessTopRight); ++ var9.addVertexWithUV(var28, var32, var34, var18, var22); ++ } ++ else ++ { ++ var9.addVertexWithUV(var26, var32, var34, var10, var14); ++ var9.addVertexWithUV(var26, var30, var34, var20, var24); ++ var9.addVertexWithUV(var28, var30, var34, var12, var16); ++ var9.addVertexWithUV(var28, var32, var34, var18, var22); ++ } ++ } ++ ++ /** ++ * Renders the given texture to the west (x-negative) face of the block. Args: block, x, y, z, texture ++ */ ++ public void renderFaceXNeg(Block par1Block, double par2, double par4, double par6, Icon par8Icon) ++ { ++ Tessellator var9 = Tessellator.instance; ++ ++ if (this.hasOverrideBlockTexture()) ++ { ++ par8Icon = this.overrideBlockTexture; ++ } ++ ++ double var10 = (double)par8Icon.getInterpolatedU(this.renderMinZ * 16.0D); ++ double var12 = (double)par8Icon.getInterpolatedU(this.renderMaxZ * 16.0D); ++ double var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); ++ double var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinY * 16.0D); ++ double var18; ++ ++ if (this.flipTexture) ++ { ++ var18 = var10; ++ var10 = var12; ++ var12 = var18; ++ } ++ ++ if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) ++ { ++ var10 = (double)par8Icon.getMinU(); ++ var12 = (double)par8Icon.getMaxU(); ++ } ++ ++ if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) ++ { ++ var14 = (double)par8Icon.getMinV(); ++ var16 = (double)par8Icon.getMaxV(); ++ } ++ ++ var18 = var12; ++ double var20 = var10; ++ double var22 = var14; ++ double var24 = var16; ++ ++ if (this.uvRotateNorth == 1) ++ { ++ var10 = (double)par8Icon.getInterpolatedU(this.renderMinY * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(this.renderMaxY * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); ++ var22 = var14; ++ var24 = var16; ++ var18 = var10; ++ var20 = var12; ++ var14 = var16; ++ var16 = var22; ++ } ++ else if (this.uvRotateNorth == 2) ++ { ++ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(this.renderMinZ * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinY * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(this.renderMaxZ * 16.0D); ++ var18 = var12; ++ var20 = var10; ++ var10 = var12; ++ var12 = var20; ++ var22 = var16; ++ var24 = var14; ++ } ++ else if (this.uvRotateNorth == 3) ++ { ++ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(this.renderMaxY * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(this.renderMinY * 16.0D); ++ var18 = var12; ++ var20 = var10; ++ var22 = var14; ++ var24 = var16; ++ } ++ ++ double var26 = par2 + this.renderMinX; ++ double var28 = par4 + this.renderMinY; ++ double var30 = par4 + this.renderMaxY; ++ double var32 = par6 + this.renderMinZ; ++ double var34 = par6 + this.renderMaxZ; ++ ++ if (this.enableAO) ++ { ++ var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); ++ var9.setBrightness(this.brightnessTopLeft); ++ var9.addVertexWithUV(var26, var30, var34, var18, var22); ++ var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); ++ var9.setBrightness(this.brightnessBottomLeft); ++ var9.addVertexWithUV(var26, var30, var32, var10, var14); ++ var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); ++ var9.setBrightness(this.brightnessBottomRight); ++ var9.addVertexWithUV(var26, var28, var32, var20, var24); ++ var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); ++ var9.setBrightness(this.brightnessTopRight); ++ var9.addVertexWithUV(var26, var28, var34, var12, var16); ++ } ++ else ++ { ++ var9.addVertexWithUV(var26, var30, var34, var18, var22); ++ var9.addVertexWithUV(var26, var30, var32, var10, var14); ++ var9.addVertexWithUV(var26, var28, var32, var20, var24); ++ var9.addVertexWithUV(var26, var28, var34, var12, var16); ++ } ++ } ++ ++ /** ++ * Renders the given texture to the east (x-positive) face of the block. Args: block, x, y, z, texture ++ */ ++ public void renderFaceXPos(Block par1Block, double par2, double par4, double par6, Icon par8Icon) ++ { ++ Tessellator var9 = Tessellator.instance; ++ ++ if (this.hasOverrideBlockTexture()) ++ { ++ par8Icon = this.overrideBlockTexture; ++ } ++ ++ double var10 = (double)par8Icon.getInterpolatedU(this.renderMinZ * 16.0D); ++ double var12 = (double)par8Icon.getInterpolatedU(this.renderMaxZ * 16.0D); ++ double var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); ++ double var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinY * 16.0D); ++ double var18; ++ ++ if (this.flipTexture) ++ { ++ var18 = var10; ++ var10 = var12; ++ var12 = var18; ++ } ++ ++ if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) ++ { ++ var10 = (double)par8Icon.getMinU(); ++ var12 = (double)par8Icon.getMaxU(); ++ } ++ ++ if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) ++ { ++ var14 = (double)par8Icon.getMinV(); ++ var16 = (double)par8Icon.getMaxV(); ++ } ++ ++ var18 = var12; ++ double var20 = var10; ++ double var22 = var14; ++ double var24 = var16; ++ ++ if (this.uvRotateSouth == 2) ++ { ++ var10 = (double)par8Icon.getInterpolatedU(this.renderMinY * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(this.renderMaxY * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); ++ var22 = var14; ++ var24 = var16; ++ var18 = var10; ++ var20 = var12; ++ var14 = var16; ++ var16 = var22; ++ } ++ else if (this.uvRotateSouth == 1) ++ { ++ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(this.renderMaxZ * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinY * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(this.renderMinZ * 16.0D); ++ var18 = var12; ++ var20 = var10; ++ var10 = var12; ++ var12 = var20; ++ var22 = var16; ++ var24 = var14; ++ } ++ else if (this.uvRotateSouth == 3) ++ { ++ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(this.renderMaxY * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(this.renderMinY * 16.0D); ++ var18 = var12; ++ var20 = var10; ++ var22 = var14; ++ var24 = var16; ++ } ++ ++ double var26 = par2 + this.renderMaxX; ++ double var28 = par4 + this.renderMinY; ++ double var30 = par4 + this.renderMaxY; ++ double var32 = par6 + this.renderMinZ; ++ double var34 = par6 + this.renderMaxZ; ++ ++ if (this.enableAO) ++ { ++ var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); ++ var9.setBrightness(this.brightnessTopLeft); ++ var9.addVertexWithUV(var26, var28, var34, var20, var24); ++ var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); ++ var9.setBrightness(this.brightnessBottomLeft); ++ var9.addVertexWithUV(var26, var28, var32, var12, var16); ++ var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); ++ var9.setBrightness(this.brightnessBottomRight); ++ var9.addVertexWithUV(var26, var30, var32, var18, var22); ++ var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); ++ var9.setBrightness(this.brightnessTopRight); ++ var9.addVertexWithUV(var26, var30, var34, var10, var14); ++ } ++ else ++ { ++ var9.addVertexWithUV(var26, var28, var34, var20, var24); ++ var9.addVertexWithUV(var26, var28, var32, var12, var16); ++ var9.addVertexWithUV(var26, var30, var32, var18, var22); ++ var9.addVertexWithUV(var26, var30, var34, var10, var14); ++ } ++ } ++ ++ /** ++ * Is called to render the image of a block on an inventory, as a held item, or as a an item on the ground ++ */ ++ public void renderBlockAsItem(Block par1Block, int par2, float par3) ++ { ++ Tessellator var4 = Tessellator.instance; ++ boolean var5 = par1Block.blockID == Block.grass.blockID; ++ ++ if (par1Block == Block.dispenser || par1Block == Block.dropper || par1Block == Block.furnaceIdle) ++ { ++ par2 = 3; ++ } ++ ++ int var6; ++ float var7; ++ float var8; ++ float var9; ++ ++ if (this.useInventoryTint) ++ { ++ var6 = par1Block.getRenderColor(par2); ++ ++ if (var5) ++ { ++ var6 = 16777215; ++ } ++ ++ var7 = (float)(var6 >> 16 & 255) / 255.0F; ++ var8 = (float)(var6 >> 8 & 255) / 255.0F; ++ var9 = (float)(var6 & 255) / 255.0F; ++ GL11.glColor4f(var7 * par3, var8 * par3, var9 * par3, 1.0F); ++ } ++ ++ var6 = par1Block.getRenderType(); ++ this.setRenderBoundsFromBlock(par1Block); ++ int var14; ++ ++ if (var6 != 0 && var6 != 31 && var6 != 39 && var6 != 16 && var6 != 26) ++ { ++ if (var6 == 1) ++ { ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, -1.0F, 0.0F); ++ this.drawCrossedSquares(par1Block, par2, -0.5D, -0.5D, -0.5D, 1.0F); ++ var4.draw(); ++ } ++ else if (var6 == 19) ++ { ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, -1.0F, 0.0F); ++ par1Block.setBlockBoundsForItemRender(); ++ this.renderBlockStemSmall(par1Block, par2, this.renderMaxY, -0.5D, -0.5D, -0.5D); ++ var4.draw(); ++ } ++ else if (var6 == 23) ++ { ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, -1.0F, 0.0F); ++ par1Block.setBlockBoundsForItemRender(); ++ var4.draw(); ++ } ++ else if (var6 == 13) ++ { ++ par1Block.setBlockBoundsForItemRender(); ++ GL11.glTranslatef(-0.5F, -0.5F, -0.5F); ++ var7 = 0.0625F; ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, -1.0F, 0.0F); ++ this.renderFaceYNeg(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 0)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, 1.0F, 0.0F); ++ this.renderFaceYPos(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 1)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, 0.0F, -1.0F); ++ var4.addTranslation(0.0F, 0.0F, var7); ++ this.renderFaceZNeg(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 2)); ++ var4.addTranslation(0.0F, 0.0F, -var7); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, 0.0F, 1.0F); ++ var4.addTranslation(0.0F, 0.0F, -var7); ++ this.renderFaceZPos(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 3)); ++ var4.addTranslation(0.0F, 0.0F, var7); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(-1.0F, 0.0F, 0.0F); ++ var4.addTranslation(var7, 0.0F, 0.0F); ++ this.renderFaceXNeg(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 4)); ++ var4.addTranslation(-var7, 0.0F, 0.0F); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(1.0F, 0.0F, 0.0F); ++ var4.addTranslation(-var7, 0.0F, 0.0F); ++ this.renderFaceXPos(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 5)); ++ var4.addTranslation(var7, 0.0F, 0.0F); ++ var4.draw(); ++ GL11.glTranslatef(0.5F, 0.5F, 0.5F); ++ } ++ else if (var6 == 22) ++ { ++ GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glTranslatef(-0.5F, -0.5F, -0.5F); ++ ChestItemRenderHelper.instance.renderChest(par1Block, par2, par3); ++ GL11.glEnable(GL12.GL_RESCALE_NORMAL); ++ } ++ else if (var6 == 6) ++ { ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, -1.0F, 0.0F); ++ this.renderBlockCropsImpl(par1Block, par2, -0.5D, -0.5D, -0.5D); ++ var4.draw(); ++ } ++ else if (var6 == 2) ++ { ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, -1.0F, 0.0F); ++ this.renderTorchAtAngle(par1Block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); ++ var4.draw(); ++ } ++ else if (var6 == 10) ++ { ++ for (var14 = 0; var14 < 2; ++var14) ++ { ++ if (var14 == 0) ++ { ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); ++ } ++ ++ if (var14 == 1) ++ { ++ this.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); ++ } ++ ++ GL11.glTranslatef(-0.5F, -0.5F, -0.5F); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, -1.0F, 0.0F); ++ this.renderFaceYNeg(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 0)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, 1.0F, 0.0F); ++ this.renderFaceYPos(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 1)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, 0.0F, -1.0F); ++ this.renderFaceZNeg(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 2)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, 0.0F, 1.0F); ++ this.renderFaceZPos(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 3)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(-1.0F, 0.0F, 0.0F); ++ this.renderFaceXNeg(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 4)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(1.0F, 0.0F, 0.0F); ++ this.renderFaceXPos(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 5)); ++ var4.draw(); ++ GL11.glTranslatef(0.5F, 0.5F, 0.5F); ++ } ++ } ++ else if (var6 == 27) ++ { ++ var14 = 0; ++ GL11.glTranslatef(-0.5F, -0.5F, -0.5F); ++ var4.startDrawingQuads(); ++ ++ for (int var15 = 0; var15 < 8; ++var15) ++ { ++ byte var16 = 0; ++ byte var17 = 1; ++ ++ if (var15 == 0) ++ { ++ var16 = 2; ++ } ++ ++ if (var15 == 1) ++ { ++ var16 = 3; ++ } ++ ++ if (var15 == 2) ++ { ++ var16 = 4; ++ } ++ ++ if (var15 == 3) ++ { ++ var16 = 5; ++ var17 = 2; ++ } ++ ++ if (var15 == 4) ++ { ++ var16 = 6; ++ var17 = 3; ++ } ++ ++ if (var15 == 5) ++ { ++ var16 = 7; ++ var17 = 5; ++ } ++ ++ if (var15 == 6) ++ { ++ var16 = 6; ++ var17 = 2; ++ } ++ ++ if (var15 == 7) ++ { ++ var16 = 3; ++ } ++ ++ float var11 = (float)var16 / 16.0F; ++ float var12 = 1.0F - (float)var14 / 16.0F; ++ float var13 = 1.0F - (float)(var14 + var17) / 16.0F; ++ var14 += var17; ++ this.setRenderBounds((double)(0.5F - var11), (double)var13, (double)(0.5F - var11), (double)(0.5F + var11), (double)var12, (double)(0.5F + var11)); ++ var4.setNormal(0.0F, -1.0F, 0.0F); ++ this.renderFaceYNeg(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 0)); ++ var4.setNormal(0.0F, 1.0F, 0.0F); ++ this.renderFaceYPos(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 1)); ++ var4.setNormal(0.0F, 0.0F, -1.0F); ++ this.renderFaceZNeg(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 2)); ++ var4.setNormal(0.0F, 0.0F, 1.0F); ++ this.renderFaceZPos(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 3)); ++ var4.setNormal(-1.0F, 0.0F, 0.0F); ++ this.renderFaceXNeg(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 4)); ++ var4.setNormal(1.0F, 0.0F, 0.0F); ++ this.renderFaceXPos(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 5)); ++ } ++ ++ var4.draw(); ++ GL11.glTranslatef(0.5F, 0.5F, 0.5F); ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); ++ } ++ else if (var6 == 11) ++ { ++ for (var14 = 0; var14 < 4; ++var14) ++ { ++ var8 = 0.125F; ++ ++ if (var14 == 0) ++ { ++ this.setRenderBounds((double)(0.5F - var8), 0.0D, 0.0D, (double)(0.5F + var8), 1.0D, (double)(var8 * 2.0F)); ++ } ++ ++ if (var14 == 1) ++ { ++ this.setRenderBounds((double)(0.5F - var8), 0.0D, (double)(1.0F - var8 * 2.0F), (double)(0.5F + var8), 1.0D, 1.0D); ++ } ++ ++ var8 = 0.0625F; ++ ++ if (var14 == 2) ++ { ++ this.setRenderBounds((double)(0.5F - var8), (double)(1.0F - var8 * 3.0F), (double)(-var8 * 2.0F), (double)(0.5F + var8), (double)(1.0F - var8), (double)(1.0F + var8 * 2.0F)); ++ } ++ ++ if (var14 == 3) ++ { ++ this.setRenderBounds((double)(0.5F - var8), (double)(0.5F - var8 * 3.0F), (double)(-var8 * 2.0F), (double)(0.5F + var8), (double)(0.5F - var8), (double)(1.0F + var8 * 2.0F)); ++ } ++ ++ GL11.glTranslatef(-0.5F, -0.5F, -0.5F); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, -1.0F, 0.0F); ++ this.renderFaceYNeg(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 0)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, 1.0F, 0.0F); ++ this.renderFaceYPos(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 1)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, 0.0F, -1.0F); ++ this.renderFaceZNeg(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 2)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, 0.0F, 1.0F); ++ this.renderFaceZPos(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 3)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(-1.0F, 0.0F, 0.0F); ++ this.renderFaceXNeg(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 4)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(1.0F, 0.0F, 0.0F); ++ this.renderFaceXPos(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 5)); ++ var4.draw(); ++ GL11.glTranslatef(0.5F, 0.5F, 0.5F); ++ } ++ ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); ++ } ++ else if (var6 == 21) ++ { ++ for (var14 = 0; var14 < 3; ++var14) ++ { ++ var8 = 0.0625F; ++ ++ if (var14 == 0) ++ { ++ this.setRenderBounds((double)(0.5F - var8), 0.30000001192092896D, 0.0D, (double)(0.5F + var8), 1.0D, (double)(var8 * 2.0F)); ++ } ++ ++ if (var14 == 1) ++ { ++ this.setRenderBounds((double)(0.5F - var8), 0.30000001192092896D, (double)(1.0F - var8 * 2.0F), (double)(0.5F + var8), 1.0D, 1.0D); ++ } ++ ++ var8 = 0.0625F; ++ ++ if (var14 == 2) ++ { ++ this.setRenderBounds((double)(0.5F - var8), 0.5D, 0.0D, (double)(0.5F + var8), (double)(1.0F - var8), 1.0D); ++ } ++ ++ GL11.glTranslatef(-0.5F, -0.5F, -0.5F); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, -1.0F, 0.0F); ++ this.renderFaceYNeg(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 0)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, 1.0F, 0.0F); ++ this.renderFaceYPos(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 1)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, 0.0F, -1.0F); ++ this.renderFaceZNeg(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 2)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, 0.0F, 1.0F); ++ this.renderFaceZPos(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 3)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(-1.0F, 0.0F, 0.0F); ++ this.renderFaceXNeg(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 4)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(1.0F, 0.0F, 0.0F); ++ this.renderFaceXPos(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(par1Block, 5)); ++ var4.draw(); ++ GL11.glTranslatef(0.5F, 0.5F, 0.5F); ++ } ++ } ++ else if (var6 == 32) ++ { ++ for (var14 = 0; var14 < 2; ++var14) ++ { ++ if (var14 == 0) ++ { ++ this.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); ++ } ++ ++ if (var14 == 1) ++ { ++ this.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); ++ } ++ ++ GL11.glTranslatef(-0.5F, -0.5F, -0.5F); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, -1.0F, 0.0F); ++ this.renderFaceYNeg(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1Block, 0, par2)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, 1.0F, 0.0F); ++ this.renderFaceYPos(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1Block, 1, par2)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, 0.0F, -1.0F); ++ this.renderFaceZNeg(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1Block, 2, par2)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, 0.0F, 1.0F); ++ this.renderFaceZPos(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1Block, 3, par2)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(-1.0F, 0.0F, 0.0F); ++ this.renderFaceXNeg(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1Block, 4, par2)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(1.0F, 0.0F, 0.0F); ++ this.renderFaceXPos(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1Block, 5, par2)); ++ var4.draw(); ++ GL11.glTranslatef(0.5F, 0.5F, 0.5F); ++ } ++ ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); ++ } ++ else if (var6 == 35) ++ { ++ GL11.glTranslatef(-0.5F, -0.5F, -0.5F); ++ this.renderBlockAnvilOrient((BlockAnvil)par1Block, 0, 0, 0, par2 << 2, true); ++ GL11.glTranslatef(0.5F, 0.5F, 0.5F); ++ } ++ else if (var6 == 34) ++ { ++ for (var14 = 0; var14 < 3; ++var14) ++ { ++ if (var14 == 0) ++ { ++ this.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); ++ this.setOverrideBlockTexture(this.getBlockIcon(Block.obsidian)); ++ } ++ else if (var14 == 1) ++ { ++ this.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); ++ this.setOverrideBlockTexture(this.getBlockIcon(Block.beacon)); ++ } ++ else if (var14 == 2) ++ { ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); ++ this.setOverrideBlockTexture(this.getBlockIcon(Block.glass)); ++ } ++ ++ GL11.glTranslatef(-0.5F, -0.5F, -0.5F); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, -1.0F, 0.0F); ++ this.renderFaceYNeg(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1Block, 0, par2)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, 1.0F, 0.0F); ++ this.renderFaceYPos(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1Block, 1, par2)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, 0.0F, -1.0F); ++ this.renderFaceZNeg(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1Block, 2, par2)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, 0.0F, 1.0F); ++ this.renderFaceZPos(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1Block, 3, par2)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(-1.0F, 0.0F, 0.0F); ++ this.renderFaceXNeg(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1Block, 4, par2)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(1.0F, 0.0F, 0.0F); ++ this.renderFaceXPos(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1Block, 5, par2)); ++ var4.draw(); ++ GL11.glTranslatef(0.5F, 0.5F, 0.5F); ++ } ++ ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); ++ this.clearOverrideBlockTexture(); ++ } ++ else if (var6 == 38) ++ { ++ GL11.glTranslatef(-0.5F, -0.5F, -0.5F); ++ this.renderBlockHopperMetadata((BlockHopper)par1Block, 0, 0, 0, 0, true); ++ GL11.glTranslatef(0.5F, 0.5F, 0.5F); ++ } ++ } ++ else ++ { ++ if (var6 == 16) ++ { ++ par2 = 1; ++ } ++ ++ par1Block.setBlockBoundsForItemRender(); ++ this.setRenderBoundsFromBlock(par1Block); ++ GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glTranslatef(-0.5F, -0.5F, -0.5F); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, -1.0F, 0.0F); ++ this.renderFaceYNeg(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1Block, 0, par2)); ++ var4.draw(); ++ ++ if (var5 && this.useInventoryTint) ++ { ++ var14 = par1Block.getRenderColor(par2); ++ var8 = (float)(var14 >> 16 & 255) / 255.0F; ++ var9 = (float)(var14 >> 8 & 255) / 255.0F; ++ float var10 = (float)(var14 & 255) / 255.0F; ++ GL11.glColor4f(var8 * par3, var9 * par3, var10 * par3, 1.0F); ++ } ++ ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, 1.0F, 0.0F); ++ this.renderFaceYPos(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1Block, 1, par2)); ++ var4.draw(); ++ ++ if (var5 && this.useInventoryTint) ++ { ++ GL11.glColor4f(par3, par3, par3, 1.0F); ++ } ++ ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, 0.0F, -1.0F); ++ this.renderFaceZNeg(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1Block, 2, par2)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, 0.0F, 1.0F); ++ this.renderFaceZPos(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1Block, 3, par2)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(-1.0F, 0.0F, 0.0F); ++ this.renderFaceXNeg(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1Block, 4, par2)); ++ var4.draw(); ++ var4.startDrawingQuads(); ++ var4.setNormal(1.0F, 0.0F, 0.0F); ++ this.renderFaceXPos(par1Block, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1Block, 5, par2)); ++ var4.draw(); ++ GL11.glTranslatef(0.5F, 0.5F, 0.5F); ++ } ++ } ++ ++ /** ++ * Checks to see if the item's render type indicates that it should be rendered as a regular block or not. ++ */ ++ public static boolean renderItemIn3d(int par0) ++ { ++ return par0 == 0 ? true : (par0 == 31 ? true : (par0 == 39 ? true : (par0 == 13 ? true : (par0 == 10 ? true : (par0 == 11 ? true : (par0 == 27 ? true : (par0 == 22 ? true : (par0 == 21 ? true : (par0 == 16 ? true : (par0 == 26 ? true : (par0 == 32 ? true : (par0 == 34 ? true : par0 == 35)))))))))))); ++ } ++ ++ public Icon getBlockIcon(Block par1Block, IBlockAccess par2IBlockAccess, int par3, int par4, int par5, int par6) ++ { ++ return this.getIconSafe(par1Block.getBlockTexture(par2IBlockAccess, par3, par4, par5, par6)); ++ } ++ ++ public Icon getBlockIconFromSideAndMetadata(Block par1Block, int par2, int par3) ++ { ++ return this.getIconSafe(par1Block.getIcon(par2, par3)); ++ } ++ ++ public Icon getBlockIconFromSide(Block par1Block, int par2) ++ { ++ return this.getIconSafe(par1Block.getBlockTextureFromSide(par2)); ++ } ++ ++ public Icon getBlockIcon(Block par1Block) ++ { ++ return this.getIconSafe(par1Block.getBlockTextureFromSide(1)); ++ } ++ ++ public Icon getIconSafe(Icon par1Icon) ++ { ++ if (par1Icon == null) ++ { ++ par1Icon = ((TextureMap)Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); ++ } ++ ++ return (Icon)par1Icon; ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- RenderBoat.java Sat Feb 5 04:12:36 2022 +*************** +*** 0 **** +--- 1,71 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class RenderBoat extends Render ++ { ++ private static final ResourceLocation boatTextures = new ResourceLocation("textures/entity/boat.png"); ++ ++ /** instance of ModelBoat for rendering */ ++ protected ModelBase modelBoat; ++ ++ public RenderBoat() ++ { ++ this.shadowSize = 0.5F; ++ this.modelBoat = new ModelBoat(); ++ } ++ ++ /** ++ * The render method used in RenderBoat that renders the boat model. ++ */ ++ public void renderBoat(EntityBoat par1EntityBoat, double par2, double par4, double par6, float par8, float par9) ++ { ++ GL11.glPushMatrix(); ++ GL11.glTranslatef((float)par2, (float)par4, (float)par6); ++ GL11.glRotatef(180.0F - par8, 0.0F, 1.0F, 0.0F); ++ float var10 = (float)par1EntityBoat.getTimeSinceHit() - par9; ++ float var11 = par1EntityBoat.getDamageTaken() - par9; ++ ++ if (var11 < 0.0F) ++ { ++ var11 = 0.0F; ++ } ++ ++ if (var10 > 0.0F) ++ { ++ GL11.glRotatef(MathHelper.sin(var10) * var10 * var11 / 10.0F * (float)par1EntityBoat.getForwardDirection(), 1.0F, 0.0F, 0.0F); ++ } ++ ++ float var12 = 0.75F; ++ GL11.glScalef(var12, var12, var12); ++ GL11.glScalef(1.0F / var12, 1.0F / var12, 1.0F / var12); ++ this.bindEntityTexture(par1EntityBoat); ++ GL11.glScalef(-1.0F, -1.0F, 1.0F); ++ this.modelBoat.render(par1EntityBoat, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); ++ GL11.glPopMatrix(); ++ } ++ ++ protected ResourceLocation getBoatTextures(EntityBoat par1EntityBoat) ++ { ++ return boatTextures; ++ } ++ ++ /** ++ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. ++ */ ++ protected ResourceLocation getEntityTexture(Entity par1Entity) ++ { ++ return this.getBoatTextures((EntityBoat)par1Entity); ++ } ++ ++ /** ++ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then ++ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic ++ * (Render 1.0F) ++ { ++ var3 = 1.0F; ++ } ++ ++ var3 *= var3; ++ var3 *= var3; ++ float var5 = (1.0F + var3 * 0.4F) * var4; ++ float var6 = (1.0F + var3 * 0.1F) / var4; ++ GL11.glScalef(var5, var6, var5); ++ } ++ ++ /** ++ * Updates color multiplier based on creeper state called by getColorMultiplier ++ */ ++ protected int updateCreeperColorMultiplier(EntityCreeper par1EntityCreeper, float par2, float par3) ++ { ++ float var4 = par1EntityCreeper.getCreeperFlashIntensity(par3); ++ ++ if ((int)(var4 * 10.0F) % 2 == 0) ++ { ++ return 0; ++ } ++ else ++ { ++ int var5 = (int)(var4 * 0.2F * 255.0F); ++ ++ if (var5 < 0) ++ { ++ var5 = 0; ++ } ++ ++ if (var5 > 255) ++ { ++ var5 = 255; ++ } ++ ++ short var6 = 255; ++ short var7 = 255; ++ short var8 = 255; ++ return var5 << 24 | var6 << 16 | var7 << 8 | var8; ++ } ++ } ++ ++ /** ++ * A method used to render a creeper's powered form as a pass model. ++ */ ++ protected int renderCreeperPassModel(EntityCreeper par1EntityCreeper, int par2, float par3) ++ { ++ if (par1EntityCreeper.getPowered()) ++ { ++ if (par1EntityCreeper.isInvisible()) ++ { ++ GL11.glDepthMask(false); ++ } ++ else ++ { ++ GL11.glDepthMask(true); ++ } ++ ++ if (par2 == 1) ++ { ++ float var4 = (float)par1EntityCreeper.ticksExisted + par3; ++ this.bindTexture(armoredCreeperTextures); ++ GL11.glMatrixMode(GL11.GL_TEXTURE); ++ GL11.glLoadIdentity(); ++ float var5 = var4 * 0.01F; ++ float var6 = var4 * 0.01F; ++ GL11.glTranslatef(var5, var6, 0.0F); ++ this.setRenderPassModel(this.creeperModel); ++ GL11.glMatrixMode(GL11.GL_MODELVIEW); ++ GL11.glEnable(GL11.GL_BLEND); ++ float var7 = 0.5F; ++ GL11.glColor4f(var7, var7, var7, 1.0F); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); ++ return 1; ++ } ++ ++ if (par2 == 2) ++ { ++ GL11.glMatrixMode(GL11.GL_TEXTURE); ++ GL11.glLoadIdentity(); ++ GL11.glMatrixMode(GL11.GL_MODELVIEW); ++ GL11.glEnable(GL11.GL_LIGHTING); ++ GL11.glDisable(GL11.GL_BLEND); ++ } ++ } ++ ++ return -1; ++ } ++ ++ protected int func_77061_b(EntityCreeper par1EntityCreeper, int par2, float par3) ++ { ++ return -1; ++ } ++ ++ protected ResourceLocation getCreeperTextures(EntityCreeper par1EntityCreeper) ++ { ++ return creeperTextures; ++ } ++ ++ /** ++ * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: ++ * entityLiving, partialTickTime ++ */ ++ protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2) ++ { ++ this.updateCreeperScale((EntityCreeper)par1EntityLivingBase, par2); ++ } ++ ++ /** ++ * Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime ++ */ ++ protected int getColorMultiplier(EntityLivingBase par1EntityLivingBase, float par2, float par3) ++ { ++ return this.updateCreeperColorMultiplier((EntityCreeper)par1EntityLivingBase, par2, par3); ++ } ++ ++ /** ++ * Queries whether should render the specified pass or not. ++ */ ++ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) ++ { ++ return this.renderCreeperPassModel((EntityCreeper)par1EntityLivingBase, par2, par3); ++ } ++ ++ protected int inheritRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) ++ { ++ return this.func_77061_b((EntityCreeper)par1EntityLivingBase, par2, par3); ++ } ++ ++ /** ++ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. ++ */ ++ protected ResourceLocation getEntityTexture(Entity par1Entity) ++ { ++ return this.getCreeperTextures((EntityCreeper)par1Entity); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- RenderDragon.java Sat Feb 5 04:12:36 2022 +*************** +*** 0 **** +--- 1,289 ---- ++ package net.minecraft.src; ++ ++ import java.util.Random; ++ import org.lwjgl.opengl.GL11; ++ ++ public class RenderDragon extends RenderLiving ++ { ++ private static final ResourceLocation enderDragonExplodingTextures = new ResourceLocation("textures/entity/enderdragon/dragon_exploding.png"); ++ private static final ResourceLocation enderDragonCrystalBeamTextures = new ResourceLocation("textures/entity/endercrystal/endercrystal_beam.png"); ++ private static final ResourceLocation enderDragonEyesTextures = new ResourceLocation("textures/entity/enderdragon/dragon_eyes.png"); ++ private static final ResourceLocation enderDragonTextures = new ResourceLocation("textures/entity/enderdragon/dragon.png"); ++ ++ /** An instance of the dragon model in RenderDragon */ ++ protected ModelDragon modelDragon; ++ ++ public RenderDragon() ++ { ++ super(new ModelDragon(0.0F), 0.5F); ++ this.modelDragon = (ModelDragon)this.mainModel; ++ this.setRenderPassModel(this.mainModel); ++ } ++ ++ /** ++ * Used to rotate the dragon as a whole in RenderDragon. It's called in the rotateCorpse method. ++ */ ++ protected void rotateDragonBody(EntityDragon par1EntityDragon, float par2, float par3, float par4) ++ { ++ float var5 = (float)par1EntityDragon.getMovementOffsets(7, par4)[0]; ++ float var6 = (float)(par1EntityDragon.getMovementOffsets(5, par4)[1] - par1EntityDragon.getMovementOffsets(10, par4)[1]); ++ GL11.glRotatef(-var5, 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(var6 * 10.0F, 1.0F, 0.0F, 0.0F); ++ GL11.glTranslatef(0.0F, 0.0F, 1.0F); ++ ++ if (par1EntityDragon.deathTime > 0) ++ { ++ float var7 = ((float)par1EntityDragon.deathTime + par4 - 1.0F) / 20.0F * 1.6F; ++ var7 = MathHelper.sqrt_float(var7); ++ ++ if (var7 > 1.0F) ++ { ++ var7 = 1.0F; ++ } ++ ++ GL11.glRotatef(var7 * this.getDeathMaxRotation(par1EntityDragon), 0.0F, 0.0F, 1.0F); ++ } ++ } ++ ++ /** ++ * Renders the dragon model. Called by renderModel. ++ */ ++ protected void renderDragonModel(EntityDragon par1EntityDragon, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ if (par1EntityDragon.deathTicks > 0) ++ { ++ float var8 = (float)par1EntityDragon.deathTicks / 200.0F; ++ GL11.glDepthFunc(GL11.GL_LEQUAL); ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ GL11.glAlphaFunc(GL11.GL_GREATER, var8); ++ this.bindTexture(enderDragonExplodingTextures); ++ this.mainModel.render(par1EntityDragon, par2, par3, par4, par5, par6, par7); ++ GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); ++ GL11.glDepthFunc(GL11.GL_EQUAL); ++ } ++ ++ this.bindEntityTexture(par1EntityDragon); ++ this.mainModel.render(par1EntityDragon, par2, par3, par4, par5, par6, par7); ++ ++ if (par1EntityDragon.hurtTime > 0) ++ { ++ GL11.glDepthFunc(GL11.GL_EQUAL); ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ GL11.glColor4f(1.0F, 0.0F, 0.0F, 0.5F); ++ this.mainModel.render(par1EntityDragon, par2, par3, par4, par5, par6, par7); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ GL11.glDisable(GL11.GL_BLEND); ++ GL11.glDepthFunc(GL11.GL_LEQUAL); ++ } ++ } ++ ++ /** ++ * Renders the dragon, along with its dying animation ++ */ ++ public void renderDragon(EntityDragon par1EntityDragon, double par2, double par4, double par6, float par8, float par9) ++ { ++ BossStatus.setBossStatus(par1EntityDragon, false); ++ super.doRenderLiving(par1EntityDragon, par2, par4, par6, par8, par9); ++ ++ if (par1EntityDragon.healingEnderCrystal != null) ++ { ++ float var10 = (float)par1EntityDragon.healingEnderCrystal.innerRotation + par9; ++ float var11 = MathHelper.sin(var10 * 0.2F) / 2.0F + 0.5F; ++ var11 = (var11 * var11 + var11) * 0.2F; ++ float var12 = (float)(par1EntityDragon.healingEnderCrystal.posX - par1EntityDragon.posX - (par1EntityDragon.prevPosX - par1EntityDragon.posX) * (double)(1.0F - par9)); ++ float var13 = (float)((double)var11 + par1EntityDragon.healingEnderCrystal.posY - 1.0D - par1EntityDragon.posY - (par1EntityDragon.prevPosY - par1EntityDragon.posY) * (double)(1.0F - par9)); ++ float var14 = (float)(par1EntityDragon.healingEnderCrystal.posZ - par1EntityDragon.posZ - (par1EntityDragon.prevPosZ - par1EntityDragon.posZ) * (double)(1.0F - par9)); ++ float var15 = MathHelper.sqrt_float(var12 * var12 + var14 * var14); ++ float var16 = MathHelper.sqrt_float(var12 * var12 + var13 * var13 + var14 * var14); ++ GL11.glPushMatrix(); ++ GL11.glTranslatef((float)par2, (float)par4 + 2.0F, (float)par6); ++ GL11.glRotatef((float)(-Math.atan2((double)var14, (double)var12)) * 180.0F / (float)Math.PI - 90.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef((float)(-Math.atan2((double)var15, (double)var13)) * 180.0F / (float)Math.PI - 90.0F, 1.0F, 0.0F, 0.0F); ++ Tessellator var17 = Tessellator.instance; ++ RenderHelper.disableStandardItemLighting(); ++ GL11.glDisable(GL11.GL_CULL_FACE); ++ this.bindTexture(enderDragonCrystalBeamTextures); ++ GL11.glShadeModel(GL11.GL_SMOOTH); ++ float var18 = 0.0F - ((float)par1EntityDragon.ticksExisted + par9) * 0.01F; ++ float var19 = MathHelper.sqrt_float(var12 * var12 + var13 * var13 + var14 * var14) / 32.0F - ((float)par1EntityDragon.ticksExisted + par9) * 0.01F; ++ var17.startDrawing(5); ++ byte var20 = 8; ++ ++ for (int var21 = 0; var21 <= var20; ++var21) ++ { ++ float var22 = MathHelper.sin((float)(var21 % var20) * (float)Math.PI * 2.0F / (float)var20) * 0.75F; ++ float var23 = MathHelper.cos((float)(var21 % var20) * (float)Math.PI * 2.0F / (float)var20) * 0.75F; ++ float var24 = (float)(var21 % var20) * 1.0F / (float)var20; ++ var17.setColorOpaque_I(0); ++ var17.addVertexWithUV((double)(var22 * 0.2F), (double)(var23 * 0.2F), 0.0D, (double)var24, (double)var19); ++ var17.setColorOpaque_I(16777215); ++ var17.addVertexWithUV((double)var22, (double)var23, (double)var16, (double)var24, (double)var18); ++ } ++ ++ var17.draw(); ++ GL11.glEnable(GL11.GL_CULL_FACE); ++ GL11.glShadeModel(GL11.GL_FLAT); ++ RenderHelper.enableStandardItemLighting(); ++ GL11.glPopMatrix(); ++ } ++ } ++ ++ protected ResourceLocation getEnderDragonTextures(EntityDragon par1EntityDragon) ++ { ++ return enderDragonTextures; ++ } ++ ++ /** ++ * Renders the animation for when an enderdragon dies ++ */ ++ protected void renderDragonDying(EntityDragon par1EntityDragon, float par2) ++ { ++ super.renderEquippedItems(par1EntityDragon, par2); ++ Tessellator var3 = Tessellator.instance; ++ ++ if (par1EntityDragon.deathTicks > 0) ++ { ++ RenderHelper.disableStandardItemLighting(); ++ float var4 = ((float)par1EntityDragon.deathTicks + par2) / 200.0F; ++ float var5 = 0.0F; ++ ++ if (var4 > 0.8F) ++ { ++ var5 = (var4 - 0.8F) / 0.2F; ++ } ++ ++ Random var6 = new Random(432L); ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ GL11.glShadeModel(GL11.GL_SMOOTH); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); ++ GL11.glDisable(GL11.GL_ALPHA_TEST); ++ GL11.glEnable(GL11.GL_CULL_FACE); ++ GL11.glDepthMask(false); ++ GL11.glPushMatrix(); ++ GL11.glTranslatef(0.0F, -1.0F, -2.0F); ++ ++ for (int var7 = 0; (float)var7 < (var4 + var4 * var4) / 2.0F * 60.0F; ++var7) ++ { ++ GL11.glRotatef(var6.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F); ++ GL11.glRotatef(var6.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(var6.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F); ++ GL11.glRotatef(var6.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F); ++ GL11.glRotatef(var6.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(var6.nextFloat() * 360.0F + var4 * 90.0F, 0.0F, 0.0F, 1.0F); ++ var3.startDrawing(6); ++ float var8 = var6.nextFloat() * 20.0F + 5.0F + var5 * 10.0F; ++ float var9 = var6.nextFloat() * 2.0F + 1.0F + var5 * 2.0F; ++ var3.setColorRGBA_I(16777215, (int)(255.0F * (1.0F - var5))); ++ var3.addVertex(0.0D, 0.0D, 0.0D); ++ var3.setColorRGBA_I(16711935, 0); ++ var3.addVertex(-0.866D * (double)var9, (double)var8, (double)(-0.5F * var9)); ++ var3.addVertex(0.866D * (double)var9, (double)var8, (double)(-0.5F * var9)); ++ var3.addVertex(0.0D, (double)var8, (double)(1.0F * var9)); ++ var3.addVertex(-0.866D * (double)var9, (double)var8, (double)(-0.5F * var9)); ++ var3.draw(); ++ } ++ ++ GL11.glPopMatrix(); ++ GL11.glDepthMask(true); ++ GL11.glDisable(GL11.GL_CULL_FACE); ++ GL11.glDisable(GL11.GL_BLEND); ++ GL11.glShadeModel(GL11.GL_FLAT); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ RenderHelper.enableStandardItemLighting(); ++ } ++ } ++ ++ /** ++ * Renders the overlay for glowing eyes and the mouth. Called by shouldRenderPass. ++ */ ++ protected int renderGlow(EntityDragon par1EntityDragon, int par2, float par3) ++ { ++ if (par2 == 1) ++ { ++ GL11.glDepthFunc(GL11.GL_LEQUAL); ++ } ++ ++ if (par2 != 0) ++ { ++ return -1; ++ } ++ else ++ { ++ this.bindTexture(enderDragonEyesTextures); ++ float var4 = 1.0F; ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glDisable(GL11.GL_ALPHA_TEST); ++ GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glDepthFunc(GL11.GL_EQUAL); ++ char var5 = 61680; ++ int var6 = var5 % 65536; ++ int var7 = var5 / 65536; ++ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var6 / 1.0F, (float)var7 / 1.0F); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glEnable(GL11.GL_LIGHTING); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, var4); ++ return 1; ++ } ++ } ++ ++ public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) ++ { ++ this.renderDragon((EntityDragon)par1EntityLiving, par2, par4, par6, par8, par9); ++ } ++ ++ /** ++ * Queries whether should render the specified pass or not. ++ */ ++ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) ++ { ++ return this.renderGlow((EntityDragon)par1EntityLivingBase, par2, par3); ++ } ++ ++ protected void renderEquippedItems(EntityLivingBase par1EntityLivingBase, float par2) ++ { ++ this.renderDragonDying((EntityDragon)par1EntityLivingBase, par2); ++ } ++ ++ protected void rotateCorpse(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) ++ { ++ this.rotateDragonBody((EntityDragon)par1EntityLivingBase, par2, par3, par4); ++ } ++ ++ /** ++ * Renders the model in RenderLiving ++ */ ++ protected void renderModel(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ this.renderDragonModel((EntityDragon)par1EntityLivingBase, par2, par3, par4, par5, par6, par7); ++ } ++ ++ public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) ++ { ++ this.renderDragon((EntityDragon)par1EntityLivingBase, par2, par4, par6, par8, par9); ++ } ++ ++ /** ++ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. ++ */ ++ protected ResourceLocation getEntityTexture(Entity par1Entity) ++ { ++ return this.getEnderDragonTextures((EntityDragon)par1Entity); ++ } ++ ++ /** ++ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then ++ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic ++ * (Render= (float)Math.PI; var10 -= ((float)Math.PI * 2F)) ++ { ++ ; ++ } ++ ++ while (var10 < -(float)Math.PI) ++ { ++ var10 += ((float)Math.PI * 2F); ++ } ++ ++ float var11 = par1TileEntityEnchantmentTable.bookRotationPrev + var10 * par8; ++ GL11.glRotatef(-var11 * 180.0F / (float)Math.PI, 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(80.0F, 0.0F, 0.0F, 1.0F); ++ this.bindTexture(enchantingTableBookTextures); ++ float var12 = par1TileEntityEnchantmentTable.pageFlipPrev + (par1TileEntityEnchantmentTable.pageFlip - par1TileEntityEnchantmentTable.pageFlipPrev) * par8 + 0.25F; ++ float var13 = par1TileEntityEnchantmentTable.pageFlipPrev + (par1TileEntityEnchantmentTable.pageFlip - par1TileEntityEnchantmentTable.pageFlipPrev) * par8 + 0.75F; ++ var12 = (var12 - (float)MathHelper.truncateDoubleToInt((double)var12)) * 1.6F - 0.3F; ++ var13 = (var13 - (float)MathHelper.truncateDoubleToInt((double)var13)) * 1.6F - 0.3F; ++ ++ if (var12 < 0.0F) ++ { ++ var12 = 0.0F; ++ } ++ ++ if (var13 < 0.0F) ++ { ++ var13 = 0.0F; ++ } ++ ++ if (var12 > 1.0F) ++ { ++ var12 = 1.0F; ++ } ++ ++ if (var13 > 1.0F) ++ { ++ var13 = 1.0F; ++ } ++ ++ float var14 = par1TileEntityEnchantmentTable.bookSpreadPrev + (par1TileEntityEnchantmentTable.bookSpread - par1TileEntityEnchantmentTable.bookSpreadPrev) * par8; ++ GL11.glEnable(GL11.GL_CULL_FACE); ++ this.enchantmentBook.render((Entity)null, var9, var12, var13, var14, 0.0F, 0.0625F); ++ GL11.glPopMatrix(); ++ } ++ ++ public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) ++ { ++ this.renderTileEntityEnchantmentTableAt((TileEntityEnchantmentTable)par1TileEntity, par2, par4, par6, par8); ++ } ++ } +*** /dev/null Thu Jan 1 01:00:00 1970 +--- RenderEnderCrystal.java Sat Feb 5 04:12:36 2022 +*************** +*** 0 **** +--- 1,54 ---- ++ package net.minecraft.src; ++ ++ import org.lwjgl.opengl.GL11; ++ ++ public class RenderEnderCrystal extends Render ++ { ++ private static final ResourceLocation enderCrystalTextures = new ResourceLocation("textures/entity/endercrystal/endercrystal.png"); ++ private ModelBase field_76995_b; ++ ++ public RenderEnderCrystal() ++ { ++ this.shadowSize = 0.5F; ++ this.field_76995_b = new ModelEnderCrystal(0.0F, true); ++ } ++ ++ /** ++ * Renders the Ender Crystal. ++ */ ++ public void doRenderEnderCrystal(EntityEnderCrystal par1EntityEnderCrystal, double par2, double par4, double par6, float par8, float par9) ++ { ++ float var10 = (float)par1EntityEnderCrystal.innerRotation + par9; ++ GL11.glPushMatrix(); ++ GL11.glTranslatef((float)par2, (float)par4, (float)par6); ++ this.bindTexture(enderCrystalTextures); ++ float var11 = MathHelper.sin(var10 * 0.2F) / 2.0F + 0.5F; ++ var11 += var11 * var11; ++ this.field_76995_b.render(par1EntityEnderCrystal, 0.0F, var10 * 3.0F, var11 * 0.2F, 0.0F, 0.0F, 0.0625F); ++ GL11.glPopMatrix(); ++ } ++ ++ protected ResourceLocation getEnderCrystalTextures(EntityEnderCrystal par1EntityEnderCrystal) ++ { ++ return enderCrystalTextures; ++ } ++ ++ /** ++ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. ++ */ ++ protected ResourceLocation getEntityTexture(Entity par1Entity) ++ { ++ return this.getEnderCrystalTextures((EntityEnderCrystal)par1Entity); ++ } ++ ++ /** ++ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then ++ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic ++ * (Render 0; ++ this.endermanModel.isAttacking = par1EntityEnderman.isScreaming(); ++ ++ if (par1EntityEnderman.isScreaming()) ++ { ++ double var10 = 0.02D; ++ par2 += this.rnd.nextGaussian() * var10; ++ par6 += this.rnd.nextGaussian() * var10; ++ } ++ ++ super.doRenderLiving(par1EntityEnderman, par2, par4, par6, par8, par9); ++ } ++ ++ protected ResourceLocation getEndermanTextures(EntityEnderman par1EntityEnderman) ++ { ++ return endermanTextures; ++ } ++ ++ /** ++ * Render the block an enderman is carrying ++ */ ++ protected void renderCarrying(EntityEnderman par1EntityEnderman, float par2) ++ { ++ super.renderEquippedItems(par1EntityEnderman, par2); ++ ++ if (par1EntityEnderman.getCarried() > 0) ++ { ++ GL11.glEnable(GL12.GL_RESCALE_NORMAL); ++ GL11.glPushMatrix(); ++ float var3 = 0.5F; ++ GL11.glTranslatef(0.0F, 0.6875F, -0.75F); ++ var3 *= 1.0F; ++ GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); ++ GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glScalef(-var3, -var3, var3); ++ int var4 = par1EntityEnderman.getBrightnessForRender(par2); ++ int var5 = var4 % 65536; ++ int var6 = var4 / 65536; ++ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var5 / 1.0F, (float)var6 / 1.0F); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.bindTexture(TextureMap.locationBlocksTexture); ++ this.renderBlocks.renderBlockAsItem(Block.blocksList[par1EntityEnderman.getCarried()], par1EntityEnderman.getCarryingData(), 1.0F); ++ GL11.glPopMatrix(); ++ GL11.glDisable(GL12.GL_RESCALE_NORMAL); ++ } ++ } ++ ++ /** ++ * Render the endermans eyes ++ */ ++ protected int renderEyes(EntityEnderman par1EntityEnderman, int par2, float par3) ++ { ++ if (par2 != 0) ++ { ++ return -1; ++ } ++ else ++ { ++ this.bindTexture(endermanEyesTexture); ++ float var4 = 1.0F; ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glDisable(GL11.GL_ALPHA_TEST); ++ GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ ++ if (par1EntityEnderman.isInvisible()) ++ { ++ GL11.glDepthMask(false); ++ } ++ else ++ { ++ GL11.glDepthMask(true); ++ } ++ ++ char var5 = 61680; ++ int var6 = var5 % 65536; ++ int var7 = var5 / 65536; ++ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var6 / 1.0F, (float)var7 / 1.0F); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glEnable(GL11.GL_LIGHTING); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, var4); ++ return 1; ++ } ++ } ++ ++ public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) ++ { ++ this.renderEnderman((EntityEnderman)par1EntityLiving, par2, par4, par6, par8, par9); ++ } ++ ++ /** ++ * Queries whether should render the specified pass or not. ++ */ ++ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) ++ { ++ return this.renderEyes((EntityEnderman)par1EntityLivingBase, par2, par3); ++ } ++ ++ protected void renderEquippedItems(EntityLivingBase par1EntityLivingBase, float par2) ++ { ++ this.renderCarrying((EntityEnderman)par1EntityLivingBase, par2); ++ } ++ ++ public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) ++ { ++ this.renderEnderman((EntityEnderman)par1EntityLivingBase, par2, par4, par6, par8, par9); ++ } ++ ++ /** ++ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. ++ */ ++ protected ResourceLocation getEntityTexture(Entity par1Entity) ++ { ++ return this.getEndermanTextures((EntityEnderman)par1Entity); ++ } ++ ++ /** ++ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then ++ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic ++ * (Render= 180.0F) ++ { ++ var4 -= 360.0F; ++ } ++ ++ return par1 + par3 * var4; ++ } ++ ++ public void doRenderLiving(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) ++ { ++ GL11.glPushMatrix(); ++ GL11.glDisable(GL11.GL_CULL_FACE); ++ this.mainModel.onGround = this.renderSwingProgress(par1EntityLivingBase, par9); ++ ++ if (this.renderPassModel != null) ++ { ++ this.renderPassModel.onGround = this.mainModel.onGround; ++ } ++ ++ this.mainModel.isRiding = par1EntityLivingBase.isRiding(); ++ ++ if (this.renderPassModel != null) ++ { ++ this.renderPassModel.isRiding = this.mainModel.isRiding; ++ } ++ ++ this.mainModel.isChild = par1EntityLivingBase.isChild(); ++ ++ if (this.renderPassModel != null) ++ { ++ this.renderPassModel.isChild = this.mainModel.isChild; ++ } ++ ++ try ++ { ++ float var10 = this.interpolateRotation(par1EntityLivingBase.prevRenderYawOffset, par1EntityLivingBase.renderYawOffset, par9); ++ float var11 = this.interpolateRotation(par1EntityLivingBase.prevRotationYawHead, par1EntityLivingBase.rotationYawHead, par9); ++ float var13; ++ ++ if (par1EntityLivingBase.isRiding() && par1EntityLivingBase.ridingEntity instanceof EntityLivingBase) ++ { ++ EntityLivingBase var12 = (EntityLivingBase)par1EntityLivingBase.ridingEntity; ++ var10 = this.interpolateRotation(var12.prevRenderYawOffset, var12.renderYawOffset, par9); ++ var13 = MathHelper.wrapAngleTo180_float(var11 - var10); ++ ++ if (var13 < -85.0F) ++ { ++ var13 = -85.0F; ++ } ++ ++ if (var13 >= 85.0F) ++ { ++ var13 = 85.0F; ++ } ++ ++ var10 = var11 - var13; ++ ++ if (var13 * var13 > 2500.0F) ++ { ++ var10 += var13 * 0.2F; ++ } ++ } ++ ++ float var26 = par1EntityLivingBase.prevRotationPitch + (par1EntityLivingBase.rotationPitch - par1EntityLivingBase.prevRotationPitch) * par9; ++ this.renderLivingAt(par1EntityLivingBase, par2, par4, par6); ++ var13 = this.handleRotationFloat(par1EntityLivingBase, par9); ++ this.rotateCorpse(par1EntityLivingBase, var13, var10, par9); ++ float var14 = 0.0625F; ++ GL11.glEnable(GL12.GL_RESCALE_NORMAL); ++ GL11.glScalef(-1.0F, -1.0F, 1.0F); ++ this.preRenderCallback(par1EntityLivingBase, par9); ++ GL11.glTranslatef(0.0F, -24.0F * var14 - 0.0078125F, 0.0F); ++ float var15 = par1EntityLivingBase.prevLimbSwingAmount + (par1EntityLivingBase.limbSwingAmount - par1EntityLivingBase.prevLimbSwingAmount) * par9; ++ float var16 = par1EntityLivingBase.limbSwing - par1EntityLivingBase.limbSwingAmount * (1.0F - par9); ++ ++ if (par1EntityLivingBase.isChild()) ++ { ++ var16 *= 3.0F; ++ } ++ ++ if (var15 > 1.0F) ++ { ++ var15 = 1.0F; ++ } ++ ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ this.mainModel.setLivingAnimations(par1EntityLivingBase, var16, var15, par9); ++ this.renderModel(par1EntityLivingBase, var16, var15, var13, var11 - var10, var26, var14); ++ int var18; ++ float var19; ++ float var20; ++ float var22; ++ ++ for (int var17 = 0; var17 < 4; ++var17) ++ { ++ var18 = this.shouldRenderPass(par1EntityLivingBase, var17, par9); ++ ++ if (var18 > 0) ++ { ++ this.renderPassModel.setLivingAnimations(par1EntityLivingBase, var16, var15, par9); ++ this.renderPassModel.render(par1EntityLivingBase, var16, var15, var13, var11 - var10, var26, var14); ++ ++ if ((var18 & 240) == 16) ++ { ++ this.func_82408_c(par1EntityLivingBase, var17, par9); ++ this.renderPassModel.render(par1EntityLivingBase, var16, var15, var13, var11 - var10, var26, var14); ++ } ++ ++ if ((var18 & 15) == 15) ++ { ++ var19 = (float)par1EntityLivingBase.ticksExisted + par9; ++ this.bindTexture(RES_ITEM_GLINT); ++ GL11.glEnable(GL11.GL_BLEND); ++ var20 = 0.5F; ++ GL11.glColor4f(var20, var20, var20, 1.0F); ++ GL11.glDepthFunc(GL11.GL_EQUAL); ++ GL11.glDepthMask(false); ++ ++ for (int var21 = 0; var21 < 2; ++var21) ++ { ++ GL11.glDisable(GL11.GL_LIGHTING); ++ var22 = 0.76F; ++ GL11.glColor4f(0.5F * var22, 0.25F * var22, 0.8F * var22, 1.0F); ++ GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); ++ GL11.glMatrixMode(GL11.GL_TEXTURE); ++ GL11.glLoadIdentity(); ++ float var23 = var19 * (0.001F + (float)var21 * 0.003F) * 20.0F; ++ float var24 = 0.33333334F; ++ GL11.glScalef(var24, var24, var24); ++ GL11.glRotatef(30.0F - (float)var21 * 60.0F, 0.0F, 0.0F, 1.0F); ++ GL11.glTranslatef(0.0F, var23, 0.0F); ++ GL11.glMatrixMode(GL11.GL_MODELVIEW); ++ this.renderPassModel.render(par1EntityLivingBase, var16, var15, var13, var11 - var10, var26, var14); ++ } ++ ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glMatrixMode(GL11.GL_TEXTURE); ++ GL11.glDepthMask(true); ++ GL11.glLoadIdentity(); ++ GL11.glMatrixMode(GL11.GL_MODELVIEW); ++ GL11.glEnable(GL11.GL_LIGHTING); ++ GL11.glDisable(GL11.GL_BLEND); ++ GL11.glDepthFunc(GL11.GL_LEQUAL); ++ } ++ ++ GL11.glDisable(GL11.GL_BLEND); ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ } ++ } ++ ++ GL11.glDepthMask(true); ++ this.renderEquippedItems(par1EntityLivingBase, par9); ++ float var27 = par1EntityLivingBase.getBrightness(par9); ++ var18 = this.getColorMultiplier(par1EntityLivingBase, var27, par9); ++ OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); ++ ++ if ((var18 >> 24 & 255) > 0 || par1EntityLivingBase.hurtTime > 0 || par1EntityLivingBase.deathTime > 0) ++ { ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ GL11.glDisable(GL11.GL_ALPHA_TEST); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ GL11.glDepthFunc(GL11.GL_EQUAL); ++ ++ if (par1EntityLivingBase.hurtTime > 0 || par1EntityLivingBase.deathTime > 0) ++ { ++ GL11.glColor4f(var27, 0.0F, 0.0F, 0.4F); ++ this.mainModel.render(par1EntityLivingBase, var16, var15, var13, var11 - var10, var26, var14); ++ ++ for (int var28 = 0; var28 < 4; ++var28) ++ { ++ if (this.inheritRenderPass(par1EntityLivingBase, var28, par9) >= 0) ++ { ++ GL11.glColor4f(var27, 0.0F, 0.0F, 0.4F); ++ this.renderPassModel.render(par1EntityLivingBase, var16, var15, var13, var11 - var10, var26, var14); ++ } ++ } ++ } ++ ++ if ((var18 >> 24 & 255) > 0) ++ { ++ var19 = (float)(var18 >> 16 & 255) / 255.0F; ++ var20 = (float)(var18 >> 8 & 255) / 255.0F; ++ float var29 = (float)(var18 & 255) / 255.0F; ++ var22 = (float)(var18 >> 24 & 255) / 255.0F; ++ GL11.glColor4f(var19, var20, var29, var22); ++ this.mainModel.render(par1EntityLivingBase, var16, var15, var13, var11 - var10, var26, var14); ++ ++ for (int var30 = 0; var30 < 4; ++var30) ++ { ++ if (this.inheritRenderPass(par1EntityLivingBase, var30, par9) >= 0) ++ { ++ GL11.glColor4f(var19, var20, var29, var22); ++ this.renderPassModel.render(par1EntityLivingBase, var16, var15, var13, var11 - var10, var26, var14); ++ } ++ } ++ } ++ ++ GL11.glDepthFunc(GL11.GL_LEQUAL); ++ GL11.glDisable(GL11.GL_BLEND); ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ } ++ ++ GL11.glDisable(GL12.GL_RESCALE_NORMAL); ++ } ++ catch (Exception var25) ++ { ++ var25.printStackTrace(); ++ } ++ ++ OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); ++ GL11.glEnable(GL11.GL_CULL_FACE); ++ GL11.glPopMatrix(); ++ this.passSpecialRender(par1EntityLivingBase, par2, par4, par6); ++ } ++ ++ /** ++ * Renders the model in RenderLiving ++ */ ++ protected void renderModel(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4, float par5, float par6, float par7) ++ { ++ this.bindEntityTexture(par1EntityLivingBase); ++ ++ if (!par1EntityLivingBase.isInvisible()) ++ { ++ this.mainModel.render(par1EntityLivingBase, par2, par3, par4, par5, par6, par7); ++ } ++ else if (!par1EntityLivingBase.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer)) ++ { ++ GL11.glPushMatrix(); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.15F); ++ GL11.glDepthMask(false); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F); ++ this.mainModel.render(par1EntityLivingBase, par2, par3, par4, par5, par6, par7); ++ GL11.glDisable(GL11.GL_BLEND); ++ GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); ++ GL11.glPopMatrix(); ++ GL11.glDepthMask(true); ++ } ++ else ++ { ++ this.mainModel.setRotationAngles(par2, par3, par4, par5, par6, par7, par1EntityLivingBase); ++ } ++ } ++ ++ /** ++ * Sets a simple glTranslate on a LivingEntity. ++ */ ++ protected void renderLivingAt(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6) ++ { ++ GL11.glTranslatef((float)par2, (float)par4, (float)par6); ++ } ++ ++ protected void rotateCorpse(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) ++ { ++ GL11.glRotatef(180.0F - par3, 0.0F, 1.0F, 0.0F); ++ ++ if (par1EntityLivingBase.deathTime > 0) ++ { ++ float var5 = ((float)par1EntityLivingBase.deathTime + par4 - 1.0F) / 20.0F * 1.6F; ++ var5 = MathHelper.sqrt_float(var5); ++ ++ if (var5 > 1.0F) ++ { ++ var5 = 1.0F; ++ } ++ ++ GL11.glRotatef(var5 * this.getDeathMaxRotation(par1EntityLivingBase), 0.0F, 0.0F, 1.0F); ++ } ++ else ++ { ++ String var6 = EnumChatFormatting.func_110646_a(par1EntityLivingBase.getEntityName()); ++ ++ if ((var6.equals("Dinnerbone") || var6.equals("Grumm")) && (!(par1EntityLivingBase instanceof EntityPlayer) || !((EntityPlayer)par1EntityLivingBase).getHideCape())) ++ { ++ GL11.glTranslatef(0.0F, par1EntityLivingBase.height + 0.1F, 0.0F); ++ GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); ++ } ++ } ++ } ++ ++ protected float renderSwingProgress(EntityLivingBase par1EntityLivingBase, float par2) ++ { ++ return par1EntityLivingBase.getSwingProgress(par2); ++ } ++ ++ /** ++ * Defines what float the third param in setRotationAngles of ModelBase is ++ */ ++ protected float handleRotationFloat(EntityLivingBase par1EntityLivingBase, float par2) ++ { ++ return (float)par1EntityLivingBase.ticksExisted + par2; ++ } ++ ++ protected void renderEquippedItems(EntityLivingBase par1EntityLivingBase, float par2) {} ++ ++ /** ++ * renders arrows the Entity has been attacked with, attached to it ++ */ ++ protected void renderArrowsStuckInEntity(EntityLivingBase par1EntityLivingBase, float par2) ++ { ++ int var3 = par1EntityLivingBase.getArrowCountInEntity(); ++ ++ if (var3 > 0) ++ { ++ EntityArrow var4 = new EntityArrow(par1EntityLivingBase.worldObj, par1EntityLivingBase.posX, par1EntityLivingBase.posY, par1EntityLivingBase.posZ); ++ Random var5 = new Random((long)par1EntityLivingBase.entityId); ++ RenderHelper.disableStandardItemLighting(); ++ ++ for (int var6 = 0; var6 < var3; ++var6) ++ { ++ GL11.glPushMatrix(); ++ ModelRenderer var7 = this.mainModel.getRandomModelBox(var5); ++ ModelBox var8 = (ModelBox)var7.cubeList.get(var5.nextInt(var7.cubeList.size())); ++ var7.postRender(0.0625F); ++ float var9 = var5.nextFloat(); ++ float var10 = var5.nextFloat(); ++ float var11 = var5.nextFloat(); ++ float var12 = (var8.posX1 + (var8.posX2 - var8.posX1) * var9) / 16.0F; ++ float var13 = (var8.posY1 + (var8.posY2 - var8.posY1) * var10) / 16.0F; ++ float var14 = (var8.posZ1 + (var8.posZ2 - var8.posZ1) * var11) / 16.0F; ++ GL11.glTranslatef(var12, var13, var14); ++ var9 = var9 * 2.0F - 1.0F; ++ var10 = var10 * 2.0F - 1.0F; ++ var11 = var11 * 2.0F - 1.0F; ++ var9 *= -1.0F; ++ var10 *= -1.0F; ++ var11 *= -1.0F; ++ float var15 = MathHelper.sqrt_float(var9 * var9 + var11 * var11); ++ var4.prevRotationYaw = var4.rotationYaw = (float)(Math.atan2((double)var9, (double)var11) * 180.0D / Math.PI); ++ var4.prevRotationPitch = var4.rotationPitch = (float)(Math.atan2((double)var10, (double)var15) * 180.0D / Math.PI); ++ double var16 = 0.0D; ++ double var18 = 0.0D; ++ double var20 = 0.0D; ++ float var22 = 0.0F; ++ this.renderManager.renderEntityWithPosYaw(var4, var16, var18, var20, var22, par2); ++ GL11.glPopMatrix(); ++ } ++ ++ RenderHelper.enableStandardItemLighting(); ++ } ++ } ++ ++ protected int inheritRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) ++ { ++ return this.shouldRenderPass(par1EntityLivingBase, par2, par3); ++ } ++ ++ /** ++ * Queries whether should render the specified pass or not. ++ */ ++ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) ++ { ++ return -1; ++ } ++ ++ protected void func_82408_c(EntityLivingBase par1EntityLivingBase, int par2, float par3) {} ++ ++ protected float getDeathMaxRotation(EntityLivingBase par1EntityLivingBase) ++ { ++ return 90.0F; ++ } ++ ++ /** ++ * Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime ++ */ ++ protected int getColorMultiplier(EntityLivingBase par1EntityLivingBase, float par2, float par3) ++ { ++ return 0; ++ } ++ ++ /** ++ * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: ++ * entityLiving, partialTickTime ++ */ ++ protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2) {} ++ ++ /** ++ * Passes the specialRender and renders it ++ */ ++ protected void passSpecialRender(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6) ++ { ++ if (this.func_110813_b(par1EntityLivingBase)) ++ { ++ float var8 = 1.6F; ++ float var9 = 0.016666668F * var8; ++ double var10 = par1EntityLivingBase.getDistanceSqToEntity(this.renderManager.livingPlayer); ++ float var12 = par1EntityLivingBase.isSneaking() ? 32.0F : 64.0F; ++ ++ if (var10 < (double)(var12 * var12)) ++ { ++ String var13 = par1EntityLivingBase.getTranslatedEntityName(); ++ ++ if (par1EntityLivingBase.isSneaking()) ++ { ++ FontRenderer var14 = this.getFontRendererFromRenderManager(); ++ GL11.glPushMatrix(); ++ GL11.glTranslatef((float)par2 + 0.0F, (float)par4 + par1EntityLivingBase.height + 0.5F, (float)par6); ++ GL11.glNormal3f(0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); ++ GL11.glScalef(-var9, -var9, var9); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glTranslatef(0.0F, 0.25F / var9, 0.0F); ++ GL11.glDepthMask(false); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ Tessellator var15 = Tessellator.instance; ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ var15.startDrawingQuads(); ++ int var16 = var14.getStringWidth(var13) / 2; ++ var15.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F); ++ var15.addVertex((double)(-var16 - 1), -1.0D, 0.0D); ++ var15.addVertex((double)(-var16 - 1), 8.0D, 0.0D); ++ var15.addVertex((double)(var16 + 1), 8.0D, 0.0D); ++ var15.addVertex((double)(var16 + 1), -1.0D, 0.0D); ++ var15.draw(); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ GL11.glDepthMask(true); ++ var14.drawString(var13, -var14.getStringWidth(var13) / 2, 0, 553648127); ++ GL11.glEnable(GL11.GL_LIGHTING); ++ GL11.glDisable(GL11.GL_BLEND); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glPopMatrix(); ++ } ++ else ++ { ++ this.func_96449_a(par1EntityLivingBase, par2, par4, par6, var13, var9, var10); ++ } ++ } ++ } ++ } ++ ++ protected boolean func_110813_b(EntityLivingBase par1EntityLivingBase) ++ { ++ return Minecraft.isGuiEnabled() && par1EntityLivingBase != this.renderManager.livingPlayer && !par1EntityLivingBase.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer) && par1EntityLivingBase.riddenByEntity == null; ++ } ++ ++ protected void func_96449_a(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, String par8Str, float par9, double par10) ++ { ++ if (par1EntityLivingBase.isPlayerSleeping()) ++ { ++ this.renderLivingLabel(par1EntityLivingBase, par8Str, par2, par4 - 1.5D, par6, 64); ++ } ++ else ++ { ++ this.renderLivingLabel(par1EntityLivingBase, par8Str, par2, par4, par6, 64); ++ } ++ } ++ ++ /** ++ * Draws the debug or playername text above a living ++ */ ++ protected void renderLivingLabel(EntityLivingBase par1EntityLivingBase, String par2Str, double par3, double par5, double par7, int par9) ++ { ++ double var10 = par1EntityLivingBase.getDistanceSqToEntity(this.renderManager.livingPlayer); ++ ++ if (var10 <= (double)(par9 * par9)) ++ { ++ FontRenderer var12 = this.getFontRendererFromRenderManager(); ++ float var13 = 1.6F; ++ float var14 = 0.016666668F * var13; ++ GL11.glPushMatrix(); ++ GL11.glTranslatef((float)par3 + 0.0F, (float)par5 + par1EntityLivingBase.height + 0.5F, (float)par7); ++ GL11.glNormal3f(0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); ++ GL11.glScalef(-var14, -var14, var14); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glDepthMask(false); ++ GL11.glDisable(GL11.GL_DEPTH_TEST); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ Tessellator var15 = Tessellator.instance; ++ byte var16 = 0; ++ ++ if (par2Str.equals("deadmau5")) ++ { ++ var16 = -10; ++ } ++ ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ var15.startDrawingQuads(); ++ int var17 = var12.getStringWidth(par2Str) / 2; ++ var15.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F); ++ var15.addVertex((double)(-var17 - 1), (double)(-1 + var16), 0.0D); ++ var15.addVertex((double)(-var17 - 1), (double)(8 + var16), 0.0D); ++ var15.addVertex((double)(var17 + 1), (double)(8 + var16), 0.0D); ++ var15.addVertex((double)(var17 + 1), (double)(-1 + var16), 0.0D); ++ var15.draw(); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ var12.drawString(par2Str, -var12.getStringWidth(par2Str) / 2, var16, 553648127); ++ GL11.glEnable(GL11.GL_DEPTH_TEST); ++ GL11.glDepthMask(true); ++ var12.drawString(par2Str, -var12.getStringWidth(par2Str) / 2, var16, -1); ++ GL11.glEnable(GL11.GL_LIGHTING); ++ GL11.glDisable(GL11.GL_BLEND); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glPopMatrix(); ++ } ++ } ++ ++ /** ++ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then ++ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic ++ * (Render 0 || par1EntityFishHook.angler != Minecraft.getMinecraft().thePlayer) ++ { ++ float var31 = (par1EntityFishHook.angler.prevRenderYawOffset + (par1EntityFishHook.angler.renderYawOffset - par1EntityFishHook.angler.prevRenderYawOffset) * par9) * (float)Math.PI / 180.0F; ++ double var32 = (double)MathHelper.sin(var31); ++ double var34 = (double)MathHelper.cos(var31); ++ var23 = par1EntityFishHook.angler.prevPosX + (par1EntityFishHook.angler.posX - par1EntityFishHook.angler.prevPosX) * (double)par9 - var34 * 0.35D - var32 * 0.85D; ++ var25 = par1EntityFishHook.angler.prevPosY + var29 + (par1EntityFishHook.angler.posY - par1EntityFishHook.angler.prevPosY) * (double)par9 - 0.45D; ++ var27 = par1EntityFishHook.angler.prevPosZ + (par1EntityFishHook.angler.posZ - par1EntityFishHook.angler.prevPosZ) * (double)par9 - var32 * 0.35D + var34 * 0.85D; ++ } ++ ++ double var46 = par1EntityFishHook.prevPosX + (par1EntityFishHook.posX - par1EntityFishHook.prevPosX) * (double)par9; ++ double var33 = par1EntityFishHook.prevPosY + (par1EntityFishHook.posY - par1EntityFishHook.prevPosY) * (double)par9 + 0.25D; ++ double var35 = par1EntityFishHook.prevPosZ + (par1EntityFishHook.posZ - par1EntityFishHook.prevPosZ) * (double)par9; ++ double var37 = (double)((float)(var23 - var46)); ++ double var39 = (double)((float)(var25 - var33)); ++ double var41 = (double)((float)(var27 - var35)); ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ var10.startDrawing(3); ++ var10.setColorOpaque_I(0); ++ byte var43 = 16; ++ ++ for (int var44 = 0; var44 <= var43; ++var44) ++ { ++ float var45 = (float)var44 / (float)var43; ++ var10.addVertex(par2 + var37 * (double)var45, par4 + var39 * (double)(var45 * var45 + var45) * 0.5D + 0.25D, par6 + var41 * (double)var45); ++ } ++ ++ var10.draw(); ++ GL11.glEnable(GL11.GL_LIGHTING); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ } ++ } ++ ++ protected ResourceLocation func_110791_a(EntityFishHook par1EntityFishHook) ++ { ++ return field_110792_a; ++ } ++ ++ /** ++ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. ++ */ ++ protected ResourceLocation getEntityTexture(Entity par1Entity) ++ { ++ return this.func_110791_a((EntityFishHook)par1Entity); ++ } ++ ++ /** ++ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then ++ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic ++ * (Render